...

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

Documentation: github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-11-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/2021-11-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: 'AacAudioProfileAacLc', 'AacAudioProfileHeAacV1', 'AacAudioProfileHeAacV2'
    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: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
    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 = OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio
    43  	objectMap := make(map[string]interface{})
    44  	if aa.Profile != "" {
    45  		objectMap["profile"] = aa.Profile
    46  	}
    47  	if aa.Channels != nil {
    48  		objectMap["channels"] = aa.Channels
    49  	}
    50  	if aa.SamplingRate != nil {
    51  		objectMap["samplingRate"] = aa.SamplingRate
    52  	}
    53  	if aa.Bitrate != nil {
    54  		objectMap["bitrate"] = aa.Bitrate
    55  	}
    56  	if aa.Label != nil {
    57  		objectMap["label"] = aa.Label
    58  	}
    59  	if aa.OdataType != "" {
    60  		objectMap["@odata.type"] = aa.OdataType
    61  	}
    62  	return json.Marshal(objectMap)
    63  }
    64  
    65  // 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  // AsVideo is the BasicCodec implementation for AacAudio.
    81  func (aa AacAudio) AsVideo() (*Video, bool) {
    82  	return nil, false
    83  }
    84  
    85  // AsBasicVideo is the BasicCodec implementation for AacAudio.
    86  func (aa AacAudio) AsBasicVideo() (BasicVideo, bool) {
    87  	return nil, false
    88  }
    89  
    90  // AsH265Video is the BasicCodec implementation for AacAudio.
    91  func (aa AacAudio) AsH265Video() (*H265Video, bool) {
    92  	return nil, false
    93  }
    94  
    95  // AsCopyVideo is the BasicCodec implementation for AacAudio.
    96  func (aa AacAudio) AsCopyVideo() (*CopyVideo, bool) {
    97  	return nil, false
    98  }
    99  
   100  // AsImage is the BasicCodec implementation for AacAudio.
   101  func (aa AacAudio) AsImage() (*Image, bool) {
   102  	return nil, false
   103  }
   104  
   105  // AsBasicImage is the BasicCodec implementation for AacAudio.
   106  func (aa AacAudio) AsBasicImage() (BasicImage, bool) {
   107  	return nil, false
   108  }
   109  
   110  // AsCopyAudio is the BasicCodec implementation for AacAudio.
   111  func (aa AacAudio) AsCopyAudio() (*CopyAudio, bool) {
   112  	return nil, false
   113  }
   114  
   115  // AsH264Video is the BasicCodec implementation for AacAudio.
   116  func (aa AacAudio) AsH264Video() (*H264Video, bool) {
   117  	return nil, false
   118  }
   119  
   120  // AsJpgImage is the BasicCodec implementation for AacAudio.
   121  func (aa AacAudio) AsJpgImage() (*JpgImage, bool) {
   122  	return nil, false
   123  }
   124  
   125  // AsPngImage is the BasicCodec implementation for AacAudio.
   126  func (aa AacAudio) AsPngImage() (*PngImage, bool) {
   127  	return nil, false
   128  }
   129  
   130  // AsCodec is the BasicCodec implementation for AacAudio.
   131  func (aa AacAudio) AsCodec() (*Codec, bool) {
   132  	return nil, false
   133  }
   134  
   135  // AsBasicCodec is the BasicCodec implementation for AacAudio.
   136  func (aa AacAudio) AsBasicCodec() (BasicCodec, bool) {
   137  	return &aa, true
   138  }
   139  
   140  // AbsoluteClipTime specifies the clip time as an absolute time position in the media file.  The absolute
   141  // time can point to a different position depending on whether the media file starts from a timestamp of
   142  // zero or not.
   143  type AbsoluteClipTime struct {
   144  	// Time - The time position on the timeline of the input media. It is usually specified as an ISO8601 period. e.g PT30S for 30 seconds.
   145  	Time *string `json:"time,omitempty"`
   146  	// OdataType - Possible values include: 'OdataTypeBasicClipTimeOdataTypeClipTime', 'OdataTypeBasicClipTimeOdataTypeMicrosoftMediaAbsoluteClipTime', 'OdataTypeBasicClipTimeOdataTypeMicrosoftMediaUtcClipTime'
   147  	OdataType OdataTypeBasicClipTime `json:"@odata.type,omitempty"`
   148  }
   149  
   150  // MarshalJSON is the custom marshaler for AbsoluteClipTime.
   151  func (act AbsoluteClipTime) MarshalJSON() ([]byte, error) {
   152  	act.OdataType = OdataTypeBasicClipTimeOdataTypeMicrosoftMediaAbsoluteClipTime
   153  	objectMap := make(map[string]interface{})
   154  	if act.Time != nil {
   155  		objectMap["time"] = act.Time
   156  	}
   157  	if act.OdataType != "" {
   158  		objectMap["@odata.type"] = act.OdataType
   159  	}
   160  	return json.Marshal(objectMap)
   161  }
   162  
   163  // AsAbsoluteClipTime is the BasicClipTime implementation for AbsoluteClipTime.
   164  func (act AbsoluteClipTime) AsAbsoluteClipTime() (*AbsoluteClipTime, bool) {
   165  	return &act, true
   166  }
   167  
   168  // AsUtcClipTime is the BasicClipTime implementation for AbsoluteClipTime.
   169  func (act AbsoluteClipTime) AsUtcClipTime() (*UtcClipTime, bool) {
   170  	return nil, false
   171  }
   172  
   173  // AsClipTime is the BasicClipTime implementation for AbsoluteClipTime.
   174  func (act AbsoluteClipTime) AsClipTime() (*ClipTime, bool) {
   175  	return nil, false
   176  }
   177  
   178  // AsBasicClipTime is the BasicClipTime implementation for AbsoluteClipTime.
   179  func (act AbsoluteClipTime) AsBasicClipTime() (BasicClipTime, bool) {
   180  	return &act, true
   181  }
   182  
   183  // AccessControl ...
   184  type AccessControl struct {
   185  	// DefaultAction - The behavior for IP access control in Key Delivery. Possible values include: 'DefaultActionAllow', 'DefaultActionDeny'
   186  	DefaultAction DefaultAction `json:"defaultAction,omitempty"`
   187  	// IPAllowList - The IP allow list for access control in Key Delivery. If the default action is set to 'Allow', the IP allow list must be empty.
   188  	IPAllowList *[]string `json:"ipAllowList,omitempty"`
   189  }
   190  
   191  // AccountEncryption ...
   192  type AccountEncryption struct {
   193  	// Type - The type of key used to encrypt the Account Key. Possible values include: 'AccountEncryptionKeyTypeSystemKey', 'AccountEncryptionKeyTypeCustomerKey'
   194  	Type AccountEncryptionKeyType `json:"type,omitempty"`
   195  	// KeyVaultProperties - The properties of the key used to encrypt the account.
   196  	KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"`
   197  	// Identity - The Key Vault identity.
   198  	Identity *ResourceIdentity `json:"identity,omitempty"`
   199  	// Status - READ-ONLY; The current status of the Key Vault mapping.
   200  	Status *string `json:"status,omitempty"`
   201  }
   202  
   203  // MarshalJSON is the custom marshaler for AccountEncryption.
   204  func (ae AccountEncryption) MarshalJSON() ([]byte, error) {
   205  	objectMap := make(map[string]interface{})
   206  	if ae.Type != "" {
   207  		objectMap["type"] = ae.Type
   208  	}
   209  	if ae.KeyVaultProperties != nil {
   210  		objectMap["keyVaultProperties"] = ae.KeyVaultProperties
   211  	}
   212  	if ae.Identity != nil {
   213  		objectMap["identity"] = ae.Identity
   214  	}
   215  	return json.Marshal(objectMap)
   216  }
   217  
   218  // AccountFilter an Account Filter.
   219  type AccountFilter struct {
   220  	autorest.Response `json:"-"`
   221  	*FilterProperties `json:"properties,omitempty"`
   222  	// SystemData - READ-ONLY; The system metadata relating to this resource.
   223  	SystemData *SystemData `json:"systemData,omitempty"`
   224  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
   225  	ID *string `json:"id,omitempty"`
   226  	// Name - READ-ONLY; The name of the resource
   227  	Name *string `json:"name,omitempty"`
   228  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
   229  	Type *string `json:"type,omitempty"`
   230  }
   231  
   232  // MarshalJSON is the custom marshaler for AccountFilter.
   233  func (af AccountFilter) MarshalJSON() ([]byte, error) {
   234  	objectMap := make(map[string]interface{})
   235  	if af.FilterProperties != nil {
   236  		objectMap["properties"] = af.FilterProperties
   237  	}
   238  	return json.Marshal(objectMap)
   239  }
   240  
   241  // UnmarshalJSON is the custom unmarshaler for AccountFilter struct.
   242  func (af *AccountFilter) UnmarshalJSON(body []byte) error {
   243  	var m map[string]*json.RawMessage
   244  	err := json.Unmarshal(body, &m)
   245  	if err != nil {
   246  		return err
   247  	}
   248  	for k, v := range m {
   249  		switch k {
   250  		case "properties":
   251  			if v != nil {
   252  				var filterProperties FilterProperties
   253  				err = json.Unmarshal(*v, &filterProperties)
   254  				if err != nil {
   255  					return err
   256  				}
   257  				af.FilterProperties = &filterProperties
   258  			}
   259  		case "systemData":
   260  			if v != nil {
   261  				var systemData SystemData
   262  				err = json.Unmarshal(*v, &systemData)
   263  				if err != nil {
   264  					return err
   265  				}
   266  				af.SystemData = &systemData
   267  			}
   268  		case "id":
   269  			if v != nil {
   270  				var ID string
   271  				err = json.Unmarshal(*v, &ID)
   272  				if err != nil {
   273  					return err
   274  				}
   275  				af.ID = &ID
   276  			}
   277  		case "name":
   278  			if v != nil {
   279  				var name string
   280  				err = json.Unmarshal(*v, &name)
   281  				if err != nil {
   282  					return err
   283  				}
   284  				af.Name = &name
   285  			}
   286  		case "type":
   287  			if v != nil {
   288  				var typeVar string
   289  				err = json.Unmarshal(*v, &typeVar)
   290  				if err != nil {
   291  					return err
   292  				}
   293  				af.Type = &typeVar
   294  			}
   295  		}
   296  	}
   297  
   298  	return nil
   299  }
   300  
   301  // AccountFilterCollection a collection of AccountFilter items.
   302  type AccountFilterCollection struct {
   303  	autorest.Response `json:"-"`
   304  	// Value - A collection of AccountFilter items.
   305  	Value *[]AccountFilter `json:"value,omitempty"`
   306  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
   307  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
   308  }
   309  
   310  // AccountFilterCollectionIterator provides access to a complete listing of AccountFilter values.
   311  type AccountFilterCollectionIterator struct {
   312  	i    int
   313  	page AccountFilterCollectionPage
   314  }
   315  
   316  // NextWithContext advances to the next value.  If there was an error making
   317  // the request the iterator does not advance and the error is returned.
   318  func (iter *AccountFilterCollectionIterator) NextWithContext(ctx context.Context) (err error) {
   319  	if tracing.IsEnabled() {
   320  		ctx = tracing.StartSpan(ctx, fqdn+"/AccountFilterCollectionIterator.NextWithContext")
   321  		defer func() {
   322  			sc := -1
   323  			if iter.Response().Response.Response != nil {
   324  				sc = iter.Response().Response.Response.StatusCode
   325  			}
   326  			tracing.EndSpan(ctx, sc, err)
   327  		}()
   328  	}
   329  	iter.i++
   330  	if iter.i < len(iter.page.Values()) {
   331  		return nil
   332  	}
   333  	err = iter.page.NextWithContext(ctx)
   334  	if err != nil {
   335  		iter.i--
   336  		return err
   337  	}
   338  	iter.i = 0
   339  	return nil
   340  }
   341  
   342  // Next advances to the next value.  If there was an error making
   343  // the request the iterator does not advance and the error is returned.
   344  // Deprecated: Use NextWithContext() instead.
   345  func (iter *AccountFilterCollectionIterator) Next() error {
   346  	return iter.NextWithContext(context.Background())
   347  }
   348  
   349  // NotDone returns true if the enumeration should be started or is not yet complete.
   350  func (iter AccountFilterCollectionIterator) NotDone() bool {
   351  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   352  }
   353  
   354  // Response returns the raw server response from the last page request.
   355  func (iter AccountFilterCollectionIterator) Response() AccountFilterCollection {
   356  	return iter.page.Response()
   357  }
   358  
   359  // Value returns the current value or a zero-initialized value if the
   360  // iterator has advanced beyond the end of the collection.
   361  func (iter AccountFilterCollectionIterator) Value() AccountFilter {
   362  	if !iter.page.NotDone() {
   363  		return AccountFilter{}
   364  	}
   365  	return iter.page.Values()[iter.i]
   366  }
   367  
   368  // Creates a new instance of the AccountFilterCollectionIterator type.
   369  func NewAccountFilterCollectionIterator(page AccountFilterCollectionPage) AccountFilterCollectionIterator {
   370  	return AccountFilterCollectionIterator{page: page}
   371  }
   372  
   373  // IsEmpty returns true if the ListResult contains no values.
   374  func (afc AccountFilterCollection) IsEmpty() bool {
   375  	return afc.Value == nil || len(*afc.Value) == 0
   376  }
   377  
   378  // hasNextLink returns true if the NextLink is not empty.
   379  func (afc AccountFilterCollection) hasNextLink() bool {
   380  	return afc.OdataNextLink != nil && len(*afc.OdataNextLink) != 0
   381  }
   382  
   383  // accountFilterCollectionPreparer prepares a request to retrieve the next set of results.
   384  // It returns nil if no more results exist.
   385  func (afc AccountFilterCollection) accountFilterCollectionPreparer(ctx context.Context) (*http.Request, error) {
   386  	if !afc.hasNextLink() {
   387  		return nil, nil
   388  	}
   389  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   390  		autorest.AsJSON(),
   391  		autorest.AsGet(),
   392  		autorest.WithBaseURL(to.String(afc.OdataNextLink)))
   393  }
   394  
   395  // AccountFilterCollectionPage contains a page of AccountFilter values.
   396  type AccountFilterCollectionPage struct {
   397  	fn  func(context.Context, AccountFilterCollection) (AccountFilterCollection, error)
   398  	afc AccountFilterCollection
   399  }
   400  
   401  // NextWithContext advances to the next page of values.  If there was an error making
   402  // the request the page does not advance and the error is returned.
   403  func (page *AccountFilterCollectionPage) NextWithContext(ctx context.Context) (err error) {
   404  	if tracing.IsEnabled() {
   405  		ctx = tracing.StartSpan(ctx, fqdn+"/AccountFilterCollectionPage.NextWithContext")
   406  		defer func() {
   407  			sc := -1
   408  			if page.Response().Response.Response != nil {
   409  				sc = page.Response().Response.Response.StatusCode
   410  			}
   411  			tracing.EndSpan(ctx, sc, err)
   412  		}()
   413  	}
   414  	for {
   415  		next, err := page.fn(ctx, page.afc)
   416  		if err != nil {
   417  			return err
   418  		}
   419  		page.afc = next
   420  		if !next.hasNextLink() || !next.IsEmpty() {
   421  			break
   422  		}
   423  	}
   424  	return nil
   425  }
   426  
   427  // Next advances to the next page of values.  If there was an error making
   428  // the request the page does not advance and the error is returned.
   429  // Deprecated: Use NextWithContext() instead.
   430  func (page *AccountFilterCollectionPage) Next() error {
   431  	return page.NextWithContext(context.Background())
   432  }
   433  
   434  // NotDone returns true if the page enumeration should be started or is not yet complete.
   435  func (page AccountFilterCollectionPage) NotDone() bool {
   436  	return !page.afc.IsEmpty()
   437  }
   438  
   439  // Response returns the raw server response from the last page request.
   440  func (page AccountFilterCollectionPage) Response() AccountFilterCollection {
   441  	return page.afc
   442  }
   443  
   444  // Values returns the slice of values for the current page or nil if there are no values.
   445  func (page AccountFilterCollectionPage) Values() []AccountFilter {
   446  	if page.afc.IsEmpty() {
   447  		return nil
   448  	}
   449  	return *page.afc.Value
   450  }
   451  
   452  // Creates a new instance of the AccountFilterCollectionPage type.
   453  func NewAccountFilterCollectionPage(cur AccountFilterCollection, getNextPage func(context.Context, AccountFilterCollection) (AccountFilterCollection, error)) AccountFilterCollectionPage {
   454  	return AccountFilterCollectionPage{
   455  		fn:  getNextPage,
   456  		afc: cur,
   457  	}
   458  }
   459  
   460  // AkamaiAccessControl akamai access control
   461  type AkamaiAccessControl struct {
   462  	// AkamaiSignatureHeaderAuthenticationKeyList - authentication key list
   463  	AkamaiSignatureHeaderAuthenticationKeyList *[]AkamaiSignatureHeaderAuthenticationKey `json:"akamaiSignatureHeaderAuthenticationKeyList,omitempty"`
   464  }
   465  
   466  // AkamaiSignatureHeaderAuthenticationKey akamai Signature Header authentication key.
   467  type AkamaiSignatureHeaderAuthenticationKey struct {
   468  	// Identifier - identifier of the key
   469  	Identifier *string `json:"identifier,omitempty"`
   470  	// Base64Key - authentication key
   471  	Base64Key *string `json:"base64Key,omitempty"`
   472  	// Expiration - The expiration time of the authentication key.
   473  	Expiration *date.Time `json:"expiration,omitempty"`
   474  }
   475  
   476  // ArmStreamingEndpointCapacity the streaming endpoint sku capacity.
   477  type ArmStreamingEndpointCapacity struct {
   478  	// ScaleType - READ-ONLY
   479  	ScaleType *string `json:"scaleType,omitempty"`
   480  	// Default - The streaming endpoint default capacity.
   481  	Default *int32 `json:"default,omitempty"`
   482  	// Minimum - The streaming endpoint minimum capacity.
   483  	Minimum *int32 `json:"minimum,omitempty"`
   484  	// Maximum - The streaming endpoint maximum capacity.
   485  	Maximum *int32 `json:"maximum,omitempty"`
   486  }
   487  
   488  // MarshalJSON is the custom marshaler for ArmStreamingEndpointCapacity.
   489  func (asec ArmStreamingEndpointCapacity) MarshalJSON() ([]byte, error) {
   490  	objectMap := make(map[string]interface{})
   491  	if asec.Default != nil {
   492  		objectMap["default"] = asec.Default
   493  	}
   494  	if asec.Minimum != nil {
   495  		objectMap["minimum"] = asec.Minimum
   496  	}
   497  	if asec.Maximum != nil {
   498  		objectMap["maximum"] = asec.Maximum
   499  	}
   500  	return json.Marshal(objectMap)
   501  }
   502  
   503  // ArmStreamingEndpointCurrentSku the streaming endpoint current sku.
   504  type ArmStreamingEndpointCurrentSku struct {
   505  	// Name - READ-ONLY; The streaming endpoint sku name.
   506  	Name *string `json:"name,omitempty"`
   507  	// Capacity - The streaming endpoint sku capacity.
   508  	Capacity *int32 `json:"capacity,omitempty"`
   509  }
   510  
   511  // MarshalJSON is the custom marshaler for ArmStreamingEndpointCurrentSku.
   512  func (asecs ArmStreamingEndpointCurrentSku) MarshalJSON() ([]byte, error) {
   513  	objectMap := make(map[string]interface{})
   514  	if asecs.Capacity != nil {
   515  		objectMap["capacity"] = asecs.Capacity
   516  	}
   517  	return json.Marshal(objectMap)
   518  }
   519  
   520  // ArmStreamingEndpointSku the streaming endpoint sku.
   521  type ArmStreamingEndpointSku struct {
   522  	// Name - READ-ONLY; The streaming endpoint sku name.
   523  	Name *string `json:"name,omitempty"`
   524  }
   525  
   526  // MarshalJSON is the custom marshaler for ArmStreamingEndpointSku.
   527  func (ases ArmStreamingEndpointSku) MarshalJSON() ([]byte, error) {
   528  	objectMap := make(map[string]interface{})
   529  	return json.Marshal(objectMap)
   530  }
   531  
   532  // ArmStreamingEndpointSkuInfo ...
   533  type ArmStreamingEndpointSkuInfo struct {
   534  	ResourceType *string                       `json:"resourceType,omitempty"`
   535  	Capacity     *ArmStreamingEndpointCapacity `json:"capacity,omitempty"`
   536  	Sku          *ArmStreamingEndpointSku      `json:"sku,omitempty"`
   537  }
   538  
   539  // Asset an Asset.
   540  type Asset struct {
   541  	autorest.Response `json:"-"`
   542  	// AssetProperties - The resource properties.
   543  	*AssetProperties `json:"properties,omitempty"`
   544  	// SystemData - READ-ONLY; The system metadata relating to this resource.
   545  	SystemData *SystemData `json:"systemData,omitempty"`
   546  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
   547  	ID *string `json:"id,omitempty"`
   548  	// Name - READ-ONLY; The name of the resource
   549  	Name *string `json:"name,omitempty"`
   550  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
   551  	Type *string `json:"type,omitempty"`
   552  }
   553  
   554  // MarshalJSON is the custom marshaler for Asset.
   555  func (a Asset) MarshalJSON() ([]byte, error) {
   556  	objectMap := make(map[string]interface{})
   557  	if a.AssetProperties != nil {
   558  		objectMap["properties"] = a.AssetProperties
   559  	}
   560  	return json.Marshal(objectMap)
   561  }
   562  
   563  // UnmarshalJSON is the custom unmarshaler for Asset struct.
   564  func (a *Asset) UnmarshalJSON(body []byte) error {
   565  	var m map[string]*json.RawMessage
   566  	err := json.Unmarshal(body, &m)
   567  	if err != nil {
   568  		return err
   569  	}
   570  	for k, v := range m {
   571  		switch k {
   572  		case "properties":
   573  			if v != nil {
   574  				var assetProperties AssetProperties
   575  				err = json.Unmarshal(*v, &assetProperties)
   576  				if err != nil {
   577  					return err
   578  				}
   579  				a.AssetProperties = &assetProperties
   580  			}
   581  		case "systemData":
   582  			if v != nil {
   583  				var systemData SystemData
   584  				err = json.Unmarshal(*v, &systemData)
   585  				if err != nil {
   586  					return err
   587  				}
   588  				a.SystemData = &systemData
   589  			}
   590  		case "id":
   591  			if v != nil {
   592  				var ID string
   593  				err = json.Unmarshal(*v, &ID)
   594  				if err != nil {
   595  					return err
   596  				}
   597  				a.ID = &ID
   598  			}
   599  		case "name":
   600  			if v != nil {
   601  				var name string
   602  				err = json.Unmarshal(*v, &name)
   603  				if err != nil {
   604  					return err
   605  				}
   606  				a.Name = &name
   607  			}
   608  		case "type":
   609  			if v != nil {
   610  				var typeVar string
   611  				err = json.Unmarshal(*v, &typeVar)
   612  				if err != nil {
   613  					return err
   614  				}
   615  				a.Type = &typeVar
   616  			}
   617  		}
   618  	}
   619  
   620  	return nil
   621  }
   622  
   623  // AssetCollection a collection of Asset items.
   624  type AssetCollection struct {
   625  	autorest.Response `json:"-"`
   626  	// Value - A collection of Asset items.
   627  	Value *[]Asset `json:"value,omitempty"`
   628  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
   629  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
   630  }
   631  
   632  // AssetCollectionIterator provides access to a complete listing of Asset values.
   633  type AssetCollectionIterator struct {
   634  	i    int
   635  	page AssetCollectionPage
   636  }
   637  
   638  // NextWithContext advances to the next value.  If there was an error making
   639  // the request the iterator does not advance and the error is returned.
   640  func (iter *AssetCollectionIterator) NextWithContext(ctx context.Context) (err error) {
   641  	if tracing.IsEnabled() {
   642  		ctx = tracing.StartSpan(ctx, fqdn+"/AssetCollectionIterator.NextWithContext")
   643  		defer func() {
   644  			sc := -1
   645  			if iter.Response().Response.Response != nil {
   646  				sc = iter.Response().Response.Response.StatusCode
   647  			}
   648  			tracing.EndSpan(ctx, sc, err)
   649  		}()
   650  	}
   651  	iter.i++
   652  	if iter.i < len(iter.page.Values()) {
   653  		return nil
   654  	}
   655  	err = iter.page.NextWithContext(ctx)
   656  	if err != nil {
   657  		iter.i--
   658  		return err
   659  	}
   660  	iter.i = 0
   661  	return nil
   662  }
   663  
   664  // Next advances to the next value.  If there was an error making
   665  // the request the iterator does not advance and the error is returned.
   666  // Deprecated: Use NextWithContext() instead.
   667  func (iter *AssetCollectionIterator) Next() error {
   668  	return iter.NextWithContext(context.Background())
   669  }
   670  
   671  // NotDone returns true if the enumeration should be started or is not yet complete.
   672  func (iter AssetCollectionIterator) NotDone() bool {
   673  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   674  }
   675  
   676  // Response returns the raw server response from the last page request.
   677  func (iter AssetCollectionIterator) Response() AssetCollection {
   678  	return iter.page.Response()
   679  }
   680  
   681  // Value returns the current value or a zero-initialized value if the
   682  // iterator has advanced beyond the end of the collection.
   683  func (iter AssetCollectionIterator) Value() Asset {
   684  	if !iter.page.NotDone() {
   685  		return Asset{}
   686  	}
   687  	return iter.page.Values()[iter.i]
   688  }
   689  
   690  // Creates a new instance of the AssetCollectionIterator type.
   691  func NewAssetCollectionIterator(page AssetCollectionPage) AssetCollectionIterator {
   692  	return AssetCollectionIterator{page: page}
   693  }
   694  
   695  // IsEmpty returns true if the ListResult contains no values.
   696  func (ac AssetCollection) IsEmpty() bool {
   697  	return ac.Value == nil || len(*ac.Value) == 0
   698  }
   699  
   700  // hasNextLink returns true if the NextLink is not empty.
   701  func (ac AssetCollection) hasNextLink() bool {
   702  	return ac.OdataNextLink != nil && len(*ac.OdataNextLink) != 0
   703  }
   704  
   705  // assetCollectionPreparer prepares a request to retrieve the next set of results.
   706  // It returns nil if no more results exist.
   707  func (ac AssetCollection) assetCollectionPreparer(ctx context.Context) (*http.Request, error) {
   708  	if !ac.hasNextLink() {
   709  		return nil, nil
   710  	}
   711  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   712  		autorest.AsJSON(),
   713  		autorest.AsGet(),
   714  		autorest.WithBaseURL(to.String(ac.OdataNextLink)))
   715  }
   716  
   717  // AssetCollectionPage contains a page of Asset values.
   718  type AssetCollectionPage struct {
   719  	fn func(context.Context, AssetCollection) (AssetCollection, error)
   720  	ac AssetCollection
   721  }
   722  
   723  // NextWithContext advances to the next page of values.  If there was an error making
   724  // the request the page does not advance and the error is returned.
   725  func (page *AssetCollectionPage) NextWithContext(ctx context.Context) (err error) {
   726  	if tracing.IsEnabled() {
   727  		ctx = tracing.StartSpan(ctx, fqdn+"/AssetCollectionPage.NextWithContext")
   728  		defer func() {
   729  			sc := -1
   730  			if page.Response().Response.Response != nil {
   731  				sc = page.Response().Response.Response.StatusCode
   732  			}
   733  			tracing.EndSpan(ctx, sc, err)
   734  		}()
   735  	}
   736  	for {
   737  		next, err := page.fn(ctx, page.ac)
   738  		if err != nil {
   739  			return err
   740  		}
   741  		page.ac = next
   742  		if !next.hasNextLink() || !next.IsEmpty() {
   743  			break
   744  		}
   745  	}
   746  	return nil
   747  }
   748  
   749  // Next advances to the next page of values.  If there was an error making
   750  // the request the page does not advance and the error is returned.
   751  // Deprecated: Use NextWithContext() instead.
   752  func (page *AssetCollectionPage) Next() error {
   753  	return page.NextWithContext(context.Background())
   754  }
   755  
   756  // NotDone returns true if the page enumeration should be started or is not yet complete.
   757  func (page AssetCollectionPage) NotDone() bool {
   758  	return !page.ac.IsEmpty()
   759  }
   760  
   761  // Response returns the raw server response from the last page request.
   762  func (page AssetCollectionPage) Response() AssetCollection {
   763  	return page.ac
   764  }
   765  
   766  // Values returns the slice of values for the current page or nil if there are no values.
   767  func (page AssetCollectionPage) Values() []Asset {
   768  	if page.ac.IsEmpty() {
   769  		return nil
   770  	}
   771  	return *page.ac.Value
   772  }
   773  
   774  // Creates a new instance of the AssetCollectionPage type.
   775  func NewAssetCollectionPage(cur AssetCollection, getNextPage func(context.Context, AssetCollection) (AssetCollection, error)) AssetCollectionPage {
   776  	return AssetCollectionPage{
   777  		fn: getNextPage,
   778  		ac: cur,
   779  	}
   780  }
   781  
   782  // AssetContainerSas the Asset Storage container SAS URLs.
   783  type AssetContainerSas struct {
   784  	autorest.Response `json:"-"`
   785  	// AssetContainerSasUrls - The list of Asset container SAS URLs.
   786  	AssetContainerSasUrls *[]string `json:"assetContainerSasUrls,omitempty"`
   787  }
   788  
   789  // AssetFileEncryptionMetadata the Asset File Storage encryption metadata.
   790  type AssetFileEncryptionMetadata struct {
   791  	// InitializationVector - The Asset File initialization vector.
   792  	InitializationVector *string `json:"initializationVector,omitempty"`
   793  	// AssetFileName - The Asset File name.
   794  	AssetFileName *string `json:"assetFileName,omitempty"`
   795  	// AssetFileID - The Asset File Id.
   796  	AssetFileID *uuid.UUID `json:"assetFileId,omitempty"`
   797  }
   798  
   799  // AssetFilter an Asset Filter.
   800  type AssetFilter struct {
   801  	autorest.Response `json:"-"`
   802  	*FilterProperties `json:"properties,omitempty"`
   803  	// SystemData - READ-ONLY; The system metadata relating to this resource.
   804  	SystemData *SystemData `json:"systemData,omitempty"`
   805  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
   806  	ID *string `json:"id,omitempty"`
   807  	// Name - READ-ONLY; The name of the resource
   808  	Name *string `json:"name,omitempty"`
   809  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
   810  	Type *string `json:"type,omitempty"`
   811  }
   812  
   813  // MarshalJSON is the custom marshaler for AssetFilter.
   814  func (af AssetFilter) MarshalJSON() ([]byte, error) {
   815  	objectMap := make(map[string]interface{})
   816  	if af.FilterProperties != nil {
   817  		objectMap["properties"] = af.FilterProperties
   818  	}
   819  	return json.Marshal(objectMap)
   820  }
   821  
   822  // UnmarshalJSON is the custom unmarshaler for AssetFilter struct.
   823  func (af *AssetFilter) UnmarshalJSON(body []byte) error {
   824  	var m map[string]*json.RawMessage
   825  	err := json.Unmarshal(body, &m)
   826  	if err != nil {
   827  		return err
   828  	}
   829  	for k, v := range m {
   830  		switch k {
   831  		case "properties":
   832  			if v != nil {
   833  				var filterProperties FilterProperties
   834  				err = json.Unmarshal(*v, &filterProperties)
   835  				if err != nil {
   836  					return err
   837  				}
   838  				af.FilterProperties = &filterProperties
   839  			}
   840  		case "systemData":
   841  			if v != nil {
   842  				var systemData SystemData
   843  				err = json.Unmarshal(*v, &systemData)
   844  				if err != nil {
   845  					return err
   846  				}
   847  				af.SystemData = &systemData
   848  			}
   849  		case "id":
   850  			if v != nil {
   851  				var ID string
   852  				err = json.Unmarshal(*v, &ID)
   853  				if err != nil {
   854  					return err
   855  				}
   856  				af.ID = &ID
   857  			}
   858  		case "name":
   859  			if v != nil {
   860  				var name string
   861  				err = json.Unmarshal(*v, &name)
   862  				if err != nil {
   863  					return err
   864  				}
   865  				af.Name = &name
   866  			}
   867  		case "type":
   868  			if v != nil {
   869  				var typeVar string
   870  				err = json.Unmarshal(*v, &typeVar)
   871  				if err != nil {
   872  					return err
   873  				}
   874  				af.Type = &typeVar
   875  			}
   876  		}
   877  	}
   878  
   879  	return nil
   880  }
   881  
   882  // AssetFilterCollection a collection of AssetFilter items.
   883  type AssetFilterCollection struct {
   884  	autorest.Response `json:"-"`
   885  	// Value - A collection of AssetFilter items.
   886  	Value *[]AssetFilter `json:"value,omitempty"`
   887  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
   888  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
   889  }
   890  
   891  // AssetFilterCollectionIterator provides access to a complete listing of AssetFilter values.
   892  type AssetFilterCollectionIterator struct {
   893  	i    int
   894  	page AssetFilterCollectionPage
   895  }
   896  
   897  // NextWithContext advances to the next value.  If there was an error making
   898  // the request the iterator does not advance and the error is returned.
   899  func (iter *AssetFilterCollectionIterator) NextWithContext(ctx context.Context) (err error) {
   900  	if tracing.IsEnabled() {
   901  		ctx = tracing.StartSpan(ctx, fqdn+"/AssetFilterCollectionIterator.NextWithContext")
   902  		defer func() {
   903  			sc := -1
   904  			if iter.Response().Response.Response != nil {
   905  				sc = iter.Response().Response.Response.StatusCode
   906  			}
   907  			tracing.EndSpan(ctx, sc, err)
   908  		}()
   909  	}
   910  	iter.i++
   911  	if iter.i < len(iter.page.Values()) {
   912  		return nil
   913  	}
   914  	err = iter.page.NextWithContext(ctx)
   915  	if err != nil {
   916  		iter.i--
   917  		return err
   918  	}
   919  	iter.i = 0
   920  	return nil
   921  }
   922  
   923  // Next advances to the next value.  If there was an error making
   924  // the request the iterator does not advance and the error is returned.
   925  // Deprecated: Use NextWithContext() instead.
   926  func (iter *AssetFilterCollectionIterator) Next() error {
   927  	return iter.NextWithContext(context.Background())
   928  }
   929  
   930  // NotDone returns true if the enumeration should be started or is not yet complete.
   931  func (iter AssetFilterCollectionIterator) NotDone() bool {
   932  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   933  }
   934  
   935  // Response returns the raw server response from the last page request.
   936  func (iter AssetFilterCollectionIterator) Response() AssetFilterCollection {
   937  	return iter.page.Response()
   938  }
   939  
   940  // Value returns the current value or a zero-initialized value if the
   941  // iterator has advanced beyond the end of the collection.
   942  func (iter AssetFilterCollectionIterator) Value() AssetFilter {
   943  	if !iter.page.NotDone() {
   944  		return AssetFilter{}
   945  	}
   946  	return iter.page.Values()[iter.i]
   947  }
   948  
   949  // Creates a new instance of the AssetFilterCollectionIterator type.
   950  func NewAssetFilterCollectionIterator(page AssetFilterCollectionPage) AssetFilterCollectionIterator {
   951  	return AssetFilterCollectionIterator{page: page}
   952  }
   953  
   954  // IsEmpty returns true if the ListResult contains no values.
   955  func (afc AssetFilterCollection) IsEmpty() bool {
   956  	return afc.Value == nil || len(*afc.Value) == 0
   957  }
   958  
   959  // hasNextLink returns true if the NextLink is not empty.
   960  func (afc AssetFilterCollection) hasNextLink() bool {
   961  	return afc.OdataNextLink != nil && len(*afc.OdataNextLink) != 0
   962  }
   963  
   964  // assetFilterCollectionPreparer prepares a request to retrieve the next set of results.
   965  // It returns nil if no more results exist.
   966  func (afc AssetFilterCollection) assetFilterCollectionPreparer(ctx context.Context) (*http.Request, error) {
   967  	if !afc.hasNextLink() {
   968  		return nil, nil
   969  	}
   970  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   971  		autorest.AsJSON(),
   972  		autorest.AsGet(),
   973  		autorest.WithBaseURL(to.String(afc.OdataNextLink)))
   974  }
   975  
   976  // AssetFilterCollectionPage contains a page of AssetFilter values.
   977  type AssetFilterCollectionPage struct {
   978  	fn  func(context.Context, AssetFilterCollection) (AssetFilterCollection, error)
   979  	afc AssetFilterCollection
   980  }
   981  
   982  // NextWithContext advances to the next page of values.  If there was an error making
   983  // the request the page does not advance and the error is returned.
   984  func (page *AssetFilterCollectionPage) NextWithContext(ctx context.Context) (err error) {
   985  	if tracing.IsEnabled() {
   986  		ctx = tracing.StartSpan(ctx, fqdn+"/AssetFilterCollectionPage.NextWithContext")
   987  		defer func() {
   988  			sc := -1
   989  			if page.Response().Response.Response != nil {
   990  				sc = page.Response().Response.Response.StatusCode
   991  			}
   992  			tracing.EndSpan(ctx, sc, err)
   993  		}()
   994  	}
   995  	for {
   996  		next, err := page.fn(ctx, page.afc)
   997  		if err != nil {
   998  			return err
   999  		}
  1000  		page.afc = next
  1001  		if !next.hasNextLink() || !next.IsEmpty() {
  1002  			break
  1003  		}
  1004  	}
  1005  	return nil
  1006  }
  1007  
  1008  // Next advances to the next page of values.  If there was an error making
  1009  // the request the page does not advance and the error is returned.
  1010  // Deprecated: Use NextWithContext() instead.
  1011  func (page *AssetFilterCollectionPage) Next() error {
  1012  	return page.NextWithContext(context.Background())
  1013  }
  1014  
  1015  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1016  func (page AssetFilterCollectionPage) NotDone() bool {
  1017  	return !page.afc.IsEmpty()
  1018  }
  1019  
  1020  // Response returns the raw server response from the last page request.
  1021  func (page AssetFilterCollectionPage) Response() AssetFilterCollection {
  1022  	return page.afc
  1023  }
  1024  
  1025  // Values returns the slice of values for the current page or nil if there are no values.
  1026  func (page AssetFilterCollectionPage) Values() []AssetFilter {
  1027  	if page.afc.IsEmpty() {
  1028  		return nil
  1029  	}
  1030  	return *page.afc.Value
  1031  }
  1032  
  1033  // Creates a new instance of the AssetFilterCollectionPage type.
  1034  func NewAssetFilterCollectionPage(cur AssetFilterCollection, getNextPage func(context.Context, AssetFilterCollection) (AssetFilterCollection, error)) AssetFilterCollectionPage {
  1035  	return AssetFilterCollectionPage{
  1036  		fn:  getNextPage,
  1037  		afc: cur,
  1038  	}
  1039  }
  1040  
  1041  // AssetProperties the Asset properties.
  1042  type AssetProperties struct {
  1043  	// AssetID - READ-ONLY; The Asset ID.
  1044  	AssetID *uuid.UUID `json:"assetId,omitempty"`
  1045  	// Created - READ-ONLY; The creation date of the Asset.
  1046  	Created *date.Time `json:"created,omitempty"`
  1047  	// LastModified - READ-ONLY; The last modified date of the Asset.
  1048  	LastModified *date.Time `json:"lastModified,omitempty"`
  1049  	// AlternateID - The alternate ID of the Asset.
  1050  	AlternateID *string `json:"alternateId,omitempty"`
  1051  	// Description - The Asset description.
  1052  	Description *string `json:"description,omitempty"`
  1053  	// Container - The name of the asset blob container.
  1054  	Container *string `json:"container,omitempty"`
  1055  	// StorageAccountName - The name of the storage account.
  1056  	StorageAccountName *string `json:"storageAccountName,omitempty"`
  1057  	// StorageEncryptionFormat - READ-ONLY; The Asset encryption format. One of None or MediaStorageEncryption. Possible values include: 'AssetStorageEncryptionFormatNone', 'AssetStorageEncryptionFormatMediaStorageClientEncryption'
  1058  	StorageEncryptionFormat AssetStorageEncryptionFormat `json:"storageEncryptionFormat,omitempty"`
  1059  }
  1060  
  1061  // MarshalJSON is the custom marshaler for AssetProperties.
  1062  func (ap AssetProperties) MarshalJSON() ([]byte, error) {
  1063  	objectMap := make(map[string]interface{})
  1064  	if ap.AlternateID != nil {
  1065  		objectMap["alternateId"] = ap.AlternateID
  1066  	}
  1067  	if ap.Description != nil {
  1068  		objectMap["description"] = ap.Description
  1069  	}
  1070  	if ap.Container != nil {
  1071  		objectMap["container"] = ap.Container
  1072  	}
  1073  	if ap.StorageAccountName != nil {
  1074  		objectMap["storageAccountName"] = ap.StorageAccountName
  1075  	}
  1076  	return json.Marshal(objectMap)
  1077  }
  1078  
  1079  // AssetStreamingLocator properties of the Streaming Locator.
  1080  type AssetStreamingLocator struct {
  1081  	// Name - READ-ONLY; Streaming Locator name.
  1082  	Name *string `json:"name,omitempty"`
  1083  	// AssetName - READ-ONLY; Asset Name.
  1084  	AssetName *string `json:"assetName,omitempty"`
  1085  	// Created - READ-ONLY; The creation time of the Streaming Locator.
  1086  	Created *date.Time `json:"created,omitempty"`
  1087  	// StartTime - READ-ONLY; The start time of the Streaming Locator.
  1088  	StartTime *date.Time `json:"startTime,omitempty"`
  1089  	// EndTime - READ-ONLY; The end time of the Streaming Locator.
  1090  	EndTime *date.Time `json:"endTime,omitempty"`
  1091  	// StreamingLocatorID - READ-ONLY; StreamingLocatorId of the Streaming Locator.
  1092  	StreamingLocatorID *uuid.UUID `json:"streamingLocatorId,omitempty"`
  1093  	// StreamingPolicyName - READ-ONLY; Name of the Streaming Policy used by this Streaming Locator.
  1094  	StreamingPolicyName *string `json:"streamingPolicyName,omitempty"`
  1095  	// DefaultContentKeyPolicyName - READ-ONLY; Name of the default ContentKeyPolicy used by this Streaming Locator.
  1096  	DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"`
  1097  }
  1098  
  1099  // MarshalJSON is the custom marshaler for AssetStreamingLocator.
  1100  func (asl AssetStreamingLocator) MarshalJSON() ([]byte, error) {
  1101  	objectMap := make(map[string]interface{})
  1102  	return json.Marshal(objectMap)
  1103  }
  1104  
  1105  // AssetTrack an Asset Track resource.
  1106  type AssetTrack struct {
  1107  	autorest.Response `json:"-"`
  1108  	// AssetTrackProperties - The resource properties.
  1109  	*AssetTrackProperties `json:"properties,omitempty"`
  1110  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  1111  	ID *string `json:"id,omitempty"`
  1112  	// Name - READ-ONLY; The name of the resource
  1113  	Name *string `json:"name,omitempty"`
  1114  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  1115  	Type *string `json:"type,omitempty"`
  1116  }
  1117  
  1118  // MarshalJSON is the custom marshaler for AssetTrack.
  1119  func (at AssetTrack) MarshalJSON() ([]byte, error) {
  1120  	objectMap := make(map[string]interface{})
  1121  	if at.AssetTrackProperties != nil {
  1122  		objectMap["properties"] = at.AssetTrackProperties
  1123  	}
  1124  	return json.Marshal(objectMap)
  1125  }
  1126  
  1127  // UnmarshalJSON is the custom unmarshaler for AssetTrack struct.
  1128  func (at *AssetTrack) UnmarshalJSON(body []byte) error {
  1129  	var m map[string]*json.RawMessage
  1130  	err := json.Unmarshal(body, &m)
  1131  	if err != nil {
  1132  		return err
  1133  	}
  1134  	for k, v := range m {
  1135  		switch k {
  1136  		case "properties":
  1137  			if v != nil {
  1138  				var assetTrackProperties AssetTrackProperties
  1139  				err = json.Unmarshal(*v, &assetTrackProperties)
  1140  				if err != nil {
  1141  					return err
  1142  				}
  1143  				at.AssetTrackProperties = &assetTrackProperties
  1144  			}
  1145  		case "id":
  1146  			if v != nil {
  1147  				var ID string
  1148  				err = json.Unmarshal(*v, &ID)
  1149  				if err != nil {
  1150  					return err
  1151  				}
  1152  				at.ID = &ID
  1153  			}
  1154  		case "name":
  1155  			if v != nil {
  1156  				var name string
  1157  				err = json.Unmarshal(*v, &name)
  1158  				if err != nil {
  1159  					return err
  1160  				}
  1161  				at.Name = &name
  1162  			}
  1163  		case "type":
  1164  			if v != nil {
  1165  				var typeVar string
  1166  				err = json.Unmarshal(*v, &typeVar)
  1167  				if err != nil {
  1168  					return err
  1169  				}
  1170  				at.Type = &typeVar
  1171  			}
  1172  		}
  1173  	}
  1174  
  1175  	return nil
  1176  }
  1177  
  1178  // AssetTrackCollection a collection of AssetTrack items.
  1179  type AssetTrackCollection struct {
  1180  	autorest.Response `json:"-"`
  1181  	// Value - A collection of AssetTrack items.
  1182  	Value *[]AssetTrack `json:"value,omitempty"`
  1183  }
  1184  
  1185  // AssetTrackOperationStatus status of asset track operation.
  1186  type AssetTrackOperationStatus struct {
  1187  	autorest.Response `json:"-"`
  1188  	// Name - Operation identifier.
  1189  	Name *string `json:"name,omitempty"`
  1190  	// ID - Operation resource ID.
  1191  	ID *string `json:"id,omitempty"`
  1192  	// StartTime - Operation start time.
  1193  	StartTime *date.Time `json:"startTime,omitempty"`
  1194  	// EndTime - Operation end time.
  1195  	EndTime *date.Time `json:"endTime,omitempty"`
  1196  	// Status - Operation status.
  1197  	Status *string      `json:"status,omitempty"`
  1198  	Error  *ErrorDetail `json:"error,omitempty"`
  1199  }
  1200  
  1201  // AssetTrackProperties properties of a video, audio or text track in the asset.
  1202  type AssetTrackProperties struct {
  1203  	// Track - Detailed information about a track in the asset.
  1204  	Track BasicTrackBase `json:"track,omitempty"`
  1205  	// ProvisioningState - READ-ONLY; Provisioning state of the asset track. Possible values include: 'ProvisioningStateFailed', 'ProvisioningStateInProgress', 'ProvisioningStateSucceeded'
  1206  	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
  1207  }
  1208  
  1209  // MarshalJSON is the custom marshaler for AssetTrackProperties.
  1210  func (atp AssetTrackProperties) MarshalJSON() ([]byte, error) {
  1211  	objectMap := make(map[string]interface{})
  1212  	objectMap["track"] = atp.Track
  1213  	return json.Marshal(objectMap)
  1214  }
  1215  
  1216  // UnmarshalJSON is the custom unmarshaler for AssetTrackProperties struct.
  1217  func (atp *AssetTrackProperties) UnmarshalJSON(body []byte) error {
  1218  	var m map[string]*json.RawMessage
  1219  	err := json.Unmarshal(body, &m)
  1220  	if err != nil {
  1221  		return err
  1222  	}
  1223  	for k, v := range m {
  1224  		switch k {
  1225  		case "track":
  1226  			if v != nil {
  1227  				track, err := unmarshalBasicTrackBase(*v)
  1228  				if err != nil {
  1229  					return err
  1230  				}
  1231  				atp.Track = track
  1232  			}
  1233  		case "provisioningState":
  1234  			if v != nil {
  1235  				var provisioningState ProvisioningState
  1236  				err = json.Unmarshal(*v, &provisioningState)
  1237  				if err != nil {
  1238  					return err
  1239  				}
  1240  				atp.ProvisioningState = provisioningState
  1241  			}
  1242  		}
  1243  	}
  1244  
  1245  	return nil
  1246  }
  1247  
  1248  // BasicAudio defines the common properties for all audio codecs.
  1249  type BasicAudio interface {
  1250  	AsAacAudio() (*AacAudio, bool)
  1251  	AsAudio() (*Audio, bool)
  1252  }
  1253  
  1254  // Audio defines the common properties for all audio codecs.
  1255  type Audio struct {
  1256  	// Channels - The number of channels in the audio.
  1257  	Channels *int32 `json:"channels,omitempty"`
  1258  	// SamplingRate - The sampling rate to use for encoding in hertz.
  1259  	SamplingRate *int32 `json:"samplingRate,omitempty"`
  1260  	// Bitrate - The bitrate, in bits per second, of the output encoded audio.
  1261  	Bitrate *int32 `json:"bitrate,omitempty"`
  1262  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  1263  	Label *string `json:"label,omitempty"`
  1264  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  1265  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  1266  }
  1267  
  1268  func unmarshalBasicAudio(body []byte) (BasicAudio, error) {
  1269  	var m map[string]interface{}
  1270  	err := json.Unmarshal(body, &m)
  1271  	if err != nil {
  1272  		return nil, err
  1273  	}
  1274  
  1275  	switch m["@odata.type"] {
  1276  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio):
  1277  		var aa AacAudio
  1278  		err := json.Unmarshal(body, &aa)
  1279  		return aa, err
  1280  	default:
  1281  		var a Audio
  1282  		err := json.Unmarshal(body, &a)
  1283  		return a, err
  1284  	}
  1285  }
  1286  func unmarshalBasicAudioArray(body []byte) ([]BasicAudio, error) {
  1287  	var rawMessages []*json.RawMessage
  1288  	err := json.Unmarshal(body, &rawMessages)
  1289  	if err != nil {
  1290  		return nil, err
  1291  	}
  1292  
  1293  	aArray := make([]BasicAudio, len(rawMessages))
  1294  
  1295  	for index, rawMessage := range rawMessages {
  1296  		a, err := unmarshalBasicAudio(*rawMessage)
  1297  		if err != nil {
  1298  			return nil, err
  1299  		}
  1300  		aArray[index] = a
  1301  	}
  1302  	return aArray, nil
  1303  }
  1304  
  1305  // MarshalJSON is the custom marshaler for Audio.
  1306  func (a Audio) MarshalJSON() ([]byte, error) {
  1307  	a.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio
  1308  	objectMap := make(map[string]interface{})
  1309  	if a.Channels != nil {
  1310  		objectMap["channels"] = a.Channels
  1311  	}
  1312  	if a.SamplingRate != nil {
  1313  		objectMap["samplingRate"] = a.SamplingRate
  1314  	}
  1315  	if a.Bitrate != nil {
  1316  		objectMap["bitrate"] = a.Bitrate
  1317  	}
  1318  	if a.Label != nil {
  1319  		objectMap["label"] = a.Label
  1320  	}
  1321  	if a.OdataType != "" {
  1322  		objectMap["@odata.type"] = a.OdataType
  1323  	}
  1324  	return json.Marshal(objectMap)
  1325  }
  1326  
  1327  // AsAudio is the BasicCodec implementation for Audio.
  1328  func (a Audio) AsAudio() (*Audio, bool) {
  1329  	return &a, true
  1330  }
  1331  
  1332  // AsBasicAudio is the BasicCodec implementation for Audio.
  1333  func (a Audio) AsBasicAudio() (BasicAudio, bool) {
  1334  	return &a, true
  1335  }
  1336  
  1337  // AsAacAudio is the BasicCodec implementation for Audio.
  1338  func (a Audio) AsAacAudio() (*AacAudio, bool) {
  1339  	return nil, false
  1340  }
  1341  
  1342  // AsVideo is the BasicCodec implementation for Audio.
  1343  func (a Audio) AsVideo() (*Video, bool) {
  1344  	return nil, false
  1345  }
  1346  
  1347  // AsBasicVideo is the BasicCodec implementation for Audio.
  1348  func (a Audio) AsBasicVideo() (BasicVideo, bool) {
  1349  	return nil, false
  1350  }
  1351  
  1352  // AsH265Video is the BasicCodec implementation for Audio.
  1353  func (a Audio) AsH265Video() (*H265Video, bool) {
  1354  	return nil, false
  1355  }
  1356  
  1357  // AsCopyVideo is the BasicCodec implementation for Audio.
  1358  func (a Audio) AsCopyVideo() (*CopyVideo, bool) {
  1359  	return nil, false
  1360  }
  1361  
  1362  // AsImage is the BasicCodec implementation for Audio.
  1363  func (a Audio) AsImage() (*Image, bool) {
  1364  	return nil, false
  1365  }
  1366  
  1367  // AsBasicImage is the BasicCodec implementation for Audio.
  1368  func (a Audio) AsBasicImage() (BasicImage, bool) {
  1369  	return nil, false
  1370  }
  1371  
  1372  // AsCopyAudio is the BasicCodec implementation for Audio.
  1373  func (a Audio) AsCopyAudio() (*CopyAudio, bool) {
  1374  	return nil, false
  1375  }
  1376  
  1377  // AsH264Video is the BasicCodec implementation for Audio.
  1378  func (a Audio) AsH264Video() (*H264Video, bool) {
  1379  	return nil, false
  1380  }
  1381  
  1382  // AsJpgImage is the BasicCodec implementation for Audio.
  1383  func (a Audio) AsJpgImage() (*JpgImage, bool) {
  1384  	return nil, false
  1385  }
  1386  
  1387  // AsPngImage is the BasicCodec implementation for Audio.
  1388  func (a Audio) AsPngImage() (*PngImage, bool) {
  1389  	return nil, false
  1390  }
  1391  
  1392  // AsCodec is the BasicCodec implementation for Audio.
  1393  func (a Audio) AsCodec() (*Codec, bool) {
  1394  	return nil, false
  1395  }
  1396  
  1397  // AsBasicCodec is the BasicCodec implementation for Audio.
  1398  func (a Audio) AsBasicCodec() (BasicCodec, bool) {
  1399  	return &a, true
  1400  }
  1401  
  1402  // BasicAudioAnalyzerPreset the Audio Analyzer preset applies a pre-defined set of AI-based analysis operations,
  1403  // including speech transcription. Currently, the preset supports processing of content with a single audio track.
  1404  type BasicAudioAnalyzerPreset interface {
  1405  	AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool)
  1406  	AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool)
  1407  }
  1408  
  1409  // AudioAnalyzerPreset the Audio Analyzer preset applies a pre-defined set of AI-based analysis operations,
  1410  // including speech transcription. Currently, the preset supports processing of content with a single audio
  1411  // track.
  1412  type AudioAnalyzerPreset struct {
  1413  	// AudioLanguage - The language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US').  If you know the language of your content, it is recommended that you specify it. The language must be specified explicitly for AudioAnalysisMode::Basic, since automatic language detection is not included in basic mode. If the language isn't specified or set to null, automatic language detection will choose the first language detected and process with the selected language for the duration of the file. It does not currently support dynamically switching between languages after the first language is detected. The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection fails to find the language, transcription would fallback to 'en-US'." The list of supported languages is available here: https://go.microsoft.com/fwlink/?linkid=2109463
  1414  	AudioLanguage *string `json:"audioLanguage,omitempty"`
  1415  	// Mode - Determines the set of audio analysis operations to be performed. If unspecified, the Standard AudioAnalysisMode would be chosen. Possible values include: 'AudioAnalysisModeStandard', 'AudioAnalysisModeBasic'
  1416  	Mode AudioAnalysisMode `json:"mode,omitempty"`
  1417  	// ExperimentalOptions - Dictionary containing key value pairs for parameters not exposed in the preset itself
  1418  	ExperimentalOptions map[string]*string `json:"experimentalOptions"`
  1419  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
  1420  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
  1421  }
  1422  
  1423  func unmarshalBasicAudioAnalyzerPreset(body []byte) (BasicAudioAnalyzerPreset, error) {
  1424  	var m map[string]interface{}
  1425  	err := json.Unmarshal(body, &m)
  1426  	if err != nil {
  1427  		return nil, err
  1428  	}
  1429  
  1430  	switch m["@odata.type"] {
  1431  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset):
  1432  		var vap VideoAnalyzerPreset
  1433  		err := json.Unmarshal(body, &vap)
  1434  		return vap, err
  1435  	default:
  1436  		var aap AudioAnalyzerPreset
  1437  		err := json.Unmarshal(body, &aap)
  1438  		return aap, err
  1439  	}
  1440  }
  1441  func unmarshalBasicAudioAnalyzerPresetArray(body []byte) ([]BasicAudioAnalyzerPreset, error) {
  1442  	var rawMessages []*json.RawMessage
  1443  	err := json.Unmarshal(body, &rawMessages)
  1444  	if err != nil {
  1445  		return nil, err
  1446  	}
  1447  
  1448  	aapArray := make([]BasicAudioAnalyzerPreset, len(rawMessages))
  1449  
  1450  	for index, rawMessage := range rawMessages {
  1451  		aap, err := unmarshalBasicAudioAnalyzerPreset(*rawMessage)
  1452  		if err != nil {
  1453  			return nil, err
  1454  		}
  1455  		aapArray[index] = aap
  1456  	}
  1457  	return aapArray, nil
  1458  }
  1459  
  1460  // MarshalJSON is the custom marshaler for AudioAnalyzerPreset.
  1461  func (aap AudioAnalyzerPreset) MarshalJSON() ([]byte, error) {
  1462  	aap.OdataType = OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset
  1463  	objectMap := make(map[string]interface{})
  1464  	if aap.AudioLanguage != nil {
  1465  		objectMap["audioLanguage"] = aap.AudioLanguage
  1466  	}
  1467  	if aap.Mode != "" {
  1468  		objectMap["mode"] = aap.Mode
  1469  	}
  1470  	if aap.ExperimentalOptions != nil {
  1471  		objectMap["experimentalOptions"] = aap.ExperimentalOptions
  1472  	}
  1473  	if aap.OdataType != "" {
  1474  		objectMap["@odata.type"] = aap.OdataType
  1475  	}
  1476  	return json.Marshal(objectMap)
  1477  }
  1478  
  1479  // AsFaceDetectorPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1480  func (aap AudioAnalyzerPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
  1481  	return nil, false
  1482  }
  1483  
  1484  // AsAudioAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1485  func (aap AudioAnalyzerPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
  1486  	return &aap, true
  1487  }
  1488  
  1489  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1490  func (aap AudioAnalyzerPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
  1491  	return &aap, true
  1492  }
  1493  
  1494  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1495  func (aap AudioAnalyzerPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
  1496  	return nil, false
  1497  }
  1498  
  1499  // AsStandardEncoderPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1500  func (aap AudioAnalyzerPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
  1501  	return nil, false
  1502  }
  1503  
  1504  // AsVideoAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1505  func (aap AudioAnalyzerPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
  1506  	return nil, false
  1507  }
  1508  
  1509  // AsPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1510  func (aap AudioAnalyzerPreset) AsPreset() (*Preset, bool) {
  1511  	return nil, false
  1512  }
  1513  
  1514  // AsBasicPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1515  func (aap AudioAnalyzerPreset) AsBasicPreset() (BasicPreset, bool) {
  1516  	return &aap, true
  1517  }
  1518  
  1519  // AudioOverlay describes the properties of an audio overlay.
  1520  type AudioOverlay struct {
  1521  	// InputLabel - The label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG, PNG, GIF or BMP format, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats.
  1522  	InputLabel *string `json:"inputLabel,omitempty"`
  1523  	// Start - The start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds into the input video. If not specified the overlay starts from the beginning of the input video.
  1524  	Start *string `json:"start,omitempty"`
  1525  	// End - The end position, with reference to the input video, at which the overlay ends. The value should be in ISO 8601 format. For example, PT30S to end the overlay at 30 seconds into the input video. If not specified or the value is greater than the input video duration, the overlay will be applied until the end of the input video if the overlay media duration is greater than the input video duration, else the overlay will last as long as the overlay media duration.
  1526  	End *string `json:"end,omitempty"`
  1527  	// 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).
  1528  	FadeInDuration *string `json:"fadeInDuration,omitempty"`
  1529  	// 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).
  1530  	FadeOutDuration *string `json:"fadeOutDuration,omitempty"`
  1531  	// AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0.
  1532  	AudioGainLevel *float64 `json:"audioGainLevel,omitempty"`
  1533  	// OdataType - Possible values include: 'OdataTypeBasicOverlayOdataTypeOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaVideoOverlay'
  1534  	OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"`
  1535  }
  1536  
  1537  // MarshalJSON is the custom marshaler for AudioOverlay.
  1538  func (ao AudioOverlay) MarshalJSON() ([]byte, error) {
  1539  	ao.OdataType = OdataTypeBasicOverlayOdataTypeMicrosoftMediaAudioOverlay
  1540  	objectMap := make(map[string]interface{})
  1541  	if ao.InputLabel != nil {
  1542  		objectMap["inputLabel"] = ao.InputLabel
  1543  	}
  1544  	if ao.Start != nil {
  1545  		objectMap["start"] = ao.Start
  1546  	}
  1547  	if ao.End != nil {
  1548  		objectMap["end"] = ao.End
  1549  	}
  1550  	if ao.FadeInDuration != nil {
  1551  		objectMap["fadeInDuration"] = ao.FadeInDuration
  1552  	}
  1553  	if ao.FadeOutDuration != nil {
  1554  		objectMap["fadeOutDuration"] = ao.FadeOutDuration
  1555  	}
  1556  	if ao.AudioGainLevel != nil {
  1557  		objectMap["audioGainLevel"] = ao.AudioGainLevel
  1558  	}
  1559  	if ao.OdataType != "" {
  1560  		objectMap["@odata.type"] = ao.OdataType
  1561  	}
  1562  	return json.Marshal(objectMap)
  1563  }
  1564  
  1565  // AsAudioOverlay is the BasicOverlay implementation for AudioOverlay.
  1566  func (ao AudioOverlay) AsAudioOverlay() (*AudioOverlay, bool) {
  1567  	return &ao, true
  1568  }
  1569  
  1570  // AsVideoOverlay is the BasicOverlay implementation for AudioOverlay.
  1571  func (ao AudioOverlay) AsVideoOverlay() (*VideoOverlay, bool) {
  1572  	return nil, false
  1573  }
  1574  
  1575  // AsOverlay is the BasicOverlay implementation for AudioOverlay.
  1576  func (ao AudioOverlay) AsOverlay() (*Overlay, bool) {
  1577  	return nil, false
  1578  }
  1579  
  1580  // AsBasicOverlay is the BasicOverlay implementation for AudioOverlay.
  1581  func (ao AudioOverlay) AsBasicOverlay() (BasicOverlay, bool) {
  1582  	return &ao, true
  1583  }
  1584  
  1585  // AudioTrack represents an audio track in the asset.
  1586  type AudioTrack struct {
  1587  	// OdataType - Possible values include: 'OdataTypeTrackBase', 'OdataTypeMicrosoftMediaAudioTrack', 'OdataTypeMicrosoftMediaVideoTrack', 'OdataTypeMicrosoftMediaTextTrack'
  1588  	OdataType OdataType `json:"@odata.type,omitempty"`
  1589  }
  1590  
  1591  // MarshalJSON is the custom marshaler for AudioTrack.
  1592  func (at AudioTrack) MarshalJSON() ([]byte, error) {
  1593  	at.OdataType = OdataTypeMicrosoftMediaAudioTrack
  1594  	objectMap := make(map[string]interface{})
  1595  	if at.OdataType != "" {
  1596  		objectMap["@odata.type"] = at.OdataType
  1597  	}
  1598  	return json.Marshal(objectMap)
  1599  }
  1600  
  1601  // AsAudioTrack is the BasicTrackBase implementation for AudioTrack.
  1602  func (at AudioTrack) AsAudioTrack() (*AudioTrack, bool) {
  1603  	return &at, true
  1604  }
  1605  
  1606  // AsVideoTrack is the BasicTrackBase implementation for AudioTrack.
  1607  func (at AudioTrack) AsVideoTrack() (*VideoTrack, bool) {
  1608  	return nil, false
  1609  }
  1610  
  1611  // AsTextTrack is the BasicTrackBase implementation for AudioTrack.
  1612  func (at AudioTrack) AsTextTrack() (*TextTrack, bool) {
  1613  	return nil, false
  1614  }
  1615  
  1616  // AsTrackBase is the BasicTrackBase implementation for AudioTrack.
  1617  func (at AudioTrack) AsTrackBase() (*TrackBase, bool) {
  1618  	return nil, false
  1619  }
  1620  
  1621  // AsBasicTrackBase is the BasicTrackBase implementation for AudioTrack.
  1622  func (at AudioTrack) AsBasicTrackBase() (BasicTrackBase, bool) {
  1623  	return &at, true
  1624  }
  1625  
  1626  // BasicAudioTrackDescriptor a TrackSelection to select audio tracks.
  1627  type BasicAudioTrackDescriptor interface {
  1628  	AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool)
  1629  	AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool)
  1630  	AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool)
  1631  }
  1632  
  1633  // AudioTrackDescriptor a TrackSelection to select audio tracks.
  1634  type AudioTrackDescriptor struct {
  1635  	// ChannelMapping - Optional designation for single channel audio tracks.  Can be used to combine the tracks into stereo or multi-channel audio tracks. Possible values include: 'ChannelMappingFrontLeft', 'ChannelMappingFrontRight', 'ChannelMappingCenter', 'ChannelMappingLowFrequencyEffects', 'ChannelMappingBackLeft', 'ChannelMappingBackRight', 'ChannelMappingStereoLeft', 'ChannelMappingStereoRight'
  1636  	ChannelMapping ChannelMapping `json:"channelMapping,omitempty"`
  1637  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
  1638  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
  1639  }
  1640  
  1641  func unmarshalBasicAudioTrackDescriptor(body []byte) (BasicAudioTrackDescriptor, error) {
  1642  	var m map[string]interface{}
  1643  	err := json.Unmarshal(body, &m)
  1644  	if err != nil {
  1645  		return nil, err
  1646  	}
  1647  
  1648  	switch m["@odata.type"] {
  1649  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute):
  1650  		var satba SelectAudioTrackByAttribute
  1651  		err := json.Unmarshal(body, &satba)
  1652  		return satba, err
  1653  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID):
  1654  		var satbi SelectAudioTrackByID
  1655  		err := json.Unmarshal(body, &satbi)
  1656  		return satbi, err
  1657  	default:
  1658  		var atd AudioTrackDescriptor
  1659  		err := json.Unmarshal(body, &atd)
  1660  		return atd, err
  1661  	}
  1662  }
  1663  func unmarshalBasicAudioTrackDescriptorArray(body []byte) ([]BasicAudioTrackDescriptor, error) {
  1664  	var rawMessages []*json.RawMessage
  1665  	err := json.Unmarshal(body, &rawMessages)
  1666  	if err != nil {
  1667  		return nil, err
  1668  	}
  1669  
  1670  	atdArray := make([]BasicAudioTrackDescriptor, len(rawMessages))
  1671  
  1672  	for index, rawMessage := range rawMessages {
  1673  		atd, err := unmarshalBasicAudioTrackDescriptor(*rawMessage)
  1674  		if err != nil {
  1675  			return nil, err
  1676  		}
  1677  		atdArray[index] = atd
  1678  	}
  1679  	return atdArray, nil
  1680  }
  1681  
  1682  // MarshalJSON is the custom marshaler for AudioTrackDescriptor.
  1683  func (atd AudioTrackDescriptor) MarshalJSON() ([]byte, error) {
  1684  	atd.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor
  1685  	objectMap := make(map[string]interface{})
  1686  	if atd.ChannelMapping != "" {
  1687  		objectMap["channelMapping"] = atd.ChannelMapping
  1688  	}
  1689  	if atd.OdataType != "" {
  1690  		objectMap["@odata.type"] = atd.OdataType
  1691  	}
  1692  	return json.Marshal(objectMap)
  1693  }
  1694  
  1695  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1696  func (atd AudioTrackDescriptor) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
  1697  	return &atd, true
  1698  }
  1699  
  1700  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1701  func (atd AudioTrackDescriptor) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
  1702  	return &atd, true
  1703  }
  1704  
  1705  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1706  func (atd AudioTrackDescriptor) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
  1707  	return nil, false
  1708  }
  1709  
  1710  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1711  func (atd AudioTrackDescriptor) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
  1712  	return nil, false
  1713  }
  1714  
  1715  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1716  func (atd AudioTrackDescriptor) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
  1717  	return nil, false
  1718  }
  1719  
  1720  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1721  func (atd AudioTrackDescriptor) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
  1722  	return nil, false
  1723  }
  1724  
  1725  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1726  func (atd AudioTrackDescriptor) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
  1727  	return nil, false
  1728  }
  1729  
  1730  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1731  func (atd AudioTrackDescriptor) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
  1732  	return nil, false
  1733  }
  1734  
  1735  // AsTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1736  func (atd AudioTrackDescriptor) AsTrackDescriptor() (*TrackDescriptor, bool) {
  1737  	return nil, false
  1738  }
  1739  
  1740  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1741  func (atd AudioTrackDescriptor) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
  1742  	return &atd, true
  1743  }
  1744  
  1745  // AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
  1746  type AzureEntityResource struct {
  1747  	// Etag - READ-ONLY; Resource Etag.
  1748  	Etag *string `json:"etag,omitempty"`
  1749  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  1750  	ID *string `json:"id,omitempty"`
  1751  	// Name - READ-ONLY; The name of the resource
  1752  	Name *string `json:"name,omitempty"`
  1753  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  1754  	Type *string `json:"type,omitempty"`
  1755  }
  1756  
  1757  // MarshalJSON is the custom marshaler for AzureEntityResource.
  1758  func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
  1759  	objectMap := make(map[string]interface{})
  1760  	return json.Marshal(objectMap)
  1761  }
  1762  
  1763  // BuiltInStandardEncoderPreset describes a built-in preset for encoding the input video with the Standard
  1764  // Encoder.
  1765  type BuiltInStandardEncoderPreset struct {
  1766  	// Configurations - Optional configuration settings for encoder. Configurations is only supported for ContentAwareEncoding and H265ContentAwareEncoding BuiltInStandardEncoderPreset.
  1767  	Configurations *PresetConfigurations `json:"configurations,omitempty"`
  1768  	// PresetName - The built-in preset to be used for encoding videos. Possible values include: 'EncoderNamedPresetH264SingleBitrateSD', 'EncoderNamedPresetH264SingleBitrate720p', 'EncoderNamedPresetH264SingleBitrate1080p', 'EncoderNamedPresetAdaptiveStreaming', 'EncoderNamedPresetAACGoodQualityAudio', 'EncoderNamedPresetContentAwareEncodingExperimental', 'EncoderNamedPresetContentAwareEncoding', 'EncoderNamedPresetCopyAllBitrateNonInterleaved', 'EncoderNamedPresetH264MultipleBitrate1080p', 'EncoderNamedPresetH264MultipleBitrate720p', 'EncoderNamedPresetH264MultipleBitrateSD', 'EncoderNamedPresetH265ContentAwareEncoding', 'EncoderNamedPresetH265AdaptiveStreaming', 'EncoderNamedPresetH265SingleBitrate720p', 'EncoderNamedPresetH265SingleBitrate1080p', 'EncoderNamedPresetH265SingleBitrate4K'
  1769  	PresetName EncoderNamedPreset `json:"presetName,omitempty"`
  1770  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
  1771  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
  1772  }
  1773  
  1774  // MarshalJSON is the custom marshaler for BuiltInStandardEncoderPreset.
  1775  func (bisep BuiltInStandardEncoderPreset) MarshalJSON() ([]byte, error) {
  1776  	bisep.OdataType = OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset
  1777  	objectMap := make(map[string]interface{})
  1778  	if bisep.Configurations != nil {
  1779  		objectMap["configurations"] = bisep.Configurations
  1780  	}
  1781  	if bisep.PresetName != "" {
  1782  		objectMap["presetName"] = bisep.PresetName
  1783  	}
  1784  	if bisep.OdataType != "" {
  1785  		objectMap["@odata.type"] = bisep.OdataType
  1786  	}
  1787  	return json.Marshal(objectMap)
  1788  }
  1789  
  1790  // AsFaceDetectorPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1791  func (bisep BuiltInStandardEncoderPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
  1792  	return nil, false
  1793  }
  1794  
  1795  // AsAudioAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1796  func (bisep BuiltInStandardEncoderPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
  1797  	return nil, false
  1798  }
  1799  
  1800  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1801  func (bisep BuiltInStandardEncoderPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
  1802  	return nil, false
  1803  }
  1804  
  1805  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1806  func (bisep BuiltInStandardEncoderPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
  1807  	return &bisep, true
  1808  }
  1809  
  1810  // AsStandardEncoderPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1811  func (bisep BuiltInStandardEncoderPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
  1812  	return nil, false
  1813  }
  1814  
  1815  // AsVideoAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1816  func (bisep BuiltInStandardEncoderPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
  1817  	return nil, false
  1818  }
  1819  
  1820  // AsPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1821  func (bisep BuiltInStandardEncoderPreset) AsPreset() (*Preset, bool) {
  1822  	return nil, false
  1823  }
  1824  
  1825  // AsBasicPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1826  func (bisep BuiltInStandardEncoderPreset) AsBasicPreset() (BasicPreset, bool) {
  1827  	return &bisep, true
  1828  }
  1829  
  1830  // CbcsDrmConfiguration class to specify DRM configurations of CommonEncryptionCbcs scheme in Streaming
  1831  // Policy
  1832  type CbcsDrmConfiguration struct {
  1833  	// FairPlay - FairPlay configurations
  1834  	FairPlay *StreamingPolicyFairPlayConfiguration `json:"fairPlay,omitempty"`
  1835  	// PlayReady - PlayReady configurations
  1836  	PlayReady *StreamingPolicyPlayReadyConfiguration `json:"playReady,omitempty"`
  1837  	// Widevine - Widevine configurations
  1838  	Widevine *StreamingPolicyWidevineConfiguration `json:"widevine,omitempty"`
  1839  }
  1840  
  1841  // CencDrmConfiguration class to specify DRM configurations of CommonEncryptionCenc scheme in Streaming
  1842  // Policy
  1843  type CencDrmConfiguration struct {
  1844  	// PlayReady - PlayReady configurations
  1845  	PlayReady *StreamingPolicyPlayReadyConfiguration `json:"playReady,omitempty"`
  1846  	// Widevine - Widevine configurations
  1847  	Widevine *StreamingPolicyWidevineConfiguration `json:"widevine,omitempty"`
  1848  }
  1849  
  1850  // CheckNameAvailabilityInput the input to the check name availability request.
  1851  type CheckNameAvailabilityInput struct {
  1852  	// Name - The account name.
  1853  	Name *string `json:"name,omitempty"`
  1854  	// Type - The account type. For a Media Services account, this should be 'MediaServices'.
  1855  	Type *string `json:"type,omitempty"`
  1856  }
  1857  
  1858  // BasicClipTime base class for specifying a clip time. Use sub classes of this class to specify the time position in
  1859  // the media.
  1860  type BasicClipTime interface {
  1861  	AsAbsoluteClipTime() (*AbsoluteClipTime, bool)
  1862  	AsUtcClipTime() (*UtcClipTime, bool)
  1863  	AsClipTime() (*ClipTime, bool)
  1864  }
  1865  
  1866  // ClipTime base class for specifying a clip time. Use sub classes of this class to specify the time position
  1867  // in the media.
  1868  type ClipTime struct {
  1869  	// OdataType - Possible values include: 'OdataTypeBasicClipTimeOdataTypeClipTime', 'OdataTypeBasicClipTimeOdataTypeMicrosoftMediaAbsoluteClipTime', 'OdataTypeBasicClipTimeOdataTypeMicrosoftMediaUtcClipTime'
  1870  	OdataType OdataTypeBasicClipTime `json:"@odata.type,omitempty"`
  1871  }
  1872  
  1873  func unmarshalBasicClipTime(body []byte) (BasicClipTime, error) {
  1874  	var m map[string]interface{}
  1875  	err := json.Unmarshal(body, &m)
  1876  	if err != nil {
  1877  		return nil, err
  1878  	}
  1879  
  1880  	switch m["@odata.type"] {
  1881  	case string(OdataTypeBasicClipTimeOdataTypeMicrosoftMediaAbsoluteClipTime):
  1882  		var act AbsoluteClipTime
  1883  		err := json.Unmarshal(body, &act)
  1884  		return act, err
  1885  	case string(OdataTypeBasicClipTimeOdataTypeMicrosoftMediaUtcClipTime):
  1886  		var uct UtcClipTime
  1887  		err := json.Unmarshal(body, &uct)
  1888  		return uct, err
  1889  	default:
  1890  		var ct ClipTime
  1891  		err := json.Unmarshal(body, &ct)
  1892  		return ct, err
  1893  	}
  1894  }
  1895  func unmarshalBasicClipTimeArray(body []byte) ([]BasicClipTime, error) {
  1896  	var rawMessages []*json.RawMessage
  1897  	err := json.Unmarshal(body, &rawMessages)
  1898  	if err != nil {
  1899  		return nil, err
  1900  	}
  1901  
  1902  	ctArray := make([]BasicClipTime, len(rawMessages))
  1903  
  1904  	for index, rawMessage := range rawMessages {
  1905  		ct, err := unmarshalBasicClipTime(*rawMessage)
  1906  		if err != nil {
  1907  			return nil, err
  1908  		}
  1909  		ctArray[index] = ct
  1910  	}
  1911  	return ctArray, nil
  1912  }
  1913  
  1914  // MarshalJSON is the custom marshaler for ClipTime.
  1915  func (ct ClipTime) MarshalJSON() ([]byte, error) {
  1916  	ct.OdataType = OdataTypeBasicClipTimeOdataTypeClipTime
  1917  	objectMap := make(map[string]interface{})
  1918  	if ct.OdataType != "" {
  1919  		objectMap["@odata.type"] = ct.OdataType
  1920  	}
  1921  	return json.Marshal(objectMap)
  1922  }
  1923  
  1924  // AsAbsoluteClipTime is the BasicClipTime implementation for ClipTime.
  1925  func (ct ClipTime) AsAbsoluteClipTime() (*AbsoluteClipTime, bool) {
  1926  	return nil, false
  1927  }
  1928  
  1929  // AsUtcClipTime is the BasicClipTime implementation for ClipTime.
  1930  func (ct ClipTime) AsUtcClipTime() (*UtcClipTime, bool) {
  1931  	return nil, false
  1932  }
  1933  
  1934  // AsClipTime is the BasicClipTime implementation for ClipTime.
  1935  func (ct ClipTime) AsClipTime() (*ClipTime, bool) {
  1936  	return &ct, true
  1937  }
  1938  
  1939  // AsBasicClipTime is the BasicClipTime implementation for ClipTime.
  1940  func (ct ClipTime) AsBasicClipTime() (BasicClipTime, bool) {
  1941  	return &ct, true
  1942  }
  1943  
  1944  // BasicCodec describes the basic properties of all codecs.
  1945  type BasicCodec interface {
  1946  	AsAudio() (*Audio, bool)
  1947  	AsBasicAudio() (BasicAudio, bool)
  1948  	AsAacAudio() (*AacAudio, bool)
  1949  	AsVideo() (*Video, bool)
  1950  	AsBasicVideo() (BasicVideo, bool)
  1951  	AsH265Video() (*H265Video, bool)
  1952  	AsCopyVideo() (*CopyVideo, bool)
  1953  	AsImage() (*Image, bool)
  1954  	AsBasicImage() (BasicImage, bool)
  1955  	AsCopyAudio() (*CopyAudio, bool)
  1956  	AsH264Video() (*H264Video, bool)
  1957  	AsJpgImage() (*JpgImage, bool)
  1958  	AsPngImage() (*PngImage, bool)
  1959  	AsCodec() (*Codec, bool)
  1960  }
  1961  
  1962  // Codec describes the basic properties of all codecs.
  1963  type Codec struct {
  1964  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  1965  	Label *string `json:"label,omitempty"`
  1966  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  1967  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  1968  }
  1969  
  1970  func unmarshalBasicCodec(body []byte) (BasicCodec, error) {
  1971  	var m map[string]interface{}
  1972  	err := json.Unmarshal(body, &m)
  1973  	if err != nil {
  1974  		return nil, err
  1975  	}
  1976  
  1977  	switch m["@odata.type"] {
  1978  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio):
  1979  		var a Audio
  1980  		err := json.Unmarshal(body, &a)
  1981  		return a, err
  1982  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio):
  1983  		var aa AacAudio
  1984  		err := json.Unmarshal(body, &aa)
  1985  		return aa, err
  1986  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo):
  1987  		var vVar Video
  1988  		err := json.Unmarshal(body, &vVar)
  1989  		return vVar, err
  1990  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video):
  1991  		var hv H265Video
  1992  		err := json.Unmarshal(body, &hv)
  1993  		return hv, err
  1994  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo):
  1995  		var cv CopyVideo
  1996  		err := json.Unmarshal(body, &cv)
  1997  		return cv, err
  1998  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaImage):
  1999  		var i Image
  2000  		err := json.Unmarshal(body, &i)
  2001  		return i, err
  2002  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio):
  2003  		var ca CopyAudio
  2004  		err := json.Unmarshal(body, &ca)
  2005  		return ca, err
  2006  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video):
  2007  		var hv H264Video
  2008  		err := json.Unmarshal(body, &hv)
  2009  		return hv, err
  2010  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage):
  2011  		var ji JpgImage
  2012  		err := json.Unmarshal(body, &ji)
  2013  		return ji, err
  2014  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage):
  2015  		var pi PngImage
  2016  		err := json.Unmarshal(body, &pi)
  2017  		return pi, err
  2018  	default:
  2019  		var c Codec
  2020  		err := json.Unmarshal(body, &c)
  2021  		return c, err
  2022  	}
  2023  }
  2024  func unmarshalBasicCodecArray(body []byte) ([]BasicCodec, error) {
  2025  	var rawMessages []*json.RawMessage
  2026  	err := json.Unmarshal(body, &rawMessages)
  2027  	if err != nil {
  2028  		return nil, err
  2029  	}
  2030  
  2031  	cArray := make([]BasicCodec, len(rawMessages))
  2032  
  2033  	for index, rawMessage := range rawMessages {
  2034  		c, err := unmarshalBasicCodec(*rawMessage)
  2035  		if err != nil {
  2036  			return nil, err
  2037  		}
  2038  		cArray[index] = c
  2039  	}
  2040  	return cArray, nil
  2041  }
  2042  
  2043  // MarshalJSON is the custom marshaler for Codec.
  2044  func (c Codec) MarshalJSON() ([]byte, error) {
  2045  	c.OdataType = OdataTypeBasicCodecOdataTypeCodec
  2046  	objectMap := make(map[string]interface{})
  2047  	if c.Label != nil {
  2048  		objectMap["label"] = c.Label
  2049  	}
  2050  	if c.OdataType != "" {
  2051  		objectMap["@odata.type"] = c.OdataType
  2052  	}
  2053  	return json.Marshal(objectMap)
  2054  }
  2055  
  2056  // AsAudio is the BasicCodec implementation for Codec.
  2057  func (c Codec) AsAudio() (*Audio, bool) {
  2058  	return nil, false
  2059  }
  2060  
  2061  // AsBasicAudio is the BasicCodec implementation for Codec.
  2062  func (c Codec) AsBasicAudio() (BasicAudio, bool) {
  2063  	return nil, false
  2064  }
  2065  
  2066  // AsAacAudio is the BasicCodec implementation for Codec.
  2067  func (c Codec) AsAacAudio() (*AacAudio, bool) {
  2068  	return nil, false
  2069  }
  2070  
  2071  // AsVideo is the BasicCodec implementation for Codec.
  2072  func (c Codec) AsVideo() (*Video, bool) {
  2073  	return nil, false
  2074  }
  2075  
  2076  // AsBasicVideo is the BasicCodec implementation for Codec.
  2077  func (c Codec) AsBasicVideo() (BasicVideo, bool) {
  2078  	return nil, false
  2079  }
  2080  
  2081  // AsH265Video is the BasicCodec implementation for Codec.
  2082  func (c Codec) AsH265Video() (*H265Video, bool) {
  2083  	return nil, false
  2084  }
  2085  
  2086  // AsCopyVideo is the BasicCodec implementation for Codec.
  2087  func (c Codec) AsCopyVideo() (*CopyVideo, bool) {
  2088  	return nil, false
  2089  }
  2090  
  2091  // AsImage is the BasicCodec implementation for Codec.
  2092  func (c Codec) AsImage() (*Image, bool) {
  2093  	return nil, false
  2094  }
  2095  
  2096  // AsBasicImage is the BasicCodec implementation for Codec.
  2097  func (c Codec) AsBasicImage() (BasicImage, bool) {
  2098  	return nil, false
  2099  }
  2100  
  2101  // AsCopyAudio is the BasicCodec implementation for Codec.
  2102  func (c Codec) AsCopyAudio() (*CopyAudio, bool) {
  2103  	return nil, false
  2104  }
  2105  
  2106  // AsH264Video is the BasicCodec implementation for Codec.
  2107  func (c Codec) AsH264Video() (*H264Video, bool) {
  2108  	return nil, false
  2109  }
  2110  
  2111  // AsJpgImage is the BasicCodec implementation for Codec.
  2112  func (c Codec) AsJpgImage() (*JpgImage, bool) {
  2113  	return nil, false
  2114  }
  2115  
  2116  // AsPngImage is the BasicCodec implementation for Codec.
  2117  func (c Codec) AsPngImage() (*PngImage, bool) {
  2118  	return nil, false
  2119  }
  2120  
  2121  // AsCodec is the BasicCodec implementation for Codec.
  2122  func (c Codec) AsCodec() (*Codec, bool) {
  2123  	return &c, true
  2124  }
  2125  
  2126  // AsBasicCodec is the BasicCodec implementation for Codec.
  2127  func (c Codec) AsBasicCodec() (BasicCodec, bool) {
  2128  	return &c, true
  2129  }
  2130  
  2131  // CommonEncryptionCbcs class for CommonEncryptionCbcs encryption scheme
  2132  type CommonEncryptionCbcs struct {
  2133  	// EnabledProtocols - Representing supported protocols
  2134  	EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
  2135  	// ClearTracks - Representing which tracks should not be encrypted
  2136  	ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"`
  2137  	// ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks
  2138  	ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"`
  2139  	// Drm - Configuration of DRMs for current encryption scheme
  2140  	Drm *CbcsDrmConfiguration `json:"drm,omitempty"`
  2141  }
  2142  
  2143  // CommonEncryptionCenc class for envelope encryption scheme
  2144  type CommonEncryptionCenc struct {
  2145  	// EnabledProtocols - Representing supported protocols
  2146  	EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
  2147  	// ClearTracks - Representing which tracks should not be encrypted
  2148  	ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"`
  2149  	// ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks
  2150  	ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"`
  2151  	// Drm - Configuration of DRMs for CommonEncryptionCenc encryption scheme
  2152  	Drm *CencDrmConfiguration `json:"drm,omitempty"`
  2153  }
  2154  
  2155  // ContentKeyPolicy a Content Key Policy resource.
  2156  type ContentKeyPolicy struct {
  2157  	autorest.Response           `json:"-"`
  2158  	*ContentKeyPolicyProperties `json:"properties,omitempty"`
  2159  	// SystemData - READ-ONLY; The system metadata relating to this resource.
  2160  	SystemData *SystemData `json:"systemData,omitempty"`
  2161  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  2162  	ID *string `json:"id,omitempty"`
  2163  	// Name - READ-ONLY; The name of the resource
  2164  	Name *string `json:"name,omitempty"`
  2165  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  2166  	Type *string `json:"type,omitempty"`
  2167  }
  2168  
  2169  // MarshalJSON is the custom marshaler for ContentKeyPolicy.
  2170  func (ckp ContentKeyPolicy) MarshalJSON() ([]byte, error) {
  2171  	objectMap := make(map[string]interface{})
  2172  	if ckp.ContentKeyPolicyProperties != nil {
  2173  		objectMap["properties"] = ckp.ContentKeyPolicyProperties
  2174  	}
  2175  	return json.Marshal(objectMap)
  2176  }
  2177  
  2178  // UnmarshalJSON is the custom unmarshaler for ContentKeyPolicy struct.
  2179  func (ckp *ContentKeyPolicy) UnmarshalJSON(body []byte) error {
  2180  	var m map[string]*json.RawMessage
  2181  	err := json.Unmarshal(body, &m)
  2182  	if err != nil {
  2183  		return err
  2184  	}
  2185  	for k, v := range m {
  2186  		switch k {
  2187  		case "properties":
  2188  			if v != nil {
  2189  				var contentKeyPolicyProperties ContentKeyPolicyProperties
  2190  				err = json.Unmarshal(*v, &contentKeyPolicyProperties)
  2191  				if err != nil {
  2192  					return err
  2193  				}
  2194  				ckp.ContentKeyPolicyProperties = &contentKeyPolicyProperties
  2195  			}
  2196  		case "systemData":
  2197  			if v != nil {
  2198  				var systemData SystemData
  2199  				err = json.Unmarshal(*v, &systemData)
  2200  				if err != nil {
  2201  					return err
  2202  				}
  2203  				ckp.SystemData = &systemData
  2204  			}
  2205  		case "id":
  2206  			if v != nil {
  2207  				var ID string
  2208  				err = json.Unmarshal(*v, &ID)
  2209  				if err != nil {
  2210  					return err
  2211  				}
  2212  				ckp.ID = &ID
  2213  			}
  2214  		case "name":
  2215  			if v != nil {
  2216  				var name string
  2217  				err = json.Unmarshal(*v, &name)
  2218  				if err != nil {
  2219  					return err
  2220  				}
  2221  				ckp.Name = &name
  2222  			}
  2223  		case "type":
  2224  			if v != nil {
  2225  				var typeVar string
  2226  				err = json.Unmarshal(*v, &typeVar)
  2227  				if err != nil {
  2228  					return err
  2229  				}
  2230  				ckp.Type = &typeVar
  2231  			}
  2232  		}
  2233  	}
  2234  
  2235  	return nil
  2236  }
  2237  
  2238  // ContentKeyPolicyClearKeyConfiguration represents a configuration for non-DRM keys.
  2239  type ContentKeyPolicyClearKeyConfiguration struct {
  2240  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  2241  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  2242  }
  2243  
  2244  // MarshalJSON is the custom marshaler for ContentKeyPolicyClearKeyConfiguration.
  2245  func (ckpckc ContentKeyPolicyClearKeyConfiguration) MarshalJSON() ([]byte, error) {
  2246  	ckpckc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration
  2247  	objectMap := make(map[string]interface{})
  2248  	if ckpckc.OdataType != "" {
  2249  		objectMap["@odata.type"] = ckpckc.OdataType
  2250  	}
  2251  	return json.Marshal(objectMap)
  2252  }
  2253  
  2254  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2255  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  2256  	return &ckpckc, true
  2257  }
  2258  
  2259  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2260  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  2261  	return nil, false
  2262  }
  2263  
  2264  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2265  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  2266  	return nil, false
  2267  }
  2268  
  2269  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2270  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  2271  	return nil, false
  2272  }
  2273  
  2274  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2275  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  2276  	return nil, false
  2277  }
  2278  
  2279  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2280  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  2281  	return nil, false
  2282  }
  2283  
  2284  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2285  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  2286  	return &ckpckc, true
  2287  }
  2288  
  2289  // ContentKeyPolicyCollection a collection of ContentKeyPolicy items.
  2290  type ContentKeyPolicyCollection struct {
  2291  	autorest.Response `json:"-"`
  2292  	// Value - A collection of ContentKeyPolicy items.
  2293  	Value *[]ContentKeyPolicy `json:"value,omitempty"`
  2294  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
  2295  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
  2296  }
  2297  
  2298  // ContentKeyPolicyCollectionIterator provides access to a complete listing of ContentKeyPolicy values.
  2299  type ContentKeyPolicyCollectionIterator struct {
  2300  	i    int
  2301  	page ContentKeyPolicyCollectionPage
  2302  }
  2303  
  2304  // NextWithContext advances to the next value.  If there was an error making
  2305  // the request the iterator does not advance and the error is returned.
  2306  func (iter *ContentKeyPolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) {
  2307  	if tracing.IsEnabled() {
  2308  		ctx = tracing.StartSpan(ctx, fqdn+"/ContentKeyPolicyCollectionIterator.NextWithContext")
  2309  		defer func() {
  2310  			sc := -1
  2311  			if iter.Response().Response.Response != nil {
  2312  				sc = iter.Response().Response.Response.StatusCode
  2313  			}
  2314  			tracing.EndSpan(ctx, sc, err)
  2315  		}()
  2316  	}
  2317  	iter.i++
  2318  	if iter.i < len(iter.page.Values()) {
  2319  		return nil
  2320  	}
  2321  	err = iter.page.NextWithContext(ctx)
  2322  	if err != nil {
  2323  		iter.i--
  2324  		return err
  2325  	}
  2326  	iter.i = 0
  2327  	return nil
  2328  }
  2329  
  2330  // Next advances to the next value.  If there was an error making
  2331  // the request the iterator does not advance and the error is returned.
  2332  // Deprecated: Use NextWithContext() instead.
  2333  func (iter *ContentKeyPolicyCollectionIterator) Next() error {
  2334  	return iter.NextWithContext(context.Background())
  2335  }
  2336  
  2337  // NotDone returns true if the enumeration should be started or is not yet complete.
  2338  func (iter ContentKeyPolicyCollectionIterator) NotDone() bool {
  2339  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  2340  }
  2341  
  2342  // Response returns the raw server response from the last page request.
  2343  func (iter ContentKeyPolicyCollectionIterator) Response() ContentKeyPolicyCollection {
  2344  	return iter.page.Response()
  2345  }
  2346  
  2347  // Value returns the current value or a zero-initialized value if the
  2348  // iterator has advanced beyond the end of the collection.
  2349  func (iter ContentKeyPolicyCollectionIterator) Value() ContentKeyPolicy {
  2350  	if !iter.page.NotDone() {
  2351  		return ContentKeyPolicy{}
  2352  	}
  2353  	return iter.page.Values()[iter.i]
  2354  }
  2355  
  2356  // Creates a new instance of the ContentKeyPolicyCollectionIterator type.
  2357  func NewContentKeyPolicyCollectionIterator(page ContentKeyPolicyCollectionPage) ContentKeyPolicyCollectionIterator {
  2358  	return ContentKeyPolicyCollectionIterator{page: page}
  2359  }
  2360  
  2361  // IsEmpty returns true if the ListResult contains no values.
  2362  func (ckpc ContentKeyPolicyCollection) IsEmpty() bool {
  2363  	return ckpc.Value == nil || len(*ckpc.Value) == 0
  2364  }
  2365  
  2366  // hasNextLink returns true if the NextLink is not empty.
  2367  func (ckpc ContentKeyPolicyCollection) hasNextLink() bool {
  2368  	return ckpc.OdataNextLink != nil && len(*ckpc.OdataNextLink) != 0
  2369  }
  2370  
  2371  // contentKeyPolicyCollectionPreparer prepares a request to retrieve the next set of results.
  2372  // It returns nil if no more results exist.
  2373  func (ckpc ContentKeyPolicyCollection) contentKeyPolicyCollectionPreparer(ctx context.Context) (*http.Request, error) {
  2374  	if !ckpc.hasNextLink() {
  2375  		return nil, nil
  2376  	}
  2377  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  2378  		autorest.AsJSON(),
  2379  		autorest.AsGet(),
  2380  		autorest.WithBaseURL(to.String(ckpc.OdataNextLink)))
  2381  }
  2382  
  2383  // ContentKeyPolicyCollectionPage contains a page of ContentKeyPolicy values.
  2384  type ContentKeyPolicyCollectionPage struct {
  2385  	fn   func(context.Context, ContentKeyPolicyCollection) (ContentKeyPolicyCollection, error)
  2386  	ckpc ContentKeyPolicyCollection
  2387  }
  2388  
  2389  // NextWithContext advances to the next page of values.  If there was an error making
  2390  // the request the page does not advance and the error is returned.
  2391  func (page *ContentKeyPolicyCollectionPage) NextWithContext(ctx context.Context) (err error) {
  2392  	if tracing.IsEnabled() {
  2393  		ctx = tracing.StartSpan(ctx, fqdn+"/ContentKeyPolicyCollectionPage.NextWithContext")
  2394  		defer func() {
  2395  			sc := -1
  2396  			if page.Response().Response.Response != nil {
  2397  				sc = page.Response().Response.Response.StatusCode
  2398  			}
  2399  			tracing.EndSpan(ctx, sc, err)
  2400  		}()
  2401  	}
  2402  	for {
  2403  		next, err := page.fn(ctx, page.ckpc)
  2404  		if err != nil {
  2405  			return err
  2406  		}
  2407  		page.ckpc = next
  2408  		if !next.hasNextLink() || !next.IsEmpty() {
  2409  			break
  2410  		}
  2411  	}
  2412  	return nil
  2413  }
  2414  
  2415  // Next advances to the next page of values.  If there was an error making
  2416  // the request the page does not advance and the error is returned.
  2417  // Deprecated: Use NextWithContext() instead.
  2418  func (page *ContentKeyPolicyCollectionPage) Next() error {
  2419  	return page.NextWithContext(context.Background())
  2420  }
  2421  
  2422  // NotDone returns true if the page enumeration should be started or is not yet complete.
  2423  func (page ContentKeyPolicyCollectionPage) NotDone() bool {
  2424  	return !page.ckpc.IsEmpty()
  2425  }
  2426  
  2427  // Response returns the raw server response from the last page request.
  2428  func (page ContentKeyPolicyCollectionPage) Response() ContentKeyPolicyCollection {
  2429  	return page.ckpc
  2430  }
  2431  
  2432  // Values returns the slice of values for the current page or nil if there are no values.
  2433  func (page ContentKeyPolicyCollectionPage) Values() []ContentKeyPolicy {
  2434  	if page.ckpc.IsEmpty() {
  2435  		return nil
  2436  	}
  2437  	return *page.ckpc.Value
  2438  }
  2439  
  2440  // Creates a new instance of the ContentKeyPolicyCollectionPage type.
  2441  func NewContentKeyPolicyCollectionPage(cur ContentKeyPolicyCollection, getNextPage func(context.Context, ContentKeyPolicyCollection) (ContentKeyPolicyCollection, error)) ContentKeyPolicyCollectionPage {
  2442  	return ContentKeyPolicyCollectionPage{
  2443  		fn:   getNextPage,
  2444  		ckpc: cur,
  2445  	}
  2446  }
  2447  
  2448  // BasicContentKeyPolicyConfiguration base class for Content Key Policy configuration. A derived class must be used to
  2449  // create a configuration.
  2450  type BasicContentKeyPolicyConfiguration interface {
  2451  	AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool)
  2452  	AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool)
  2453  	AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool)
  2454  	AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool)
  2455  	AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool)
  2456  	AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool)
  2457  }
  2458  
  2459  // ContentKeyPolicyConfiguration base class for Content Key Policy configuration. A derived class must be used
  2460  // to create a configuration.
  2461  type ContentKeyPolicyConfiguration struct {
  2462  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  2463  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  2464  }
  2465  
  2466  func unmarshalBasicContentKeyPolicyConfiguration(body []byte) (BasicContentKeyPolicyConfiguration, error) {
  2467  	var m map[string]interface{}
  2468  	err := json.Unmarshal(body, &m)
  2469  	if err != nil {
  2470  		return nil, err
  2471  	}
  2472  
  2473  	switch m["@odata.type"] {
  2474  	case string(OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration):
  2475  		var ckpckc ContentKeyPolicyClearKeyConfiguration
  2476  		err := json.Unmarshal(body, &ckpckc)
  2477  		return ckpckc, err
  2478  	case string(OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration):
  2479  		var ckpuc ContentKeyPolicyUnknownConfiguration
  2480  		err := json.Unmarshal(body, &ckpuc)
  2481  		return ckpuc, err
  2482  	case string(OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration):
  2483  		var ckpwc ContentKeyPolicyWidevineConfiguration
  2484  		err := json.Unmarshal(body, &ckpwc)
  2485  		return ckpwc, err
  2486  	case string(OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration):
  2487  		var ckpprc ContentKeyPolicyPlayReadyConfiguration
  2488  		err := json.Unmarshal(body, &ckpprc)
  2489  		return ckpprc, err
  2490  	case string(OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration):
  2491  		var ckpfpc ContentKeyPolicyFairPlayConfiguration
  2492  		err := json.Unmarshal(body, &ckpfpc)
  2493  		return ckpfpc, err
  2494  	default:
  2495  		var ckpc ContentKeyPolicyConfiguration
  2496  		err := json.Unmarshal(body, &ckpc)
  2497  		return ckpc, err
  2498  	}
  2499  }
  2500  func unmarshalBasicContentKeyPolicyConfigurationArray(body []byte) ([]BasicContentKeyPolicyConfiguration, error) {
  2501  	var rawMessages []*json.RawMessage
  2502  	err := json.Unmarshal(body, &rawMessages)
  2503  	if err != nil {
  2504  		return nil, err
  2505  	}
  2506  
  2507  	ckpcArray := make([]BasicContentKeyPolicyConfiguration, len(rawMessages))
  2508  
  2509  	for index, rawMessage := range rawMessages {
  2510  		ckpc, err := unmarshalBasicContentKeyPolicyConfiguration(*rawMessage)
  2511  		if err != nil {
  2512  			return nil, err
  2513  		}
  2514  		ckpcArray[index] = ckpc
  2515  	}
  2516  	return ckpcArray, nil
  2517  }
  2518  
  2519  // MarshalJSON is the custom marshaler for ContentKeyPolicyConfiguration.
  2520  func (ckpc ContentKeyPolicyConfiguration) MarshalJSON() ([]byte, error) {
  2521  	ckpc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration
  2522  	objectMap := make(map[string]interface{})
  2523  	if ckpc.OdataType != "" {
  2524  		objectMap["@odata.type"] = ckpc.OdataType
  2525  	}
  2526  	return json.Marshal(objectMap)
  2527  }
  2528  
  2529  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2530  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  2531  	return nil, false
  2532  }
  2533  
  2534  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2535  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  2536  	return nil, false
  2537  }
  2538  
  2539  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2540  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  2541  	return nil, false
  2542  }
  2543  
  2544  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2545  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  2546  	return nil, false
  2547  }
  2548  
  2549  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2550  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  2551  	return nil, false
  2552  }
  2553  
  2554  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2555  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  2556  	return &ckpc, true
  2557  }
  2558  
  2559  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2560  func (ckpc ContentKeyPolicyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  2561  	return &ckpc, true
  2562  }
  2563  
  2564  // ContentKeyPolicyFairPlayConfiguration specifies a configuration for FairPlay licenses.
  2565  type ContentKeyPolicyFairPlayConfiguration struct {
  2566  	// Ask - The key that must be used as FairPlay Application Secret key.
  2567  	Ask *[]byte `json:"ask,omitempty"`
  2568  	// FairPlayPfxPassword - The password encrypting FairPlay certificate in PKCS 12 (pfx) format.
  2569  	FairPlayPfxPassword *string `json:"fairPlayPfxPassword,omitempty"`
  2570  	// FairPlayPfx - The Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key).
  2571  	FairPlayPfx *string `json:"fairPlayPfx,omitempty"`
  2572  	// RentalAndLeaseKeyType - The rental and lease key type. Possible values include: 'ContentKeyPolicyFairPlayRentalAndLeaseKeyTypeUnknown', 'ContentKeyPolicyFairPlayRentalAndLeaseKeyTypeUndefined', 'ContentKeyPolicyFairPlayRentalAndLeaseKeyTypeDualExpiry', 'ContentKeyPolicyFairPlayRentalAndLeaseKeyTypePersistentUnlimited', 'ContentKeyPolicyFairPlayRentalAndLeaseKeyTypePersistentLimited'
  2573  	RentalAndLeaseKeyType ContentKeyPolicyFairPlayRentalAndLeaseKeyType `json:"rentalAndLeaseKeyType,omitempty"`
  2574  	// RentalDuration - The rental duration. Must be greater than or equal to 0.
  2575  	RentalDuration *int64 `json:"rentalDuration,omitempty"`
  2576  	// OfflineRentalConfiguration - Offline rental policy
  2577  	OfflineRentalConfiguration *ContentKeyPolicyFairPlayOfflineRentalConfiguration `json:"offlineRentalConfiguration,omitempty"`
  2578  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  2579  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  2580  }
  2581  
  2582  // MarshalJSON is the custom marshaler for ContentKeyPolicyFairPlayConfiguration.
  2583  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) MarshalJSON() ([]byte, error) {
  2584  	ckpfpc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration
  2585  	objectMap := make(map[string]interface{})
  2586  	if ckpfpc.Ask != nil {
  2587  		objectMap["ask"] = ckpfpc.Ask
  2588  	}
  2589  	if ckpfpc.FairPlayPfxPassword != nil {
  2590  		objectMap["fairPlayPfxPassword"] = ckpfpc.FairPlayPfxPassword
  2591  	}
  2592  	if ckpfpc.FairPlayPfx != nil {
  2593  		objectMap["fairPlayPfx"] = ckpfpc.FairPlayPfx
  2594  	}
  2595  	if ckpfpc.RentalAndLeaseKeyType != "" {
  2596  		objectMap["rentalAndLeaseKeyType"] = ckpfpc.RentalAndLeaseKeyType
  2597  	}
  2598  	if ckpfpc.RentalDuration != nil {
  2599  		objectMap["rentalDuration"] = ckpfpc.RentalDuration
  2600  	}
  2601  	if ckpfpc.OfflineRentalConfiguration != nil {
  2602  		objectMap["offlineRentalConfiguration"] = ckpfpc.OfflineRentalConfiguration
  2603  	}
  2604  	if ckpfpc.OdataType != "" {
  2605  		objectMap["@odata.type"] = ckpfpc.OdataType
  2606  	}
  2607  	return json.Marshal(objectMap)
  2608  }
  2609  
  2610  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2611  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  2612  	return nil, false
  2613  }
  2614  
  2615  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2616  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  2617  	return nil, false
  2618  }
  2619  
  2620  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2621  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  2622  	return nil, false
  2623  }
  2624  
  2625  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2626  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  2627  	return nil, false
  2628  }
  2629  
  2630  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2631  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  2632  	return &ckpfpc, true
  2633  }
  2634  
  2635  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2636  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  2637  	return nil, false
  2638  }
  2639  
  2640  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2641  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  2642  	return &ckpfpc, true
  2643  }
  2644  
  2645  // ContentKeyPolicyFairPlayOfflineRentalConfiguration ...
  2646  type ContentKeyPolicyFairPlayOfflineRentalConfiguration struct {
  2647  	// PlaybackDurationSeconds - Playback duration
  2648  	PlaybackDurationSeconds *int64 `json:"playbackDurationSeconds,omitempty"`
  2649  	// StorageDurationSeconds - Storage duration
  2650  	StorageDurationSeconds *int64 `json:"storageDurationSeconds,omitempty"`
  2651  }
  2652  
  2653  // ContentKeyPolicyOpenRestriction represents an open restriction. License or key will be delivered on
  2654  // every request.
  2655  type ContentKeyPolicyOpenRestriction struct {
  2656  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeContentKeyPolicyRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction'
  2657  	OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
  2658  }
  2659  
  2660  // MarshalJSON is the custom marshaler for ContentKeyPolicyOpenRestriction.
  2661  func (ckpor ContentKeyPolicyOpenRestriction) MarshalJSON() ([]byte, error) {
  2662  	ckpor.OdataType = OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction
  2663  	objectMap := make(map[string]interface{})
  2664  	if ckpor.OdataType != "" {
  2665  		objectMap["@odata.type"] = ckpor.OdataType
  2666  	}
  2667  	return json.Marshal(objectMap)
  2668  }
  2669  
  2670  // AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
  2671  func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
  2672  	return &ckpor, true
  2673  }
  2674  
  2675  // AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
  2676  func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
  2677  	return nil, false
  2678  }
  2679  
  2680  // AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
  2681  func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
  2682  	return nil, false
  2683  }
  2684  
  2685  // AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
  2686  func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
  2687  	return nil, false
  2688  }
  2689  
  2690  // AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
  2691  func (ckpor ContentKeyPolicyOpenRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
  2692  	return &ckpor, true
  2693  }
  2694  
  2695  // ContentKeyPolicyOption represents a policy option.
  2696  type ContentKeyPolicyOption struct {
  2697  	// PolicyOptionID - READ-ONLY; The legacy Policy Option ID.
  2698  	PolicyOptionID *uuid.UUID `json:"policyOptionId,omitempty"`
  2699  	// Name - The Policy Option description.
  2700  	Name *string `json:"name,omitempty"`
  2701  	// Configuration - The key delivery configuration.
  2702  	Configuration BasicContentKeyPolicyConfiguration `json:"configuration,omitempty"`
  2703  	// Restriction - The requirements that must be met to deliver keys with this configuration
  2704  	Restriction BasicContentKeyPolicyRestriction `json:"restriction,omitempty"`
  2705  }
  2706  
  2707  // MarshalJSON is the custom marshaler for ContentKeyPolicyOption.
  2708  func (ckpo ContentKeyPolicyOption) MarshalJSON() ([]byte, error) {
  2709  	objectMap := make(map[string]interface{})
  2710  	if ckpo.Name != nil {
  2711  		objectMap["name"] = ckpo.Name
  2712  	}
  2713  	objectMap["configuration"] = ckpo.Configuration
  2714  	objectMap["restriction"] = ckpo.Restriction
  2715  	return json.Marshal(objectMap)
  2716  }
  2717  
  2718  // UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyOption struct.
  2719  func (ckpo *ContentKeyPolicyOption) UnmarshalJSON(body []byte) error {
  2720  	var m map[string]*json.RawMessage
  2721  	err := json.Unmarshal(body, &m)
  2722  	if err != nil {
  2723  		return err
  2724  	}
  2725  	for k, v := range m {
  2726  		switch k {
  2727  		case "policyOptionId":
  2728  			if v != nil {
  2729  				var policyOptionID uuid.UUID
  2730  				err = json.Unmarshal(*v, &policyOptionID)
  2731  				if err != nil {
  2732  					return err
  2733  				}
  2734  				ckpo.PolicyOptionID = &policyOptionID
  2735  			}
  2736  		case "name":
  2737  			if v != nil {
  2738  				var name string
  2739  				err = json.Unmarshal(*v, &name)
  2740  				if err != nil {
  2741  					return err
  2742  				}
  2743  				ckpo.Name = &name
  2744  			}
  2745  		case "configuration":
  2746  			if v != nil {
  2747  				configuration, err := unmarshalBasicContentKeyPolicyConfiguration(*v)
  2748  				if err != nil {
  2749  					return err
  2750  				}
  2751  				ckpo.Configuration = configuration
  2752  			}
  2753  		case "restriction":
  2754  			if v != nil {
  2755  				restriction, err := unmarshalBasicContentKeyPolicyRestriction(*v)
  2756  				if err != nil {
  2757  					return err
  2758  				}
  2759  				ckpo.Restriction = restriction
  2760  			}
  2761  		}
  2762  	}
  2763  
  2764  	return nil
  2765  }
  2766  
  2767  // ContentKeyPolicyPlayReadyConfiguration specifies a configuration for PlayReady licenses.
  2768  type ContentKeyPolicyPlayReadyConfiguration struct {
  2769  	// Licenses - The PlayReady licenses.
  2770  	Licenses *[]ContentKeyPolicyPlayReadyLicense `json:"licenses,omitempty"`
  2771  	// ResponseCustomData - The custom response data.
  2772  	ResponseCustomData *string `json:"responseCustomData,omitempty"`
  2773  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  2774  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  2775  }
  2776  
  2777  // MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyConfiguration.
  2778  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) MarshalJSON() ([]byte, error) {
  2779  	ckpprc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration
  2780  	objectMap := make(map[string]interface{})
  2781  	if ckpprc.Licenses != nil {
  2782  		objectMap["licenses"] = ckpprc.Licenses
  2783  	}
  2784  	if ckpprc.ResponseCustomData != nil {
  2785  		objectMap["responseCustomData"] = ckpprc.ResponseCustomData
  2786  	}
  2787  	if ckpprc.OdataType != "" {
  2788  		objectMap["@odata.type"] = ckpprc.OdataType
  2789  	}
  2790  	return json.Marshal(objectMap)
  2791  }
  2792  
  2793  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2794  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  2795  	return nil, false
  2796  }
  2797  
  2798  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2799  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  2800  	return nil, false
  2801  }
  2802  
  2803  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2804  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  2805  	return nil, false
  2806  }
  2807  
  2808  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2809  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  2810  	return &ckpprc, true
  2811  }
  2812  
  2813  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2814  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  2815  	return nil, false
  2816  }
  2817  
  2818  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2819  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  2820  	return nil, false
  2821  }
  2822  
  2823  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2824  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  2825  	return &ckpprc, true
  2826  }
  2827  
  2828  // ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader specifies that the content key ID is in the
  2829  // PlayReady header.
  2830  type ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader struct {
  2831  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocationOdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier'
  2832  	OdataType OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocation `json:"@odata.type,omitempty"`
  2833  }
  2834  
  2835  // MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
  2836  func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) MarshalJSON() ([]byte, error) {
  2837  	ckpprcekfh.OdataType = OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader
  2838  	objectMap := make(map[string]interface{})
  2839  	if ckpprcekfh.OdataType != "" {
  2840  		objectMap["@odata.type"] = ckpprcekfh.OdataType
  2841  	}
  2842  	return json.Marshal(objectMap)
  2843  }
  2844  
  2845  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
  2846  func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) {
  2847  	return &ckpprcekfh, true
  2848  }
  2849  
  2850  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
  2851  func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) {
  2852  	return nil, false
  2853  }
  2854  
  2855  // AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
  2856  func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2857  	return nil, false
  2858  }
  2859  
  2860  // AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
  2861  func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2862  	return &ckpprcekfh, true
  2863  }
  2864  
  2865  // ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier specifies that the content key ID is
  2866  // specified in the PlayReady configuration.
  2867  type ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier struct {
  2868  	// KeyID - The content key ID.
  2869  	KeyID *uuid.UUID `json:"keyId,omitempty"`
  2870  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocationOdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier'
  2871  	OdataType OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocation `json:"@odata.type,omitempty"`
  2872  }
  2873  
  2874  // MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
  2875  func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) MarshalJSON() ([]byte, error) {
  2876  	ckpprcekfki.OdataType = OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier
  2877  	objectMap := make(map[string]interface{})
  2878  	if ckpprcekfki.KeyID != nil {
  2879  		objectMap["keyId"] = ckpprcekfki.KeyID
  2880  	}
  2881  	if ckpprcekfki.OdataType != "" {
  2882  		objectMap["@odata.type"] = ckpprcekfki.OdataType
  2883  	}
  2884  	return json.Marshal(objectMap)
  2885  }
  2886  
  2887  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
  2888  func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) {
  2889  	return nil, false
  2890  }
  2891  
  2892  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
  2893  func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) {
  2894  	return &ckpprcekfki, true
  2895  }
  2896  
  2897  // AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
  2898  func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2899  	return nil, false
  2900  }
  2901  
  2902  // AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
  2903  func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2904  	return &ckpprcekfki, true
  2905  }
  2906  
  2907  // BasicContentKeyPolicyPlayReadyContentKeyLocation base class for content key ID location. A derived class must be
  2908  // used to represent the location.
  2909  type BasicContentKeyPolicyPlayReadyContentKeyLocation interface {
  2910  	AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool)
  2911  	AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool)
  2912  	AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool)
  2913  }
  2914  
  2915  // ContentKeyPolicyPlayReadyContentKeyLocation base class for content key ID location. A derived class must be
  2916  // used to represent the location.
  2917  type ContentKeyPolicyPlayReadyContentKeyLocation struct {
  2918  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocationOdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier'
  2919  	OdataType OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocation `json:"@odata.type,omitempty"`
  2920  }
  2921  
  2922  func unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(body []byte) (BasicContentKeyPolicyPlayReadyContentKeyLocation, error) {
  2923  	var m map[string]interface{}
  2924  	err := json.Unmarshal(body, &m)
  2925  	if err != nil {
  2926  		return nil, err
  2927  	}
  2928  
  2929  	switch m["@odata.type"] {
  2930  	case string(OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader):
  2931  		var ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader
  2932  		err := json.Unmarshal(body, &ckpprcekfh)
  2933  		return ckpprcekfh, err
  2934  	case string(OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier):
  2935  		var ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier
  2936  		err := json.Unmarshal(body, &ckpprcekfki)
  2937  		return ckpprcekfki, err
  2938  	default:
  2939  		var ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation
  2940  		err := json.Unmarshal(body, &ckpprckl)
  2941  		return ckpprckl, err
  2942  	}
  2943  }
  2944  func unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocationArray(body []byte) ([]BasicContentKeyPolicyPlayReadyContentKeyLocation, error) {
  2945  	var rawMessages []*json.RawMessage
  2946  	err := json.Unmarshal(body, &rawMessages)
  2947  	if err != nil {
  2948  		return nil, err
  2949  	}
  2950  
  2951  	ckpprcklArray := make([]BasicContentKeyPolicyPlayReadyContentKeyLocation, len(rawMessages))
  2952  
  2953  	for index, rawMessage := range rawMessages {
  2954  		ckpprckl, err := unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(*rawMessage)
  2955  		if err != nil {
  2956  			return nil, err
  2957  		}
  2958  		ckpprcklArray[index] = ckpprckl
  2959  	}
  2960  	return ckpprcklArray, nil
  2961  }
  2962  
  2963  // MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentKeyLocation.
  2964  func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) MarshalJSON() ([]byte, error) {
  2965  	ckpprckl.OdataType = OdataTypeBasicContentKeyPolicyPlayReadyContentKeyLocationOdataTypeContentKeyPolicyPlayReadyContentKeyLocation
  2966  	objectMap := make(map[string]interface{})
  2967  	if ckpprckl.OdataType != "" {
  2968  		objectMap["@odata.type"] = ckpprckl.OdataType
  2969  	}
  2970  	return json.Marshal(objectMap)
  2971  }
  2972  
  2973  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation.
  2974  func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) {
  2975  	return nil, false
  2976  }
  2977  
  2978  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation.
  2979  func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) {
  2980  	return nil, false
  2981  }
  2982  
  2983  // AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation.
  2984  func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2985  	return &ckpprckl, true
  2986  }
  2987  
  2988  // AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation.
  2989  func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2990  	return &ckpprckl, true
  2991  }
  2992  
  2993  // ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction configures the Explicit Analog Television
  2994  // Output Restriction control bits. For further details see the PlayReady Compliance Rules.
  2995  type ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction struct {
  2996  	// BestEffort - Indicates whether this restriction is enforced on a Best Effort basis.
  2997  	BestEffort *bool `json:"bestEffort,omitempty"`
  2998  	// ConfigurationData - Configures the restriction control bits. Must be between 0 and 3 inclusive.
  2999  	ConfigurationData *int32 `json:"configurationData,omitempty"`
  3000  }
  3001  
  3002  // ContentKeyPolicyPlayReadyLicense the PlayReady license
  3003  type ContentKeyPolicyPlayReadyLicense struct {
  3004  	// AllowTestDevices - A flag indicating whether test devices can use the license.
  3005  	AllowTestDevices *bool `json:"allowTestDevices,omitempty"`
  3006  	// BeginDate - The begin date of license
  3007  	BeginDate *date.Time `json:"beginDate,omitempty"`
  3008  	// ExpirationDate - The expiration date of license.
  3009  	ExpirationDate *date.Time `json:"expirationDate,omitempty"`
  3010  	// RelativeBeginDate - The relative begin date of license.
  3011  	RelativeBeginDate *string `json:"relativeBeginDate,omitempty"`
  3012  	// RelativeExpirationDate - The relative expiration date of license.
  3013  	RelativeExpirationDate *string `json:"relativeExpirationDate,omitempty"`
  3014  	// GracePeriod - The grace period of license.
  3015  	GracePeriod *string `json:"gracePeriod,omitempty"`
  3016  	// PlayRight - The license PlayRight
  3017  	PlayRight *ContentKeyPolicyPlayReadyPlayRight `json:"playRight,omitempty"`
  3018  	// LicenseType - The license type. Possible values include: 'ContentKeyPolicyPlayReadyLicenseTypeUnknown', 'ContentKeyPolicyPlayReadyLicenseTypeNonPersistent', 'ContentKeyPolicyPlayReadyLicenseTypePersistent'
  3019  	LicenseType ContentKeyPolicyPlayReadyLicenseType `json:"licenseType,omitempty"`
  3020  	// ContentKeyLocation - The content key location.
  3021  	ContentKeyLocation BasicContentKeyPolicyPlayReadyContentKeyLocation `json:"contentKeyLocation,omitempty"`
  3022  	// ContentType - The PlayReady content type. Possible values include: 'ContentKeyPolicyPlayReadyContentTypeUnknown', 'ContentKeyPolicyPlayReadyContentTypeUnspecified', 'ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload', 'ContentKeyPolicyPlayReadyContentTypeUltraVioletStreaming'
  3023  	ContentType ContentKeyPolicyPlayReadyContentType `json:"contentType,omitempty"`
  3024  }
  3025  
  3026  // UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyPlayReadyLicense struct.
  3027  func (ckpprl *ContentKeyPolicyPlayReadyLicense) UnmarshalJSON(body []byte) error {
  3028  	var m map[string]*json.RawMessage
  3029  	err := json.Unmarshal(body, &m)
  3030  	if err != nil {
  3031  		return err
  3032  	}
  3033  	for k, v := range m {
  3034  		switch k {
  3035  		case "allowTestDevices":
  3036  			if v != nil {
  3037  				var allowTestDevices bool
  3038  				err = json.Unmarshal(*v, &allowTestDevices)
  3039  				if err != nil {
  3040  					return err
  3041  				}
  3042  				ckpprl.AllowTestDevices = &allowTestDevices
  3043  			}
  3044  		case "beginDate":
  3045  			if v != nil {
  3046  				var beginDate date.Time
  3047  				err = json.Unmarshal(*v, &beginDate)
  3048  				if err != nil {
  3049  					return err
  3050  				}
  3051  				ckpprl.BeginDate = &beginDate
  3052  			}
  3053  		case "expirationDate":
  3054  			if v != nil {
  3055  				var expirationDate date.Time
  3056  				err = json.Unmarshal(*v, &expirationDate)
  3057  				if err != nil {
  3058  					return err
  3059  				}
  3060  				ckpprl.ExpirationDate = &expirationDate
  3061  			}
  3062  		case "relativeBeginDate":
  3063  			if v != nil {
  3064  				var relativeBeginDate string
  3065  				err = json.Unmarshal(*v, &relativeBeginDate)
  3066  				if err != nil {
  3067  					return err
  3068  				}
  3069  				ckpprl.RelativeBeginDate = &relativeBeginDate
  3070  			}
  3071  		case "relativeExpirationDate":
  3072  			if v != nil {
  3073  				var relativeExpirationDate string
  3074  				err = json.Unmarshal(*v, &relativeExpirationDate)
  3075  				if err != nil {
  3076  					return err
  3077  				}
  3078  				ckpprl.RelativeExpirationDate = &relativeExpirationDate
  3079  			}
  3080  		case "gracePeriod":
  3081  			if v != nil {
  3082  				var gracePeriod string
  3083  				err = json.Unmarshal(*v, &gracePeriod)
  3084  				if err != nil {
  3085  					return err
  3086  				}
  3087  				ckpprl.GracePeriod = &gracePeriod
  3088  			}
  3089  		case "playRight":
  3090  			if v != nil {
  3091  				var playRight ContentKeyPolicyPlayReadyPlayRight
  3092  				err = json.Unmarshal(*v, &playRight)
  3093  				if err != nil {
  3094  					return err
  3095  				}
  3096  				ckpprl.PlayRight = &playRight
  3097  			}
  3098  		case "licenseType":
  3099  			if v != nil {
  3100  				var licenseType ContentKeyPolicyPlayReadyLicenseType
  3101  				err = json.Unmarshal(*v, &licenseType)
  3102  				if err != nil {
  3103  					return err
  3104  				}
  3105  				ckpprl.LicenseType = licenseType
  3106  			}
  3107  		case "contentKeyLocation":
  3108  			if v != nil {
  3109  				contentKeyLocation, err := unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(*v)
  3110  				if err != nil {
  3111  					return err
  3112  				}
  3113  				ckpprl.ContentKeyLocation = contentKeyLocation
  3114  			}
  3115  		case "contentType":
  3116  			if v != nil {
  3117  				var contentType ContentKeyPolicyPlayReadyContentType
  3118  				err = json.Unmarshal(*v, &contentType)
  3119  				if err != nil {
  3120  					return err
  3121  				}
  3122  				ckpprl.ContentType = contentType
  3123  			}
  3124  		}
  3125  	}
  3126  
  3127  	return nil
  3128  }
  3129  
  3130  // ContentKeyPolicyPlayReadyPlayRight configures the Play Right in the PlayReady license.
  3131  type ContentKeyPolicyPlayReadyPlayRight struct {
  3132  	// FirstPlayExpiration - The amount of time that the license is valid after the license is first used to play content.
  3133  	FirstPlayExpiration *string `json:"firstPlayExpiration,omitempty"`
  3134  	// ScmsRestriction - Configures the Serial Copy Management System (SCMS) in the license. Must be between 0 and 3 inclusive.
  3135  	ScmsRestriction *int32 `json:"scmsRestriction,omitempty"`
  3136  	// AgcAndColorStripeRestriction - Configures Automatic Gain Control (AGC) and Color Stripe in the license. Must be between 0 and 3 inclusive.
  3137  	AgcAndColorStripeRestriction *int32 `json:"agcAndColorStripeRestriction,omitempty"`
  3138  	// ExplicitAnalogTelevisionOutputRestriction - Configures the Explicit Analog Television Output Restriction in the license. Configuration data must be between 0 and 3 inclusive.
  3139  	ExplicitAnalogTelevisionOutputRestriction *ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction `json:"explicitAnalogTelevisionOutputRestriction,omitempty"`
  3140  	// DigitalVideoOnlyContentRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license.
  3141  	DigitalVideoOnlyContentRestriction *bool `json:"digitalVideoOnlyContentRestriction,omitempty"`
  3142  	// ImageConstraintForAnalogComponentVideoRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license.
  3143  	ImageConstraintForAnalogComponentVideoRestriction *bool `json:"imageConstraintForAnalogComponentVideoRestriction,omitempty"`
  3144  	// ImageConstraintForAnalogComputerMonitorRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license.
  3145  	ImageConstraintForAnalogComputerMonitorRestriction *bool `json:"imageConstraintForAnalogComputerMonitorRestriction,omitempty"`
  3146  	// AllowPassingVideoContentToUnknownOutput - Configures Unknown output handling settings of the license. Possible values include: 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionUnknown', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowed', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowedWithVideoConstriction'
  3147  	AllowPassingVideoContentToUnknownOutput ContentKeyPolicyPlayReadyUnknownOutputPassingOption `json:"allowPassingVideoContentToUnknownOutput,omitempty"`
  3148  	// UncompressedDigitalVideoOpl - Specifies the output protection level for uncompressed digital video.
  3149  	UncompressedDigitalVideoOpl *int32 `json:"uncompressedDigitalVideoOpl,omitempty"`
  3150  	// CompressedDigitalVideoOpl - Specifies the output protection level for compressed digital video.
  3151  	CompressedDigitalVideoOpl *int32 `json:"compressedDigitalVideoOpl,omitempty"`
  3152  	// AnalogVideoOpl - Specifies the output protection level for compressed digital audio.
  3153  	AnalogVideoOpl *int32 `json:"analogVideoOpl,omitempty"`
  3154  	// CompressedDigitalAudioOpl - Specifies the output protection level for compressed digital audio.
  3155  	CompressedDigitalAudioOpl *int32 `json:"compressedDigitalAudioOpl,omitempty"`
  3156  	// UncompressedDigitalAudioOpl - Specifies the output protection level for uncompressed digital audio.
  3157  	UncompressedDigitalAudioOpl *int32 `json:"uncompressedDigitalAudioOpl,omitempty"`
  3158  }
  3159  
  3160  // ContentKeyPolicyProperties the properties of the Content Key Policy.
  3161  type ContentKeyPolicyProperties struct {
  3162  	autorest.Response `json:"-"`
  3163  	// PolicyID - READ-ONLY; The legacy Policy ID.
  3164  	PolicyID *uuid.UUID `json:"policyId,omitempty"`
  3165  	// Created - READ-ONLY; The creation date of the Policy
  3166  	Created *date.Time `json:"created,omitempty"`
  3167  	// LastModified - READ-ONLY; The last modified date of the Policy
  3168  	LastModified *date.Time `json:"lastModified,omitempty"`
  3169  	// Description - A description for the Policy.
  3170  	Description *string `json:"description,omitempty"`
  3171  	// Options - The Key Policy options.
  3172  	Options *[]ContentKeyPolicyOption `json:"options,omitempty"`
  3173  }
  3174  
  3175  // MarshalJSON is the custom marshaler for ContentKeyPolicyProperties.
  3176  func (ckpp ContentKeyPolicyProperties) MarshalJSON() ([]byte, error) {
  3177  	objectMap := make(map[string]interface{})
  3178  	if ckpp.Description != nil {
  3179  		objectMap["description"] = ckpp.Description
  3180  	}
  3181  	if ckpp.Options != nil {
  3182  		objectMap["options"] = ckpp.Options
  3183  	}
  3184  	return json.Marshal(objectMap)
  3185  }
  3186  
  3187  // BasicContentKeyPolicyRestriction base class for Content Key Policy restrictions. A derived class must be used to
  3188  // create a restriction.
  3189  type BasicContentKeyPolicyRestriction interface {
  3190  	AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool)
  3191  	AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool)
  3192  	AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool)
  3193  	AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool)
  3194  }
  3195  
  3196  // ContentKeyPolicyRestriction base class for Content Key Policy restrictions. A derived class must be used to
  3197  // create a restriction.
  3198  type ContentKeyPolicyRestriction struct {
  3199  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeContentKeyPolicyRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction'
  3200  	OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
  3201  }
  3202  
  3203  func unmarshalBasicContentKeyPolicyRestriction(body []byte) (BasicContentKeyPolicyRestriction, error) {
  3204  	var m map[string]interface{}
  3205  	err := json.Unmarshal(body, &m)
  3206  	if err != nil {
  3207  		return nil, err
  3208  	}
  3209  
  3210  	switch m["@odata.type"] {
  3211  	case string(OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction):
  3212  		var ckpor ContentKeyPolicyOpenRestriction
  3213  		err := json.Unmarshal(body, &ckpor)
  3214  		return ckpor, err
  3215  	case string(OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction):
  3216  		var ckpur ContentKeyPolicyUnknownRestriction
  3217  		err := json.Unmarshal(body, &ckpur)
  3218  		return ckpur, err
  3219  	case string(OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction):
  3220  		var ckptr ContentKeyPolicyTokenRestriction
  3221  		err := json.Unmarshal(body, &ckptr)
  3222  		return ckptr, err
  3223  	default:
  3224  		var ckpr ContentKeyPolicyRestriction
  3225  		err := json.Unmarshal(body, &ckpr)
  3226  		return ckpr, err
  3227  	}
  3228  }
  3229  func unmarshalBasicContentKeyPolicyRestrictionArray(body []byte) ([]BasicContentKeyPolicyRestriction, error) {
  3230  	var rawMessages []*json.RawMessage
  3231  	err := json.Unmarshal(body, &rawMessages)
  3232  	if err != nil {
  3233  		return nil, err
  3234  	}
  3235  
  3236  	ckprArray := make([]BasicContentKeyPolicyRestriction, len(rawMessages))
  3237  
  3238  	for index, rawMessage := range rawMessages {
  3239  		ckpr, err := unmarshalBasicContentKeyPolicyRestriction(*rawMessage)
  3240  		if err != nil {
  3241  			return nil, err
  3242  		}
  3243  		ckprArray[index] = ckpr
  3244  	}
  3245  	return ckprArray, nil
  3246  }
  3247  
  3248  // MarshalJSON is the custom marshaler for ContentKeyPolicyRestriction.
  3249  func (ckpr ContentKeyPolicyRestriction) MarshalJSON() ([]byte, error) {
  3250  	ckpr.OdataType = OdataTypeBasicContentKeyPolicyRestrictionOdataTypeContentKeyPolicyRestriction
  3251  	objectMap := make(map[string]interface{})
  3252  	if ckpr.OdataType != "" {
  3253  		objectMap["@odata.type"] = ckpr.OdataType
  3254  	}
  3255  	return json.Marshal(objectMap)
  3256  }
  3257  
  3258  // AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
  3259  func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
  3260  	return nil, false
  3261  }
  3262  
  3263  // AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
  3264  func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
  3265  	return nil, false
  3266  }
  3267  
  3268  // AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
  3269  func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
  3270  	return nil, false
  3271  }
  3272  
  3273  // AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
  3274  func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
  3275  	return &ckpr, true
  3276  }
  3277  
  3278  // AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
  3279  func (ckpr ContentKeyPolicyRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
  3280  	return &ckpr, true
  3281  }
  3282  
  3283  // BasicContentKeyPolicyRestrictionTokenKey base class for Content Key Policy key for token validation. A derived class
  3284  // must be used to create a token key.
  3285  type BasicContentKeyPolicyRestrictionTokenKey interface {
  3286  	AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool)
  3287  	AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool)
  3288  	AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool)
  3289  	AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool)
  3290  }
  3291  
  3292  // ContentKeyPolicyRestrictionTokenKey base class for Content Key Policy key for token validation. A derived
  3293  // class must be used to create a token key.
  3294  type ContentKeyPolicyRestrictionTokenKey struct {
  3295  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey'
  3296  	OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
  3297  }
  3298  
  3299  func unmarshalBasicContentKeyPolicyRestrictionTokenKey(body []byte) (BasicContentKeyPolicyRestrictionTokenKey, error) {
  3300  	var m map[string]interface{}
  3301  	err := json.Unmarshal(body, &m)
  3302  	if err != nil {
  3303  		return nil, err
  3304  	}
  3305  
  3306  	switch m["@odata.type"] {
  3307  	case string(OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey):
  3308  		var ckpstk ContentKeyPolicySymmetricTokenKey
  3309  		err := json.Unmarshal(body, &ckpstk)
  3310  		return ckpstk, err
  3311  	case string(OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey):
  3312  		var ckprtk ContentKeyPolicyRsaTokenKey
  3313  		err := json.Unmarshal(body, &ckprtk)
  3314  		return ckprtk, err
  3315  	case string(OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey):
  3316  		var ckpxctk ContentKeyPolicyX509CertificateTokenKey
  3317  		err := json.Unmarshal(body, &ckpxctk)
  3318  		return ckpxctk, err
  3319  	default:
  3320  		var ckprtk ContentKeyPolicyRestrictionTokenKey
  3321  		err := json.Unmarshal(body, &ckprtk)
  3322  		return ckprtk, err
  3323  	}
  3324  }
  3325  func unmarshalBasicContentKeyPolicyRestrictionTokenKeyArray(body []byte) ([]BasicContentKeyPolicyRestrictionTokenKey, error) {
  3326  	var rawMessages []*json.RawMessage
  3327  	err := json.Unmarshal(body, &rawMessages)
  3328  	if err != nil {
  3329  		return nil, err
  3330  	}
  3331  
  3332  	ckprtkArray := make([]BasicContentKeyPolicyRestrictionTokenKey, len(rawMessages))
  3333  
  3334  	for index, rawMessage := range rawMessages {
  3335  		ckprtk, err := unmarshalBasicContentKeyPolicyRestrictionTokenKey(*rawMessage)
  3336  		if err != nil {
  3337  			return nil, err
  3338  		}
  3339  		ckprtkArray[index] = ckprtk
  3340  	}
  3341  	return ckprtkArray, nil
  3342  }
  3343  
  3344  // MarshalJSON is the custom marshaler for ContentKeyPolicyRestrictionTokenKey.
  3345  func (ckprtk ContentKeyPolicyRestrictionTokenKey) MarshalJSON() ([]byte, error) {
  3346  	ckprtk.OdataType = OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeContentKeyPolicyRestrictionTokenKey
  3347  	objectMap := make(map[string]interface{})
  3348  	if ckprtk.OdataType != "" {
  3349  		objectMap["@odata.type"] = ckprtk.OdataType
  3350  	}
  3351  	return json.Marshal(objectMap)
  3352  }
  3353  
  3354  // AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
  3355  func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
  3356  	return nil, false
  3357  }
  3358  
  3359  // AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
  3360  func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
  3361  	return nil, false
  3362  }
  3363  
  3364  // AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
  3365  func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
  3366  	return nil, false
  3367  }
  3368  
  3369  // AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
  3370  func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
  3371  	return &ckprtk, true
  3372  }
  3373  
  3374  // AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
  3375  func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
  3376  	return &ckprtk, true
  3377  }
  3378  
  3379  // ContentKeyPolicyRsaTokenKey specifies a RSA key for token validation
  3380  type ContentKeyPolicyRsaTokenKey struct {
  3381  	// Exponent - The RSA Parameter exponent
  3382  	Exponent *[]byte `json:"exponent,omitempty"`
  3383  	// Modulus - The RSA Parameter modulus
  3384  	Modulus *[]byte `json:"modulus,omitempty"`
  3385  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey'
  3386  	OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
  3387  }
  3388  
  3389  // MarshalJSON is the custom marshaler for ContentKeyPolicyRsaTokenKey.
  3390  func (ckprtk ContentKeyPolicyRsaTokenKey) MarshalJSON() ([]byte, error) {
  3391  	ckprtk.OdataType = OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey
  3392  	objectMap := make(map[string]interface{})
  3393  	if ckprtk.Exponent != nil {
  3394  		objectMap["exponent"] = ckprtk.Exponent
  3395  	}
  3396  	if ckprtk.Modulus != nil {
  3397  		objectMap["modulus"] = ckprtk.Modulus
  3398  	}
  3399  	if ckprtk.OdataType != "" {
  3400  		objectMap["@odata.type"] = ckprtk.OdataType
  3401  	}
  3402  	return json.Marshal(objectMap)
  3403  }
  3404  
  3405  // AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
  3406  func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
  3407  	return nil, false
  3408  }
  3409  
  3410  // AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
  3411  func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
  3412  	return &ckprtk, true
  3413  }
  3414  
  3415  // AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
  3416  func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
  3417  	return nil, false
  3418  }
  3419  
  3420  // AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
  3421  func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
  3422  	return nil, false
  3423  }
  3424  
  3425  // AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
  3426  func (ckprtk ContentKeyPolicyRsaTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
  3427  	return &ckprtk, true
  3428  }
  3429  
  3430  // ContentKeyPolicySymmetricTokenKey specifies a symmetric key for token validation.
  3431  type ContentKeyPolicySymmetricTokenKey struct {
  3432  	// KeyValue - The key value of the key
  3433  	KeyValue *[]byte `json:"keyValue,omitempty"`
  3434  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey'
  3435  	OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
  3436  }
  3437  
  3438  // MarshalJSON is the custom marshaler for ContentKeyPolicySymmetricTokenKey.
  3439  func (ckpstk ContentKeyPolicySymmetricTokenKey) MarshalJSON() ([]byte, error) {
  3440  	ckpstk.OdataType = OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey
  3441  	objectMap := make(map[string]interface{})
  3442  	if ckpstk.KeyValue != nil {
  3443  		objectMap["keyValue"] = ckpstk.KeyValue
  3444  	}
  3445  	if ckpstk.OdataType != "" {
  3446  		objectMap["@odata.type"] = ckpstk.OdataType
  3447  	}
  3448  	return json.Marshal(objectMap)
  3449  }
  3450  
  3451  // AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
  3452  func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
  3453  	return &ckpstk, true
  3454  }
  3455  
  3456  // AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
  3457  func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
  3458  	return nil, false
  3459  }
  3460  
  3461  // AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
  3462  func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
  3463  	return nil, false
  3464  }
  3465  
  3466  // AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
  3467  func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
  3468  	return nil, false
  3469  }
  3470  
  3471  // AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
  3472  func (ckpstk ContentKeyPolicySymmetricTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
  3473  	return &ckpstk, true
  3474  }
  3475  
  3476  // ContentKeyPolicyTokenClaim represents a token claim.
  3477  type ContentKeyPolicyTokenClaim struct {
  3478  	// ClaimType - Token claim type.
  3479  	ClaimType *string `json:"claimType,omitempty"`
  3480  	// ClaimValue - Token claim value.
  3481  	ClaimValue *string `json:"claimValue,omitempty"`
  3482  }
  3483  
  3484  // ContentKeyPolicyTokenRestriction represents a token restriction. Provided token must match these
  3485  // requirements for successful license or key delivery.
  3486  type ContentKeyPolicyTokenRestriction struct {
  3487  	// Issuer - The token issuer.
  3488  	Issuer *string `json:"issuer,omitempty"`
  3489  	// Audience - The audience for the token.
  3490  	Audience *string `json:"audience,omitempty"`
  3491  	// PrimaryVerificationKey - The primary verification key.
  3492  	PrimaryVerificationKey BasicContentKeyPolicyRestrictionTokenKey `json:"primaryVerificationKey,omitempty"`
  3493  	// AlternateVerificationKeys - A list of alternative verification keys.
  3494  	AlternateVerificationKeys *[]BasicContentKeyPolicyRestrictionTokenKey `json:"alternateVerificationKeys,omitempty"`
  3495  	// RequiredClaims - A list of required token claims.
  3496  	RequiredClaims *[]ContentKeyPolicyTokenClaim `json:"requiredClaims,omitempty"`
  3497  	// RestrictionTokenType - The type of token. Possible values include: 'ContentKeyPolicyRestrictionTokenTypeUnknown', 'ContentKeyPolicyRestrictionTokenTypeSwt', 'ContentKeyPolicyRestrictionTokenTypeJwt'
  3498  	RestrictionTokenType ContentKeyPolicyRestrictionTokenType `json:"restrictionTokenType,omitempty"`
  3499  	// OpenIDConnectDiscoveryDocument - The OpenID connect discovery document.
  3500  	OpenIDConnectDiscoveryDocument *string `json:"openIdConnectDiscoveryDocument,omitempty"`
  3501  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeContentKeyPolicyRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction'
  3502  	OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
  3503  }
  3504  
  3505  // MarshalJSON is the custom marshaler for ContentKeyPolicyTokenRestriction.
  3506  func (ckptr ContentKeyPolicyTokenRestriction) MarshalJSON() ([]byte, error) {
  3507  	ckptr.OdataType = OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction
  3508  	objectMap := make(map[string]interface{})
  3509  	if ckptr.Issuer != nil {
  3510  		objectMap["issuer"] = ckptr.Issuer
  3511  	}
  3512  	if ckptr.Audience != nil {
  3513  		objectMap["audience"] = ckptr.Audience
  3514  	}
  3515  	objectMap["primaryVerificationKey"] = ckptr.PrimaryVerificationKey
  3516  	if ckptr.AlternateVerificationKeys != nil {
  3517  		objectMap["alternateVerificationKeys"] = ckptr.AlternateVerificationKeys
  3518  	}
  3519  	if ckptr.RequiredClaims != nil {
  3520  		objectMap["requiredClaims"] = ckptr.RequiredClaims
  3521  	}
  3522  	if ckptr.RestrictionTokenType != "" {
  3523  		objectMap["restrictionTokenType"] = ckptr.RestrictionTokenType
  3524  	}
  3525  	if ckptr.OpenIDConnectDiscoveryDocument != nil {
  3526  		objectMap["openIdConnectDiscoveryDocument"] = ckptr.OpenIDConnectDiscoveryDocument
  3527  	}
  3528  	if ckptr.OdataType != "" {
  3529  		objectMap["@odata.type"] = ckptr.OdataType
  3530  	}
  3531  	return json.Marshal(objectMap)
  3532  }
  3533  
  3534  // AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
  3535  func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
  3536  	return nil, false
  3537  }
  3538  
  3539  // AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
  3540  func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
  3541  	return nil, false
  3542  }
  3543  
  3544  // AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
  3545  func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
  3546  	return &ckptr, true
  3547  }
  3548  
  3549  // AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
  3550  func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
  3551  	return nil, false
  3552  }
  3553  
  3554  // AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
  3555  func (ckptr ContentKeyPolicyTokenRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
  3556  	return &ckptr, true
  3557  }
  3558  
  3559  // UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyTokenRestriction struct.
  3560  func (ckptr *ContentKeyPolicyTokenRestriction) UnmarshalJSON(body []byte) error {
  3561  	var m map[string]*json.RawMessage
  3562  	err := json.Unmarshal(body, &m)
  3563  	if err != nil {
  3564  		return err
  3565  	}
  3566  	for k, v := range m {
  3567  		switch k {
  3568  		case "issuer":
  3569  			if v != nil {
  3570  				var issuer string
  3571  				err = json.Unmarshal(*v, &issuer)
  3572  				if err != nil {
  3573  					return err
  3574  				}
  3575  				ckptr.Issuer = &issuer
  3576  			}
  3577  		case "audience":
  3578  			if v != nil {
  3579  				var audience string
  3580  				err = json.Unmarshal(*v, &audience)
  3581  				if err != nil {
  3582  					return err
  3583  				}
  3584  				ckptr.Audience = &audience
  3585  			}
  3586  		case "primaryVerificationKey":
  3587  			if v != nil {
  3588  				primaryVerificationKey, err := unmarshalBasicContentKeyPolicyRestrictionTokenKey(*v)
  3589  				if err != nil {
  3590  					return err
  3591  				}
  3592  				ckptr.PrimaryVerificationKey = primaryVerificationKey
  3593  			}
  3594  		case "alternateVerificationKeys":
  3595  			if v != nil {
  3596  				alternateVerificationKeys, err := unmarshalBasicContentKeyPolicyRestrictionTokenKeyArray(*v)
  3597  				if err != nil {
  3598  					return err
  3599  				}
  3600  				ckptr.AlternateVerificationKeys = &alternateVerificationKeys
  3601  			}
  3602  		case "requiredClaims":
  3603  			if v != nil {
  3604  				var requiredClaims []ContentKeyPolicyTokenClaim
  3605  				err = json.Unmarshal(*v, &requiredClaims)
  3606  				if err != nil {
  3607  					return err
  3608  				}
  3609  				ckptr.RequiredClaims = &requiredClaims
  3610  			}
  3611  		case "restrictionTokenType":
  3612  			if v != nil {
  3613  				var restrictionTokenType ContentKeyPolicyRestrictionTokenType
  3614  				err = json.Unmarshal(*v, &restrictionTokenType)
  3615  				if err != nil {
  3616  					return err
  3617  				}
  3618  				ckptr.RestrictionTokenType = restrictionTokenType
  3619  			}
  3620  		case "openIdConnectDiscoveryDocument":
  3621  			if v != nil {
  3622  				var openIDConnectDiscoveryDocument string
  3623  				err = json.Unmarshal(*v, &openIDConnectDiscoveryDocument)
  3624  				if err != nil {
  3625  					return err
  3626  				}
  3627  				ckptr.OpenIDConnectDiscoveryDocument = &openIDConnectDiscoveryDocument
  3628  			}
  3629  		case "@odata.type":
  3630  			if v != nil {
  3631  				var odataType OdataTypeBasicContentKeyPolicyRestriction
  3632  				err = json.Unmarshal(*v, &odataType)
  3633  				if err != nil {
  3634  					return err
  3635  				}
  3636  				ckptr.OdataType = odataType
  3637  			}
  3638  		}
  3639  	}
  3640  
  3641  	return nil
  3642  }
  3643  
  3644  // ContentKeyPolicyUnknownConfiguration represents a ContentKeyPolicyConfiguration that is unavailable in
  3645  // the current API version.
  3646  type ContentKeyPolicyUnknownConfiguration struct {
  3647  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  3648  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  3649  }
  3650  
  3651  // MarshalJSON is the custom marshaler for ContentKeyPolicyUnknownConfiguration.
  3652  func (ckpuc ContentKeyPolicyUnknownConfiguration) MarshalJSON() ([]byte, error) {
  3653  	ckpuc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration
  3654  	objectMap := make(map[string]interface{})
  3655  	if ckpuc.OdataType != "" {
  3656  		objectMap["@odata.type"] = ckpuc.OdataType
  3657  	}
  3658  	return json.Marshal(objectMap)
  3659  }
  3660  
  3661  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3662  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  3663  	return nil, false
  3664  }
  3665  
  3666  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3667  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  3668  	return &ckpuc, true
  3669  }
  3670  
  3671  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3672  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  3673  	return nil, false
  3674  }
  3675  
  3676  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3677  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  3678  	return nil, false
  3679  }
  3680  
  3681  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3682  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  3683  	return nil, false
  3684  }
  3685  
  3686  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3687  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  3688  	return nil, false
  3689  }
  3690  
  3691  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3692  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  3693  	return &ckpuc, true
  3694  }
  3695  
  3696  // ContentKeyPolicyUnknownRestriction represents a ContentKeyPolicyRestriction that is unavailable in the
  3697  // current API version.
  3698  type ContentKeyPolicyUnknownRestriction struct {
  3699  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeContentKeyPolicyRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction'
  3700  	OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
  3701  }
  3702  
  3703  // MarshalJSON is the custom marshaler for ContentKeyPolicyUnknownRestriction.
  3704  func (ckpur ContentKeyPolicyUnknownRestriction) MarshalJSON() ([]byte, error) {
  3705  	ckpur.OdataType = OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction
  3706  	objectMap := make(map[string]interface{})
  3707  	if ckpur.OdataType != "" {
  3708  		objectMap["@odata.type"] = ckpur.OdataType
  3709  	}
  3710  	return json.Marshal(objectMap)
  3711  }
  3712  
  3713  // AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
  3714  func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
  3715  	return nil, false
  3716  }
  3717  
  3718  // AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
  3719  func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
  3720  	return &ckpur, true
  3721  }
  3722  
  3723  // AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
  3724  func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
  3725  	return nil, false
  3726  }
  3727  
  3728  // AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
  3729  func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
  3730  	return nil, false
  3731  }
  3732  
  3733  // AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
  3734  func (ckpur ContentKeyPolicyUnknownRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
  3735  	return &ckpur, true
  3736  }
  3737  
  3738  // ContentKeyPolicyWidevineConfiguration specifies a configuration for Widevine licenses.
  3739  type ContentKeyPolicyWidevineConfiguration struct {
  3740  	// WidevineTemplate - The Widevine template.
  3741  	WidevineTemplate *string `json:"widevineTemplate,omitempty"`
  3742  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  3743  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  3744  }
  3745  
  3746  // MarshalJSON is the custom marshaler for ContentKeyPolicyWidevineConfiguration.
  3747  func (ckpwc ContentKeyPolicyWidevineConfiguration) MarshalJSON() ([]byte, error) {
  3748  	ckpwc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration
  3749  	objectMap := make(map[string]interface{})
  3750  	if ckpwc.WidevineTemplate != nil {
  3751  		objectMap["widevineTemplate"] = ckpwc.WidevineTemplate
  3752  	}
  3753  	if ckpwc.OdataType != "" {
  3754  		objectMap["@odata.type"] = ckpwc.OdataType
  3755  	}
  3756  	return json.Marshal(objectMap)
  3757  }
  3758  
  3759  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3760  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  3761  	return nil, false
  3762  }
  3763  
  3764  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3765  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  3766  	return nil, false
  3767  }
  3768  
  3769  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3770  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  3771  	return &ckpwc, true
  3772  }
  3773  
  3774  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3775  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  3776  	return nil, false
  3777  }
  3778  
  3779  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3780  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  3781  	return nil, false
  3782  }
  3783  
  3784  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3785  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  3786  	return nil, false
  3787  }
  3788  
  3789  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3790  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  3791  	return &ckpwc, true
  3792  }
  3793  
  3794  // ContentKeyPolicyX509CertificateTokenKey specifies a certificate for token validation.
  3795  type ContentKeyPolicyX509CertificateTokenKey struct {
  3796  	// RawBody - The raw data field of a certificate in PKCS 12 format (X509Certificate2 in .NET)
  3797  	RawBody *[]byte `json:"rawBody,omitempty"`
  3798  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey'
  3799  	OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
  3800  }
  3801  
  3802  // MarshalJSON is the custom marshaler for ContentKeyPolicyX509CertificateTokenKey.
  3803  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) MarshalJSON() ([]byte, error) {
  3804  	ckpxctk.OdataType = OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey
  3805  	objectMap := make(map[string]interface{})
  3806  	if ckpxctk.RawBody != nil {
  3807  		objectMap["rawBody"] = ckpxctk.RawBody
  3808  	}
  3809  	if ckpxctk.OdataType != "" {
  3810  		objectMap["@odata.type"] = ckpxctk.OdataType
  3811  	}
  3812  	return json.Marshal(objectMap)
  3813  }
  3814  
  3815  // AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
  3816  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
  3817  	return nil, false
  3818  }
  3819  
  3820  // AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
  3821  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
  3822  	return nil, false
  3823  }
  3824  
  3825  // AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
  3826  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
  3827  	return &ckpxctk, true
  3828  }
  3829  
  3830  // AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
  3831  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
  3832  	return nil, false
  3833  }
  3834  
  3835  // AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
  3836  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
  3837  	return &ckpxctk, true
  3838  }
  3839  
  3840  // CopyAudio a codec flag, which tells the encoder to copy the input audio bitstream.
  3841  type CopyAudio struct {
  3842  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  3843  	Label *string `json:"label,omitempty"`
  3844  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  3845  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  3846  }
  3847  
  3848  // MarshalJSON is the custom marshaler for CopyAudio.
  3849  func (ca CopyAudio) MarshalJSON() ([]byte, error) {
  3850  	ca.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio
  3851  	objectMap := make(map[string]interface{})
  3852  	if ca.Label != nil {
  3853  		objectMap["label"] = ca.Label
  3854  	}
  3855  	if ca.OdataType != "" {
  3856  		objectMap["@odata.type"] = ca.OdataType
  3857  	}
  3858  	return json.Marshal(objectMap)
  3859  }
  3860  
  3861  // AsAudio is the BasicCodec implementation for CopyAudio.
  3862  func (ca CopyAudio) AsAudio() (*Audio, bool) {
  3863  	return nil, false
  3864  }
  3865  
  3866  // AsBasicAudio is the BasicCodec implementation for CopyAudio.
  3867  func (ca CopyAudio) AsBasicAudio() (BasicAudio, bool) {
  3868  	return nil, false
  3869  }
  3870  
  3871  // AsAacAudio is the BasicCodec implementation for CopyAudio.
  3872  func (ca CopyAudio) AsAacAudio() (*AacAudio, bool) {
  3873  	return nil, false
  3874  }
  3875  
  3876  // AsVideo is the BasicCodec implementation for CopyAudio.
  3877  func (ca CopyAudio) AsVideo() (*Video, bool) {
  3878  	return nil, false
  3879  }
  3880  
  3881  // AsBasicVideo is the BasicCodec implementation for CopyAudio.
  3882  func (ca CopyAudio) AsBasicVideo() (BasicVideo, bool) {
  3883  	return nil, false
  3884  }
  3885  
  3886  // AsH265Video is the BasicCodec implementation for CopyAudio.
  3887  func (ca CopyAudio) AsH265Video() (*H265Video, bool) {
  3888  	return nil, false
  3889  }
  3890  
  3891  // AsCopyVideo is the BasicCodec implementation for CopyAudio.
  3892  func (ca CopyAudio) AsCopyVideo() (*CopyVideo, bool) {
  3893  	return nil, false
  3894  }
  3895  
  3896  // AsImage is the BasicCodec implementation for CopyAudio.
  3897  func (ca CopyAudio) AsImage() (*Image, bool) {
  3898  	return nil, false
  3899  }
  3900  
  3901  // AsBasicImage is the BasicCodec implementation for CopyAudio.
  3902  func (ca CopyAudio) AsBasicImage() (BasicImage, bool) {
  3903  	return nil, false
  3904  }
  3905  
  3906  // AsCopyAudio is the BasicCodec implementation for CopyAudio.
  3907  func (ca CopyAudio) AsCopyAudio() (*CopyAudio, bool) {
  3908  	return &ca, true
  3909  }
  3910  
  3911  // AsH264Video is the BasicCodec implementation for CopyAudio.
  3912  func (ca CopyAudio) AsH264Video() (*H264Video, bool) {
  3913  	return nil, false
  3914  }
  3915  
  3916  // AsJpgImage is the BasicCodec implementation for CopyAudio.
  3917  func (ca CopyAudio) AsJpgImage() (*JpgImage, bool) {
  3918  	return nil, false
  3919  }
  3920  
  3921  // AsPngImage is the BasicCodec implementation for CopyAudio.
  3922  func (ca CopyAudio) AsPngImage() (*PngImage, bool) {
  3923  	return nil, false
  3924  }
  3925  
  3926  // AsCodec is the BasicCodec implementation for CopyAudio.
  3927  func (ca CopyAudio) AsCodec() (*Codec, bool) {
  3928  	return nil, false
  3929  }
  3930  
  3931  // AsBasicCodec is the BasicCodec implementation for CopyAudio.
  3932  func (ca CopyAudio) AsBasicCodec() (BasicCodec, bool) {
  3933  	return &ca, true
  3934  }
  3935  
  3936  // CopyVideo a codec flag, which tells the encoder to copy the input video bitstream without re-encoding.
  3937  type CopyVideo struct {
  3938  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  3939  	Label *string `json:"label,omitempty"`
  3940  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  3941  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  3942  }
  3943  
  3944  // MarshalJSON is the custom marshaler for CopyVideo.
  3945  func (cv CopyVideo) MarshalJSON() ([]byte, error) {
  3946  	cv.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo
  3947  	objectMap := make(map[string]interface{})
  3948  	if cv.Label != nil {
  3949  		objectMap["label"] = cv.Label
  3950  	}
  3951  	if cv.OdataType != "" {
  3952  		objectMap["@odata.type"] = cv.OdataType
  3953  	}
  3954  	return json.Marshal(objectMap)
  3955  }
  3956  
  3957  // AsAudio is the BasicCodec implementation for CopyVideo.
  3958  func (cv CopyVideo) AsAudio() (*Audio, bool) {
  3959  	return nil, false
  3960  }
  3961  
  3962  // AsBasicAudio is the BasicCodec implementation for CopyVideo.
  3963  func (cv CopyVideo) AsBasicAudio() (BasicAudio, bool) {
  3964  	return nil, false
  3965  }
  3966  
  3967  // AsAacAudio is the BasicCodec implementation for CopyVideo.
  3968  func (cv CopyVideo) AsAacAudio() (*AacAudio, bool) {
  3969  	return nil, false
  3970  }
  3971  
  3972  // AsVideo is the BasicCodec implementation for CopyVideo.
  3973  func (cv CopyVideo) AsVideo() (*Video, bool) {
  3974  	return nil, false
  3975  }
  3976  
  3977  // AsBasicVideo is the BasicCodec implementation for CopyVideo.
  3978  func (cv CopyVideo) AsBasicVideo() (BasicVideo, bool) {
  3979  	return nil, false
  3980  }
  3981  
  3982  // AsH265Video is the BasicCodec implementation for CopyVideo.
  3983  func (cv CopyVideo) AsH265Video() (*H265Video, bool) {
  3984  	return nil, false
  3985  }
  3986  
  3987  // AsCopyVideo is the BasicCodec implementation for CopyVideo.
  3988  func (cv CopyVideo) AsCopyVideo() (*CopyVideo, bool) {
  3989  	return &cv, true
  3990  }
  3991  
  3992  // AsImage is the BasicCodec implementation for CopyVideo.
  3993  func (cv CopyVideo) AsImage() (*Image, bool) {
  3994  	return nil, false
  3995  }
  3996  
  3997  // AsBasicImage is the BasicCodec implementation for CopyVideo.
  3998  func (cv CopyVideo) AsBasicImage() (BasicImage, bool) {
  3999  	return nil, false
  4000  }
  4001  
  4002  // AsCopyAudio is the BasicCodec implementation for CopyVideo.
  4003  func (cv CopyVideo) AsCopyAudio() (*CopyAudio, bool) {
  4004  	return nil, false
  4005  }
  4006  
  4007  // AsH264Video is the BasicCodec implementation for CopyVideo.
  4008  func (cv CopyVideo) AsH264Video() (*H264Video, bool) {
  4009  	return nil, false
  4010  }
  4011  
  4012  // AsJpgImage is the BasicCodec implementation for CopyVideo.
  4013  func (cv CopyVideo) AsJpgImage() (*JpgImage, bool) {
  4014  	return nil, false
  4015  }
  4016  
  4017  // AsPngImage is the BasicCodec implementation for CopyVideo.
  4018  func (cv CopyVideo) AsPngImage() (*PngImage, bool) {
  4019  	return nil, false
  4020  }
  4021  
  4022  // AsCodec is the BasicCodec implementation for CopyVideo.
  4023  func (cv CopyVideo) AsCodec() (*Codec, bool) {
  4024  	return nil, false
  4025  }
  4026  
  4027  // AsBasicCodec is the BasicCodec implementation for CopyVideo.
  4028  func (cv CopyVideo) AsBasicCodec() (BasicCodec, bool) {
  4029  	return &cv, true
  4030  }
  4031  
  4032  // CrossSiteAccessPolicies the client access policy.
  4033  type CrossSiteAccessPolicies struct {
  4034  	// ClientAccessPolicy - The content of clientaccesspolicy.xml used by Silverlight.
  4035  	ClientAccessPolicy *string `json:"clientAccessPolicy,omitempty"`
  4036  	// CrossDomainPolicy - The content of crossdomain.xml used by Silverlight.
  4037  	CrossDomainPolicy *string `json:"crossDomainPolicy,omitempty"`
  4038  }
  4039  
  4040  // DefaultKey class to specify properties of default content key for each encryption scheme
  4041  type DefaultKey struct {
  4042  	// Label - Label can be used to specify Content Key when creating a Streaming Locator
  4043  	Label *string `json:"label,omitempty"`
  4044  	// PolicyName - Policy used by Default Key
  4045  	PolicyName *string `json:"policyName,omitempty"`
  4046  }
  4047  
  4048  // Deinterlace describes the de-interlacing settings.
  4049  type Deinterlace struct {
  4050  	// Parity - The field parity for de-interlacing, defaults to Auto. Possible values include: 'DeinterlaceParityAuto', 'DeinterlaceParityTopFieldFirst', 'DeinterlaceParityBottomFieldFirst'
  4051  	Parity DeinterlaceParity `json:"parity,omitempty"`
  4052  	// Mode - The deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values include: 'DeinterlaceModeOff', 'DeinterlaceModeAutoPixelAdaptive'
  4053  	Mode DeinterlaceMode `json:"mode,omitempty"`
  4054  }
  4055  
  4056  // EdgePolicies ...
  4057  type EdgePolicies struct {
  4058  	autorest.Response         `json:"-"`
  4059  	UsageDataCollectionPolicy *EdgeUsageDataCollectionPolicy `json:"usageDataCollectionPolicy,omitempty"`
  4060  }
  4061  
  4062  // EdgeUsageDataCollectionPolicy ...
  4063  type EdgeUsageDataCollectionPolicy struct {
  4064  	// DataCollectionFrequency - Usage data collection frequency in ISO 8601 duration format e.g. PT10M , PT5H.
  4065  	DataCollectionFrequency *string `json:"dataCollectionFrequency,omitempty"`
  4066  	// DataReportingFrequency - Usage data reporting frequency in ISO 8601 duration format e.g. PT10M , PT5H.
  4067  	DataReportingFrequency *string `json:"dataReportingFrequency,omitempty"`
  4068  	// MaxAllowedUnreportedUsageDuration - Maximum time for which the functionality of the device will not be hampered for not reporting the usage data.
  4069  	MaxAllowedUnreportedUsageDuration *string `json:"maxAllowedUnreportedUsageDuration,omitempty"`
  4070  	// EventHubDetails - Details of Event Hub where the usage will be reported.
  4071  	EventHubDetails *EdgeUsageDataEventHub `json:"eventHubDetails,omitempty"`
  4072  }
  4073  
  4074  // EdgeUsageDataEventHub ...
  4075  type EdgeUsageDataEventHub struct {
  4076  	// Name - Name of the Event Hub where usage will be reported.
  4077  	Name *string `json:"name,omitempty"`
  4078  	// Namespace - Namespace of the Event Hub where usage will be reported.
  4079  	Namespace *string `json:"namespace,omitempty"`
  4080  	// Token - SAS token needed to interact with Event Hub.
  4081  	Token *string `json:"token,omitempty"`
  4082  }
  4083  
  4084  // EnabledProtocols class to specify which protocols are enabled
  4085  type EnabledProtocols struct {
  4086  	// Download - Enable Download protocol or not
  4087  	Download *bool `json:"download,omitempty"`
  4088  	// Dash - Enable DASH protocol or not
  4089  	Dash *bool `json:"dash,omitempty"`
  4090  	// Hls - Enable HLS protocol or not
  4091  	Hls *bool `json:"hls,omitempty"`
  4092  	// SmoothStreaming - Enable SmoothStreaming protocol or not
  4093  	SmoothStreaming *bool `json:"smoothStreaming,omitempty"`
  4094  }
  4095  
  4096  // EntityNameAvailabilityCheckOutput the response from the check name availability request.
  4097  type EntityNameAvailabilityCheckOutput struct {
  4098  	autorest.Response `json:"-"`
  4099  	// NameAvailable - Specifies if the name is available.
  4100  	NameAvailable *bool `json:"nameAvailable,omitempty"`
  4101  	// Reason - Specifies the reason if the name is not available.
  4102  	Reason *string `json:"reason,omitempty"`
  4103  	// Message - Specifies the detailed reason if the name is not available.
  4104  	Message *string `json:"message,omitempty"`
  4105  }
  4106  
  4107  // EnvelopeEncryption class for EnvelopeEncryption encryption scheme
  4108  type EnvelopeEncryption struct {
  4109  	// EnabledProtocols - Representing supported protocols
  4110  	EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
  4111  	// ClearTracks - Representing which tracks should not be encrypted
  4112  	ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"`
  4113  	// ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks
  4114  	ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"`
  4115  	// 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.
  4116  	CustomKeyAcquisitionURLTemplate *string `json:"customKeyAcquisitionUrlTemplate,omitempty"`
  4117  }
  4118  
  4119  // ErrorAdditionalInfo the resource management error additional info.
  4120  type ErrorAdditionalInfo struct {
  4121  	// Type - READ-ONLY; The additional info type.
  4122  	Type *string `json:"type,omitempty"`
  4123  	// Info - READ-ONLY; The additional info.
  4124  	Info interface{} `json:"info,omitempty"`
  4125  }
  4126  
  4127  // MarshalJSON is the custom marshaler for ErrorAdditionalInfo.
  4128  func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
  4129  	objectMap := make(map[string]interface{})
  4130  	return json.Marshal(objectMap)
  4131  }
  4132  
  4133  // ErrorDetail the error detail.
  4134  type ErrorDetail struct {
  4135  	// Code - READ-ONLY; The error code.
  4136  	Code *string `json:"code,omitempty"`
  4137  	// Message - READ-ONLY; The error message.
  4138  	Message *string `json:"message,omitempty"`
  4139  	// Target - READ-ONLY; The error target.
  4140  	Target *string `json:"target,omitempty"`
  4141  	// Details - READ-ONLY; The error details.
  4142  	Details *[]ErrorDetail `json:"details,omitempty"`
  4143  	// AdditionalInfo - READ-ONLY; The error additional info.
  4144  	AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
  4145  }
  4146  
  4147  // MarshalJSON is the custom marshaler for ErrorDetail.
  4148  func (ed ErrorDetail) MarshalJSON() ([]byte, error) {
  4149  	objectMap := make(map[string]interface{})
  4150  	return json.Marshal(objectMap)
  4151  }
  4152  
  4153  // ErrorResponse common error response for all Azure Resource Manager APIs to return error details for
  4154  // failed operations. (This also follows the OData error response format.).
  4155  type ErrorResponse struct {
  4156  	// Error - The error object.
  4157  	Error *ErrorDetail `json:"error,omitempty"`
  4158  }
  4159  
  4160  // FaceDetectorPreset describes all the settings to be used when analyzing a video in order to detect (and
  4161  // optionally redact) all the faces present.
  4162  type FaceDetectorPreset struct {
  4163  	// 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: 'AnalysisResolutionSourceResolution', 'AnalysisResolutionStandardDefinition'
  4164  	Resolution AnalysisResolution `json:"resolution,omitempty"`
  4165  	// Mode - This mode provides the ability to choose between the following settings: 1) Analyze - For detection only.This mode generates a metadata JSON file marking appearances of faces throughout the video.Where possible, appearances of the same person are assigned the same ID. 2) Combined - Additionally redacts(blurs) detected faces. 3) Redact - This enables a 2-pass process, allowing for selective redaction of a subset of detected faces.It takes in the metadata file from a prior analyze pass, along with the source video, and a user-selected subset of IDs that require redaction. Possible values include: 'FaceRedactorModeAnalyze', 'FaceRedactorModeRedact', 'FaceRedactorModeCombined'
  4166  	Mode FaceRedactorMode `json:"mode,omitempty"`
  4167  	// BlurType - Blur type. Possible values include: 'BlurTypeBox', 'BlurTypeLow', 'BlurTypeMed', 'BlurTypeHigh', 'BlurTypeBlack'
  4168  	BlurType BlurType `json:"blurType,omitempty"`
  4169  	// ExperimentalOptions - Dictionary containing key value pairs for parameters not exposed in the preset itself
  4170  	ExperimentalOptions map[string]*string `json:"experimentalOptions"`
  4171  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
  4172  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
  4173  }
  4174  
  4175  // MarshalJSON is the custom marshaler for FaceDetectorPreset.
  4176  func (fdp FaceDetectorPreset) MarshalJSON() ([]byte, error) {
  4177  	fdp.OdataType = OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset
  4178  	objectMap := make(map[string]interface{})
  4179  	if fdp.Resolution != "" {
  4180  		objectMap["resolution"] = fdp.Resolution
  4181  	}
  4182  	if fdp.Mode != "" {
  4183  		objectMap["mode"] = fdp.Mode
  4184  	}
  4185  	if fdp.BlurType != "" {
  4186  		objectMap["blurType"] = fdp.BlurType
  4187  	}
  4188  	if fdp.ExperimentalOptions != nil {
  4189  		objectMap["experimentalOptions"] = fdp.ExperimentalOptions
  4190  	}
  4191  	if fdp.OdataType != "" {
  4192  		objectMap["@odata.type"] = fdp.OdataType
  4193  	}
  4194  	return json.Marshal(objectMap)
  4195  }
  4196  
  4197  // AsFaceDetectorPreset is the BasicPreset implementation for FaceDetectorPreset.
  4198  func (fdp FaceDetectorPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
  4199  	return &fdp, true
  4200  }
  4201  
  4202  // AsAudioAnalyzerPreset is the BasicPreset implementation for FaceDetectorPreset.
  4203  func (fdp FaceDetectorPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
  4204  	return nil, false
  4205  }
  4206  
  4207  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for FaceDetectorPreset.
  4208  func (fdp FaceDetectorPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
  4209  	return nil, false
  4210  }
  4211  
  4212  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for FaceDetectorPreset.
  4213  func (fdp FaceDetectorPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
  4214  	return nil, false
  4215  }
  4216  
  4217  // AsStandardEncoderPreset is the BasicPreset implementation for FaceDetectorPreset.
  4218  func (fdp FaceDetectorPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
  4219  	return nil, false
  4220  }
  4221  
  4222  // AsVideoAnalyzerPreset is the BasicPreset implementation for FaceDetectorPreset.
  4223  func (fdp FaceDetectorPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
  4224  	return nil, false
  4225  }
  4226  
  4227  // AsPreset is the BasicPreset implementation for FaceDetectorPreset.
  4228  func (fdp FaceDetectorPreset) AsPreset() (*Preset, bool) {
  4229  	return nil, false
  4230  }
  4231  
  4232  // AsBasicPreset is the BasicPreset implementation for FaceDetectorPreset.
  4233  func (fdp FaceDetectorPreset) AsBasicPreset() (BasicPreset, bool) {
  4234  	return &fdp, true
  4235  }
  4236  
  4237  // FilterProperties the Media Filter properties.
  4238  type FilterProperties struct {
  4239  	// PresentationTimeRange - The presentation time range.
  4240  	PresentationTimeRange *PresentationTimeRange `json:"presentationTimeRange,omitempty"`
  4241  	// FirstQuality - The first quality.
  4242  	FirstQuality *FirstQuality `json:"firstQuality,omitempty"`
  4243  	// Tracks - The tracks selection conditions.
  4244  	Tracks *[]FilterTrackSelection `json:"tracks,omitempty"`
  4245  }
  4246  
  4247  // Filters describes all the filtering operations, such as de-interlacing, rotation etc. that are to be
  4248  // applied to the input media before encoding.
  4249  type Filters struct {
  4250  	// Deinterlace - The de-interlacing settings.
  4251  	Deinterlace *Deinterlace `json:"deinterlace,omitempty"`
  4252  	// 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'
  4253  	Rotation Rotation `json:"rotation,omitempty"`
  4254  	// Crop - The parameters for the rectangular window with which to crop the input video.
  4255  	Crop *Rectangle `json:"crop,omitempty"`
  4256  	// Overlays - The properties of overlays to be applied to the input video. These could be audio, image or video overlays.
  4257  	Overlays *[]BasicOverlay `json:"overlays,omitempty"`
  4258  }
  4259  
  4260  // UnmarshalJSON is the custom unmarshaler for Filters struct.
  4261  func (f *Filters) UnmarshalJSON(body []byte) error {
  4262  	var m map[string]*json.RawMessage
  4263  	err := json.Unmarshal(body, &m)
  4264  	if err != nil {
  4265  		return err
  4266  	}
  4267  	for k, v := range m {
  4268  		switch k {
  4269  		case "deinterlace":
  4270  			if v != nil {
  4271  				var deinterlace Deinterlace
  4272  				err = json.Unmarshal(*v, &deinterlace)
  4273  				if err != nil {
  4274  					return err
  4275  				}
  4276  				f.Deinterlace = &deinterlace
  4277  			}
  4278  		case "rotation":
  4279  			if v != nil {
  4280  				var rotation Rotation
  4281  				err = json.Unmarshal(*v, &rotation)
  4282  				if err != nil {
  4283  					return err
  4284  				}
  4285  				f.Rotation = rotation
  4286  			}
  4287  		case "crop":
  4288  			if v != nil {
  4289  				var crop Rectangle
  4290  				err = json.Unmarshal(*v, &crop)
  4291  				if err != nil {
  4292  					return err
  4293  				}
  4294  				f.Crop = &crop
  4295  			}
  4296  		case "overlays":
  4297  			if v != nil {
  4298  				overlays, err := unmarshalBasicOverlayArray(*v)
  4299  				if err != nil {
  4300  					return err
  4301  				}
  4302  				f.Overlays = &overlays
  4303  			}
  4304  		}
  4305  	}
  4306  
  4307  	return nil
  4308  }
  4309  
  4310  // FilterTrackPropertyCondition the class to specify one track property condition.
  4311  type FilterTrackPropertyCondition struct {
  4312  	// Property - The track property type. Possible values include: 'FilterTrackPropertyTypeUnknown', 'FilterTrackPropertyTypeType', 'FilterTrackPropertyTypeName', 'FilterTrackPropertyTypeLanguage', 'FilterTrackPropertyTypeFourCC', 'FilterTrackPropertyTypeBitrate'
  4313  	Property FilterTrackPropertyType `json:"property,omitempty"`
  4314  	// Value - The track property value.
  4315  	Value *string `json:"value,omitempty"`
  4316  	// Operation - The track property condition operation. Possible values include: 'FilterTrackPropertyCompareOperationEqual', 'FilterTrackPropertyCompareOperationNotEqual'
  4317  	Operation FilterTrackPropertyCompareOperation `json:"operation,omitempty"`
  4318  }
  4319  
  4320  // FilterTrackSelection representing a list of FilterTrackPropertyConditions to select a track.  The
  4321  // filters are combined using a logical AND operation.
  4322  type FilterTrackSelection struct {
  4323  	// TrackSelections - The track selections.
  4324  	TrackSelections *[]FilterTrackPropertyCondition `json:"trackSelections,omitempty"`
  4325  }
  4326  
  4327  // FirstQuality filter First Quality
  4328  type FirstQuality struct {
  4329  	// Bitrate - The first quality bitrate.
  4330  	Bitrate *int32 `json:"bitrate,omitempty"`
  4331  }
  4332  
  4333  // BasicFormat base class for output.
  4334  type BasicFormat interface {
  4335  	AsImageFormat() (*ImageFormat, bool)
  4336  	AsBasicImageFormat() (BasicImageFormat, bool)
  4337  	AsJpgFormat() (*JpgFormat, bool)
  4338  	AsPngFormat() (*PngFormat, bool)
  4339  	AsMultiBitrateFormat() (*MultiBitrateFormat, bool)
  4340  	AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool)
  4341  	AsMp4Format() (*Mp4Format, bool)
  4342  	AsTransportStreamFormat() (*TransportStreamFormat, bool)
  4343  	AsFormat() (*Format, bool)
  4344  }
  4345  
  4346  // Format base class for output.
  4347  type Format struct {
  4348  	// FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of input video files will be used. If the length of base name of the input video file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename.
  4349  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  4350  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  4351  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  4352  }
  4353  
  4354  func unmarshalBasicFormat(body []byte) (BasicFormat, error) {
  4355  	var m map[string]interface{}
  4356  	err := json.Unmarshal(body, &m)
  4357  	if err != nil {
  4358  		return nil, err
  4359  	}
  4360  
  4361  	switch m["@odata.type"] {
  4362  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat):
  4363  		var ifVar ImageFormat
  4364  		err := json.Unmarshal(body, &ifVar)
  4365  		return ifVar, err
  4366  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat):
  4367  		var jf JpgFormat
  4368  		err := json.Unmarshal(body, &jf)
  4369  		return jf, err
  4370  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat):
  4371  		var pf PngFormat
  4372  		err := json.Unmarshal(body, &pf)
  4373  		return pf, err
  4374  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat):
  4375  		var mbf MultiBitrateFormat
  4376  		err := json.Unmarshal(body, &mbf)
  4377  		return mbf, err
  4378  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format):
  4379  		var m4f Mp4Format
  4380  		err := json.Unmarshal(body, &m4f)
  4381  		return m4f, err
  4382  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat):
  4383  		var tsf TransportStreamFormat
  4384  		err := json.Unmarshal(body, &tsf)
  4385  		return tsf, err
  4386  	default:
  4387  		var f Format
  4388  		err := json.Unmarshal(body, &f)
  4389  		return f, err
  4390  	}
  4391  }
  4392  func unmarshalBasicFormatArray(body []byte) ([]BasicFormat, error) {
  4393  	var rawMessages []*json.RawMessage
  4394  	err := json.Unmarshal(body, &rawMessages)
  4395  	if err != nil {
  4396  		return nil, err
  4397  	}
  4398  
  4399  	fArray := make([]BasicFormat, len(rawMessages))
  4400  
  4401  	for index, rawMessage := range rawMessages {
  4402  		f, err := unmarshalBasicFormat(*rawMessage)
  4403  		if err != nil {
  4404  			return nil, err
  4405  		}
  4406  		fArray[index] = f
  4407  	}
  4408  	return fArray, nil
  4409  }
  4410  
  4411  // MarshalJSON is the custom marshaler for Format.
  4412  func (f Format) MarshalJSON() ([]byte, error) {
  4413  	f.OdataType = OdataTypeBasicFormatOdataTypeFormat
  4414  	objectMap := make(map[string]interface{})
  4415  	if f.FilenamePattern != nil {
  4416  		objectMap["filenamePattern"] = f.FilenamePattern
  4417  	}
  4418  	if f.OdataType != "" {
  4419  		objectMap["@odata.type"] = f.OdataType
  4420  	}
  4421  	return json.Marshal(objectMap)
  4422  }
  4423  
  4424  // AsImageFormat is the BasicFormat implementation for Format.
  4425  func (f Format) AsImageFormat() (*ImageFormat, bool) {
  4426  	return nil, false
  4427  }
  4428  
  4429  // AsBasicImageFormat is the BasicFormat implementation for Format.
  4430  func (f Format) AsBasicImageFormat() (BasicImageFormat, bool) {
  4431  	return nil, false
  4432  }
  4433  
  4434  // AsJpgFormat is the BasicFormat implementation for Format.
  4435  func (f Format) AsJpgFormat() (*JpgFormat, bool) {
  4436  	return nil, false
  4437  }
  4438  
  4439  // AsPngFormat is the BasicFormat implementation for Format.
  4440  func (f Format) AsPngFormat() (*PngFormat, bool) {
  4441  	return nil, false
  4442  }
  4443  
  4444  // AsMultiBitrateFormat is the BasicFormat implementation for Format.
  4445  func (f Format) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  4446  	return nil, false
  4447  }
  4448  
  4449  // AsBasicMultiBitrateFormat is the BasicFormat implementation for Format.
  4450  func (f Format) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  4451  	return nil, false
  4452  }
  4453  
  4454  // AsMp4Format is the BasicFormat implementation for Format.
  4455  func (f Format) AsMp4Format() (*Mp4Format, bool) {
  4456  	return nil, false
  4457  }
  4458  
  4459  // AsTransportStreamFormat is the BasicFormat implementation for Format.
  4460  func (f Format) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  4461  	return nil, false
  4462  }
  4463  
  4464  // AsFormat is the BasicFormat implementation for Format.
  4465  func (f Format) AsFormat() (*Format, bool) {
  4466  	return &f, true
  4467  }
  4468  
  4469  // AsBasicFormat is the BasicFormat implementation for Format.
  4470  func (f Format) AsBasicFormat() (BasicFormat, bool) {
  4471  	return &f, true
  4472  }
  4473  
  4474  // FromAllInputFile an InputDefinition that looks across all of the files provided to select tracks
  4475  // specified by the IncludedTracks property. Generally used with the AudioTrackByAttribute and
  4476  // VideoTrackByAttribute to allow selection of a single track across a set of input files.
  4477  type FromAllInputFile struct {
  4478  	// IncludedTracks - The list of TrackDescriptors which define the metadata and selection of tracks in the input.
  4479  	IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
  4480  	// OdataType - Possible values include: 'OdataTypeBasicInputDefinitionOdataTypeInputDefinition', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile'
  4481  	OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
  4482  }
  4483  
  4484  // MarshalJSON is the custom marshaler for FromAllInputFile.
  4485  func (faif FromAllInputFile) MarshalJSON() ([]byte, error) {
  4486  	faif.OdataType = OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile
  4487  	objectMap := make(map[string]interface{})
  4488  	if faif.IncludedTracks != nil {
  4489  		objectMap["includedTracks"] = faif.IncludedTracks
  4490  	}
  4491  	if faif.OdataType != "" {
  4492  		objectMap["@odata.type"] = faif.OdataType
  4493  	}
  4494  	return json.Marshal(objectMap)
  4495  }
  4496  
  4497  // AsFromAllInputFile is the BasicInputDefinition implementation for FromAllInputFile.
  4498  func (faif FromAllInputFile) AsFromAllInputFile() (*FromAllInputFile, bool) {
  4499  	return &faif, true
  4500  }
  4501  
  4502  // AsFromEachInputFile is the BasicInputDefinition implementation for FromAllInputFile.
  4503  func (faif FromAllInputFile) AsFromEachInputFile() (*FromEachInputFile, bool) {
  4504  	return nil, false
  4505  }
  4506  
  4507  // AsInputFile is the BasicInputDefinition implementation for FromAllInputFile.
  4508  func (faif FromAllInputFile) AsInputFile() (*InputFile, bool) {
  4509  	return nil, false
  4510  }
  4511  
  4512  // AsInputDefinition is the BasicInputDefinition implementation for FromAllInputFile.
  4513  func (faif FromAllInputFile) AsInputDefinition() (*InputDefinition, bool) {
  4514  	return nil, false
  4515  }
  4516  
  4517  // AsBasicInputDefinition is the BasicInputDefinition implementation for FromAllInputFile.
  4518  func (faif FromAllInputFile) AsBasicInputDefinition() (BasicInputDefinition, bool) {
  4519  	return &faif, true
  4520  }
  4521  
  4522  // UnmarshalJSON is the custom unmarshaler for FromAllInputFile struct.
  4523  func (faif *FromAllInputFile) UnmarshalJSON(body []byte) error {
  4524  	var m map[string]*json.RawMessage
  4525  	err := json.Unmarshal(body, &m)
  4526  	if err != nil {
  4527  		return err
  4528  	}
  4529  	for k, v := range m {
  4530  		switch k {
  4531  		case "includedTracks":
  4532  			if v != nil {
  4533  				includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
  4534  				if err != nil {
  4535  					return err
  4536  				}
  4537  				faif.IncludedTracks = &includedTracks
  4538  			}
  4539  		case "@odata.type":
  4540  			if v != nil {
  4541  				var odataType OdataTypeBasicInputDefinition
  4542  				err = json.Unmarshal(*v, &odataType)
  4543  				if err != nil {
  4544  					return err
  4545  				}
  4546  				faif.OdataType = odataType
  4547  			}
  4548  		}
  4549  	}
  4550  
  4551  	return nil
  4552  }
  4553  
  4554  // FromEachInputFile an InputDefinition that looks at each input file provided to select tracks specified
  4555  // by the IncludedTracks property. Generally used with the AudioTrackByAttribute and VideoTrackByAttribute
  4556  // to select tracks from each file given.
  4557  type FromEachInputFile struct {
  4558  	// IncludedTracks - The list of TrackDescriptors which define the metadata and selection of tracks in the input.
  4559  	IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
  4560  	// OdataType - Possible values include: 'OdataTypeBasicInputDefinitionOdataTypeInputDefinition', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile'
  4561  	OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
  4562  }
  4563  
  4564  // MarshalJSON is the custom marshaler for FromEachInputFile.
  4565  func (feif FromEachInputFile) MarshalJSON() ([]byte, error) {
  4566  	feif.OdataType = OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile
  4567  	objectMap := make(map[string]interface{})
  4568  	if feif.IncludedTracks != nil {
  4569  		objectMap["includedTracks"] = feif.IncludedTracks
  4570  	}
  4571  	if feif.OdataType != "" {
  4572  		objectMap["@odata.type"] = feif.OdataType
  4573  	}
  4574  	return json.Marshal(objectMap)
  4575  }
  4576  
  4577  // AsFromAllInputFile is the BasicInputDefinition implementation for FromEachInputFile.
  4578  func (feif FromEachInputFile) AsFromAllInputFile() (*FromAllInputFile, bool) {
  4579  	return nil, false
  4580  }
  4581  
  4582  // AsFromEachInputFile is the BasicInputDefinition implementation for FromEachInputFile.
  4583  func (feif FromEachInputFile) AsFromEachInputFile() (*FromEachInputFile, bool) {
  4584  	return &feif, true
  4585  }
  4586  
  4587  // AsInputFile is the BasicInputDefinition implementation for FromEachInputFile.
  4588  func (feif FromEachInputFile) AsInputFile() (*InputFile, bool) {
  4589  	return nil, false
  4590  }
  4591  
  4592  // AsInputDefinition is the BasicInputDefinition implementation for FromEachInputFile.
  4593  func (feif FromEachInputFile) AsInputDefinition() (*InputDefinition, bool) {
  4594  	return nil, false
  4595  }
  4596  
  4597  // AsBasicInputDefinition is the BasicInputDefinition implementation for FromEachInputFile.
  4598  func (feif FromEachInputFile) AsBasicInputDefinition() (BasicInputDefinition, bool) {
  4599  	return &feif, true
  4600  }
  4601  
  4602  // UnmarshalJSON is the custom unmarshaler for FromEachInputFile struct.
  4603  func (feif *FromEachInputFile) UnmarshalJSON(body []byte) error {
  4604  	var m map[string]*json.RawMessage
  4605  	err := json.Unmarshal(body, &m)
  4606  	if err != nil {
  4607  		return err
  4608  	}
  4609  	for k, v := range m {
  4610  		switch k {
  4611  		case "includedTracks":
  4612  			if v != nil {
  4613  				includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
  4614  				if err != nil {
  4615  					return err
  4616  				}
  4617  				feif.IncludedTracks = &includedTracks
  4618  			}
  4619  		case "@odata.type":
  4620  			if v != nil {
  4621  				var odataType OdataTypeBasicInputDefinition
  4622  				err = json.Unmarshal(*v, &odataType)
  4623  				if err != nil {
  4624  					return err
  4625  				}
  4626  				feif.OdataType = odataType
  4627  			}
  4628  		}
  4629  	}
  4630  
  4631  	return nil
  4632  }
  4633  
  4634  // H264Layer describes the settings to be used when encoding the input video into a desired output bitrate
  4635  // layer with the H.264 video codec.
  4636  type H264Layer struct {
  4637  	// Profile - We currently support Baseline, Main, High, High422, High444. Default is Auto. Possible values include: 'H264VideoProfileAuto', 'H264VideoProfileBaseline', 'H264VideoProfileMain', 'H264VideoProfileHigh', 'H264VideoProfileHigh422', 'H264VideoProfileHigh444'
  4638  	Profile H264VideoProfile `json:"profile,omitempty"`
  4639  	// 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.
  4640  	Level *string `json:"level,omitempty"`
  4641  	// 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).
  4642  	BufferWindow *string `json:"bufferWindow,omitempty"`
  4643  	// Crf - The value of CRF to be used when encoding this layer. This setting takes effect when RateControlMode of video codec is set at CRF mode. The range of CRF value is between 0 and 51, where lower values would result in better quality, at the expense of higher file sizes. Higher values mean more compression, but at some point quality degradation will be noticed. Default value is 23.
  4644  	Crf *float64 `json:"crf,omitempty"`
  4645  	// 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.
  4646  	ReferenceFrames *int32 `json:"referenceFrames,omitempty"`
  4647  	// 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: 'EntropyModeCabac', 'EntropyModeCavlc'
  4648  	EntropyMode EntropyMode `json:"entropyMode,omitempty"`
  4649  	// Bitrate - The average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field.
  4650  	Bitrate *int32 `json:"bitrate,omitempty"`
  4651  	// 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.
  4652  	MaxBitrate *int32 `json:"maxBitrate,omitempty"`
  4653  	// 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.
  4654  	BFrames *int32 `json:"bFrames,omitempty"`
  4655  	// 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.
  4656  	FrameRate *string `json:"frameRate,omitempty"`
  4657  	// 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.
  4658  	Slices *int32 `json:"slices,omitempty"`
  4659  	// 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.
  4660  	AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
  4661  	// 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.
  4662  	Width *string `json:"width,omitempty"`
  4663  	// 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.
  4664  	Height *string `json:"height,omitempty"`
  4665  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  4666  	Label *string `json:"label,omitempty"`
  4667  }
  4668  
  4669  // H264Video describes all the properties for encoding a video with the H.264 codec.
  4670  type H264Video struct {
  4671  	// Complexity - Tells the encoder how to choose its encoding settings. The default value is Balanced. Possible values include: 'H264ComplexitySpeed', 'H264ComplexityBalanced', 'H264ComplexityQuality'
  4672  	Complexity H264Complexity `json:"complexity,omitempty"`
  4673  	// Layers - The collection of output H.264 layers to be produced by the encoder.
  4674  	Layers *[]H264Layer `json:"layers,omitempty"`
  4675  	// RateControlMode - The video rate control mode. Possible values include: 'H264RateControlModeABR', 'H264RateControlModeCBR', 'H264RateControlModeCRF'
  4676  	RateControlMode H264RateControlMode `json:"rateControlMode,omitempty"`
  4677  	// 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.
  4678  	SceneChangeDetection *bool `json:"sceneChangeDetection,omitempty"`
  4679  	// KeyFrameInterval - The distance between two key frames. The value should be non-zero in the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will follow the input source setting.
  4680  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  4681  	// 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'
  4682  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  4683  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
  4684  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
  4685  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  4686  	Label *string `json:"label,omitempty"`
  4687  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  4688  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  4689  }
  4690  
  4691  // MarshalJSON is the custom marshaler for H264Video.
  4692  func (hv H264Video) MarshalJSON() ([]byte, error) {
  4693  	hv.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video
  4694  	objectMap := make(map[string]interface{})
  4695  	if hv.Complexity != "" {
  4696  		objectMap["complexity"] = hv.Complexity
  4697  	}
  4698  	if hv.Layers != nil {
  4699  		objectMap["layers"] = hv.Layers
  4700  	}
  4701  	if hv.RateControlMode != "" {
  4702  		objectMap["rateControlMode"] = hv.RateControlMode
  4703  	}
  4704  	if hv.SceneChangeDetection != nil {
  4705  		objectMap["sceneChangeDetection"] = hv.SceneChangeDetection
  4706  	}
  4707  	if hv.KeyFrameInterval != nil {
  4708  		objectMap["keyFrameInterval"] = hv.KeyFrameInterval
  4709  	}
  4710  	if hv.StretchMode != "" {
  4711  		objectMap["stretchMode"] = hv.StretchMode
  4712  	}
  4713  	if hv.SyncMode != "" {
  4714  		objectMap["syncMode"] = hv.SyncMode
  4715  	}
  4716  	if hv.Label != nil {
  4717  		objectMap["label"] = hv.Label
  4718  	}
  4719  	if hv.OdataType != "" {
  4720  		objectMap["@odata.type"] = hv.OdataType
  4721  	}
  4722  	return json.Marshal(objectMap)
  4723  }
  4724  
  4725  // AsAudio is the BasicCodec implementation for H264Video.
  4726  func (hv H264Video) AsAudio() (*Audio, bool) {
  4727  	return nil, false
  4728  }
  4729  
  4730  // AsBasicAudio is the BasicCodec implementation for H264Video.
  4731  func (hv H264Video) AsBasicAudio() (BasicAudio, bool) {
  4732  	return nil, false
  4733  }
  4734  
  4735  // AsAacAudio is the BasicCodec implementation for H264Video.
  4736  func (hv H264Video) AsAacAudio() (*AacAudio, bool) {
  4737  	return nil, false
  4738  }
  4739  
  4740  // AsVideo is the BasicCodec implementation for H264Video.
  4741  func (hv H264Video) AsVideo() (*Video, bool) {
  4742  	return nil, false
  4743  }
  4744  
  4745  // AsBasicVideo is the BasicCodec implementation for H264Video.
  4746  func (hv H264Video) AsBasicVideo() (BasicVideo, bool) {
  4747  	return &hv, true
  4748  }
  4749  
  4750  // AsH265Video is the BasicCodec implementation for H264Video.
  4751  func (hv H264Video) AsH265Video() (*H265Video, bool) {
  4752  	return nil, false
  4753  }
  4754  
  4755  // AsCopyVideo is the BasicCodec implementation for H264Video.
  4756  func (hv H264Video) AsCopyVideo() (*CopyVideo, bool) {
  4757  	return nil, false
  4758  }
  4759  
  4760  // AsImage is the BasicCodec implementation for H264Video.
  4761  func (hv H264Video) AsImage() (*Image, bool) {
  4762  	return nil, false
  4763  }
  4764  
  4765  // AsBasicImage is the BasicCodec implementation for H264Video.
  4766  func (hv H264Video) AsBasicImage() (BasicImage, bool) {
  4767  	return nil, false
  4768  }
  4769  
  4770  // AsCopyAudio is the BasicCodec implementation for H264Video.
  4771  func (hv H264Video) AsCopyAudio() (*CopyAudio, bool) {
  4772  	return nil, false
  4773  }
  4774  
  4775  // AsH264Video is the BasicCodec implementation for H264Video.
  4776  func (hv H264Video) AsH264Video() (*H264Video, bool) {
  4777  	return &hv, true
  4778  }
  4779  
  4780  // AsJpgImage is the BasicCodec implementation for H264Video.
  4781  func (hv H264Video) AsJpgImage() (*JpgImage, bool) {
  4782  	return nil, false
  4783  }
  4784  
  4785  // AsPngImage is the BasicCodec implementation for H264Video.
  4786  func (hv H264Video) AsPngImage() (*PngImage, bool) {
  4787  	return nil, false
  4788  }
  4789  
  4790  // AsCodec is the BasicCodec implementation for H264Video.
  4791  func (hv H264Video) AsCodec() (*Codec, bool) {
  4792  	return nil, false
  4793  }
  4794  
  4795  // AsBasicCodec is the BasicCodec implementation for H264Video.
  4796  func (hv H264Video) AsBasicCodec() (BasicCodec, bool) {
  4797  	return &hv, true
  4798  }
  4799  
  4800  // H265Layer describes the settings to be used when encoding the input video into a desired output bitrate
  4801  // layer with the H.265 video codec.
  4802  type H265Layer struct {
  4803  	// Profile - We currently support Main. Default is Auto. Possible values include: 'H265VideoProfileAuto', 'H265VideoProfileMain', 'H265VideoProfileMain10'
  4804  	Profile H265VideoProfile `json:"profile,omitempty"`
  4805  	// Level - We currently support Level up to 6.2. The value can be Auto, or a number that matches the H.265 profile. If not specified, the default is Auto, which lets the encoder choose the Level that is appropriate for this layer.
  4806  	Level *string `json:"level,omitempty"`
  4807  	// 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).
  4808  	BufferWindow *string `json:"bufferWindow,omitempty"`
  4809  	// Crf - The value of CRF to be used when encoding this layer. This setting takes effect when RateControlMode of video codec is set at CRF mode. The range of CRF value is between 0 and 51, where lower values would result in better quality, at the expense of higher file sizes. Higher values mean more compression, but at some point quality degradation will be noticed. Default value is 28.
  4810  	Crf *float64 `json:"crf,omitempty"`
  4811  	// 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.
  4812  	ReferenceFrames *int32 `json:"referenceFrames,omitempty"`
  4813  	// Bitrate - The average bitrate in bits per second at which to encode the input video when generating this layer. For example: a target bitrate of 3000Kbps or 3Mbps means this value should be 3000000 This is a required field.
  4814  	Bitrate *int32 `json:"bitrate,omitempty"`
  4815  	// 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.
  4816  	MaxBitrate *int32 `json:"maxBitrate,omitempty"`
  4817  	// 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.
  4818  	BFrames *int32 `json:"bFrames,omitempty"`
  4819  	// 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.
  4820  	FrameRate *string `json:"frameRate,omitempty"`
  4821  	// 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.
  4822  	Slices *int32 `json:"slices,omitempty"`
  4823  	// AdaptiveBFrame - Specifies whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use.
  4824  	AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
  4825  	// 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.
  4826  	Width *string `json:"width,omitempty"`
  4827  	// 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.
  4828  	Height *string `json:"height,omitempty"`
  4829  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  4830  	Label *string `json:"label,omitempty"`
  4831  }
  4832  
  4833  // H265Video describes all the properties for encoding a video with the H.265 codec.
  4834  type H265Video struct {
  4835  	// SceneChangeDetection - Specifies whether or not the encoder should insert key frames at scene changes. If not specified, the default is false. This flag should be set to true only when the encoder is being configured to produce a single output video.
  4836  	SceneChangeDetection *bool `json:"sceneChangeDetection,omitempty"`
  4837  	// Complexity - Tells the encoder how to choose its encoding settings.  Quality will provide for a higher compression ratio but at a higher cost and longer compute time.  Speed will produce a relatively larger file but is faster and more economical. The default value is Balanced. Possible values include: 'H265ComplexitySpeed', 'H265ComplexityBalanced', 'H265ComplexityQuality'
  4838  	Complexity H265Complexity `json:"complexity,omitempty"`
  4839  	// Layers - The collection of output H.265 layers to be produced by the encoder.
  4840  	Layers *[]H265Layer `json:"layers,omitempty"`
  4841  	// KeyFrameInterval - The distance between two key frames. The value should be non-zero in the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will follow the input source setting.
  4842  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  4843  	// 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'
  4844  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  4845  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
  4846  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
  4847  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  4848  	Label *string `json:"label,omitempty"`
  4849  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  4850  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  4851  }
  4852  
  4853  // MarshalJSON is the custom marshaler for H265Video.
  4854  func (hv H265Video) MarshalJSON() ([]byte, error) {
  4855  	hv.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video
  4856  	objectMap := make(map[string]interface{})
  4857  	if hv.SceneChangeDetection != nil {
  4858  		objectMap["sceneChangeDetection"] = hv.SceneChangeDetection
  4859  	}
  4860  	if hv.Complexity != "" {
  4861  		objectMap["complexity"] = hv.Complexity
  4862  	}
  4863  	if hv.Layers != nil {
  4864  		objectMap["layers"] = hv.Layers
  4865  	}
  4866  	if hv.KeyFrameInterval != nil {
  4867  		objectMap["keyFrameInterval"] = hv.KeyFrameInterval
  4868  	}
  4869  	if hv.StretchMode != "" {
  4870  		objectMap["stretchMode"] = hv.StretchMode
  4871  	}
  4872  	if hv.SyncMode != "" {
  4873  		objectMap["syncMode"] = hv.SyncMode
  4874  	}
  4875  	if hv.Label != nil {
  4876  		objectMap["label"] = hv.Label
  4877  	}
  4878  	if hv.OdataType != "" {
  4879  		objectMap["@odata.type"] = hv.OdataType
  4880  	}
  4881  	return json.Marshal(objectMap)
  4882  }
  4883  
  4884  // AsAudio is the BasicCodec implementation for H265Video.
  4885  func (hv H265Video) AsAudio() (*Audio, bool) {
  4886  	return nil, false
  4887  }
  4888  
  4889  // AsBasicAudio is the BasicCodec implementation for H265Video.
  4890  func (hv H265Video) AsBasicAudio() (BasicAudio, bool) {
  4891  	return nil, false
  4892  }
  4893  
  4894  // AsAacAudio is the BasicCodec implementation for H265Video.
  4895  func (hv H265Video) AsAacAudio() (*AacAudio, bool) {
  4896  	return nil, false
  4897  }
  4898  
  4899  // AsVideo is the BasicCodec implementation for H265Video.
  4900  func (hv H265Video) AsVideo() (*Video, bool) {
  4901  	return nil, false
  4902  }
  4903  
  4904  // AsBasicVideo is the BasicCodec implementation for H265Video.
  4905  func (hv H265Video) AsBasicVideo() (BasicVideo, bool) {
  4906  	return &hv, true
  4907  }
  4908  
  4909  // AsH265Video is the BasicCodec implementation for H265Video.
  4910  func (hv H265Video) AsH265Video() (*H265Video, bool) {
  4911  	return &hv, true
  4912  }
  4913  
  4914  // AsCopyVideo is the BasicCodec implementation for H265Video.
  4915  func (hv H265Video) AsCopyVideo() (*CopyVideo, bool) {
  4916  	return nil, false
  4917  }
  4918  
  4919  // AsImage is the BasicCodec implementation for H265Video.
  4920  func (hv H265Video) AsImage() (*Image, bool) {
  4921  	return nil, false
  4922  }
  4923  
  4924  // AsBasicImage is the BasicCodec implementation for H265Video.
  4925  func (hv H265Video) AsBasicImage() (BasicImage, bool) {
  4926  	return nil, false
  4927  }
  4928  
  4929  // AsCopyAudio is the BasicCodec implementation for H265Video.
  4930  func (hv H265Video) AsCopyAudio() (*CopyAudio, bool) {
  4931  	return nil, false
  4932  }
  4933  
  4934  // AsH264Video is the BasicCodec implementation for H265Video.
  4935  func (hv H265Video) AsH264Video() (*H264Video, bool) {
  4936  	return nil, false
  4937  }
  4938  
  4939  // AsJpgImage is the BasicCodec implementation for H265Video.
  4940  func (hv H265Video) AsJpgImage() (*JpgImage, bool) {
  4941  	return nil, false
  4942  }
  4943  
  4944  // AsPngImage is the BasicCodec implementation for H265Video.
  4945  func (hv H265Video) AsPngImage() (*PngImage, bool) {
  4946  	return nil, false
  4947  }
  4948  
  4949  // AsCodec is the BasicCodec implementation for H265Video.
  4950  func (hv H265Video) AsCodec() (*Codec, bool) {
  4951  	return nil, false
  4952  }
  4953  
  4954  // AsBasicCodec is the BasicCodec implementation for H265Video.
  4955  func (hv H265Video) AsBasicCodec() (BasicCodec, bool) {
  4956  	return &hv, true
  4957  }
  4958  
  4959  // H265VideoLayer describes the settings to be used when encoding the input video into a desired output
  4960  // bitrate layer.
  4961  type H265VideoLayer struct {
  4962  	// Bitrate - The average bitrate in bits per second at which to encode the input video when generating this layer. For example: a target bitrate of 3000Kbps or 3Mbps means this value should be 3000000 This is a required field.
  4963  	Bitrate *int32 `json:"bitrate,omitempty"`
  4964  	// 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.
  4965  	MaxBitrate *int32 `json:"maxBitrate,omitempty"`
  4966  	// 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.
  4967  	BFrames *int32 `json:"bFrames,omitempty"`
  4968  	// 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.
  4969  	FrameRate *string `json:"frameRate,omitempty"`
  4970  	// 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.
  4971  	Slices *int32 `json:"slices,omitempty"`
  4972  	// AdaptiveBFrame - Specifies whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use.
  4973  	AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
  4974  	// 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.
  4975  	Width *string `json:"width,omitempty"`
  4976  	// 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.
  4977  	Height *string `json:"height,omitempty"`
  4978  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  4979  	Label *string `json:"label,omitempty"`
  4980  }
  4981  
  4982  // Hls HTTP Live Streaming (HLS) packing setting for the live output.
  4983  type Hls struct {
  4984  	// FragmentsPerTsSegment - The number of fragments in an HTTP Live Streaming (HLS) TS segment in the output of the live event. This value does not affect the packing ratio for HLS CMAF output.
  4985  	FragmentsPerTsSegment *int32 `json:"fragmentsPerTsSegment,omitempty"`
  4986  }
  4987  
  4988  // HlsSettings the HLS setting for a text track.
  4989  type HlsSettings struct {
  4990  	// Default - The default for the HLS setting.
  4991  	Default *bool `json:"default,omitempty"`
  4992  	// Forced - The forced for the HLS setting.
  4993  	Forced *bool `json:"forced,omitempty"`
  4994  	// Characteristics - The characteristics for the HLS setting.
  4995  	Characteristics *string `json:"characteristics,omitempty"`
  4996  }
  4997  
  4998  // BasicImage describes the basic properties for generating thumbnails from the input video
  4999  type BasicImage interface {
  5000  	AsJpgImage() (*JpgImage, bool)
  5001  	AsPngImage() (*PngImage, bool)
  5002  	AsImage() (*Image, bool)
  5003  }
  5004  
  5005  // Image describes the basic properties for generating thumbnails from the input video
  5006  type Image struct {
  5007  	// Start - The position in the input video from where to start generating thumbnails. The value can be in ISO 8601 format (For example, PT05S to start at 5 seconds), or a frame count (For example, 10 to start at the 10th frame), or a relative value to stream duration (For example, 10% to start at 10% of stream duration). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video and will only produce one thumbnail, no matter what other settings are for Step and Range. The default value is macro {Best}.
  5008  	Start *string `json:"start,omitempty"`
  5009  	// Step - The intervals at which thumbnails are generated. The value can be in ISO 8601 format (For example, PT05S for one image every 5 seconds), or a frame count (For example, 30 for one image every 30 frames), or a relative value to stream duration (For example, 10% for one image every 10% of stream duration). Note: Step value will affect the first generated thumbnail, which may not be exactly the one specified at transform preset start time. This is due to the encoder, which tries to select the best thumbnail between start time and Step position from start time as the first output. As the default value is 10%, it means if stream has long duration, the first generated thumbnail might be far away from the one specified at start time. Try to select reasonable value for Step if the first thumbnail is expected close to start time, or set Range value at 1 if only one thumbnail is needed at start time.
  5010  	Step *string `json:"step,omitempty"`
  5011  	// Range - The position relative to transform preset start time in the input video at which to stop generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to stop at 5 minutes and 30 seconds from start time), or a frame count (For example, 300 to stop at the 300th frame from the frame at start time. If this value is 1, it means only producing one thumbnail at start time), or a relative value to the stream duration (For example, 50% to stop at half of stream duration from start time). The default value is 100%, which means to stop at the end of the stream.
  5012  	Range *string `json:"range,omitempty"`
  5013  	// KeyFrameInterval - The distance between two key frames. The value should be non-zero in the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will follow the input source setting.
  5014  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  5015  	// 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'
  5016  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  5017  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
  5018  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
  5019  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  5020  	Label *string `json:"label,omitempty"`
  5021  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  5022  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  5023  }
  5024  
  5025  func unmarshalBasicImage(body []byte) (BasicImage, error) {
  5026  	var m map[string]interface{}
  5027  	err := json.Unmarshal(body, &m)
  5028  	if err != nil {
  5029  		return nil, err
  5030  	}
  5031  
  5032  	switch m["@odata.type"] {
  5033  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage):
  5034  		var ji JpgImage
  5035  		err := json.Unmarshal(body, &ji)
  5036  		return ji, err
  5037  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage):
  5038  		var pi PngImage
  5039  		err := json.Unmarshal(body, &pi)
  5040  		return pi, err
  5041  	default:
  5042  		var i Image
  5043  		err := json.Unmarshal(body, &i)
  5044  		return i, err
  5045  	}
  5046  }
  5047  func unmarshalBasicImageArray(body []byte) ([]BasicImage, error) {
  5048  	var rawMessages []*json.RawMessage
  5049  	err := json.Unmarshal(body, &rawMessages)
  5050  	if err != nil {
  5051  		return nil, err
  5052  	}
  5053  
  5054  	iArray := make([]BasicImage, len(rawMessages))
  5055  
  5056  	for index, rawMessage := range rawMessages {
  5057  		i, err := unmarshalBasicImage(*rawMessage)
  5058  		if err != nil {
  5059  			return nil, err
  5060  		}
  5061  		iArray[index] = i
  5062  	}
  5063  	return iArray, nil
  5064  }
  5065  
  5066  // MarshalJSON is the custom marshaler for Image.
  5067  func (i Image) MarshalJSON() ([]byte, error) {
  5068  	i.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaImage
  5069  	objectMap := make(map[string]interface{})
  5070  	if i.Start != nil {
  5071  		objectMap["start"] = i.Start
  5072  	}
  5073  	if i.Step != nil {
  5074  		objectMap["step"] = i.Step
  5075  	}
  5076  	if i.Range != nil {
  5077  		objectMap["range"] = i.Range
  5078  	}
  5079  	if i.KeyFrameInterval != nil {
  5080  		objectMap["keyFrameInterval"] = i.KeyFrameInterval
  5081  	}
  5082  	if i.StretchMode != "" {
  5083  		objectMap["stretchMode"] = i.StretchMode
  5084  	}
  5085  	if i.SyncMode != "" {
  5086  		objectMap["syncMode"] = i.SyncMode
  5087  	}
  5088  	if i.Label != nil {
  5089  		objectMap["label"] = i.Label
  5090  	}
  5091  	if i.OdataType != "" {
  5092  		objectMap["@odata.type"] = i.OdataType
  5093  	}
  5094  	return json.Marshal(objectMap)
  5095  }
  5096  
  5097  // AsAudio is the BasicCodec implementation for Image.
  5098  func (i Image) AsAudio() (*Audio, bool) {
  5099  	return nil, false
  5100  }
  5101  
  5102  // AsBasicAudio is the BasicCodec implementation for Image.
  5103  func (i Image) AsBasicAudio() (BasicAudio, bool) {
  5104  	return nil, false
  5105  }
  5106  
  5107  // AsAacAudio is the BasicCodec implementation for Image.
  5108  func (i Image) AsAacAudio() (*AacAudio, bool) {
  5109  	return nil, false
  5110  }
  5111  
  5112  // AsVideo is the BasicCodec implementation for Image.
  5113  func (i Image) AsVideo() (*Video, bool) {
  5114  	return nil, false
  5115  }
  5116  
  5117  // AsBasicVideo is the BasicCodec implementation for Image.
  5118  func (i Image) AsBasicVideo() (BasicVideo, bool) {
  5119  	return &i, true
  5120  }
  5121  
  5122  // AsH265Video is the BasicCodec implementation for Image.
  5123  func (i Image) AsH265Video() (*H265Video, bool) {
  5124  	return nil, false
  5125  }
  5126  
  5127  // AsCopyVideo is the BasicCodec implementation for Image.
  5128  func (i Image) AsCopyVideo() (*CopyVideo, bool) {
  5129  	return nil, false
  5130  }
  5131  
  5132  // AsImage is the BasicCodec implementation for Image.
  5133  func (i Image) AsImage() (*Image, bool) {
  5134  	return &i, true
  5135  }
  5136  
  5137  // AsBasicImage is the BasicCodec implementation for Image.
  5138  func (i Image) AsBasicImage() (BasicImage, bool) {
  5139  	return &i, true
  5140  }
  5141  
  5142  // AsCopyAudio is the BasicCodec implementation for Image.
  5143  func (i Image) AsCopyAudio() (*CopyAudio, bool) {
  5144  	return nil, false
  5145  }
  5146  
  5147  // AsH264Video is the BasicCodec implementation for Image.
  5148  func (i Image) AsH264Video() (*H264Video, bool) {
  5149  	return nil, false
  5150  }
  5151  
  5152  // AsJpgImage is the BasicCodec implementation for Image.
  5153  func (i Image) AsJpgImage() (*JpgImage, bool) {
  5154  	return nil, false
  5155  }
  5156  
  5157  // AsPngImage is the BasicCodec implementation for Image.
  5158  func (i Image) AsPngImage() (*PngImage, bool) {
  5159  	return nil, false
  5160  }
  5161  
  5162  // AsCodec is the BasicCodec implementation for Image.
  5163  func (i Image) AsCodec() (*Codec, bool) {
  5164  	return nil, false
  5165  }
  5166  
  5167  // AsBasicCodec is the BasicCodec implementation for Image.
  5168  func (i Image) AsBasicCodec() (BasicCodec, bool) {
  5169  	return &i, true
  5170  }
  5171  
  5172  // BasicImageFormat describes the properties for an output image file.
  5173  type BasicImageFormat interface {
  5174  	AsJpgFormat() (*JpgFormat, bool)
  5175  	AsPngFormat() (*PngFormat, bool)
  5176  	AsImageFormat() (*ImageFormat, bool)
  5177  }
  5178  
  5179  // ImageFormat describes the properties for an output image file.
  5180  type ImageFormat struct {
  5181  	// FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of input video files will be used. If the length of base name of the input video file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename.
  5182  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  5183  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  5184  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  5185  }
  5186  
  5187  func unmarshalBasicImageFormat(body []byte) (BasicImageFormat, error) {
  5188  	var m map[string]interface{}
  5189  	err := json.Unmarshal(body, &m)
  5190  	if err != nil {
  5191  		return nil, err
  5192  	}
  5193  
  5194  	switch m["@odata.type"] {
  5195  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat):
  5196  		var jf JpgFormat
  5197  		err := json.Unmarshal(body, &jf)
  5198  		return jf, err
  5199  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat):
  5200  		var pf PngFormat
  5201  		err := json.Unmarshal(body, &pf)
  5202  		return pf, err
  5203  	default:
  5204  		var ifVar ImageFormat
  5205  		err := json.Unmarshal(body, &ifVar)
  5206  		return ifVar, err
  5207  	}
  5208  }
  5209  func unmarshalBasicImageFormatArray(body []byte) ([]BasicImageFormat, error) {
  5210  	var rawMessages []*json.RawMessage
  5211  	err := json.Unmarshal(body, &rawMessages)
  5212  	if err != nil {
  5213  		return nil, err
  5214  	}
  5215  
  5216  	ifVarArray := make([]BasicImageFormat, len(rawMessages))
  5217  
  5218  	for index, rawMessage := range rawMessages {
  5219  		ifVar, err := unmarshalBasicImageFormat(*rawMessage)
  5220  		if err != nil {
  5221  			return nil, err
  5222  		}
  5223  		ifVarArray[index] = ifVar
  5224  	}
  5225  	return ifVarArray, nil
  5226  }
  5227  
  5228  // MarshalJSON is the custom marshaler for ImageFormat.
  5229  func (ifVar ImageFormat) MarshalJSON() ([]byte, error) {
  5230  	ifVar.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat
  5231  	objectMap := make(map[string]interface{})
  5232  	if ifVar.FilenamePattern != nil {
  5233  		objectMap["filenamePattern"] = ifVar.FilenamePattern
  5234  	}
  5235  	if ifVar.OdataType != "" {
  5236  		objectMap["@odata.type"] = ifVar.OdataType
  5237  	}
  5238  	return json.Marshal(objectMap)
  5239  }
  5240  
  5241  // AsImageFormat is the BasicFormat implementation for ImageFormat.
  5242  func (ifVar ImageFormat) AsImageFormat() (*ImageFormat, bool) {
  5243  	return &ifVar, true
  5244  }
  5245  
  5246  // AsBasicImageFormat is the BasicFormat implementation for ImageFormat.
  5247  func (ifVar ImageFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
  5248  	return &ifVar, true
  5249  }
  5250  
  5251  // AsJpgFormat is the BasicFormat implementation for ImageFormat.
  5252  func (ifVar ImageFormat) AsJpgFormat() (*JpgFormat, bool) {
  5253  	return nil, false
  5254  }
  5255  
  5256  // AsPngFormat is the BasicFormat implementation for ImageFormat.
  5257  func (ifVar ImageFormat) AsPngFormat() (*PngFormat, bool) {
  5258  	return nil, false
  5259  }
  5260  
  5261  // AsMultiBitrateFormat is the BasicFormat implementation for ImageFormat.
  5262  func (ifVar ImageFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  5263  	return nil, false
  5264  }
  5265  
  5266  // AsBasicMultiBitrateFormat is the BasicFormat implementation for ImageFormat.
  5267  func (ifVar ImageFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  5268  	return nil, false
  5269  }
  5270  
  5271  // AsMp4Format is the BasicFormat implementation for ImageFormat.
  5272  func (ifVar ImageFormat) AsMp4Format() (*Mp4Format, bool) {
  5273  	return nil, false
  5274  }
  5275  
  5276  // AsTransportStreamFormat is the BasicFormat implementation for ImageFormat.
  5277  func (ifVar ImageFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  5278  	return nil, false
  5279  }
  5280  
  5281  // AsFormat is the BasicFormat implementation for ImageFormat.
  5282  func (ifVar ImageFormat) AsFormat() (*Format, bool) {
  5283  	return nil, false
  5284  }
  5285  
  5286  // AsBasicFormat is the BasicFormat implementation for ImageFormat.
  5287  func (ifVar ImageFormat) AsBasicFormat() (BasicFormat, bool) {
  5288  	return &ifVar, true
  5289  }
  5290  
  5291  // BasicInputDefinition base class for defining an input. Use sub classes of this class to specify tracks selections
  5292  // and related metadata.
  5293  type BasicInputDefinition interface {
  5294  	AsFromAllInputFile() (*FromAllInputFile, bool)
  5295  	AsFromEachInputFile() (*FromEachInputFile, bool)
  5296  	AsInputFile() (*InputFile, bool)
  5297  	AsInputDefinition() (*InputDefinition, bool)
  5298  }
  5299  
  5300  // InputDefinition base class for defining an input. Use sub classes of this class to specify tracks selections
  5301  // and related metadata.
  5302  type InputDefinition struct {
  5303  	// IncludedTracks - The list of TrackDescriptors which define the metadata and selection of tracks in the input.
  5304  	IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
  5305  	// OdataType - Possible values include: 'OdataTypeBasicInputDefinitionOdataTypeInputDefinition', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile'
  5306  	OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
  5307  }
  5308  
  5309  func unmarshalBasicInputDefinition(body []byte) (BasicInputDefinition, error) {
  5310  	var m map[string]interface{}
  5311  	err := json.Unmarshal(body, &m)
  5312  	if err != nil {
  5313  		return nil, err
  5314  	}
  5315  
  5316  	switch m["@odata.type"] {
  5317  	case string(OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile):
  5318  		var faif FromAllInputFile
  5319  		err := json.Unmarshal(body, &faif)
  5320  		return faif, err
  5321  	case string(OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile):
  5322  		var feif FromEachInputFile
  5323  		err := json.Unmarshal(body, &feif)
  5324  		return feif, err
  5325  	case string(OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile):
  5326  		var ifVar InputFile
  5327  		err := json.Unmarshal(body, &ifVar)
  5328  		return ifVar, err
  5329  	default:
  5330  		var ID InputDefinition
  5331  		err := json.Unmarshal(body, &ID)
  5332  		return ID, err
  5333  	}
  5334  }
  5335  func unmarshalBasicInputDefinitionArray(body []byte) ([]BasicInputDefinition, error) {
  5336  	var rawMessages []*json.RawMessage
  5337  	err := json.Unmarshal(body, &rawMessages)
  5338  	if err != nil {
  5339  		return nil, err
  5340  	}
  5341  
  5342  	IDArray := make([]BasicInputDefinition, len(rawMessages))
  5343  
  5344  	for index, rawMessage := range rawMessages {
  5345  		ID, err := unmarshalBasicInputDefinition(*rawMessage)
  5346  		if err != nil {
  5347  			return nil, err
  5348  		}
  5349  		IDArray[index] = ID
  5350  	}
  5351  	return IDArray, nil
  5352  }
  5353  
  5354  // MarshalJSON is the custom marshaler for InputDefinition.
  5355  func (ID InputDefinition) MarshalJSON() ([]byte, error) {
  5356  	ID.OdataType = OdataTypeBasicInputDefinitionOdataTypeInputDefinition
  5357  	objectMap := make(map[string]interface{})
  5358  	if ID.IncludedTracks != nil {
  5359  		objectMap["includedTracks"] = ID.IncludedTracks
  5360  	}
  5361  	if ID.OdataType != "" {
  5362  		objectMap["@odata.type"] = ID.OdataType
  5363  	}
  5364  	return json.Marshal(objectMap)
  5365  }
  5366  
  5367  // AsFromAllInputFile is the BasicInputDefinition implementation for InputDefinition.
  5368  func (ID InputDefinition) AsFromAllInputFile() (*FromAllInputFile, bool) {
  5369  	return nil, false
  5370  }
  5371  
  5372  // AsFromEachInputFile is the BasicInputDefinition implementation for InputDefinition.
  5373  func (ID InputDefinition) AsFromEachInputFile() (*FromEachInputFile, bool) {
  5374  	return nil, false
  5375  }
  5376  
  5377  // AsInputFile is the BasicInputDefinition implementation for InputDefinition.
  5378  func (ID InputDefinition) AsInputFile() (*InputFile, bool) {
  5379  	return nil, false
  5380  }
  5381  
  5382  // AsInputDefinition is the BasicInputDefinition implementation for InputDefinition.
  5383  func (ID InputDefinition) AsInputDefinition() (*InputDefinition, bool) {
  5384  	return &ID, true
  5385  }
  5386  
  5387  // AsBasicInputDefinition is the BasicInputDefinition implementation for InputDefinition.
  5388  func (ID InputDefinition) AsBasicInputDefinition() (BasicInputDefinition, bool) {
  5389  	return &ID, true
  5390  }
  5391  
  5392  // UnmarshalJSON is the custom unmarshaler for InputDefinition struct.
  5393  func (ID *InputDefinition) UnmarshalJSON(body []byte) error {
  5394  	var m map[string]*json.RawMessage
  5395  	err := json.Unmarshal(body, &m)
  5396  	if err != nil {
  5397  		return err
  5398  	}
  5399  	for k, v := range m {
  5400  		switch k {
  5401  		case "includedTracks":
  5402  			if v != nil {
  5403  				includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
  5404  				if err != nil {
  5405  					return err
  5406  				}
  5407  				ID.IncludedTracks = &includedTracks
  5408  			}
  5409  		case "@odata.type":
  5410  			if v != nil {
  5411  				var odataType OdataTypeBasicInputDefinition
  5412  				err = json.Unmarshal(*v, &odataType)
  5413  				if err != nil {
  5414  					return err
  5415  				}
  5416  				ID.OdataType = odataType
  5417  			}
  5418  		}
  5419  	}
  5420  
  5421  	return nil
  5422  }
  5423  
  5424  // InputFile an InputDefinition for a single file.  TrackSelections are scoped to the file specified.
  5425  type InputFile struct {
  5426  	// Filename - Name of the file that this input definition applies to.
  5427  	Filename *string `json:"filename,omitempty"`
  5428  	// IncludedTracks - The list of TrackDescriptors which define the metadata and selection of tracks in the input.
  5429  	IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
  5430  	// OdataType - Possible values include: 'OdataTypeBasicInputDefinitionOdataTypeInputDefinition', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile'
  5431  	OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
  5432  }
  5433  
  5434  // MarshalJSON is the custom marshaler for InputFile.
  5435  func (ifVar InputFile) MarshalJSON() ([]byte, error) {
  5436  	ifVar.OdataType = OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile
  5437  	objectMap := make(map[string]interface{})
  5438  	if ifVar.Filename != nil {
  5439  		objectMap["filename"] = ifVar.Filename
  5440  	}
  5441  	if ifVar.IncludedTracks != nil {
  5442  		objectMap["includedTracks"] = ifVar.IncludedTracks
  5443  	}
  5444  	if ifVar.OdataType != "" {
  5445  		objectMap["@odata.type"] = ifVar.OdataType
  5446  	}
  5447  	return json.Marshal(objectMap)
  5448  }
  5449  
  5450  // AsFromAllInputFile is the BasicInputDefinition implementation for InputFile.
  5451  func (ifVar InputFile) AsFromAllInputFile() (*FromAllInputFile, bool) {
  5452  	return nil, false
  5453  }
  5454  
  5455  // AsFromEachInputFile is the BasicInputDefinition implementation for InputFile.
  5456  func (ifVar InputFile) AsFromEachInputFile() (*FromEachInputFile, bool) {
  5457  	return nil, false
  5458  }
  5459  
  5460  // AsInputFile is the BasicInputDefinition implementation for InputFile.
  5461  func (ifVar InputFile) AsInputFile() (*InputFile, bool) {
  5462  	return &ifVar, true
  5463  }
  5464  
  5465  // AsInputDefinition is the BasicInputDefinition implementation for InputFile.
  5466  func (ifVar InputFile) AsInputDefinition() (*InputDefinition, bool) {
  5467  	return nil, false
  5468  }
  5469  
  5470  // AsBasicInputDefinition is the BasicInputDefinition implementation for InputFile.
  5471  func (ifVar InputFile) AsBasicInputDefinition() (BasicInputDefinition, bool) {
  5472  	return &ifVar, true
  5473  }
  5474  
  5475  // UnmarshalJSON is the custom unmarshaler for InputFile struct.
  5476  func (ifVar *InputFile) UnmarshalJSON(body []byte) error {
  5477  	var m map[string]*json.RawMessage
  5478  	err := json.Unmarshal(body, &m)
  5479  	if err != nil {
  5480  		return err
  5481  	}
  5482  	for k, v := range m {
  5483  		switch k {
  5484  		case "filename":
  5485  			if v != nil {
  5486  				var filename string
  5487  				err = json.Unmarshal(*v, &filename)
  5488  				if err != nil {
  5489  					return err
  5490  				}
  5491  				ifVar.Filename = &filename
  5492  			}
  5493  		case "includedTracks":
  5494  			if v != nil {
  5495  				includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
  5496  				if err != nil {
  5497  					return err
  5498  				}
  5499  				ifVar.IncludedTracks = &includedTracks
  5500  			}
  5501  		case "@odata.type":
  5502  			if v != nil {
  5503  				var odataType OdataTypeBasicInputDefinition
  5504  				err = json.Unmarshal(*v, &odataType)
  5505  				if err != nil {
  5506  					return err
  5507  				}
  5508  				ifVar.OdataType = odataType
  5509  			}
  5510  		}
  5511  	}
  5512  
  5513  	return nil
  5514  }
  5515  
  5516  // IPAccessControl the IP access control.
  5517  type IPAccessControl struct {
  5518  	// Allow - The IP allow list.
  5519  	Allow *[]IPRange `json:"allow,omitempty"`
  5520  }
  5521  
  5522  // IPRange the IP address range in the CIDR scheme.
  5523  type IPRange struct {
  5524  	// Name - The friendly name for the IP address range.
  5525  	Name *string `json:"name,omitempty"`
  5526  	// Address - The IP address.
  5527  	Address *string `json:"address,omitempty"`
  5528  	// SubnetPrefixLength - The subnet mask prefix length (see CIDR notation).
  5529  	SubnetPrefixLength *int32 `json:"subnetPrefixLength,omitempty"`
  5530  }
  5531  
  5532  // Job a Job resource type. The progress and state can be obtained by polling a Job or subscribing to
  5533  // events using EventGrid.
  5534  type Job struct {
  5535  	autorest.Response `json:"-"`
  5536  	// JobProperties - The resource properties.
  5537  	*JobProperties `json:"properties,omitempty"`
  5538  	// SystemData - READ-ONLY; The system metadata relating to this resource.
  5539  	SystemData *SystemData `json:"systemData,omitempty"`
  5540  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  5541  	ID *string `json:"id,omitempty"`
  5542  	// Name - READ-ONLY; The name of the resource
  5543  	Name *string `json:"name,omitempty"`
  5544  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  5545  	Type *string `json:"type,omitempty"`
  5546  }
  5547  
  5548  // MarshalJSON is the custom marshaler for Job.
  5549  func (j Job) MarshalJSON() ([]byte, error) {
  5550  	objectMap := make(map[string]interface{})
  5551  	if j.JobProperties != nil {
  5552  		objectMap["properties"] = j.JobProperties
  5553  	}
  5554  	return json.Marshal(objectMap)
  5555  }
  5556  
  5557  // UnmarshalJSON is the custom unmarshaler for Job struct.
  5558  func (j *Job) UnmarshalJSON(body []byte) error {
  5559  	var m map[string]*json.RawMessage
  5560  	err := json.Unmarshal(body, &m)
  5561  	if err != nil {
  5562  		return err
  5563  	}
  5564  	for k, v := range m {
  5565  		switch k {
  5566  		case "properties":
  5567  			if v != nil {
  5568  				var jobProperties JobProperties
  5569  				err = json.Unmarshal(*v, &jobProperties)
  5570  				if err != nil {
  5571  					return err
  5572  				}
  5573  				j.JobProperties = &jobProperties
  5574  			}
  5575  		case "systemData":
  5576  			if v != nil {
  5577  				var systemData SystemData
  5578  				err = json.Unmarshal(*v, &systemData)
  5579  				if err != nil {
  5580  					return err
  5581  				}
  5582  				j.SystemData = &systemData
  5583  			}
  5584  		case "id":
  5585  			if v != nil {
  5586  				var ID string
  5587  				err = json.Unmarshal(*v, &ID)
  5588  				if err != nil {
  5589  					return err
  5590  				}
  5591  				j.ID = &ID
  5592  			}
  5593  		case "name":
  5594  			if v != nil {
  5595  				var name string
  5596  				err = json.Unmarshal(*v, &name)
  5597  				if err != nil {
  5598  					return err
  5599  				}
  5600  				j.Name = &name
  5601  			}
  5602  		case "type":
  5603  			if v != nil {
  5604  				var typeVar string
  5605  				err = json.Unmarshal(*v, &typeVar)
  5606  				if err != nil {
  5607  					return err
  5608  				}
  5609  				j.Type = &typeVar
  5610  			}
  5611  		}
  5612  	}
  5613  
  5614  	return nil
  5615  }
  5616  
  5617  // JobCollection a collection of Job items.
  5618  type JobCollection struct {
  5619  	autorest.Response `json:"-"`
  5620  	// Value - A collection of Job items.
  5621  	Value *[]Job `json:"value,omitempty"`
  5622  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
  5623  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
  5624  }
  5625  
  5626  // JobCollectionIterator provides access to a complete listing of Job values.
  5627  type JobCollectionIterator struct {
  5628  	i    int
  5629  	page JobCollectionPage
  5630  }
  5631  
  5632  // NextWithContext advances to the next value.  If there was an error making
  5633  // the request the iterator does not advance and the error is returned.
  5634  func (iter *JobCollectionIterator) NextWithContext(ctx context.Context) (err error) {
  5635  	if tracing.IsEnabled() {
  5636  		ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionIterator.NextWithContext")
  5637  		defer func() {
  5638  			sc := -1
  5639  			if iter.Response().Response.Response != nil {
  5640  				sc = iter.Response().Response.Response.StatusCode
  5641  			}
  5642  			tracing.EndSpan(ctx, sc, err)
  5643  		}()
  5644  	}
  5645  	iter.i++
  5646  	if iter.i < len(iter.page.Values()) {
  5647  		return nil
  5648  	}
  5649  	err = iter.page.NextWithContext(ctx)
  5650  	if err != nil {
  5651  		iter.i--
  5652  		return err
  5653  	}
  5654  	iter.i = 0
  5655  	return nil
  5656  }
  5657  
  5658  // Next advances to the next value.  If there was an error making
  5659  // the request the iterator does not advance and the error is returned.
  5660  // Deprecated: Use NextWithContext() instead.
  5661  func (iter *JobCollectionIterator) Next() error {
  5662  	return iter.NextWithContext(context.Background())
  5663  }
  5664  
  5665  // NotDone returns true if the enumeration should be started or is not yet complete.
  5666  func (iter JobCollectionIterator) NotDone() bool {
  5667  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  5668  }
  5669  
  5670  // Response returns the raw server response from the last page request.
  5671  func (iter JobCollectionIterator) Response() JobCollection {
  5672  	return iter.page.Response()
  5673  }
  5674  
  5675  // Value returns the current value or a zero-initialized value if the
  5676  // iterator has advanced beyond the end of the collection.
  5677  func (iter JobCollectionIterator) Value() Job {
  5678  	if !iter.page.NotDone() {
  5679  		return Job{}
  5680  	}
  5681  	return iter.page.Values()[iter.i]
  5682  }
  5683  
  5684  // Creates a new instance of the JobCollectionIterator type.
  5685  func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator {
  5686  	return JobCollectionIterator{page: page}
  5687  }
  5688  
  5689  // IsEmpty returns true if the ListResult contains no values.
  5690  func (jc JobCollection) IsEmpty() bool {
  5691  	return jc.Value == nil || len(*jc.Value) == 0
  5692  }
  5693  
  5694  // hasNextLink returns true if the NextLink is not empty.
  5695  func (jc JobCollection) hasNextLink() bool {
  5696  	return jc.OdataNextLink != nil && len(*jc.OdataNextLink) != 0
  5697  }
  5698  
  5699  // jobCollectionPreparer prepares a request to retrieve the next set of results.
  5700  // It returns nil if no more results exist.
  5701  func (jc JobCollection) jobCollectionPreparer(ctx context.Context) (*http.Request, error) {
  5702  	if !jc.hasNextLink() {
  5703  		return nil, nil
  5704  	}
  5705  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  5706  		autorest.AsJSON(),
  5707  		autorest.AsGet(),
  5708  		autorest.WithBaseURL(to.String(jc.OdataNextLink)))
  5709  }
  5710  
  5711  // JobCollectionPage contains a page of Job values.
  5712  type JobCollectionPage struct {
  5713  	fn func(context.Context, JobCollection) (JobCollection, error)
  5714  	jc JobCollection
  5715  }
  5716  
  5717  // NextWithContext advances to the next page of values.  If there was an error making
  5718  // the request the page does not advance and the error is returned.
  5719  func (page *JobCollectionPage) NextWithContext(ctx context.Context) (err error) {
  5720  	if tracing.IsEnabled() {
  5721  		ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionPage.NextWithContext")
  5722  		defer func() {
  5723  			sc := -1
  5724  			if page.Response().Response.Response != nil {
  5725  				sc = page.Response().Response.Response.StatusCode
  5726  			}
  5727  			tracing.EndSpan(ctx, sc, err)
  5728  		}()
  5729  	}
  5730  	for {
  5731  		next, err := page.fn(ctx, page.jc)
  5732  		if err != nil {
  5733  			return err
  5734  		}
  5735  		page.jc = next
  5736  		if !next.hasNextLink() || !next.IsEmpty() {
  5737  			break
  5738  		}
  5739  	}
  5740  	return nil
  5741  }
  5742  
  5743  // Next advances to the next page of values.  If there was an error making
  5744  // the request the page does not advance and the error is returned.
  5745  // Deprecated: Use NextWithContext() instead.
  5746  func (page *JobCollectionPage) Next() error {
  5747  	return page.NextWithContext(context.Background())
  5748  }
  5749  
  5750  // NotDone returns true if the page enumeration should be started or is not yet complete.
  5751  func (page JobCollectionPage) NotDone() bool {
  5752  	return !page.jc.IsEmpty()
  5753  }
  5754  
  5755  // Response returns the raw server response from the last page request.
  5756  func (page JobCollectionPage) Response() JobCollection {
  5757  	return page.jc
  5758  }
  5759  
  5760  // Values returns the slice of values for the current page or nil if there are no values.
  5761  func (page JobCollectionPage) Values() []Job {
  5762  	if page.jc.IsEmpty() {
  5763  		return nil
  5764  	}
  5765  	return *page.jc.Value
  5766  }
  5767  
  5768  // Creates a new instance of the JobCollectionPage type.
  5769  func NewJobCollectionPage(cur JobCollection, getNextPage func(context.Context, JobCollection) (JobCollection, error)) JobCollectionPage {
  5770  	return JobCollectionPage{
  5771  		fn: getNextPage,
  5772  		jc: cur,
  5773  	}
  5774  }
  5775  
  5776  // JobError details of JobOutput errors.
  5777  type JobError struct {
  5778  	// Code - READ-ONLY; Error code describing the error. Possible values include: 'JobErrorCodeServiceError', 'JobErrorCodeServiceTransientError', 'JobErrorCodeDownloadNotAccessible', 'JobErrorCodeDownloadTransientError', 'JobErrorCodeUploadNotAccessible', 'JobErrorCodeUploadTransientError', 'JobErrorCodeConfigurationUnsupported', 'JobErrorCodeContentMalformed', 'JobErrorCodeContentUnsupported'
  5779  	Code JobErrorCode `json:"code,omitempty"`
  5780  	// Message - READ-ONLY; A human-readable language-dependent representation of the error.
  5781  	Message *string `json:"message,omitempty"`
  5782  	// Category - READ-ONLY; Helps with categorization of errors. Possible values include: 'JobErrorCategoryService', 'JobErrorCategoryDownload', 'JobErrorCategoryUpload', 'JobErrorCategoryConfiguration', 'JobErrorCategoryContent'
  5783  	Category JobErrorCategory `json:"category,omitempty"`
  5784  	// 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: 'JobRetryDoNotRetry', 'JobRetryMayRetry'
  5785  	Retry JobRetry `json:"retry,omitempty"`
  5786  	// Details - READ-ONLY; An array of details about specific errors that led to this reported error.
  5787  	Details *[]JobErrorDetail `json:"details,omitempty"`
  5788  }
  5789  
  5790  // MarshalJSON is the custom marshaler for JobError.
  5791  func (je JobError) MarshalJSON() ([]byte, error) {
  5792  	objectMap := make(map[string]interface{})
  5793  	return json.Marshal(objectMap)
  5794  }
  5795  
  5796  // JobErrorDetail details of JobOutput errors.
  5797  type JobErrorDetail struct {
  5798  	// Code - READ-ONLY; Code describing the error detail.
  5799  	Code *string `json:"code,omitempty"`
  5800  	// Message - READ-ONLY; A human-readable representation of the error.
  5801  	Message *string `json:"message,omitempty"`
  5802  }
  5803  
  5804  // MarshalJSON is the custom marshaler for JobErrorDetail.
  5805  func (jed JobErrorDetail) MarshalJSON() ([]byte, error) {
  5806  	objectMap := make(map[string]interface{})
  5807  	return json.Marshal(objectMap)
  5808  }
  5809  
  5810  // BasicJobInput base class for inputs to a Job.
  5811  type BasicJobInput interface {
  5812  	AsJobInputClip() (*JobInputClip, bool)
  5813  	AsBasicJobInputClip() (BasicJobInputClip, bool)
  5814  	AsJobInputs() (*JobInputs, bool)
  5815  	AsJobInputAsset() (*JobInputAsset, bool)
  5816  	AsJobInputHTTP() (*JobInputHTTP, bool)
  5817  	AsJobInputSequence() (*JobInputSequence, bool)
  5818  	AsJobInput() (*JobInput, bool)
  5819  }
  5820  
  5821  // JobInput base class for inputs to a Job.
  5822  type JobInput struct {
  5823  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  5824  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  5825  }
  5826  
  5827  func unmarshalBasicJobInput(body []byte) (BasicJobInput, error) {
  5828  	var m map[string]interface{}
  5829  	err := json.Unmarshal(body, &m)
  5830  	if err != nil {
  5831  		return nil, err
  5832  	}
  5833  
  5834  	switch m["@odata.type"] {
  5835  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip):
  5836  		var jic JobInputClip
  5837  		err := json.Unmarshal(body, &jic)
  5838  		return jic, err
  5839  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs):
  5840  		var ji JobInputs
  5841  		err := json.Unmarshal(body, &ji)
  5842  		return ji, err
  5843  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset):
  5844  		var jia JobInputAsset
  5845  		err := json.Unmarshal(body, &jia)
  5846  		return jia, err
  5847  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP):
  5848  		var jih JobInputHTTP
  5849  		err := json.Unmarshal(body, &jih)
  5850  		return jih, err
  5851  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence):
  5852  		var jis JobInputSequence
  5853  		err := json.Unmarshal(body, &jis)
  5854  		return jis, err
  5855  	default:
  5856  		var ji JobInput
  5857  		err := json.Unmarshal(body, &ji)
  5858  		return ji, err
  5859  	}
  5860  }
  5861  func unmarshalBasicJobInputArray(body []byte) ([]BasicJobInput, error) {
  5862  	var rawMessages []*json.RawMessage
  5863  	err := json.Unmarshal(body, &rawMessages)
  5864  	if err != nil {
  5865  		return nil, err
  5866  	}
  5867  
  5868  	jiArray := make([]BasicJobInput, len(rawMessages))
  5869  
  5870  	for index, rawMessage := range rawMessages {
  5871  		ji, err := unmarshalBasicJobInput(*rawMessage)
  5872  		if err != nil {
  5873  			return nil, err
  5874  		}
  5875  		jiArray[index] = ji
  5876  	}
  5877  	return jiArray, nil
  5878  }
  5879  
  5880  // MarshalJSON is the custom marshaler for JobInput.
  5881  func (ji JobInput) MarshalJSON() ([]byte, error) {
  5882  	ji.OdataType = OdataTypeBasicJobInputOdataTypeJobInput
  5883  	objectMap := make(map[string]interface{})
  5884  	if ji.OdataType != "" {
  5885  		objectMap["@odata.type"] = ji.OdataType
  5886  	}
  5887  	return json.Marshal(objectMap)
  5888  }
  5889  
  5890  // AsJobInputClip is the BasicJobInput implementation for JobInput.
  5891  func (ji JobInput) AsJobInputClip() (*JobInputClip, bool) {
  5892  	return nil, false
  5893  }
  5894  
  5895  // AsBasicJobInputClip is the BasicJobInput implementation for JobInput.
  5896  func (ji JobInput) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  5897  	return nil, false
  5898  }
  5899  
  5900  // AsJobInputs is the BasicJobInput implementation for JobInput.
  5901  func (ji JobInput) AsJobInputs() (*JobInputs, bool) {
  5902  	return nil, false
  5903  }
  5904  
  5905  // AsJobInputAsset is the BasicJobInput implementation for JobInput.
  5906  func (ji JobInput) AsJobInputAsset() (*JobInputAsset, bool) {
  5907  	return nil, false
  5908  }
  5909  
  5910  // AsJobInputHTTP is the BasicJobInput implementation for JobInput.
  5911  func (ji JobInput) AsJobInputHTTP() (*JobInputHTTP, bool) {
  5912  	return nil, false
  5913  }
  5914  
  5915  // AsJobInputSequence is the BasicJobInput implementation for JobInput.
  5916  func (ji JobInput) AsJobInputSequence() (*JobInputSequence, bool) {
  5917  	return nil, false
  5918  }
  5919  
  5920  // AsJobInput is the BasicJobInput implementation for JobInput.
  5921  func (ji JobInput) AsJobInput() (*JobInput, bool) {
  5922  	return &ji, true
  5923  }
  5924  
  5925  // AsBasicJobInput is the BasicJobInput implementation for JobInput.
  5926  func (ji JobInput) AsBasicJobInput() (BasicJobInput, bool) {
  5927  	return &ji, true
  5928  }
  5929  
  5930  // JobInputAsset represents an Asset for input into a Job.
  5931  type JobInputAsset struct {
  5932  	// AssetName - The name of the input Asset.
  5933  	AssetName *string `json:"assetName,omitempty"`
  5934  	// Files - List of files. Required for JobInputHttp. Maximum of 4000 characters each. Query strings will not be returned in service responses to prevent sensitive data exposure.
  5935  	Files *[]string `json:"files,omitempty"`
  5936  	// Start - Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.
  5937  	Start BasicClipTime `json:"start,omitempty"`
  5938  	// End - Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.
  5939  	End BasicClipTime `json:"end,omitempty"`
  5940  	// 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'.
  5941  	Label *string `json:"label,omitempty"`
  5942  	// InputDefinitions - Defines a list of InputDefinitions. For each InputDefinition, it defines a list of track selections and related metadata.
  5943  	InputDefinitions *[]BasicInputDefinition `json:"inputDefinitions,omitempty"`
  5944  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  5945  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  5946  }
  5947  
  5948  // MarshalJSON is the custom marshaler for JobInputAsset.
  5949  func (jia JobInputAsset) MarshalJSON() ([]byte, error) {
  5950  	jia.OdataType = OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset
  5951  	objectMap := make(map[string]interface{})
  5952  	if jia.AssetName != nil {
  5953  		objectMap["assetName"] = jia.AssetName
  5954  	}
  5955  	if jia.Files != nil {
  5956  		objectMap["files"] = jia.Files
  5957  	}
  5958  	objectMap["start"] = jia.Start
  5959  	objectMap["end"] = jia.End
  5960  	if jia.Label != nil {
  5961  		objectMap["label"] = jia.Label
  5962  	}
  5963  	if jia.InputDefinitions != nil {
  5964  		objectMap["inputDefinitions"] = jia.InputDefinitions
  5965  	}
  5966  	if jia.OdataType != "" {
  5967  		objectMap["@odata.type"] = jia.OdataType
  5968  	}
  5969  	return json.Marshal(objectMap)
  5970  }
  5971  
  5972  // AsJobInputClip is the BasicJobInput implementation for JobInputAsset.
  5973  func (jia JobInputAsset) AsJobInputClip() (*JobInputClip, bool) {
  5974  	return nil, false
  5975  }
  5976  
  5977  // AsBasicJobInputClip is the BasicJobInput implementation for JobInputAsset.
  5978  func (jia JobInputAsset) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  5979  	return &jia, true
  5980  }
  5981  
  5982  // AsJobInputs is the BasicJobInput implementation for JobInputAsset.
  5983  func (jia JobInputAsset) AsJobInputs() (*JobInputs, bool) {
  5984  	return nil, false
  5985  }
  5986  
  5987  // AsJobInputAsset is the BasicJobInput implementation for JobInputAsset.
  5988  func (jia JobInputAsset) AsJobInputAsset() (*JobInputAsset, bool) {
  5989  	return &jia, true
  5990  }
  5991  
  5992  // AsJobInputHTTP is the BasicJobInput implementation for JobInputAsset.
  5993  func (jia JobInputAsset) AsJobInputHTTP() (*JobInputHTTP, bool) {
  5994  	return nil, false
  5995  }
  5996  
  5997  // AsJobInputSequence is the BasicJobInput implementation for JobInputAsset.
  5998  func (jia JobInputAsset) AsJobInputSequence() (*JobInputSequence, bool) {
  5999  	return nil, false
  6000  }
  6001  
  6002  // AsJobInput is the BasicJobInput implementation for JobInputAsset.
  6003  func (jia JobInputAsset) AsJobInput() (*JobInput, bool) {
  6004  	return nil, false
  6005  }
  6006  
  6007  // AsBasicJobInput is the BasicJobInput implementation for JobInputAsset.
  6008  func (jia JobInputAsset) AsBasicJobInput() (BasicJobInput, bool) {
  6009  	return &jia, true
  6010  }
  6011  
  6012  // UnmarshalJSON is the custom unmarshaler for JobInputAsset struct.
  6013  func (jia *JobInputAsset) UnmarshalJSON(body []byte) error {
  6014  	var m map[string]*json.RawMessage
  6015  	err := json.Unmarshal(body, &m)
  6016  	if err != nil {
  6017  		return err
  6018  	}
  6019  	for k, v := range m {
  6020  		switch k {
  6021  		case "assetName":
  6022  			if v != nil {
  6023  				var assetName string
  6024  				err = json.Unmarshal(*v, &assetName)
  6025  				if err != nil {
  6026  					return err
  6027  				}
  6028  				jia.AssetName = &assetName
  6029  			}
  6030  		case "files":
  6031  			if v != nil {
  6032  				var files []string
  6033  				err = json.Unmarshal(*v, &files)
  6034  				if err != nil {
  6035  					return err
  6036  				}
  6037  				jia.Files = &files
  6038  			}
  6039  		case "start":
  6040  			if v != nil {
  6041  				start, err := unmarshalBasicClipTime(*v)
  6042  				if err != nil {
  6043  					return err
  6044  				}
  6045  				jia.Start = start
  6046  			}
  6047  		case "end":
  6048  			if v != nil {
  6049  				end, err := unmarshalBasicClipTime(*v)
  6050  				if err != nil {
  6051  					return err
  6052  				}
  6053  				jia.End = end
  6054  			}
  6055  		case "label":
  6056  			if v != nil {
  6057  				var label string
  6058  				err = json.Unmarshal(*v, &label)
  6059  				if err != nil {
  6060  					return err
  6061  				}
  6062  				jia.Label = &label
  6063  			}
  6064  		case "inputDefinitions":
  6065  			if v != nil {
  6066  				inputDefinitions, err := unmarshalBasicInputDefinitionArray(*v)
  6067  				if err != nil {
  6068  					return err
  6069  				}
  6070  				jia.InputDefinitions = &inputDefinitions
  6071  			}
  6072  		case "@odata.type":
  6073  			if v != nil {
  6074  				var odataType OdataTypeBasicJobInput
  6075  				err = json.Unmarshal(*v, &odataType)
  6076  				if err != nil {
  6077  					return err
  6078  				}
  6079  				jia.OdataType = odataType
  6080  			}
  6081  		}
  6082  	}
  6083  
  6084  	return nil
  6085  }
  6086  
  6087  // BasicJobInputClip represents input files for a Job.
  6088  type BasicJobInputClip interface {
  6089  	AsJobInputAsset() (*JobInputAsset, bool)
  6090  	AsJobInputHTTP() (*JobInputHTTP, bool)
  6091  	AsJobInputClip() (*JobInputClip, bool)
  6092  }
  6093  
  6094  // JobInputClip represents input files for a Job.
  6095  type JobInputClip struct {
  6096  	// Files - List of files. Required for JobInputHttp. Maximum of 4000 characters each. Query strings will not be returned in service responses to prevent sensitive data exposure.
  6097  	Files *[]string `json:"files,omitempty"`
  6098  	// Start - Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.
  6099  	Start BasicClipTime `json:"start,omitempty"`
  6100  	// End - Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.
  6101  	End BasicClipTime `json:"end,omitempty"`
  6102  	// 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'.
  6103  	Label *string `json:"label,omitempty"`
  6104  	// InputDefinitions - Defines a list of InputDefinitions. For each InputDefinition, it defines a list of track selections and related metadata.
  6105  	InputDefinitions *[]BasicInputDefinition `json:"inputDefinitions,omitempty"`
  6106  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  6107  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  6108  }
  6109  
  6110  func unmarshalBasicJobInputClip(body []byte) (BasicJobInputClip, error) {
  6111  	var m map[string]interface{}
  6112  	err := json.Unmarshal(body, &m)
  6113  	if err != nil {
  6114  		return nil, err
  6115  	}
  6116  
  6117  	switch m["@odata.type"] {
  6118  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset):
  6119  		var jia JobInputAsset
  6120  		err := json.Unmarshal(body, &jia)
  6121  		return jia, err
  6122  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP):
  6123  		var jih JobInputHTTP
  6124  		err := json.Unmarshal(body, &jih)
  6125  		return jih, err
  6126  	default:
  6127  		var jic JobInputClip
  6128  		err := json.Unmarshal(body, &jic)
  6129  		return jic, err
  6130  	}
  6131  }
  6132  func unmarshalBasicJobInputClipArray(body []byte) ([]BasicJobInputClip, error) {
  6133  	var rawMessages []*json.RawMessage
  6134  	err := json.Unmarshal(body, &rawMessages)
  6135  	if err != nil {
  6136  		return nil, err
  6137  	}
  6138  
  6139  	jicArray := make([]BasicJobInputClip, len(rawMessages))
  6140  
  6141  	for index, rawMessage := range rawMessages {
  6142  		jic, err := unmarshalBasicJobInputClip(*rawMessage)
  6143  		if err != nil {
  6144  			return nil, err
  6145  		}
  6146  		jicArray[index] = jic
  6147  	}
  6148  	return jicArray, nil
  6149  }
  6150  
  6151  // MarshalJSON is the custom marshaler for JobInputClip.
  6152  func (jic JobInputClip) MarshalJSON() ([]byte, error) {
  6153  	jic.OdataType = OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip
  6154  	objectMap := make(map[string]interface{})
  6155  	if jic.Files != nil {
  6156  		objectMap["files"] = jic.Files
  6157  	}
  6158  	objectMap["start"] = jic.Start
  6159  	objectMap["end"] = jic.End
  6160  	if jic.Label != nil {
  6161  		objectMap["label"] = jic.Label
  6162  	}
  6163  	if jic.InputDefinitions != nil {
  6164  		objectMap["inputDefinitions"] = jic.InputDefinitions
  6165  	}
  6166  	if jic.OdataType != "" {
  6167  		objectMap["@odata.type"] = jic.OdataType
  6168  	}
  6169  	return json.Marshal(objectMap)
  6170  }
  6171  
  6172  // AsJobInputClip is the BasicJobInput implementation for JobInputClip.
  6173  func (jic JobInputClip) AsJobInputClip() (*JobInputClip, bool) {
  6174  	return &jic, true
  6175  }
  6176  
  6177  // AsBasicJobInputClip is the BasicJobInput implementation for JobInputClip.
  6178  func (jic JobInputClip) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  6179  	return &jic, true
  6180  }
  6181  
  6182  // AsJobInputs is the BasicJobInput implementation for JobInputClip.
  6183  func (jic JobInputClip) AsJobInputs() (*JobInputs, bool) {
  6184  	return nil, false
  6185  }
  6186  
  6187  // AsJobInputAsset is the BasicJobInput implementation for JobInputClip.
  6188  func (jic JobInputClip) AsJobInputAsset() (*JobInputAsset, bool) {
  6189  	return nil, false
  6190  }
  6191  
  6192  // AsJobInputHTTP is the BasicJobInput implementation for JobInputClip.
  6193  func (jic JobInputClip) AsJobInputHTTP() (*JobInputHTTP, bool) {
  6194  	return nil, false
  6195  }
  6196  
  6197  // AsJobInputSequence is the BasicJobInput implementation for JobInputClip.
  6198  func (jic JobInputClip) AsJobInputSequence() (*JobInputSequence, bool) {
  6199  	return nil, false
  6200  }
  6201  
  6202  // AsJobInput is the BasicJobInput implementation for JobInputClip.
  6203  func (jic JobInputClip) AsJobInput() (*JobInput, bool) {
  6204  	return nil, false
  6205  }
  6206  
  6207  // AsBasicJobInput is the BasicJobInput implementation for JobInputClip.
  6208  func (jic JobInputClip) AsBasicJobInput() (BasicJobInput, bool) {
  6209  	return &jic, true
  6210  }
  6211  
  6212  // UnmarshalJSON is the custom unmarshaler for JobInputClip struct.
  6213  func (jic *JobInputClip) UnmarshalJSON(body []byte) error {
  6214  	var m map[string]*json.RawMessage
  6215  	err := json.Unmarshal(body, &m)
  6216  	if err != nil {
  6217  		return err
  6218  	}
  6219  	for k, v := range m {
  6220  		switch k {
  6221  		case "files":
  6222  			if v != nil {
  6223  				var files []string
  6224  				err = json.Unmarshal(*v, &files)
  6225  				if err != nil {
  6226  					return err
  6227  				}
  6228  				jic.Files = &files
  6229  			}
  6230  		case "start":
  6231  			if v != nil {
  6232  				start, err := unmarshalBasicClipTime(*v)
  6233  				if err != nil {
  6234  					return err
  6235  				}
  6236  				jic.Start = start
  6237  			}
  6238  		case "end":
  6239  			if v != nil {
  6240  				end, err := unmarshalBasicClipTime(*v)
  6241  				if err != nil {
  6242  					return err
  6243  				}
  6244  				jic.End = end
  6245  			}
  6246  		case "label":
  6247  			if v != nil {
  6248  				var label string
  6249  				err = json.Unmarshal(*v, &label)
  6250  				if err != nil {
  6251  					return err
  6252  				}
  6253  				jic.Label = &label
  6254  			}
  6255  		case "inputDefinitions":
  6256  			if v != nil {
  6257  				inputDefinitions, err := unmarshalBasicInputDefinitionArray(*v)
  6258  				if err != nil {
  6259  					return err
  6260  				}
  6261  				jic.InputDefinitions = &inputDefinitions
  6262  			}
  6263  		case "@odata.type":
  6264  			if v != nil {
  6265  				var odataType OdataTypeBasicJobInput
  6266  				err = json.Unmarshal(*v, &odataType)
  6267  				if err != nil {
  6268  					return err
  6269  				}
  6270  				jic.OdataType = odataType
  6271  			}
  6272  		}
  6273  	}
  6274  
  6275  	return nil
  6276  }
  6277  
  6278  // JobInputHTTP represents HTTPS job input.
  6279  type JobInputHTTP struct {
  6280  	// 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. The query strings will not be returned in service responses to prevent sensitive data exposure.
  6281  	BaseURI *string `json:"baseUri,omitempty"`
  6282  	// Files - List of files. Required for JobInputHttp. Maximum of 4000 characters each. Query strings will not be returned in service responses to prevent sensitive data exposure.
  6283  	Files *[]string `json:"files,omitempty"`
  6284  	// Start - Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.
  6285  	Start BasicClipTime `json:"start,omitempty"`
  6286  	// End - Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.
  6287  	End BasicClipTime `json:"end,omitempty"`
  6288  	// 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'.
  6289  	Label *string `json:"label,omitempty"`
  6290  	// InputDefinitions - Defines a list of InputDefinitions. For each InputDefinition, it defines a list of track selections and related metadata.
  6291  	InputDefinitions *[]BasicInputDefinition `json:"inputDefinitions,omitempty"`
  6292  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  6293  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  6294  }
  6295  
  6296  // MarshalJSON is the custom marshaler for JobInputHTTP.
  6297  func (jih JobInputHTTP) MarshalJSON() ([]byte, error) {
  6298  	jih.OdataType = OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP
  6299  	objectMap := make(map[string]interface{})
  6300  	if jih.BaseURI != nil {
  6301  		objectMap["baseUri"] = jih.BaseURI
  6302  	}
  6303  	if jih.Files != nil {
  6304  		objectMap["files"] = jih.Files
  6305  	}
  6306  	objectMap["start"] = jih.Start
  6307  	objectMap["end"] = jih.End
  6308  	if jih.Label != nil {
  6309  		objectMap["label"] = jih.Label
  6310  	}
  6311  	if jih.InputDefinitions != nil {
  6312  		objectMap["inputDefinitions"] = jih.InputDefinitions
  6313  	}
  6314  	if jih.OdataType != "" {
  6315  		objectMap["@odata.type"] = jih.OdataType
  6316  	}
  6317  	return json.Marshal(objectMap)
  6318  }
  6319  
  6320  // AsJobInputClip is the BasicJobInput implementation for JobInputHTTP.
  6321  func (jih JobInputHTTP) AsJobInputClip() (*JobInputClip, bool) {
  6322  	return nil, false
  6323  }
  6324  
  6325  // AsBasicJobInputClip is the BasicJobInput implementation for JobInputHTTP.
  6326  func (jih JobInputHTTP) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  6327  	return &jih, true
  6328  }
  6329  
  6330  // AsJobInputs is the BasicJobInput implementation for JobInputHTTP.
  6331  func (jih JobInputHTTP) AsJobInputs() (*JobInputs, bool) {
  6332  	return nil, false
  6333  }
  6334  
  6335  // AsJobInputAsset is the BasicJobInput implementation for JobInputHTTP.
  6336  func (jih JobInputHTTP) AsJobInputAsset() (*JobInputAsset, bool) {
  6337  	return nil, false
  6338  }
  6339  
  6340  // AsJobInputHTTP is the BasicJobInput implementation for JobInputHTTP.
  6341  func (jih JobInputHTTP) AsJobInputHTTP() (*JobInputHTTP, bool) {
  6342  	return &jih, true
  6343  }
  6344  
  6345  // AsJobInputSequence is the BasicJobInput implementation for JobInputHTTP.
  6346  func (jih JobInputHTTP) AsJobInputSequence() (*JobInputSequence, bool) {
  6347  	return nil, false
  6348  }
  6349  
  6350  // AsJobInput is the BasicJobInput implementation for JobInputHTTP.
  6351  func (jih JobInputHTTP) AsJobInput() (*JobInput, bool) {
  6352  	return nil, false
  6353  }
  6354  
  6355  // AsBasicJobInput is the BasicJobInput implementation for JobInputHTTP.
  6356  func (jih JobInputHTTP) AsBasicJobInput() (BasicJobInput, bool) {
  6357  	return &jih, true
  6358  }
  6359  
  6360  // UnmarshalJSON is the custom unmarshaler for JobInputHTTP struct.
  6361  func (jih *JobInputHTTP) UnmarshalJSON(body []byte) error {
  6362  	var m map[string]*json.RawMessage
  6363  	err := json.Unmarshal(body, &m)
  6364  	if err != nil {
  6365  		return err
  6366  	}
  6367  	for k, v := range m {
  6368  		switch k {
  6369  		case "baseUri":
  6370  			if v != nil {
  6371  				var baseURI string
  6372  				err = json.Unmarshal(*v, &baseURI)
  6373  				if err != nil {
  6374  					return err
  6375  				}
  6376  				jih.BaseURI = &baseURI
  6377  			}
  6378  		case "files":
  6379  			if v != nil {
  6380  				var files []string
  6381  				err = json.Unmarshal(*v, &files)
  6382  				if err != nil {
  6383  					return err
  6384  				}
  6385  				jih.Files = &files
  6386  			}
  6387  		case "start":
  6388  			if v != nil {
  6389  				start, err := unmarshalBasicClipTime(*v)
  6390  				if err != nil {
  6391  					return err
  6392  				}
  6393  				jih.Start = start
  6394  			}
  6395  		case "end":
  6396  			if v != nil {
  6397  				end, err := unmarshalBasicClipTime(*v)
  6398  				if err != nil {
  6399  					return err
  6400  				}
  6401  				jih.End = end
  6402  			}
  6403  		case "label":
  6404  			if v != nil {
  6405  				var label string
  6406  				err = json.Unmarshal(*v, &label)
  6407  				if err != nil {
  6408  					return err
  6409  				}
  6410  				jih.Label = &label
  6411  			}
  6412  		case "inputDefinitions":
  6413  			if v != nil {
  6414  				inputDefinitions, err := unmarshalBasicInputDefinitionArray(*v)
  6415  				if err != nil {
  6416  					return err
  6417  				}
  6418  				jih.InputDefinitions = &inputDefinitions
  6419  			}
  6420  		case "@odata.type":
  6421  			if v != nil {
  6422  				var odataType OdataTypeBasicJobInput
  6423  				err = json.Unmarshal(*v, &odataType)
  6424  				if err != nil {
  6425  					return err
  6426  				}
  6427  				jih.OdataType = odataType
  6428  			}
  6429  		}
  6430  	}
  6431  
  6432  	return nil
  6433  }
  6434  
  6435  // JobInputs describes a list of inputs to a Job.
  6436  type JobInputs struct {
  6437  	// Inputs - List of inputs to a Job.
  6438  	Inputs *[]BasicJobInput `json:"inputs,omitempty"`
  6439  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  6440  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  6441  }
  6442  
  6443  // MarshalJSON is the custom marshaler for JobInputs.
  6444  func (ji JobInputs) MarshalJSON() ([]byte, error) {
  6445  	ji.OdataType = OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs
  6446  	objectMap := make(map[string]interface{})
  6447  	if ji.Inputs != nil {
  6448  		objectMap["inputs"] = ji.Inputs
  6449  	}
  6450  	if ji.OdataType != "" {
  6451  		objectMap["@odata.type"] = ji.OdataType
  6452  	}
  6453  	return json.Marshal(objectMap)
  6454  }
  6455  
  6456  // AsJobInputClip is the BasicJobInput implementation for JobInputs.
  6457  func (ji JobInputs) AsJobInputClip() (*JobInputClip, bool) {
  6458  	return nil, false
  6459  }
  6460  
  6461  // AsBasicJobInputClip is the BasicJobInput implementation for JobInputs.
  6462  func (ji JobInputs) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  6463  	return nil, false
  6464  }
  6465  
  6466  // AsJobInputs is the BasicJobInput implementation for JobInputs.
  6467  func (ji JobInputs) AsJobInputs() (*JobInputs, bool) {
  6468  	return &ji, true
  6469  }
  6470  
  6471  // AsJobInputAsset is the BasicJobInput implementation for JobInputs.
  6472  func (ji JobInputs) AsJobInputAsset() (*JobInputAsset, bool) {
  6473  	return nil, false
  6474  }
  6475  
  6476  // AsJobInputHTTP is the BasicJobInput implementation for JobInputs.
  6477  func (ji JobInputs) AsJobInputHTTP() (*JobInputHTTP, bool) {
  6478  	return nil, false
  6479  }
  6480  
  6481  // AsJobInputSequence is the BasicJobInput implementation for JobInputs.
  6482  func (ji JobInputs) AsJobInputSequence() (*JobInputSequence, bool) {
  6483  	return nil, false
  6484  }
  6485  
  6486  // AsJobInput is the BasicJobInput implementation for JobInputs.
  6487  func (ji JobInputs) AsJobInput() (*JobInput, bool) {
  6488  	return nil, false
  6489  }
  6490  
  6491  // AsBasicJobInput is the BasicJobInput implementation for JobInputs.
  6492  func (ji JobInputs) AsBasicJobInput() (BasicJobInput, bool) {
  6493  	return &ji, true
  6494  }
  6495  
  6496  // UnmarshalJSON is the custom unmarshaler for JobInputs struct.
  6497  func (ji *JobInputs) UnmarshalJSON(body []byte) error {
  6498  	var m map[string]*json.RawMessage
  6499  	err := json.Unmarshal(body, &m)
  6500  	if err != nil {
  6501  		return err
  6502  	}
  6503  	for k, v := range m {
  6504  		switch k {
  6505  		case "inputs":
  6506  			if v != nil {
  6507  				inputs, err := unmarshalBasicJobInputArray(*v)
  6508  				if err != nil {
  6509  					return err
  6510  				}
  6511  				ji.Inputs = &inputs
  6512  			}
  6513  		case "@odata.type":
  6514  			if v != nil {
  6515  				var odataType OdataTypeBasicJobInput
  6516  				err = json.Unmarshal(*v, &odataType)
  6517  				if err != nil {
  6518  					return err
  6519  				}
  6520  				ji.OdataType = odataType
  6521  			}
  6522  		}
  6523  	}
  6524  
  6525  	return nil
  6526  }
  6527  
  6528  // JobInputSequence a Sequence contains an ordered list of Clips where each clip is a JobInput.  The
  6529  // Sequence will be treated as a single input.
  6530  type JobInputSequence struct {
  6531  	// Inputs - JobInputs that make up the timeline.
  6532  	Inputs *[]BasicJobInputClip `json:"inputs,omitempty"`
  6533  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  6534  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  6535  }
  6536  
  6537  // MarshalJSON is the custom marshaler for JobInputSequence.
  6538  func (jis JobInputSequence) MarshalJSON() ([]byte, error) {
  6539  	jis.OdataType = OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence
  6540  	objectMap := make(map[string]interface{})
  6541  	if jis.Inputs != nil {
  6542  		objectMap["inputs"] = jis.Inputs
  6543  	}
  6544  	if jis.OdataType != "" {
  6545  		objectMap["@odata.type"] = jis.OdataType
  6546  	}
  6547  	return json.Marshal(objectMap)
  6548  }
  6549  
  6550  // AsJobInputClip is the BasicJobInput implementation for JobInputSequence.
  6551  func (jis JobInputSequence) AsJobInputClip() (*JobInputClip, bool) {
  6552  	return nil, false
  6553  }
  6554  
  6555  // AsBasicJobInputClip is the BasicJobInput implementation for JobInputSequence.
  6556  func (jis JobInputSequence) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  6557  	return nil, false
  6558  }
  6559  
  6560  // AsJobInputs is the BasicJobInput implementation for JobInputSequence.
  6561  func (jis JobInputSequence) AsJobInputs() (*JobInputs, bool) {
  6562  	return nil, false
  6563  }
  6564  
  6565  // AsJobInputAsset is the BasicJobInput implementation for JobInputSequence.
  6566  func (jis JobInputSequence) AsJobInputAsset() (*JobInputAsset, bool) {
  6567  	return nil, false
  6568  }
  6569  
  6570  // AsJobInputHTTP is the BasicJobInput implementation for JobInputSequence.
  6571  func (jis JobInputSequence) AsJobInputHTTP() (*JobInputHTTP, bool) {
  6572  	return nil, false
  6573  }
  6574  
  6575  // AsJobInputSequence is the BasicJobInput implementation for JobInputSequence.
  6576  func (jis JobInputSequence) AsJobInputSequence() (*JobInputSequence, bool) {
  6577  	return &jis, true
  6578  }
  6579  
  6580  // AsJobInput is the BasicJobInput implementation for JobInputSequence.
  6581  func (jis JobInputSequence) AsJobInput() (*JobInput, bool) {
  6582  	return nil, false
  6583  }
  6584  
  6585  // AsBasicJobInput is the BasicJobInput implementation for JobInputSequence.
  6586  func (jis JobInputSequence) AsBasicJobInput() (BasicJobInput, bool) {
  6587  	return &jis, true
  6588  }
  6589  
  6590  // UnmarshalJSON is the custom unmarshaler for JobInputSequence struct.
  6591  func (jis *JobInputSequence) UnmarshalJSON(body []byte) error {
  6592  	var m map[string]*json.RawMessage
  6593  	err := json.Unmarshal(body, &m)
  6594  	if err != nil {
  6595  		return err
  6596  	}
  6597  	for k, v := range m {
  6598  		switch k {
  6599  		case "inputs":
  6600  			if v != nil {
  6601  				inputs, err := unmarshalBasicJobInputClipArray(*v)
  6602  				if err != nil {
  6603  					return err
  6604  				}
  6605  				jis.Inputs = &inputs
  6606  			}
  6607  		case "@odata.type":
  6608  			if v != nil {
  6609  				var odataType OdataTypeBasicJobInput
  6610  				err = json.Unmarshal(*v, &odataType)
  6611  				if err != nil {
  6612  					return err
  6613  				}
  6614  				jis.OdataType = odataType
  6615  			}
  6616  		}
  6617  	}
  6618  
  6619  	return nil
  6620  }
  6621  
  6622  // BasicJobOutput describes all the properties of a JobOutput.
  6623  type BasicJobOutput interface {
  6624  	AsJobOutputAsset() (*JobOutputAsset, bool)
  6625  	AsJobOutput() (*JobOutput, bool)
  6626  }
  6627  
  6628  // JobOutput describes all the properties of a JobOutput.
  6629  type JobOutput struct {
  6630  	// Error - READ-ONLY; If the JobOutput is in the Error state, it contains the details of the error.
  6631  	Error *JobError `json:"error,omitempty"`
  6632  	// PresetOverride - A preset used to override the preset in the corresponding transform output.
  6633  	PresetOverride BasicPreset `json:"presetOverride,omitempty"`
  6634  	// State - READ-ONLY; Describes the state of the JobOutput. Possible values include: 'JobStateCanceled', 'JobStateCanceling', 'JobStateError', 'JobStateFinished', 'JobStateProcessing', 'JobStateQueued', 'JobStateScheduled'
  6635  	State JobState `json:"state,omitempty"`
  6636  	// 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.
  6637  	Progress *int32 `json:"progress,omitempty"`
  6638  	// 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.
  6639  	Label *string `json:"label,omitempty"`
  6640  	// StartTime - READ-ONLY; The UTC date and time at which this Job Output began processing.
  6641  	StartTime *date.Time `json:"startTime,omitempty"`
  6642  	// EndTime - READ-ONLY; The UTC date and time at which this Job Output finished processing.
  6643  	EndTime *date.Time `json:"endTime,omitempty"`
  6644  	// OdataType - Possible values include: 'OdataTypeBasicJobOutputOdataTypeJobOutput', 'OdataTypeBasicJobOutputOdataTypeMicrosoftMediaJobOutputAsset'
  6645  	OdataType OdataTypeBasicJobOutput `json:"@odata.type,omitempty"`
  6646  }
  6647  
  6648  func unmarshalBasicJobOutput(body []byte) (BasicJobOutput, error) {
  6649  	var m map[string]interface{}
  6650  	err := json.Unmarshal(body, &m)
  6651  	if err != nil {
  6652  		return nil, err
  6653  	}
  6654  
  6655  	switch m["@odata.type"] {
  6656  	case string(OdataTypeBasicJobOutputOdataTypeMicrosoftMediaJobOutputAsset):
  6657  		var joa JobOutputAsset
  6658  		err := json.Unmarshal(body, &joa)
  6659  		return joa, err
  6660  	default:
  6661  		var jo JobOutput
  6662  		err := json.Unmarshal(body, &jo)
  6663  		return jo, err
  6664  	}
  6665  }
  6666  func unmarshalBasicJobOutputArray(body []byte) ([]BasicJobOutput, error) {
  6667  	var rawMessages []*json.RawMessage
  6668  	err := json.Unmarshal(body, &rawMessages)
  6669  	if err != nil {
  6670  		return nil, err
  6671  	}
  6672  
  6673  	joArray := make([]BasicJobOutput, len(rawMessages))
  6674  
  6675  	for index, rawMessage := range rawMessages {
  6676  		jo, err := unmarshalBasicJobOutput(*rawMessage)
  6677  		if err != nil {
  6678  			return nil, err
  6679  		}
  6680  		joArray[index] = jo
  6681  	}
  6682  	return joArray, nil
  6683  }
  6684  
  6685  // MarshalJSON is the custom marshaler for JobOutput.
  6686  func (jo JobOutput) MarshalJSON() ([]byte, error) {
  6687  	jo.OdataType = OdataTypeBasicJobOutputOdataTypeJobOutput
  6688  	objectMap := make(map[string]interface{})
  6689  	objectMap["presetOverride"] = jo.PresetOverride
  6690  	if jo.Label != nil {
  6691  		objectMap["label"] = jo.Label
  6692  	}
  6693  	if jo.OdataType != "" {
  6694  		objectMap["@odata.type"] = jo.OdataType
  6695  	}
  6696  	return json.Marshal(objectMap)
  6697  }
  6698  
  6699  // AsJobOutputAsset is the BasicJobOutput implementation for JobOutput.
  6700  func (jo JobOutput) AsJobOutputAsset() (*JobOutputAsset, bool) {
  6701  	return nil, false
  6702  }
  6703  
  6704  // AsJobOutput is the BasicJobOutput implementation for JobOutput.
  6705  func (jo JobOutput) AsJobOutput() (*JobOutput, bool) {
  6706  	return &jo, true
  6707  }
  6708  
  6709  // AsBasicJobOutput is the BasicJobOutput implementation for JobOutput.
  6710  func (jo JobOutput) AsBasicJobOutput() (BasicJobOutput, bool) {
  6711  	return &jo, true
  6712  }
  6713  
  6714  // UnmarshalJSON is the custom unmarshaler for JobOutput struct.
  6715  func (jo *JobOutput) UnmarshalJSON(body []byte) error {
  6716  	var m map[string]*json.RawMessage
  6717  	err := json.Unmarshal(body, &m)
  6718  	if err != nil {
  6719  		return err
  6720  	}
  6721  	for k, v := range m {
  6722  		switch k {
  6723  		case "error":
  6724  			if v != nil {
  6725  				var errorVar JobError
  6726  				err = json.Unmarshal(*v, &errorVar)
  6727  				if err != nil {
  6728  					return err
  6729  				}
  6730  				jo.Error = &errorVar
  6731  			}
  6732  		case "presetOverride":
  6733  			if v != nil {
  6734  				presetOverride, err := unmarshalBasicPreset(*v)
  6735  				if err != nil {
  6736  					return err
  6737  				}
  6738  				jo.PresetOverride = presetOverride
  6739  			}
  6740  		case "state":
  6741  			if v != nil {
  6742  				var state JobState
  6743  				err = json.Unmarshal(*v, &state)
  6744  				if err != nil {
  6745  					return err
  6746  				}
  6747  				jo.State = state
  6748  			}
  6749  		case "progress":
  6750  			if v != nil {
  6751  				var progress int32
  6752  				err = json.Unmarshal(*v, &progress)
  6753  				if err != nil {
  6754  					return err
  6755  				}
  6756  				jo.Progress = &progress
  6757  			}
  6758  		case "label":
  6759  			if v != nil {
  6760  				var label string
  6761  				err = json.Unmarshal(*v, &label)
  6762  				if err != nil {
  6763  					return err
  6764  				}
  6765  				jo.Label = &label
  6766  			}
  6767  		case "startTime":
  6768  			if v != nil {
  6769  				var startTime date.Time
  6770  				err = json.Unmarshal(*v, &startTime)
  6771  				if err != nil {
  6772  					return err
  6773  				}
  6774  				jo.StartTime = &startTime
  6775  			}
  6776  		case "endTime":
  6777  			if v != nil {
  6778  				var endTime date.Time
  6779  				err = json.Unmarshal(*v, &endTime)
  6780  				if err != nil {
  6781  					return err
  6782  				}
  6783  				jo.EndTime = &endTime
  6784  			}
  6785  		case "@odata.type":
  6786  			if v != nil {
  6787  				var odataType OdataTypeBasicJobOutput
  6788  				err = json.Unmarshal(*v, &odataType)
  6789  				if err != nil {
  6790  					return err
  6791  				}
  6792  				jo.OdataType = odataType
  6793  			}
  6794  		}
  6795  	}
  6796  
  6797  	return nil
  6798  }
  6799  
  6800  // JobOutputAsset represents an Asset used as a JobOutput.
  6801  type JobOutputAsset struct {
  6802  	// AssetName - The name of the output Asset.
  6803  	AssetName *string `json:"assetName,omitempty"`
  6804  	// Error - READ-ONLY; If the JobOutput is in the Error state, it contains the details of the error.
  6805  	Error *JobError `json:"error,omitempty"`
  6806  	// PresetOverride - A preset used to override the preset in the corresponding transform output.
  6807  	PresetOverride BasicPreset `json:"presetOverride,omitempty"`
  6808  	// State - READ-ONLY; Describes the state of the JobOutput. Possible values include: 'JobStateCanceled', 'JobStateCanceling', 'JobStateError', 'JobStateFinished', 'JobStateProcessing', 'JobStateQueued', 'JobStateScheduled'
  6809  	State JobState `json:"state,omitempty"`
  6810  	// 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.
  6811  	Progress *int32 `json:"progress,omitempty"`
  6812  	// 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.
  6813  	Label *string `json:"label,omitempty"`
  6814  	// StartTime - READ-ONLY; The UTC date and time at which this Job Output began processing.
  6815  	StartTime *date.Time `json:"startTime,omitempty"`
  6816  	// EndTime - READ-ONLY; The UTC date and time at which this Job Output finished processing.
  6817  	EndTime *date.Time `json:"endTime,omitempty"`
  6818  	// OdataType - Possible values include: 'OdataTypeBasicJobOutputOdataTypeJobOutput', 'OdataTypeBasicJobOutputOdataTypeMicrosoftMediaJobOutputAsset'
  6819  	OdataType OdataTypeBasicJobOutput `json:"@odata.type,omitempty"`
  6820  }
  6821  
  6822  // MarshalJSON is the custom marshaler for JobOutputAsset.
  6823  func (joa JobOutputAsset) MarshalJSON() ([]byte, error) {
  6824  	joa.OdataType = OdataTypeBasicJobOutputOdataTypeMicrosoftMediaJobOutputAsset
  6825  	objectMap := make(map[string]interface{})
  6826  	if joa.AssetName != nil {
  6827  		objectMap["assetName"] = joa.AssetName
  6828  	}
  6829  	objectMap["presetOverride"] = joa.PresetOverride
  6830  	if joa.Label != nil {
  6831  		objectMap["label"] = joa.Label
  6832  	}
  6833  	if joa.OdataType != "" {
  6834  		objectMap["@odata.type"] = joa.OdataType
  6835  	}
  6836  	return json.Marshal(objectMap)
  6837  }
  6838  
  6839  // AsJobOutputAsset is the BasicJobOutput implementation for JobOutputAsset.
  6840  func (joa JobOutputAsset) AsJobOutputAsset() (*JobOutputAsset, bool) {
  6841  	return &joa, true
  6842  }
  6843  
  6844  // AsJobOutput is the BasicJobOutput implementation for JobOutputAsset.
  6845  func (joa JobOutputAsset) AsJobOutput() (*JobOutput, bool) {
  6846  	return nil, false
  6847  }
  6848  
  6849  // AsBasicJobOutput is the BasicJobOutput implementation for JobOutputAsset.
  6850  func (joa JobOutputAsset) AsBasicJobOutput() (BasicJobOutput, bool) {
  6851  	return &joa, true
  6852  }
  6853  
  6854  // UnmarshalJSON is the custom unmarshaler for JobOutputAsset struct.
  6855  func (joa *JobOutputAsset) UnmarshalJSON(body []byte) error {
  6856  	var m map[string]*json.RawMessage
  6857  	err := json.Unmarshal(body, &m)
  6858  	if err != nil {
  6859  		return err
  6860  	}
  6861  	for k, v := range m {
  6862  		switch k {
  6863  		case "assetName":
  6864  			if v != nil {
  6865  				var assetName string
  6866  				err = json.Unmarshal(*v, &assetName)
  6867  				if err != nil {
  6868  					return err
  6869  				}
  6870  				joa.AssetName = &assetName
  6871  			}
  6872  		case "error":
  6873  			if v != nil {
  6874  				var errorVar JobError
  6875  				err = json.Unmarshal(*v, &errorVar)
  6876  				if err != nil {
  6877  					return err
  6878  				}
  6879  				joa.Error = &errorVar
  6880  			}
  6881  		case "presetOverride":
  6882  			if v != nil {
  6883  				presetOverride, err := unmarshalBasicPreset(*v)
  6884  				if err != nil {
  6885  					return err
  6886  				}
  6887  				joa.PresetOverride = presetOverride
  6888  			}
  6889  		case "state":
  6890  			if v != nil {
  6891  				var state JobState
  6892  				err = json.Unmarshal(*v, &state)
  6893  				if err != nil {
  6894  					return err
  6895  				}
  6896  				joa.State = state
  6897  			}
  6898  		case "progress":
  6899  			if v != nil {
  6900  				var progress int32
  6901  				err = json.Unmarshal(*v, &progress)
  6902  				if err != nil {
  6903  					return err
  6904  				}
  6905  				joa.Progress = &progress
  6906  			}
  6907  		case "label":
  6908  			if v != nil {
  6909  				var label string
  6910  				err = json.Unmarshal(*v, &label)
  6911  				if err != nil {
  6912  					return err
  6913  				}
  6914  				joa.Label = &label
  6915  			}
  6916  		case "startTime":
  6917  			if v != nil {
  6918  				var startTime date.Time
  6919  				err = json.Unmarshal(*v, &startTime)
  6920  				if err != nil {
  6921  					return err
  6922  				}
  6923  				joa.StartTime = &startTime
  6924  			}
  6925  		case "endTime":
  6926  			if v != nil {
  6927  				var endTime date.Time
  6928  				err = json.Unmarshal(*v, &endTime)
  6929  				if err != nil {
  6930  					return err
  6931  				}
  6932  				joa.EndTime = &endTime
  6933  			}
  6934  		case "@odata.type":
  6935  			if v != nil {
  6936  				var odataType OdataTypeBasicJobOutput
  6937  				err = json.Unmarshal(*v, &odataType)
  6938  				if err != nil {
  6939  					return err
  6940  				}
  6941  				joa.OdataType = odataType
  6942  			}
  6943  		}
  6944  	}
  6945  
  6946  	return nil
  6947  }
  6948  
  6949  // JobProperties properties of the Job.
  6950  type JobProperties struct {
  6951  	// Created - READ-ONLY; The UTC date and time when the customer has created the Job, in 'YYYY-MM-DDThh:mm:ssZ' format.
  6952  	Created *date.Time `json:"created,omitempty"`
  6953  	// State - READ-ONLY; The current state of the job. Possible values include: 'JobStateCanceled', 'JobStateCanceling', 'JobStateError', 'JobStateFinished', 'JobStateProcessing', 'JobStateQueued', 'JobStateScheduled'
  6954  	State JobState `json:"state,omitempty"`
  6955  	// Description - Optional customer supplied description of the Job.
  6956  	Description *string `json:"description,omitempty"`
  6957  	// Input - The inputs for the Job.
  6958  	Input BasicJobInput `json:"input,omitempty"`
  6959  	// LastModified - READ-ONLY; The UTC date and time when the customer has last updated the Job, in 'YYYY-MM-DDThh:mm:ssZ' format.
  6960  	LastModified *date.Time `json:"lastModified,omitempty"`
  6961  	// Outputs - The outputs for the Job.
  6962  	Outputs *[]BasicJobOutput `json:"outputs,omitempty"`
  6963  	// Priority - Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'PriorityLow', 'PriorityNormal', 'PriorityHigh'
  6964  	Priority Priority `json:"priority,omitempty"`
  6965  	// CorrelationData - Customer provided key, value pairs that will be returned in Job and JobOutput state events.
  6966  	CorrelationData map[string]*string `json:"correlationData"`
  6967  	// StartTime - READ-ONLY; The UTC date and time at which this Job began processing.
  6968  	StartTime *date.Time `json:"startTime,omitempty"`
  6969  	// EndTime - READ-ONLY; The UTC date and time at which this Job finished processing.
  6970  	EndTime *date.Time `json:"endTime,omitempty"`
  6971  }
  6972  
  6973  // MarshalJSON is the custom marshaler for JobProperties.
  6974  func (jp JobProperties) MarshalJSON() ([]byte, error) {
  6975  	objectMap := make(map[string]interface{})
  6976  	if jp.Description != nil {
  6977  		objectMap["description"] = jp.Description
  6978  	}
  6979  	objectMap["input"] = jp.Input
  6980  	if jp.Outputs != nil {
  6981  		objectMap["outputs"] = jp.Outputs
  6982  	}
  6983  	if jp.Priority != "" {
  6984  		objectMap["priority"] = jp.Priority
  6985  	}
  6986  	if jp.CorrelationData != nil {
  6987  		objectMap["correlationData"] = jp.CorrelationData
  6988  	}
  6989  	return json.Marshal(objectMap)
  6990  }
  6991  
  6992  // UnmarshalJSON is the custom unmarshaler for JobProperties struct.
  6993  func (jp *JobProperties) UnmarshalJSON(body []byte) error {
  6994  	var m map[string]*json.RawMessage
  6995  	err := json.Unmarshal(body, &m)
  6996  	if err != nil {
  6997  		return err
  6998  	}
  6999  	for k, v := range m {
  7000  		switch k {
  7001  		case "created":
  7002  			if v != nil {
  7003  				var created date.Time
  7004  				err = json.Unmarshal(*v, &created)
  7005  				if err != nil {
  7006  					return err
  7007  				}
  7008  				jp.Created = &created
  7009  			}
  7010  		case "state":
  7011  			if v != nil {
  7012  				var state JobState
  7013  				err = json.Unmarshal(*v, &state)
  7014  				if err != nil {
  7015  					return err
  7016  				}
  7017  				jp.State = state
  7018  			}
  7019  		case "description":
  7020  			if v != nil {
  7021  				var description string
  7022  				err = json.Unmarshal(*v, &description)
  7023  				if err != nil {
  7024  					return err
  7025  				}
  7026  				jp.Description = &description
  7027  			}
  7028  		case "input":
  7029  			if v != nil {
  7030  				input, err := unmarshalBasicJobInput(*v)
  7031  				if err != nil {
  7032  					return err
  7033  				}
  7034  				jp.Input = input
  7035  			}
  7036  		case "lastModified":
  7037  			if v != nil {
  7038  				var lastModified date.Time
  7039  				err = json.Unmarshal(*v, &lastModified)
  7040  				if err != nil {
  7041  					return err
  7042  				}
  7043  				jp.LastModified = &lastModified
  7044  			}
  7045  		case "outputs":
  7046  			if v != nil {
  7047  				outputs, err := unmarshalBasicJobOutputArray(*v)
  7048  				if err != nil {
  7049  					return err
  7050  				}
  7051  				jp.Outputs = &outputs
  7052  			}
  7053  		case "priority":
  7054  			if v != nil {
  7055  				var priority Priority
  7056  				err = json.Unmarshal(*v, &priority)
  7057  				if err != nil {
  7058  					return err
  7059  				}
  7060  				jp.Priority = priority
  7061  			}
  7062  		case "correlationData":
  7063  			if v != nil {
  7064  				var correlationData map[string]*string
  7065  				err = json.Unmarshal(*v, &correlationData)
  7066  				if err != nil {
  7067  					return err
  7068  				}
  7069  				jp.CorrelationData = correlationData
  7070  			}
  7071  		case "startTime":
  7072  			if v != nil {
  7073  				var startTime date.Time
  7074  				err = json.Unmarshal(*v, &startTime)
  7075  				if err != nil {
  7076  					return err
  7077  				}
  7078  				jp.StartTime = &startTime
  7079  			}
  7080  		case "endTime":
  7081  			if v != nil {
  7082  				var endTime date.Time
  7083  				err = json.Unmarshal(*v, &endTime)
  7084  				if err != nil {
  7085  					return err
  7086  				}
  7087  				jp.EndTime = &endTime
  7088  			}
  7089  		}
  7090  	}
  7091  
  7092  	return nil
  7093  }
  7094  
  7095  // JpgFormat describes the settings for producing JPEG thumbnails.
  7096  type JpgFormat struct {
  7097  	// FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of input video files will be used. If the length of base name of the input video file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename.
  7098  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  7099  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  7100  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  7101  }
  7102  
  7103  // MarshalJSON is the custom marshaler for JpgFormat.
  7104  func (jf JpgFormat) MarshalJSON() ([]byte, error) {
  7105  	jf.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat
  7106  	objectMap := make(map[string]interface{})
  7107  	if jf.FilenamePattern != nil {
  7108  		objectMap["filenamePattern"] = jf.FilenamePattern
  7109  	}
  7110  	if jf.OdataType != "" {
  7111  		objectMap["@odata.type"] = jf.OdataType
  7112  	}
  7113  	return json.Marshal(objectMap)
  7114  }
  7115  
  7116  // AsImageFormat is the BasicFormat implementation for JpgFormat.
  7117  func (jf JpgFormat) AsImageFormat() (*ImageFormat, bool) {
  7118  	return nil, false
  7119  }
  7120  
  7121  // AsBasicImageFormat is the BasicFormat implementation for JpgFormat.
  7122  func (jf JpgFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
  7123  	return &jf, true
  7124  }
  7125  
  7126  // AsJpgFormat is the BasicFormat implementation for JpgFormat.
  7127  func (jf JpgFormat) AsJpgFormat() (*JpgFormat, bool) {
  7128  	return &jf, true
  7129  }
  7130  
  7131  // AsPngFormat is the BasicFormat implementation for JpgFormat.
  7132  func (jf JpgFormat) AsPngFormat() (*PngFormat, bool) {
  7133  	return nil, false
  7134  }
  7135  
  7136  // AsMultiBitrateFormat is the BasicFormat implementation for JpgFormat.
  7137  func (jf JpgFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  7138  	return nil, false
  7139  }
  7140  
  7141  // AsBasicMultiBitrateFormat is the BasicFormat implementation for JpgFormat.
  7142  func (jf JpgFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  7143  	return nil, false
  7144  }
  7145  
  7146  // AsMp4Format is the BasicFormat implementation for JpgFormat.
  7147  func (jf JpgFormat) AsMp4Format() (*Mp4Format, bool) {
  7148  	return nil, false
  7149  }
  7150  
  7151  // AsTransportStreamFormat is the BasicFormat implementation for JpgFormat.
  7152  func (jf JpgFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  7153  	return nil, false
  7154  }
  7155  
  7156  // AsFormat is the BasicFormat implementation for JpgFormat.
  7157  func (jf JpgFormat) AsFormat() (*Format, bool) {
  7158  	return nil, false
  7159  }
  7160  
  7161  // AsBasicFormat is the BasicFormat implementation for JpgFormat.
  7162  func (jf JpgFormat) AsBasicFormat() (BasicFormat, bool) {
  7163  	return &jf, true
  7164  }
  7165  
  7166  // JpgImage describes the properties for producing a series of JPEG images from the input video.
  7167  type JpgImage struct {
  7168  	// Layers - A collection of output JPEG image layers to be produced by the encoder.
  7169  	Layers *[]JpgLayer `json:"layers,omitempty"`
  7170  	// SpriteColumn - Sets the number of columns used in thumbnail sprite image.  The number of rows are automatically calculated and a VTT file is generated with the coordinate mappings for each thumbnail in the sprite. Note: this value should be a positive integer and a proper value is recommended so that the output image resolution will not go beyond JPEG maximum pixel resolution limit 65535x65535.
  7171  	SpriteColumn *int32 `json:"spriteColumn,omitempty"`
  7172  	// Start - The position in the input video from where to start generating thumbnails. The value can be in ISO 8601 format (For example, PT05S to start at 5 seconds), or a frame count (For example, 10 to start at the 10th frame), or a relative value to stream duration (For example, 10% to start at 10% of stream duration). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video and will only produce one thumbnail, no matter what other settings are for Step and Range. The default value is macro {Best}.
  7173  	Start *string `json:"start,omitempty"`
  7174  	// Step - The intervals at which thumbnails are generated. The value can be in ISO 8601 format (For example, PT05S for one image every 5 seconds), or a frame count (For example, 30 for one image every 30 frames), or a relative value to stream duration (For example, 10% for one image every 10% of stream duration). Note: Step value will affect the first generated thumbnail, which may not be exactly the one specified at transform preset start time. This is due to the encoder, which tries to select the best thumbnail between start time and Step position from start time as the first output. As the default value is 10%, it means if stream has long duration, the first generated thumbnail might be far away from the one specified at start time. Try to select reasonable value for Step if the first thumbnail is expected close to start time, or set Range value at 1 if only one thumbnail is needed at start time.
  7175  	Step *string `json:"step,omitempty"`
  7176  	// Range - The position relative to transform preset start time in the input video at which to stop generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to stop at 5 minutes and 30 seconds from start time), or a frame count (For example, 300 to stop at the 300th frame from the frame at start time. If this value is 1, it means only producing one thumbnail at start time), or a relative value to the stream duration (For example, 50% to stop at half of stream duration from start time). The default value is 100%, which means to stop at the end of the stream.
  7177  	Range *string `json:"range,omitempty"`
  7178  	// KeyFrameInterval - The distance between two key frames. The value should be non-zero in the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will follow the input source setting.
  7179  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  7180  	// 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'
  7181  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  7182  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
  7183  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
  7184  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  7185  	Label *string `json:"label,omitempty"`
  7186  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  7187  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  7188  }
  7189  
  7190  // MarshalJSON is the custom marshaler for JpgImage.
  7191  func (ji JpgImage) MarshalJSON() ([]byte, error) {
  7192  	ji.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage
  7193  	objectMap := make(map[string]interface{})
  7194  	if ji.Layers != nil {
  7195  		objectMap["layers"] = ji.Layers
  7196  	}
  7197  	if ji.SpriteColumn != nil {
  7198  		objectMap["spriteColumn"] = ji.SpriteColumn
  7199  	}
  7200  	if ji.Start != nil {
  7201  		objectMap["start"] = ji.Start
  7202  	}
  7203  	if ji.Step != nil {
  7204  		objectMap["step"] = ji.Step
  7205  	}
  7206  	if ji.Range != nil {
  7207  		objectMap["range"] = ji.Range
  7208  	}
  7209  	if ji.KeyFrameInterval != nil {
  7210  		objectMap["keyFrameInterval"] = ji.KeyFrameInterval
  7211  	}
  7212  	if ji.StretchMode != "" {
  7213  		objectMap["stretchMode"] = ji.StretchMode
  7214  	}
  7215  	if ji.SyncMode != "" {
  7216  		objectMap["syncMode"] = ji.SyncMode
  7217  	}
  7218  	if ji.Label != nil {
  7219  		objectMap["label"] = ji.Label
  7220  	}
  7221  	if ji.OdataType != "" {
  7222  		objectMap["@odata.type"] = ji.OdataType
  7223  	}
  7224  	return json.Marshal(objectMap)
  7225  }
  7226  
  7227  // AsAudio is the BasicCodec implementation for JpgImage.
  7228  func (ji JpgImage) AsAudio() (*Audio, bool) {
  7229  	return nil, false
  7230  }
  7231  
  7232  // AsBasicAudio is the BasicCodec implementation for JpgImage.
  7233  func (ji JpgImage) AsBasicAudio() (BasicAudio, bool) {
  7234  	return nil, false
  7235  }
  7236  
  7237  // AsAacAudio is the BasicCodec implementation for JpgImage.
  7238  func (ji JpgImage) AsAacAudio() (*AacAudio, bool) {
  7239  	return nil, false
  7240  }
  7241  
  7242  // AsVideo is the BasicCodec implementation for JpgImage.
  7243  func (ji JpgImage) AsVideo() (*Video, bool) {
  7244  	return nil, false
  7245  }
  7246  
  7247  // AsBasicVideo is the BasicCodec implementation for JpgImage.
  7248  func (ji JpgImage) AsBasicVideo() (BasicVideo, bool) {
  7249  	return &ji, true
  7250  }
  7251  
  7252  // AsH265Video is the BasicCodec implementation for JpgImage.
  7253  func (ji JpgImage) AsH265Video() (*H265Video, bool) {
  7254  	return nil, false
  7255  }
  7256  
  7257  // AsCopyVideo is the BasicCodec implementation for JpgImage.
  7258  func (ji JpgImage) AsCopyVideo() (*CopyVideo, bool) {
  7259  	return nil, false
  7260  }
  7261  
  7262  // AsImage is the BasicCodec implementation for JpgImage.
  7263  func (ji JpgImage) AsImage() (*Image, bool) {
  7264  	return nil, false
  7265  }
  7266  
  7267  // AsBasicImage is the BasicCodec implementation for JpgImage.
  7268  func (ji JpgImage) AsBasicImage() (BasicImage, bool) {
  7269  	return &ji, true
  7270  }
  7271  
  7272  // AsCopyAudio is the BasicCodec implementation for JpgImage.
  7273  func (ji JpgImage) AsCopyAudio() (*CopyAudio, bool) {
  7274  	return nil, false
  7275  }
  7276  
  7277  // AsH264Video is the BasicCodec implementation for JpgImage.
  7278  func (ji JpgImage) AsH264Video() (*H264Video, bool) {
  7279  	return nil, false
  7280  }
  7281  
  7282  // AsJpgImage is the BasicCodec implementation for JpgImage.
  7283  func (ji JpgImage) AsJpgImage() (*JpgImage, bool) {
  7284  	return &ji, true
  7285  }
  7286  
  7287  // AsPngImage is the BasicCodec implementation for JpgImage.
  7288  func (ji JpgImage) AsPngImage() (*PngImage, bool) {
  7289  	return nil, false
  7290  }
  7291  
  7292  // AsCodec is the BasicCodec implementation for JpgImage.
  7293  func (ji JpgImage) AsCodec() (*Codec, bool) {
  7294  	return nil, false
  7295  }
  7296  
  7297  // AsBasicCodec is the BasicCodec implementation for JpgImage.
  7298  func (ji JpgImage) AsBasicCodec() (BasicCodec, bool) {
  7299  	return &ji, true
  7300  }
  7301  
  7302  // JpgLayer describes the settings to produce a JPEG image from the input video.
  7303  type JpgLayer struct {
  7304  	// Quality - The compression quality of the JPEG output. Range is from 0-100 and the default is 70.
  7305  	Quality *int32 `json:"quality,omitempty"`
  7306  	// 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.
  7307  	Width *string `json:"width,omitempty"`
  7308  	// 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.
  7309  	Height *string `json:"height,omitempty"`
  7310  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  7311  	Label *string `json:"label,omitempty"`
  7312  }
  7313  
  7314  // KeyDelivery ...
  7315  type KeyDelivery struct {
  7316  	// AccessControl - The access control properties for Key Delivery.
  7317  	AccessControl *AccessControl `json:"accessControl,omitempty"`
  7318  }
  7319  
  7320  // KeyVaultProperties ...
  7321  type KeyVaultProperties struct {
  7322  	// KeyIdentifier - The URL of the Key Vault key used to encrypt the account. The key may either be versioned (for example https://vault/keys/mykey/version1) or reference a key without a version (for example https://vault/keys/mykey).
  7323  	KeyIdentifier *string `json:"keyIdentifier,omitempty"`
  7324  	// CurrentKeyIdentifier - READ-ONLY; The current key used to encrypt the Media Services account, including the key version.
  7325  	CurrentKeyIdentifier *string `json:"currentKeyIdentifier,omitempty"`
  7326  }
  7327  
  7328  // MarshalJSON is the custom marshaler for KeyVaultProperties.
  7329  func (kvp KeyVaultProperties) MarshalJSON() ([]byte, error) {
  7330  	objectMap := make(map[string]interface{})
  7331  	if kvp.KeyIdentifier != nil {
  7332  		objectMap["keyIdentifier"] = kvp.KeyIdentifier
  7333  	}
  7334  	return json.Marshal(objectMap)
  7335  }
  7336  
  7337  // Layer the encoder can be configured to produce video and/or images (thumbnails) at different
  7338  // resolutions, by specifying a layer for each desired resolution. A layer represents the properties for
  7339  // the video or image at a resolution.
  7340  type Layer struct {
  7341  	// 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.
  7342  	Width *string `json:"width,omitempty"`
  7343  	// 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.
  7344  	Height *string `json:"height,omitempty"`
  7345  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  7346  	Label *string `json:"label,omitempty"`
  7347  }
  7348  
  7349  // ListContainerSasInput the parameters to the list SAS request.
  7350  type ListContainerSasInput struct {
  7351  	// Permissions - The permissions to set on the SAS URL. Possible values include: 'AssetContainerPermissionRead', 'AssetContainerPermissionReadWrite', 'AssetContainerPermissionReadWriteDelete'
  7352  	Permissions AssetContainerPermission `json:"permissions,omitempty"`
  7353  	// ExpiryTime - The SAS URL expiration time.  This must be less than 24 hours from the current time.
  7354  	ExpiryTime *date.Time `json:"expiryTime,omitempty"`
  7355  }
  7356  
  7357  // ListContentKeysResponse class of response for listContentKeys action
  7358  type ListContentKeysResponse struct {
  7359  	autorest.Response `json:"-"`
  7360  	// ContentKeys - ContentKeys used by current Streaming Locator
  7361  	ContentKeys *[]StreamingLocatorContentKey `json:"contentKeys,omitempty"`
  7362  }
  7363  
  7364  // ListEdgePoliciesInput ...
  7365  type ListEdgePoliciesInput struct {
  7366  	// DeviceID - Unique identifier of the edge device.
  7367  	DeviceID *string `json:"deviceId,omitempty"`
  7368  }
  7369  
  7370  // ListPathsResponse class of response for listPaths action
  7371  type ListPathsResponse struct {
  7372  	autorest.Response `json:"-"`
  7373  	// StreamingPaths - Streaming Paths supported by current Streaming Locator
  7374  	StreamingPaths *[]StreamingPath `json:"streamingPaths,omitempty"`
  7375  	// DownloadPaths - Download Paths supported by current Streaming Locator
  7376  	DownloadPaths *[]string `json:"downloadPaths,omitempty"`
  7377  }
  7378  
  7379  // ListStreamingLocatorsResponse the Streaming Locators associated with this Asset.
  7380  type ListStreamingLocatorsResponse struct {
  7381  	autorest.Response `json:"-"`
  7382  	// StreamingLocators - READ-ONLY; The list of Streaming Locators.
  7383  	StreamingLocators *[]AssetStreamingLocator `json:"streamingLocators,omitempty"`
  7384  }
  7385  
  7386  // MarshalJSON is the custom marshaler for ListStreamingLocatorsResponse.
  7387  func (lslr ListStreamingLocatorsResponse) MarshalJSON() ([]byte, error) {
  7388  	objectMap := make(map[string]interface{})
  7389  	return json.Marshal(objectMap)
  7390  }
  7391  
  7392  // LiveEvent the live event.
  7393  type LiveEvent struct {
  7394  	autorest.Response `json:"-"`
  7395  	// LiveEventProperties - The live event properties.
  7396  	*LiveEventProperties `json:"properties,omitempty"`
  7397  	// SystemData - READ-ONLY; The system metadata relating to this resource.
  7398  	SystemData *SystemData `json:"systemData,omitempty"`
  7399  	// Tags - Resource tags.
  7400  	Tags map[string]*string `json:"tags"`
  7401  	// Location - The geo-location where the resource lives
  7402  	Location *string `json:"location,omitempty"`
  7403  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  7404  	ID *string `json:"id,omitempty"`
  7405  	// Name - READ-ONLY; The name of the resource
  7406  	Name *string `json:"name,omitempty"`
  7407  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  7408  	Type *string `json:"type,omitempty"`
  7409  }
  7410  
  7411  // MarshalJSON is the custom marshaler for LiveEvent.
  7412  func (le LiveEvent) MarshalJSON() ([]byte, error) {
  7413  	objectMap := make(map[string]interface{})
  7414  	if le.LiveEventProperties != nil {
  7415  		objectMap["properties"] = le.LiveEventProperties
  7416  	}
  7417  	if le.Tags != nil {
  7418  		objectMap["tags"] = le.Tags
  7419  	}
  7420  	if le.Location != nil {
  7421  		objectMap["location"] = le.Location
  7422  	}
  7423  	return json.Marshal(objectMap)
  7424  }
  7425  
  7426  // UnmarshalJSON is the custom unmarshaler for LiveEvent struct.
  7427  func (le *LiveEvent) UnmarshalJSON(body []byte) error {
  7428  	var m map[string]*json.RawMessage
  7429  	err := json.Unmarshal(body, &m)
  7430  	if err != nil {
  7431  		return err
  7432  	}
  7433  	for k, v := range m {
  7434  		switch k {
  7435  		case "properties":
  7436  			if v != nil {
  7437  				var liveEventProperties LiveEventProperties
  7438  				err = json.Unmarshal(*v, &liveEventProperties)
  7439  				if err != nil {
  7440  					return err
  7441  				}
  7442  				le.LiveEventProperties = &liveEventProperties
  7443  			}
  7444  		case "systemData":
  7445  			if v != nil {
  7446  				var systemData SystemData
  7447  				err = json.Unmarshal(*v, &systemData)
  7448  				if err != nil {
  7449  					return err
  7450  				}
  7451  				le.SystemData = &systemData
  7452  			}
  7453  		case "tags":
  7454  			if v != nil {
  7455  				var tags map[string]*string
  7456  				err = json.Unmarshal(*v, &tags)
  7457  				if err != nil {
  7458  					return err
  7459  				}
  7460  				le.Tags = tags
  7461  			}
  7462  		case "location":
  7463  			if v != nil {
  7464  				var location string
  7465  				err = json.Unmarshal(*v, &location)
  7466  				if err != nil {
  7467  					return err
  7468  				}
  7469  				le.Location = &location
  7470  			}
  7471  		case "id":
  7472  			if v != nil {
  7473  				var ID string
  7474  				err = json.Unmarshal(*v, &ID)
  7475  				if err != nil {
  7476  					return err
  7477  				}
  7478  				le.ID = &ID
  7479  			}
  7480  		case "name":
  7481  			if v != nil {
  7482  				var name string
  7483  				err = json.Unmarshal(*v, &name)
  7484  				if err != nil {
  7485  					return err
  7486  				}
  7487  				le.Name = &name
  7488  			}
  7489  		case "type":
  7490  			if v != nil {
  7491  				var typeVar string
  7492  				err = json.Unmarshal(*v, &typeVar)
  7493  				if err != nil {
  7494  					return err
  7495  				}
  7496  				le.Type = &typeVar
  7497  			}
  7498  		}
  7499  	}
  7500  
  7501  	return nil
  7502  }
  7503  
  7504  // LiveEventActionInput the LiveEvent action input parameter definition.
  7505  type LiveEventActionInput struct {
  7506  	// RemoveOutputsOnStop - The flag indicates whether live outputs are automatically deleted when live event is being stopped. Deleting live outputs do not delete the underlying assets.
  7507  	RemoveOutputsOnStop *bool `json:"removeOutputsOnStop,omitempty"`
  7508  }
  7509  
  7510  // LiveEventEncoding specifies the live event type and optional encoding settings for encoding live events.
  7511  type LiveEventEncoding struct {
  7512  	// EncodingType - Live event type. When encodingType is set to PassthroughBasic or PassthroughStandard, the service simply passes through the incoming video and audio layer(s) to the output. When encodingType is set to Standard or Premium1080p, a live encoder transcodes the incoming stream into multiple bitrates or layers. See https://go.microsoft.com/fwlink/?linkid=2095101 for more information. This property cannot be modified after the live event is created. Possible values include: 'LiveEventEncodingTypeNone', 'LiveEventEncodingTypeStandard', 'LiveEventEncodingTypePremium1080p', 'LiveEventEncodingTypePassthroughBasic', 'LiveEventEncodingTypePassthroughStandard'
  7513  	EncodingType LiveEventEncodingType `json:"encodingType,omitempty"`
  7514  	// PresetName - The optional encoding preset name, used when encodingType is not None. This value is specified at creation time and cannot be updated. If the encodingType is set to Standard, then the default preset name is ‘Default720p’. Else if the encodingType is set to Premium1080p, the default preset is ‘Default1080p’.
  7515  	PresetName *string `json:"presetName,omitempty"`
  7516  	// StretchMode - Specifies how the input video will be resized to fit the desired output resolution(s). Default is None. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit'
  7517  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  7518  	// KeyFrameInterval - Use an ISO 8601 time value between 0.5 to 20 seconds to specify the output fragment length for the video and audio tracks of an encoding live event. For example, use PT2S to indicate 2 seconds. For the video track it also defines the key frame interval, or the length of a GoP (group of pictures).   If this value is not set for an encoding live event, the fragment duration defaults to 2 seconds. The value cannot be set for pass-through live events.
  7519  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  7520  }
  7521  
  7522  // LiveEventEndpoint the live event endpoint.
  7523  type LiveEventEndpoint struct {
  7524  	// Protocol - The endpoint protocol.
  7525  	Protocol *string `json:"protocol,omitempty"`
  7526  	// URL - The endpoint URL.
  7527  	URL *string `json:"url,omitempty"`
  7528  }
  7529  
  7530  // LiveEventInput the live event input.
  7531  type LiveEventInput struct {
  7532  	// StreamingProtocol - The input protocol for the live event. This is specified at creation time and cannot be updated. Possible values include: 'LiveEventInputProtocolFragmentedMP4', 'LiveEventInputProtocolRTMP'
  7533  	StreamingProtocol LiveEventInputProtocol `json:"streamingProtocol,omitempty"`
  7534  	// AccessControl - Access control for live event input.
  7535  	AccessControl *LiveEventInputAccessControl `json:"accessControl,omitempty"`
  7536  	// KeyFrameIntervalDuration - ISO 8601 time duration of the key frame interval duration of the input. This value sets the EXT-X-TARGETDURATION property in the HLS output. For example, use PT2S to indicate 2 seconds. Leave the value empty for encoding live events.
  7537  	KeyFrameIntervalDuration *string `json:"keyFrameIntervalDuration,omitempty"`
  7538  	// AccessToken - A UUID in string form to uniquely identify the stream. This can be specified at creation time but cannot be updated. If omitted, the service will generate a unique value.
  7539  	AccessToken *string `json:"accessToken,omitempty"`
  7540  	// Endpoints - The input endpoints for the live event.
  7541  	Endpoints *[]LiveEventEndpoint `json:"endpoints,omitempty"`
  7542  }
  7543  
  7544  // LiveEventInputAccessControl the IP access control for live event input.
  7545  type LiveEventInputAccessControl struct {
  7546  	// IP - The IP access control properties.
  7547  	IP *IPAccessControl `json:"ip,omitempty"`
  7548  }
  7549  
  7550  // LiveEventInputTrackSelection a track selection condition. This property is reserved for future use, any
  7551  // value set on this property will be ignored.
  7552  type LiveEventInputTrackSelection struct {
  7553  	// Property - Property name to select. This property is reserved for future use, any value set on this property will be ignored.
  7554  	Property *string `json:"property,omitempty"`
  7555  	// Operation - Comparing operation. This property is reserved for future use, any value set on this property will be ignored.
  7556  	Operation *string `json:"operation,omitempty"`
  7557  	// Value - Property value to select. This property is reserved for future use, any value set on this property will be ignored.
  7558  	Value *string `json:"value,omitempty"`
  7559  }
  7560  
  7561  // LiveEventListResult the LiveEvent list result.
  7562  type LiveEventListResult struct {
  7563  	autorest.Response `json:"-"`
  7564  	// Value - The result of the List Live Event operation.
  7565  	Value *[]LiveEvent `json:"value,omitempty"`
  7566  	// OdataCount - The number of result.
  7567  	OdataCount *int32 `json:"@odata.count,omitempty"`
  7568  	// OdataNextLink - The link to the next set of results. Not empty if value contains incomplete list of live outputs.
  7569  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
  7570  }
  7571  
  7572  // LiveEventListResultIterator provides access to a complete listing of LiveEvent values.
  7573  type LiveEventListResultIterator struct {
  7574  	i    int
  7575  	page LiveEventListResultPage
  7576  }
  7577  
  7578  // NextWithContext advances to the next value.  If there was an error making
  7579  // the request the iterator does not advance and the error is returned.
  7580  func (iter *LiveEventListResultIterator) NextWithContext(ctx context.Context) (err error) {
  7581  	if tracing.IsEnabled() {
  7582  		ctx = tracing.StartSpan(ctx, fqdn+"/LiveEventListResultIterator.NextWithContext")
  7583  		defer func() {
  7584  			sc := -1
  7585  			if iter.Response().Response.Response != nil {
  7586  				sc = iter.Response().Response.Response.StatusCode
  7587  			}
  7588  			tracing.EndSpan(ctx, sc, err)
  7589  		}()
  7590  	}
  7591  	iter.i++
  7592  	if iter.i < len(iter.page.Values()) {
  7593  		return nil
  7594  	}
  7595  	err = iter.page.NextWithContext(ctx)
  7596  	if err != nil {
  7597  		iter.i--
  7598  		return err
  7599  	}
  7600  	iter.i = 0
  7601  	return nil
  7602  }
  7603  
  7604  // Next advances to the next value.  If there was an error making
  7605  // the request the iterator does not advance and the error is returned.
  7606  // Deprecated: Use NextWithContext() instead.
  7607  func (iter *LiveEventListResultIterator) Next() error {
  7608  	return iter.NextWithContext(context.Background())
  7609  }
  7610  
  7611  // NotDone returns true if the enumeration should be started or is not yet complete.
  7612  func (iter LiveEventListResultIterator) NotDone() bool {
  7613  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  7614  }
  7615  
  7616  // Response returns the raw server response from the last page request.
  7617  func (iter LiveEventListResultIterator) Response() LiveEventListResult {
  7618  	return iter.page.Response()
  7619  }
  7620  
  7621  // Value returns the current value or a zero-initialized value if the
  7622  // iterator has advanced beyond the end of the collection.
  7623  func (iter LiveEventListResultIterator) Value() LiveEvent {
  7624  	if !iter.page.NotDone() {
  7625  		return LiveEvent{}
  7626  	}
  7627  	return iter.page.Values()[iter.i]
  7628  }
  7629  
  7630  // Creates a new instance of the LiveEventListResultIterator type.
  7631  func NewLiveEventListResultIterator(page LiveEventListResultPage) LiveEventListResultIterator {
  7632  	return LiveEventListResultIterator{page: page}
  7633  }
  7634  
  7635  // IsEmpty returns true if the ListResult contains no values.
  7636  func (lelr LiveEventListResult) IsEmpty() bool {
  7637  	return lelr.Value == nil || len(*lelr.Value) == 0
  7638  }
  7639  
  7640  // hasNextLink returns true if the NextLink is not empty.
  7641  func (lelr LiveEventListResult) hasNextLink() bool {
  7642  	return lelr.OdataNextLink != nil && len(*lelr.OdataNextLink) != 0
  7643  }
  7644  
  7645  // liveEventListResultPreparer prepares a request to retrieve the next set of results.
  7646  // It returns nil if no more results exist.
  7647  func (lelr LiveEventListResult) liveEventListResultPreparer(ctx context.Context) (*http.Request, error) {
  7648  	if !lelr.hasNextLink() {
  7649  		return nil, nil
  7650  	}
  7651  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  7652  		autorest.AsJSON(),
  7653  		autorest.AsGet(),
  7654  		autorest.WithBaseURL(to.String(lelr.OdataNextLink)))
  7655  }
  7656  
  7657  // LiveEventListResultPage contains a page of LiveEvent values.
  7658  type LiveEventListResultPage struct {
  7659  	fn   func(context.Context, LiveEventListResult) (LiveEventListResult, error)
  7660  	lelr LiveEventListResult
  7661  }
  7662  
  7663  // NextWithContext advances to the next page of values.  If there was an error making
  7664  // the request the page does not advance and the error is returned.
  7665  func (page *LiveEventListResultPage) NextWithContext(ctx context.Context) (err error) {
  7666  	if tracing.IsEnabled() {
  7667  		ctx = tracing.StartSpan(ctx, fqdn+"/LiveEventListResultPage.NextWithContext")
  7668  		defer func() {
  7669  			sc := -1
  7670  			if page.Response().Response.Response != nil {
  7671  				sc = page.Response().Response.Response.StatusCode
  7672  			}
  7673  			tracing.EndSpan(ctx, sc, err)
  7674  		}()
  7675  	}
  7676  	for {
  7677  		next, err := page.fn(ctx, page.lelr)
  7678  		if err != nil {
  7679  			return err
  7680  		}
  7681  		page.lelr = next
  7682  		if !next.hasNextLink() || !next.IsEmpty() {
  7683  			break
  7684  		}
  7685  	}
  7686  	return nil
  7687  }
  7688  
  7689  // Next advances to the next page of values.  If there was an error making
  7690  // the request the page does not advance and the error is returned.
  7691  // Deprecated: Use NextWithContext() instead.
  7692  func (page *LiveEventListResultPage) Next() error {
  7693  	return page.NextWithContext(context.Background())
  7694  }
  7695  
  7696  // NotDone returns true if the page enumeration should be started or is not yet complete.
  7697  func (page LiveEventListResultPage) NotDone() bool {
  7698  	return !page.lelr.IsEmpty()
  7699  }
  7700  
  7701  // Response returns the raw server response from the last page request.
  7702  func (page LiveEventListResultPage) Response() LiveEventListResult {
  7703  	return page.lelr
  7704  }
  7705  
  7706  // Values returns the slice of values for the current page or nil if there are no values.
  7707  func (page LiveEventListResultPage) Values() []LiveEvent {
  7708  	if page.lelr.IsEmpty() {
  7709  		return nil
  7710  	}
  7711  	return *page.lelr.Value
  7712  }
  7713  
  7714  // Creates a new instance of the LiveEventListResultPage type.
  7715  func NewLiveEventListResultPage(cur LiveEventListResult, getNextPage func(context.Context, LiveEventListResult) (LiveEventListResult, error)) LiveEventListResultPage {
  7716  	return LiveEventListResultPage{
  7717  		fn:   getNextPage,
  7718  		lelr: cur,
  7719  	}
  7720  }
  7721  
  7722  // LiveEventOutputTranscriptionTrack describes a transcription track in the output of a live event,
  7723  // generated using speech-to-text transcription. This property is reserved for future use, any value set on
  7724  // this property will be ignored.
  7725  type LiveEventOutputTranscriptionTrack struct {
  7726  	// TrackName - The output track name. This property is reserved for future use, any value set on this property will be ignored.
  7727  	TrackName *string `json:"trackName,omitempty"`
  7728  }
  7729  
  7730  // LiveEventPreview live event preview settings.
  7731  type LiveEventPreview struct {
  7732  	// Endpoints - The endpoints for preview. Do not share the preview URL with the live event audience.
  7733  	Endpoints *[]LiveEventEndpoint `json:"endpoints,omitempty"`
  7734  	// AccessControl - The access control for live event preview.
  7735  	AccessControl *LiveEventPreviewAccessControl `json:"accessControl,omitempty"`
  7736  	// 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.
  7737  	PreviewLocator *string `json:"previewLocator,omitempty"`
  7738  	// StreamingPolicyName - The name of streaming policy used for the live event preview. This value is specified at creation time and cannot be updated.
  7739  	StreamingPolicyName *string `json:"streamingPolicyName,omitempty"`
  7740  	// AlternativeMediaID - An alternative media identifier associated with the streaming locator created for the preview. This value is specified at creation time and cannot be updated. The identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the StreamingPolicyName field.
  7741  	AlternativeMediaID *string `json:"alternativeMediaId,omitempty"`
  7742  }
  7743  
  7744  // LiveEventPreviewAccessControl the IP access control for the live event preview endpoint.
  7745  type LiveEventPreviewAccessControl struct {
  7746  	// IP - The IP access control properties.
  7747  	IP *IPAccessControl `json:"ip,omitempty"`
  7748  }
  7749  
  7750  // LiveEventProperties the live event properties.
  7751  type LiveEventProperties struct {
  7752  	// Description - A description for the live event.
  7753  	Description *string `json:"description,omitempty"`
  7754  	// Input - Live event input settings. It defines how the live event receives input from a contribution encoder.
  7755  	Input *LiveEventInput `json:"input,omitempty"`
  7756  	// Preview - Live event preview settings. Preview allows live event producers to preview the live streaming content without creating any live output.
  7757  	Preview *LiveEventPreview `json:"preview,omitempty"`
  7758  	// Encoding - Encoding settings for the live event. It configures whether a live encoder is used for the live event and settings for the live encoder if it is used.
  7759  	Encoding *LiveEventEncoding `json:"encoding,omitempty"`
  7760  	// Transcriptions - Live transcription settings for the live event. See https://go.microsoft.com/fwlink/?linkid=2133742 for more information about the live transcription feature.
  7761  	Transcriptions *[]LiveEventTranscription `json:"transcriptions,omitempty"`
  7762  	// ProvisioningState - READ-ONLY; The provisioning state of the live event.
  7763  	ProvisioningState *string `json:"provisioningState,omitempty"`
  7764  	// ResourceState - READ-ONLY; The resource state of the live event. See https://go.microsoft.com/fwlink/?linkid=2139012 for more information. Possible values include: 'LiveEventResourceStateStopped', 'LiveEventResourceStateAllocating', 'LiveEventResourceStateStandBy', 'LiveEventResourceStateStarting', 'LiveEventResourceStateRunning', 'LiveEventResourceStateStopping', 'LiveEventResourceStateDeleting'
  7765  	ResourceState LiveEventResourceState `json:"resourceState,omitempty"`
  7766  	// CrossSiteAccessPolicies - Live event cross site access policies.
  7767  	CrossSiteAccessPolicies *CrossSiteAccessPolicies `json:"crossSiteAccessPolicies,omitempty"`
  7768  	// UseStaticHostname - Specifies whether a static hostname would be assigned to the live event preview and ingest endpoints. This value can only be updated if the live event is in Standby state
  7769  	UseStaticHostname *bool `json:"useStaticHostname,omitempty"`
  7770  	// HostnamePrefix - When useStaticHostname is set to true, the hostnamePrefix specifies the first part of the hostname assigned to the live event preview and ingest endpoints. The final hostname would be a combination of this prefix, the media service account name and a short code for the Azure Media Services data center.
  7771  	HostnamePrefix *string `json:"hostnamePrefix,omitempty"`
  7772  	// StreamOptions - The options to use for the LiveEvent. This value is specified at creation time and cannot be updated. The valid values for the array entry values are 'Default' and 'LowLatency'.
  7773  	StreamOptions *[]StreamOptionsFlag `json:"streamOptions,omitempty"`
  7774  	// Created - READ-ONLY; The creation time for the live event
  7775  	Created *date.Time `json:"created,omitempty"`
  7776  	// LastModified - READ-ONLY; The last modified time of the live event.
  7777  	LastModified *date.Time `json:"lastModified,omitempty"`
  7778  }
  7779  
  7780  // MarshalJSON is the custom marshaler for LiveEventProperties.
  7781  func (lep LiveEventProperties) MarshalJSON() ([]byte, error) {
  7782  	objectMap := make(map[string]interface{})
  7783  	if lep.Description != nil {
  7784  		objectMap["description"] = lep.Description
  7785  	}
  7786  	if lep.Input != nil {
  7787  		objectMap["input"] = lep.Input
  7788  	}
  7789  	if lep.Preview != nil {
  7790  		objectMap["preview"] = lep.Preview
  7791  	}
  7792  	if lep.Encoding != nil {
  7793  		objectMap["encoding"] = lep.Encoding
  7794  	}
  7795  	if lep.Transcriptions != nil {
  7796  		objectMap["transcriptions"] = lep.Transcriptions
  7797  	}
  7798  	if lep.CrossSiteAccessPolicies != nil {
  7799  		objectMap["crossSiteAccessPolicies"] = lep.CrossSiteAccessPolicies
  7800  	}
  7801  	if lep.UseStaticHostname != nil {
  7802  		objectMap["useStaticHostname"] = lep.UseStaticHostname
  7803  	}
  7804  	if lep.HostnamePrefix != nil {
  7805  		objectMap["hostnamePrefix"] = lep.HostnamePrefix
  7806  	}
  7807  	if lep.StreamOptions != nil {
  7808  		objectMap["streamOptions"] = lep.StreamOptions
  7809  	}
  7810  	return json.Marshal(objectMap)
  7811  }
  7812  
  7813  // LiveEventsAllocateFuture an abstraction for monitoring and retrieving the results of a long-running
  7814  // operation.
  7815  type LiveEventsAllocateFuture struct {
  7816  	azure.FutureAPI
  7817  	// Result returns the result of the asynchronous operation.
  7818  	// If the operation has not completed it will return an error.
  7819  	Result func(LiveEventsClient) (autorest.Response, error)
  7820  }
  7821  
  7822  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7823  func (future *LiveEventsAllocateFuture) UnmarshalJSON(body []byte) error {
  7824  	var azFuture azure.Future
  7825  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7826  		return err
  7827  	}
  7828  	future.FutureAPI = &azFuture
  7829  	future.Result = future.result
  7830  	return nil
  7831  }
  7832  
  7833  // result is the default implementation for LiveEventsAllocateFuture.Result.
  7834  func (future *LiveEventsAllocateFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
  7835  	var done bool
  7836  	done, err = future.DoneWithContext(context.Background(), client)
  7837  	if err != nil {
  7838  		err = autorest.NewErrorWithError(err, "media.LiveEventsAllocateFuture", "Result", future.Response(), "Polling failure")
  7839  		return
  7840  	}
  7841  	if !done {
  7842  		ar.Response = future.Response()
  7843  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsAllocateFuture")
  7844  		return
  7845  	}
  7846  	ar.Response = future.Response()
  7847  	return
  7848  }
  7849  
  7850  // LiveEventsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
  7851  // operation.
  7852  type LiveEventsCreateFuture struct {
  7853  	azure.FutureAPI
  7854  	// Result returns the result of the asynchronous operation.
  7855  	// If the operation has not completed it will return an error.
  7856  	Result func(LiveEventsClient) (LiveEvent, error)
  7857  }
  7858  
  7859  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7860  func (future *LiveEventsCreateFuture) UnmarshalJSON(body []byte) error {
  7861  	var azFuture azure.Future
  7862  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7863  		return err
  7864  	}
  7865  	future.FutureAPI = &azFuture
  7866  	future.Result = future.result
  7867  	return nil
  7868  }
  7869  
  7870  // result is the default implementation for LiveEventsCreateFuture.Result.
  7871  func (future *LiveEventsCreateFuture) result(client LiveEventsClient) (le LiveEvent, err error) {
  7872  	var done bool
  7873  	done, err = future.DoneWithContext(context.Background(), client)
  7874  	if err != nil {
  7875  		err = autorest.NewErrorWithError(err, "media.LiveEventsCreateFuture", "Result", future.Response(), "Polling failure")
  7876  		return
  7877  	}
  7878  	if !done {
  7879  		le.Response.Response = future.Response()
  7880  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsCreateFuture")
  7881  		return
  7882  	}
  7883  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  7884  	if le.Response.Response, err = future.GetResult(sender); err == nil && le.Response.Response.StatusCode != http.StatusNoContent {
  7885  		le, err = client.CreateResponder(le.Response.Response)
  7886  		if err != nil {
  7887  			err = autorest.NewErrorWithError(err, "media.LiveEventsCreateFuture", "Result", le.Response.Response, "Failure responding to request")
  7888  		}
  7889  	}
  7890  	return
  7891  }
  7892  
  7893  // LiveEventsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  7894  // operation.
  7895  type LiveEventsDeleteFuture struct {
  7896  	azure.FutureAPI
  7897  	// Result returns the result of the asynchronous operation.
  7898  	// If the operation has not completed it will return an error.
  7899  	Result func(LiveEventsClient) (autorest.Response, error)
  7900  }
  7901  
  7902  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7903  func (future *LiveEventsDeleteFuture) UnmarshalJSON(body []byte) error {
  7904  	var azFuture azure.Future
  7905  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7906  		return err
  7907  	}
  7908  	future.FutureAPI = &azFuture
  7909  	future.Result = future.result
  7910  	return nil
  7911  }
  7912  
  7913  // result is the default implementation for LiveEventsDeleteFuture.Result.
  7914  func (future *LiveEventsDeleteFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
  7915  	var done bool
  7916  	done, err = future.DoneWithContext(context.Background(), client)
  7917  	if err != nil {
  7918  		err = autorest.NewErrorWithError(err, "media.LiveEventsDeleteFuture", "Result", future.Response(), "Polling failure")
  7919  		return
  7920  	}
  7921  	if !done {
  7922  		ar.Response = future.Response()
  7923  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsDeleteFuture")
  7924  		return
  7925  	}
  7926  	ar.Response = future.Response()
  7927  	return
  7928  }
  7929  
  7930  // LiveEventsResetFuture an abstraction for monitoring and retrieving the results of a long-running
  7931  // operation.
  7932  type LiveEventsResetFuture struct {
  7933  	azure.FutureAPI
  7934  	// Result returns the result of the asynchronous operation.
  7935  	// If the operation has not completed it will return an error.
  7936  	Result func(LiveEventsClient) (autorest.Response, error)
  7937  }
  7938  
  7939  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7940  func (future *LiveEventsResetFuture) UnmarshalJSON(body []byte) error {
  7941  	var azFuture azure.Future
  7942  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7943  		return err
  7944  	}
  7945  	future.FutureAPI = &azFuture
  7946  	future.Result = future.result
  7947  	return nil
  7948  }
  7949  
  7950  // result is the default implementation for LiveEventsResetFuture.Result.
  7951  func (future *LiveEventsResetFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
  7952  	var done bool
  7953  	done, err = future.DoneWithContext(context.Background(), client)
  7954  	if err != nil {
  7955  		err = autorest.NewErrorWithError(err, "media.LiveEventsResetFuture", "Result", future.Response(), "Polling failure")
  7956  		return
  7957  	}
  7958  	if !done {
  7959  		ar.Response = future.Response()
  7960  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsResetFuture")
  7961  		return
  7962  	}
  7963  	ar.Response = future.Response()
  7964  	return
  7965  }
  7966  
  7967  // LiveEventsStartFuture an abstraction for monitoring and retrieving the results of a long-running
  7968  // operation.
  7969  type LiveEventsStartFuture struct {
  7970  	azure.FutureAPI
  7971  	// Result returns the result of the asynchronous operation.
  7972  	// If the operation has not completed it will return an error.
  7973  	Result func(LiveEventsClient) (autorest.Response, error)
  7974  }
  7975  
  7976  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7977  func (future *LiveEventsStartFuture) UnmarshalJSON(body []byte) error {
  7978  	var azFuture azure.Future
  7979  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7980  		return err
  7981  	}
  7982  	future.FutureAPI = &azFuture
  7983  	future.Result = future.result
  7984  	return nil
  7985  }
  7986  
  7987  // result is the default implementation for LiveEventsStartFuture.Result.
  7988  func (future *LiveEventsStartFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
  7989  	var done bool
  7990  	done, err = future.DoneWithContext(context.Background(), client)
  7991  	if err != nil {
  7992  		err = autorest.NewErrorWithError(err, "media.LiveEventsStartFuture", "Result", future.Response(), "Polling failure")
  7993  		return
  7994  	}
  7995  	if !done {
  7996  		ar.Response = future.Response()
  7997  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsStartFuture")
  7998  		return
  7999  	}
  8000  	ar.Response = future.Response()
  8001  	return
  8002  }
  8003  
  8004  // LiveEventsStopFuture an abstraction for monitoring and retrieving the results of a long-running
  8005  // operation.
  8006  type LiveEventsStopFuture struct {
  8007  	azure.FutureAPI
  8008  	// Result returns the result of the asynchronous operation.
  8009  	// If the operation has not completed it will return an error.
  8010  	Result func(LiveEventsClient) (autorest.Response, error)
  8011  }
  8012  
  8013  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8014  func (future *LiveEventsStopFuture) UnmarshalJSON(body []byte) error {
  8015  	var azFuture azure.Future
  8016  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8017  		return err
  8018  	}
  8019  	future.FutureAPI = &azFuture
  8020  	future.Result = future.result
  8021  	return nil
  8022  }
  8023  
  8024  // result is the default implementation for LiveEventsStopFuture.Result.
  8025  func (future *LiveEventsStopFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
  8026  	var done bool
  8027  	done, err = future.DoneWithContext(context.Background(), client)
  8028  	if err != nil {
  8029  		err = autorest.NewErrorWithError(err, "media.LiveEventsStopFuture", "Result", future.Response(), "Polling failure")
  8030  		return
  8031  	}
  8032  	if !done {
  8033  		ar.Response = future.Response()
  8034  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsStopFuture")
  8035  		return
  8036  	}
  8037  	ar.Response = future.Response()
  8038  	return
  8039  }
  8040  
  8041  // LiveEventsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
  8042  // operation.
  8043  type LiveEventsUpdateFuture struct {
  8044  	azure.FutureAPI
  8045  	// Result returns the result of the asynchronous operation.
  8046  	// If the operation has not completed it will return an error.
  8047  	Result func(LiveEventsClient) (LiveEvent, error)
  8048  }
  8049  
  8050  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8051  func (future *LiveEventsUpdateFuture) UnmarshalJSON(body []byte) error {
  8052  	var azFuture azure.Future
  8053  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8054  		return err
  8055  	}
  8056  	future.FutureAPI = &azFuture
  8057  	future.Result = future.result
  8058  	return nil
  8059  }
  8060  
  8061  // result is the default implementation for LiveEventsUpdateFuture.Result.
  8062  func (future *LiveEventsUpdateFuture) result(client LiveEventsClient) (le LiveEvent, err error) {
  8063  	var done bool
  8064  	done, err = future.DoneWithContext(context.Background(), client)
  8065  	if err != nil {
  8066  		err = autorest.NewErrorWithError(err, "media.LiveEventsUpdateFuture", "Result", future.Response(), "Polling failure")
  8067  		return
  8068  	}
  8069  	if !done {
  8070  		le.Response.Response = future.Response()
  8071  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsUpdateFuture")
  8072  		return
  8073  	}
  8074  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  8075  	if le.Response.Response, err = future.GetResult(sender); err == nil && le.Response.Response.StatusCode != http.StatusNoContent {
  8076  		le, err = client.UpdateResponder(le.Response.Response)
  8077  		if err != nil {
  8078  			err = autorest.NewErrorWithError(err, "media.LiveEventsUpdateFuture", "Result", le.Response.Response, "Failure responding to request")
  8079  		}
  8080  	}
  8081  	return
  8082  }
  8083  
  8084  // LiveEventTranscription describes the transcription tracks in the output of a live event, generated using
  8085  // speech-to-text transcription. This property is reserved for future use, any value set on this property
  8086  // will be ignored.
  8087  type LiveEventTranscription struct {
  8088  	// Language - Specifies the language (locale) to be used for speech-to-text transcription – it should match the spoken language in the audio track. The value should be in BCP-47 format (e.g: 'en-US'). See https://go.microsoft.com/fwlink/?linkid=2133742 for more information about the live transcription feature and the list of supported languages.
  8089  	Language *string `json:"language,omitempty"`
  8090  	// InputTrackSelection - Provides a mechanism to select the audio track in the input live feed, to which speech-to-text transcription is applied. This property is reserved for future use, any value set on this property will be ignored.
  8091  	InputTrackSelection *[]LiveEventInputTrackSelection `json:"inputTrackSelection,omitempty"`
  8092  	// OutputTranscriptionTrack - Describes a transcription track in the output of a live event, generated using speech-to-text transcription. This property is reserved for future use, any value set on this property will be ignored.
  8093  	OutputTranscriptionTrack *LiveEventOutputTranscriptionTrack `json:"outputTranscriptionTrack,omitempty"`
  8094  }
  8095  
  8096  // LiveOutput the Live Output.
  8097  type LiveOutput struct {
  8098  	autorest.Response `json:"-"`
  8099  	// LiveOutputProperties - Live output properties.
  8100  	*LiveOutputProperties `json:"properties,omitempty"`
  8101  	// SystemData - READ-ONLY; The system metadata relating to this resource.
  8102  	SystemData *SystemData `json:"systemData,omitempty"`
  8103  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  8104  	ID *string `json:"id,omitempty"`
  8105  	// Name - READ-ONLY; The name of the resource
  8106  	Name *string `json:"name,omitempty"`
  8107  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  8108  	Type *string `json:"type,omitempty"`
  8109  }
  8110  
  8111  // MarshalJSON is the custom marshaler for LiveOutput.
  8112  func (lo LiveOutput) MarshalJSON() ([]byte, error) {
  8113  	objectMap := make(map[string]interface{})
  8114  	if lo.LiveOutputProperties != nil {
  8115  		objectMap["properties"] = lo.LiveOutputProperties
  8116  	}
  8117  	return json.Marshal(objectMap)
  8118  }
  8119  
  8120  // UnmarshalJSON is the custom unmarshaler for LiveOutput struct.
  8121  func (lo *LiveOutput) UnmarshalJSON(body []byte) error {
  8122  	var m map[string]*json.RawMessage
  8123  	err := json.Unmarshal(body, &m)
  8124  	if err != nil {
  8125  		return err
  8126  	}
  8127  	for k, v := range m {
  8128  		switch k {
  8129  		case "properties":
  8130  			if v != nil {
  8131  				var liveOutputProperties LiveOutputProperties
  8132  				err = json.Unmarshal(*v, &liveOutputProperties)
  8133  				if err != nil {
  8134  					return err
  8135  				}
  8136  				lo.LiveOutputProperties = &liveOutputProperties
  8137  			}
  8138  		case "systemData":
  8139  			if v != nil {
  8140  				var systemData SystemData
  8141  				err = json.Unmarshal(*v, &systemData)
  8142  				if err != nil {
  8143  					return err
  8144  				}
  8145  				lo.SystemData = &systemData
  8146  			}
  8147  		case "id":
  8148  			if v != nil {
  8149  				var ID string
  8150  				err = json.Unmarshal(*v, &ID)
  8151  				if err != nil {
  8152  					return err
  8153  				}
  8154  				lo.ID = &ID
  8155  			}
  8156  		case "name":
  8157  			if v != nil {
  8158  				var name string
  8159  				err = json.Unmarshal(*v, &name)
  8160  				if err != nil {
  8161  					return err
  8162  				}
  8163  				lo.Name = &name
  8164  			}
  8165  		case "type":
  8166  			if v != nil {
  8167  				var typeVar string
  8168  				err = json.Unmarshal(*v, &typeVar)
  8169  				if err != nil {
  8170  					return err
  8171  				}
  8172  				lo.Type = &typeVar
  8173  			}
  8174  		}
  8175  	}
  8176  
  8177  	return nil
  8178  }
  8179  
  8180  // LiveOutputListResult the LiveOutput list result.
  8181  type LiveOutputListResult struct {
  8182  	autorest.Response `json:"-"`
  8183  	// Value - The result of the List LiveOutput operation.
  8184  	Value *[]LiveOutput `json:"value,omitempty"`
  8185  	// OdataCount - The number of result.
  8186  	OdataCount *int32 `json:"@odata.count,omitempty"`
  8187  	// OdataNextLink - The link to the next set of results. Not empty if value contains incomplete list of live outputs.
  8188  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
  8189  }
  8190  
  8191  // LiveOutputListResultIterator provides access to a complete listing of LiveOutput values.
  8192  type LiveOutputListResultIterator struct {
  8193  	i    int
  8194  	page LiveOutputListResultPage
  8195  }
  8196  
  8197  // NextWithContext advances to the next value.  If there was an error making
  8198  // the request the iterator does not advance and the error is returned.
  8199  func (iter *LiveOutputListResultIterator) NextWithContext(ctx context.Context) (err error) {
  8200  	if tracing.IsEnabled() {
  8201  		ctx = tracing.StartSpan(ctx, fqdn+"/LiveOutputListResultIterator.NextWithContext")
  8202  		defer func() {
  8203  			sc := -1
  8204  			if iter.Response().Response.Response != nil {
  8205  				sc = iter.Response().Response.Response.StatusCode
  8206  			}
  8207  			tracing.EndSpan(ctx, sc, err)
  8208  		}()
  8209  	}
  8210  	iter.i++
  8211  	if iter.i < len(iter.page.Values()) {
  8212  		return nil
  8213  	}
  8214  	err = iter.page.NextWithContext(ctx)
  8215  	if err != nil {
  8216  		iter.i--
  8217  		return err
  8218  	}
  8219  	iter.i = 0
  8220  	return nil
  8221  }
  8222  
  8223  // Next advances to the next value.  If there was an error making
  8224  // the request the iterator does not advance and the error is returned.
  8225  // Deprecated: Use NextWithContext() instead.
  8226  func (iter *LiveOutputListResultIterator) Next() error {
  8227  	return iter.NextWithContext(context.Background())
  8228  }
  8229  
  8230  // NotDone returns true if the enumeration should be started or is not yet complete.
  8231  func (iter LiveOutputListResultIterator) NotDone() bool {
  8232  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  8233  }
  8234  
  8235  // Response returns the raw server response from the last page request.
  8236  func (iter LiveOutputListResultIterator) Response() LiveOutputListResult {
  8237  	return iter.page.Response()
  8238  }
  8239  
  8240  // Value returns the current value or a zero-initialized value if the
  8241  // iterator has advanced beyond the end of the collection.
  8242  func (iter LiveOutputListResultIterator) Value() LiveOutput {
  8243  	if !iter.page.NotDone() {
  8244  		return LiveOutput{}
  8245  	}
  8246  	return iter.page.Values()[iter.i]
  8247  }
  8248  
  8249  // Creates a new instance of the LiveOutputListResultIterator type.
  8250  func NewLiveOutputListResultIterator(page LiveOutputListResultPage) LiveOutputListResultIterator {
  8251  	return LiveOutputListResultIterator{page: page}
  8252  }
  8253  
  8254  // IsEmpty returns true if the ListResult contains no values.
  8255  func (lolr LiveOutputListResult) IsEmpty() bool {
  8256  	return lolr.Value == nil || len(*lolr.Value) == 0
  8257  }
  8258  
  8259  // hasNextLink returns true if the NextLink is not empty.
  8260  func (lolr LiveOutputListResult) hasNextLink() bool {
  8261  	return lolr.OdataNextLink != nil && len(*lolr.OdataNextLink) != 0
  8262  }
  8263  
  8264  // liveOutputListResultPreparer prepares a request to retrieve the next set of results.
  8265  // It returns nil if no more results exist.
  8266  func (lolr LiveOutputListResult) liveOutputListResultPreparer(ctx context.Context) (*http.Request, error) {
  8267  	if !lolr.hasNextLink() {
  8268  		return nil, nil
  8269  	}
  8270  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  8271  		autorest.AsJSON(),
  8272  		autorest.AsGet(),
  8273  		autorest.WithBaseURL(to.String(lolr.OdataNextLink)))
  8274  }
  8275  
  8276  // LiveOutputListResultPage contains a page of LiveOutput values.
  8277  type LiveOutputListResultPage struct {
  8278  	fn   func(context.Context, LiveOutputListResult) (LiveOutputListResult, error)
  8279  	lolr LiveOutputListResult
  8280  }
  8281  
  8282  // NextWithContext advances to the next page of values.  If there was an error making
  8283  // the request the page does not advance and the error is returned.
  8284  func (page *LiveOutputListResultPage) NextWithContext(ctx context.Context) (err error) {
  8285  	if tracing.IsEnabled() {
  8286  		ctx = tracing.StartSpan(ctx, fqdn+"/LiveOutputListResultPage.NextWithContext")
  8287  		defer func() {
  8288  			sc := -1
  8289  			if page.Response().Response.Response != nil {
  8290  				sc = page.Response().Response.Response.StatusCode
  8291  			}
  8292  			tracing.EndSpan(ctx, sc, err)
  8293  		}()
  8294  	}
  8295  	for {
  8296  		next, err := page.fn(ctx, page.lolr)
  8297  		if err != nil {
  8298  			return err
  8299  		}
  8300  		page.lolr = next
  8301  		if !next.hasNextLink() || !next.IsEmpty() {
  8302  			break
  8303  		}
  8304  	}
  8305  	return nil
  8306  }
  8307  
  8308  // Next advances to the next page of values.  If there was an error making
  8309  // the request the page does not advance and the error is returned.
  8310  // Deprecated: Use NextWithContext() instead.
  8311  func (page *LiveOutputListResultPage) Next() error {
  8312  	return page.NextWithContext(context.Background())
  8313  }
  8314  
  8315  // NotDone returns true if the page enumeration should be started or is not yet complete.
  8316  func (page LiveOutputListResultPage) NotDone() bool {
  8317  	return !page.lolr.IsEmpty()
  8318  }
  8319  
  8320  // Response returns the raw server response from the last page request.
  8321  func (page LiveOutputListResultPage) Response() LiveOutputListResult {
  8322  	return page.lolr
  8323  }
  8324  
  8325  // Values returns the slice of values for the current page or nil if there are no values.
  8326  func (page LiveOutputListResultPage) Values() []LiveOutput {
  8327  	if page.lolr.IsEmpty() {
  8328  		return nil
  8329  	}
  8330  	return *page.lolr.Value
  8331  }
  8332  
  8333  // Creates a new instance of the LiveOutputListResultPage type.
  8334  func NewLiveOutputListResultPage(cur LiveOutputListResult, getNextPage func(context.Context, LiveOutputListResult) (LiveOutputListResult, error)) LiveOutputListResultPage {
  8335  	return LiveOutputListResultPage{
  8336  		fn:   getNextPage,
  8337  		lolr: cur,
  8338  	}
  8339  }
  8340  
  8341  // LiveOutputProperties the JSON object that contains the properties required to create a live output.
  8342  type LiveOutputProperties struct {
  8343  	// Description - The description of the live output.
  8344  	Description *string `json:"description,omitempty"`
  8345  	// AssetName - The asset that the live output will write to.
  8346  	AssetName *string `json:"assetName,omitempty"`
  8347  	// ArchiveWindowLength - ISO 8601 time between 1 minute to 25 hours to indicate the maximum content length that can be archived in the asset for this live output. This also sets the maximum content length for the rewind window. For example, use PT1H30M to indicate 1 hour and 30 minutes of archive window.
  8348  	ArchiveWindowLength *string `json:"archiveWindowLength,omitempty"`
  8349  	// ManifestName - The manifest file name. If not provided, the service will generate one automatically.
  8350  	ManifestName *string `json:"manifestName,omitempty"`
  8351  	// Hls - HTTP Live Streaming (HLS) packing setting for the live output.
  8352  	Hls *Hls `json:"hls,omitempty"`
  8353  	// OutputSnapTime - The initial timestamp that the live output will start at, any content before this value will not be archived.
  8354  	OutputSnapTime *int64 `json:"outputSnapTime,omitempty"`
  8355  	// Created - READ-ONLY; The creation time the live output.
  8356  	Created *date.Time `json:"created,omitempty"`
  8357  	// LastModified - READ-ONLY; The time the live output was last modified.
  8358  	LastModified *date.Time `json:"lastModified,omitempty"`
  8359  	// ProvisioningState - READ-ONLY; The provisioning state of the live output.
  8360  	ProvisioningState *string `json:"provisioningState,omitempty"`
  8361  	// ResourceState - READ-ONLY; The resource state of the live output. Possible values include: 'LiveOutputResourceStateCreating', 'LiveOutputResourceStateRunning', 'LiveOutputResourceStateDeleting'
  8362  	ResourceState LiveOutputResourceState `json:"resourceState,omitempty"`
  8363  }
  8364  
  8365  // MarshalJSON is the custom marshaler for LiveOutputProperties.
  8366  func (lop LiveOutputProperties) MarshalJSON() ([]byte, error) {
  8367  	objectMap := make(map[string]interface{})
  8368  	if lop.Description != nil {
  8369  		objectMap["description"] = lop.Description
  8370  	}
  8371  	if lop.AssetName != nil {
  8372  		objectMap["assetName"] = lop.AssetName
  8373  	}
  8374  	if lop.ArchiveWindowLength != nil {
  8375  		objectMap["archiveWindowLength"] = lop.ArchiveWindowLength
  8376  	}
  8377  	if lop.ManifestName != nil {
  8378  		objectMap["manifestName"] = lop.ManifestName
  8379  	}
  8380  	if lop.Hls != nil {
  8381  		objectMap["hls"] = lop.Hls
  8382  	}
  8383  	if lop.OutputSnapTime != nil {
  8384  		objectMap["outputSnapTime"] = lop.OutputSnapTime
  8385  	}
  8386  	return json.Marshal(objectMap)
  8387  }
  8388  
  8389  // LiveOutputsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
  8390  // operation.
  8391  type LiveOutputsCreateFuture struct {
  8392  	azure.FutureAPI
  8393  	// Result returns the result of the asynchronous operation.
  8394  	// If the operation has not completed it will return an error.
  8395  	Result func(LiveOutputsClient) (LiveOutput, error)
  8396  }
  8397  
  8398  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8399  func (future *LiveOutputsCreateFuture) UnmarshalJSON(body []byte) error {
  8400  	var azFuture azure.Future
  8401  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8402  		return err
  8403  	}
  8404  	future.FutureAPI = &azFuture
  8405  	future.Result = future.result
  8406  	return nil
  8407  }
  8408  
  8409  // result is the default implementation for LiveOutputsCreateFuture.Result.
  8410  func (future *LiveOutputsCreateFuture) result(client LiveOutputsClient) (lo LiveOutput, err error) {
  8411  	var done bool
  8412  	done, err = future.DoneWithContext(context.Background(), client)
  8413  	if err != nil {
  8414  		err = autorest.NewErrorWithError(err, "media.LiveOutputsCreateFuture", "Result", future.Response(), "Polling failure")
  8415  		return
  8416  	}
  8417  	if !done {
  8418  		lo.Response.Response = future.Response()
  8419  		err = azure.NewAsyncOpIncompleteError("media.LiveOutputsCreateFuture")
  8420  		return
  8421  	}
  8422  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  8423  	if lo.Response.Response, err = future.GetResult(sender); err == nil && lo.Response.Response.StatusCode != http.StatusNoContent {
  8424  		lo, err = client.CreateResponder(lo.Response.Response)
  8425  		if err != nil {
  8426  			err = autorest.NewErrorWithError(err, "media.LiveOutputsCreateFuture", "Result", lo.Response.Response, "Failure responding to request")
  8427  		}
  8428  	}
  8429  	return
  8430  }
  8431  
  8432  // LiveOutputsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  8433  // operation.
  8434  type LiveOutputsDeleteFuture struct {
  8435  	azure.FutureAPI
  8436  	// Result returns the result of the asynchronous operation.
  8437  	// If the operation has not completed it will return an error.
  8438  	Result func(LiveOutputsClient) (autorest.Response, error)
  8439  }
  8440  
  8441  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8442  func (future *LiveOutputsDeleteFuture) UnmarshalJSON(body []byte) error {
  8443  	var azFuture azure.Future
  8444  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8445  		return err
  8446  	}
  8447  	future.FutureAPI = &azFuture
  8448  	future.Result = future.result
  8449  	return nil
  8450  }
  8451  
  8452  // result is the default implementation for LiveOutputsDeleteFuture.Result.
  8453  func (future *LiveOutputsDeleteFuture) result(client LiveOutputsClient) (ar autorest.Response, err error) {
  8454  	var done bool
  8455  	done, err = future.DoneWithContext(context.Background(), client)
  8456  	if err != nil {
  8457  		err = autorest.NewErrorWithError(err, "media.LiveOutputsDeleteFuture", "Result", future.Response(), "Polling failure")
  8458  		return
  8459  	}
  8460  	if !done {
  8461  		ar.Response = future.Response()
  8462  		err = azure.NewAsyncOpIncompleteError("media.LiveOutputsDeleteFuture")
  8463  		return
  8464  	}
  8465  	ar.Response = future.Response()
  8466  	return
  8467  }
  8468  
  8469  // LogSpecification a diagnostic log emitted by service.
  8470  type LogSpecification struct {
  8471  	// Name - READ-ONLY; The diagnostic log category name.
  8472  	Name *string `json:"name,omitempty"`
  8473  	// DisplayName - READ-ONLY; The diagnostic log category display name.
  8474  	DisplayName *string `json:"displayName,omitempty"`
  8475  	// BlobDuration - READ-ONLY; The time range for requests in each blob.
  8476  	BlobDuration *string `json:"blobDuration,omitempty"`
  8477  }
  8478  
  8479  // MarshalJSON is the custom marshaler for LogSpecification.
  8480  func (ls LogSpecification) MarshalJSON() ([]byte, error) {
  8481  	objectMap := make(map[string]interface{})
  8482  	return json.Marshal(objectMap)
  8483  }
  8484  
  8485  // MetricDimension a metric dimension.
  8486  type MetricDimension struct {
  8487  	// Name - READ-ONLY; The metric dimension name.
  8488  	Name *string `json:"name,omitempty"`
  8489  	// DisplayName - READ-ONLY; The display name for the dimension.
  8490  	DisplayName *string `json:"displayName,omitempty"`
  8491  	// ToBeExportedForShoebox - READ-ONLY; Whether to export metric to shoebox.
  8492  	ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"`
  8493  }
  8494  
  8495  // MarshalJSON is the custom marshaler for MetricDimension.
  8496  func (md MetricDimension) MarshalJSON() ([]byte, error) {
  8497  	objectMap := make(map[string]interface{})
  8498  	return json.Marshal(objectMap)
  8499  }
  8500  
  8501  // MetricSpecification a metric emitted by service.
  8502  type MetricSpecification struct {
  8503  	// Name - READ-ONLY; The metric name.
  8504  	Name *string `json:"name,omitempty"`
  8505  	// DisplayName - READ-ONLY; The metric display name.
  8506  	DisplayName *string `json:"displayName,omitempty"`
  8507  	// DisplayDescription - READ-ONLY; The metric display description.
  8508  	DisplayDescription *string `json:"displayDescription,omitempty"`
  8509  	// Unit - READ-ONLY; The metric unit. Possible values include: 'MetricUnitBytes', 'MetricUnitCount', 'MetricUnitMilliseconds'
  8510  	Unit MetricUnit `json:"unit,omitempty"`
  8511  	// AggregationType - READ-ONLY; The metric aggregation type. Possible values include: 'MetricAggregationTypeAverage', 'MetricAggregationTypeCount', 'MetricAggregationTypeTotal'
  8512  	AggregationType MetricAggregationType `json:"aggregationType,omitempty"`
  8513  	// LockAggregationType - READ-ONLY; The metric lock aggregation type. Possible values include: 'MetricAggregationTypeAverage', 'MetricAggregationTypeCount', 'MetricAggregationTypeTotal'
  8514  	LockAggregationType MetricAggregationType `json:"lockAggregationType,omitempty"`
  8515  	// SupportedAggregationTypes - Supported aggregation types.
  8516  	SupportedAggregationTypes *[]string `json:"supportedAggregationTypes,omitempty"`
  8517  	// Dimensions - READ-ONLY; The metric dimensions.
  8518  	Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
  8519  	// EnableRegionalMdmAccount - READ-ONLY; Indicates whether regional MDM account is enabled.
  8520  	EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"`
  8521  	// SourceMdmAccount - READ-ONLY; The source MDM account.
  8522  	SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"`
  8523  	// SourceMdmNamespace - READ-ONLY; The source MDM namespace.
  8524  	SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"`
  8525  	// SupportedTimeGrainTypes - READ-ONLY; The supported time grain types.
  8526  	SupportedTimeGrainTypes *[]string `json:"supportedTimeGrainTypes,omitempty"`
  8527  }
  8528  
  8529  // MarshalJSON is the custom marshaler for MetricSpecification.
  8530  func (ms MetricSpecification) MarshalJSON() ([]byte, error) {
  8531  	objectMap := make(map[string]interface{})
  8532  	if ms.SupportedAggregationTypes != nil {
  8533  		objectMap["supportedAggregationTypes"] = ms.SupportedAggregationTypes
  8534  	}
  8535  	return json.Marshal(objectMap)
  8536  }
  8537  
  8538  // Mp4Format describes the properties for an output ISO MP4 file.
  8539  type Mp4Format struct {
  8540  	// 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 .
  8541  	OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
  8542  	// FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of input video files will be used. If the length of base name of the input video file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename.
  8543  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  8544  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  8545  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  8546  }
  8547  
  8548  // MarshalJSON is the custom marshaler for Mp4Format.
  8549  func (m4f Mp4Format) MarshalJSON() ([]byte, error) {
  8550  	m4f.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format
  8551  	objectMap := make(map[string]interface{})
  8552  	if m4f.OutputFiles != nil {
  8553  		objectMap["outputFiles"] = m4f.OutputFiles
  8554  	}
  8555  	if m4f.FilenamePattern != nil {
  8556  		objectMap["filenamePattern"] = m4f.FilenamePattern
  8557  	}
  8558  	if m4f.OdataType != "" {
  8559  		objectMap["@odata.type"] = m4f.OdataType
  8560  	}
  8561  	return json.Marshal(objectMap)
  8562  }
  8563  
  8564  // AsImageFormat is the BasicFormat implementation for Mp4Format.
  8565  func (m4f Mp4Format) AsImageFormat() (*ImageFormat, bool) {
  8566  	return nil, false
  8567  }
  8568  
  8569  // AsBasicImageFormat is the BasicFormat implementation for Mp4Format.
  8570  func (m4f Mp4Format) AsBasicImageFormat() (BasicImageFormat, bool) {
  8571  	return nil, false
  8572  }
  8573  
  8574  // AsJpgFormat is the BasicFormat implementation for Mp4Format.
  8575  func (m4f Mp4Format) AsJpgFormat() (*JpgFormat, bool) {
  8576  	return nil, false
  8577  }
  8578  
  8579  // AsPngFormat is the BasicFormat implementation for Mp4Format.
  8580  func (m4f Mp4Format) AsPngFormat() (*PngFormat, bool) {
  8581  	return nil, false
  8582  }
  8583  
  8584  // AsMultiBitrateFormat is the BasicFormat implementation for Mp4Format.
  8585  func (m4f Mp4Format) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  8586  	return nil, false
  8587  }
  8588  
  8589  // AsBasicMultiBitrateFormat is the BasicFormat implementation for Mp4Format.
  8590  func (m4f Mp4Format) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  8591  	return &m4f, true
  8592  }
  8593  
  8594  // AsMp4Format is the BasicFormat implementation for Mp4Format.
  8595  func (m4f Mp4Format) AsMp4Format() (*Mp4Format, bool) {
  8596  	return &m4f, true
  8597  }
  8598  
  8599  // AsTransportStreamFormat is the BasicFormat implementation for Mp4Format.
  8600  func (m4f Mp4Format) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  8601  	return nil, false
  8602  }
  8603  
  8604  // AsFormat is the BasicFormat implementation for Mp4Format.
  8605  func (m4f Mp4Format) AsFormat() (*Format, bool) {
  8606  	return nil, false
  8607  }
  8608  
  8609  // AsBasicFormat is the BasicFormat implementation for Mp4Format.
  8610  func (m4f Mp4Format) AsBasicFormat() (BasicFormat, bool) {
  8611  	return &m4f, true
  8612  }
  8613  
  8614  // BasicMultiBitrateFormat describes the properties for producing a collection of GOP aligned multi-bitrate files. The
  8615  // default behavior is to produce one output file for each video layer which is muxed together with all the audios. The
  8616  // exact output files produced can be controlled by specifying the outputFiles collection.
  8617  type BasicMultiBitrateFormat interface {
  8618  	AsMp4Format() (*Mp4Format, bool)
  8619  	AsTransportStreamFormat() (*TransportStreamFormat, bool)
  8620  	AsMultiBitrateFormat() (*MultiBitrateFormat, bool)
  8621  }
  8622  
  8623  // MultiBitrateFormat describes the properties for producing a collection of GOP aligned multi-bitrate files.
  8624  // The default behavior is to produce one output file for each video layer which is muxed together with all the
  8625  // audios. The exact output files produced can be controlled by specifying the outputFiles collection.
  8626  type MultiBitrateFormat struct {
  8627  	// 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 .
  8628  	OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
  8629  	// FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of input video files will be used. If the length of base name of the input video file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename.
  8630  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  8631  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  8632  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  8633  }
  8634  
  8635  func unmarshalBasicMultiBitrateFormat(body []byte) (BasicMultiBitrateFormat, error) {
  8636  	var m map[string]interface{}
  8637  	err := json.Unmarshal(body, &m)
  8638  	if err != nil {
  8639  		return nil, err
  8640  	}
  8641  
  8642  	switch m["@odata.type"] {
  8643  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format):
  8644  		var m4f Mp4Format
  8645  		err := json.Unmarshal(body, &m4f)
  8646  		return m4f, err
  8647  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat):
  8648  		var tsf TransportStreamFormat
  8649  		err := json.Unmarshal(body, &tsf)
  8650  		return tsf, err
  8651  	default:
  8652  		var mbf MultiBitrateFormat
  8653  		err := json.Unmarshal(body, &mbf)
  8654  		return mbf, err
  8655  	}
  8656  }
  8657  func unmarshalBasicMultiBitrateFormatArray(body []byte) ([]BasicMultiBitrateFormat, error) {
  8658  	var rawMessages []*json.RawMessage
  8659  	err := json.Unmarshal(body, &rawMessages)
  8660  	if err != nil {
  8661  		return nil, err
  8662  	}
  8663  
  8664  	mbfArray := make([]BasicMultiBitrateFormat, len(rawMessages))
  8665  
  8666  	for index, rawMessage := range rawMessages {
  8667  		mbf, err := unmarshalBasicMultiBitrateFormat(*rawMessage)
  8668  		if err != nil {
  8669  			return nil, err
  8670  		}
  8671  		mbfArray[index] = mbf
  8672  	}
  8673  	return mbfArray, nil
  8674  }
  8675  
  8676  // MarshalJSON is the custom marshaler for MultiBitrateFormat.
  8677  func (mbf MultiBitrateFormat) MarshalJSON() ([]byte, error) {
  8678  	mbf.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat
  8679  	objectMap := make(map[string]interface{})
  8680  	if mbf.OutputFiles != nil {
  8681  		objectMap["outputFiles"] = mbf.OutputFiles
  8682  	}
  8683  	if mbf.FilenamePattern != nil {
  8684  		objectMap["filenamePattern"] = mbf.FilenamePattern
  8685  	}
  8686  	if mbf.OdataType != "" {
  8687  		objectMap["@odata.type"] = mbf.OdataType
  8688  	}
  8689  	return json.Marshal(objectMap)
  8690  }
  8691  
  8692  // AsImageFormat is the BasicFormat implementation for MultiBitrateFormat.
  8693  func (mbf MultiBitrateFormat) AsImageFormat() (*ImageFormat, bool) {
  8694  	return nil, false
  8695  }
  8696  
  8697  // AsBasicImageFormat is the BasicFormat implementation for MultiBitrateFormat.
  8698  func (mbf MultiBitrateFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
  8699  	return nil, false
  8700  }
  8701  
  8702  // AsJpgFormat is the BasicFormat implementation for MultiBitrateFormat.
  8703  func (mbf MultiBitrateFormat) AsJpgFormat() (*JpgFormat, bool) {
  8704  	return nil, false
  8705  }
  8706  
  8707  // AsPngFormat is the BasicFormat implementation for MultiBitrateFormat.
  8708  func (mbf MultiBitrateFormat) AsPngFormat() (*PngFormat, bool) {
  8709  	return nil, false
  8710  }
  8711  
  8712  // AsMultiBitrateFormat is the BasicFormat implementation for MultiBitrateFormat.
  8713  func (mbf MultiBitrateFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  8714  	return &mbf, true
  8715  }
  8716  
  8717  // AsBasicMultiBitrateFormat is the BasicFormat implementation for MultiBitrateFormat.
  8718  func (mbf MultiBitrateFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  8719  	return &mbf, true
  8720  }
  8721  
  8722  // AsMp4Format is the BasicFormat implementation for MultiBitrateFormat.
  8723  func (mbf MultiBitrateFormat) AsMp4Format() (*Mp4Format, bool) {
  8724  	return nil, false
  8725  }
  8726  
  8727  // AsTransportStreamFormat is the BasicFormat implementation for MultiBitrateFormat.
  8728  func (mbf MultiBitrateFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  8729  	return nil, false
  8730  }
  8731  
  8732  // AsFormat is the BasicFormat implementation for MultiBitrateFormat.
  8733  func (mbf MultiBitrateFormat) AsFormat() (*Format, bool) {
  8734  	return nil, false
  8735  }
  8736  
  8737  // AsBasicFormat is the BasicFormat implementation for MultiBitrateFormat.
  8738  func (mbf MultiBitrateFormat) AsBasicFormat() (BasicFormat, bool) {
  8739  	return &mbf, true
  8740  }
  8741  
  8742  // NoEncryption class for NoEncryption scheme
  8743  type NoEncryption struct {
  8744  	// EnabledProtocols - Representing supported protocols
  8745  	EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
  8746  }
  8747  
  8748  // Operation an operation.
  8749  type Operation struct {
  8750  	// Name - The operation name.
  8751  	Name *string `json:"name,omitempty"`
  8752  	// Display - The operation display name.
  8753  	Display *OperationDisplay `json:"display,omitempty"`
  8754  	// Origin - Origin of the operation.
  8755  	Origin *string `json:"origin,omitempty"`
  8756  	// Properties - Operation properties format.
  8757  	Properties *Properties `json:"properties,omitempty"`
  8758  	// IsDataAction - Whether the operation applies to data-plane.
  8759  	IsDataAction *bool `json:"isDataAction,omitempty"`
  8760  	// ActionType - Indicates the action type. Possible values include: 'ActionTypeInternal'
  8761  	ActionType ActionType `json:"actionType,omitempty"`
  8762  }
  8763  
  8764  // OperationCollection a collection of Operation items.
  8765  type OperationCollection struct {
  8766  	autorest.Response `json:"-"`
  8767  	// Value - A collection of Operation items.
  8768  	Value *[]Operation `json:"value,omitempty"`
  8769  }
  8770  
  8771  // OperationDisplay operation details.
  8772  type OperationDisplay struct {
  8773  	// Provider - The service provider.
  8774  	Provider *string `json:"provider,omitempty"`
  8775  	// Resource - Resource on which the operation is performed.
  8776  	Resource *string `json:"resource,omitempty"`
  8777  	// Operation - The operation type.
  8778  	Operation *string `json:"operation,omitempty"`
  8779  	// Description - The operation description.
  8780  	Description *string `json:"description,omitempty"`
  8781  }
  8782  
  8783  // OutputFile represents an output file produced.
  8784  type OutputFile struct {
  8785  	// 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.
  8786  	Labels *[]string `json:"labels,omitempty"`
  8787  }
  8788  
  8789  // BasicOverlay base type for all overlays - image, audio or video.
  8790  type BasicOverlay interface {
  8791  	AsAudioOverlay() (*AudioOverlay, bool)
  8792  	AsVideoOverlay() (*VideoOverlay, bool)
  8793  	AsOverlay() (*Overlay, bool)
  8794  }
  8795  
  8796  // Overlay base type for all overlays - image, audio or video.
  8797  type Overlay struct {
  8798  	// InputLabel - The label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG, PNG, GIF or BMP format, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats.
  8799  	InputLabel *string `json:"inputLabel,omitempty"`
  8800  	// Start - The start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds into the input video. If not specified the overlay starts from the beginning of the input video.
  8801  	Start *string `json:"start,omitempty"`
  8802  	// End - The end position, with reference to the input video, at which the overlay ends. The value should be in ISO 8601 format. For example, PT30S to end the overlay at 30 seconds into the input video. If not specified or the value is greater than the input video duration, the overlay will be applied until the end of the input video if the overlay media duration is greater than the input video duration, else the overlay will last as long as the overlay media duration.
  8803  	End *string `json:"end,omitempty"`
  8804  	// 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).
  8805  	FadeInDuration *string `json:"fadeInDuration,omitempty"`
  8806  	// 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).
  8807  	FadeOutDuration *string `json:"fadeOutDuration,omitempty"`
  8808  	// AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0.
  8809  	AudioGainLevel *float64 `json:"audioGainLevel,omitempty"`
  8810  	// OdataType - Possible values include: 'OdataTypeBasicOverlayOdataTypeOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaVideoOverlay'
  8811  	OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"`
  8812  }
  8813  
  8814  func unmarshalBasicOverlay(body []byte) (BasicOverlay, error) {
  8815  	var m map[string]interface{}
  8816  	err := json.Unmarshal(body, &m)
  8817  	if err != nil {
  8818  		return nil, err
  8819  	}
  8820  
  8821  	switch m["@odata.type"] {
  8822  	case string(OdataTypeBasicOverlayOdataTypeMicrosoftMediaAudioOverlay):
  8823  		var ao AudioOverlay
  8824  		err := json.Unmarshal(body, &ao)
  8825  		return ao, err
  8826  	case string(OdataTypeBasicOverlayOdataTypeMicrosoftMediaVideoOverlay):
  8827  		var vo VideoOverlay
  8828  		err := json.Unmarshal(body, &vo)
  8829  		return vo, err
  8830  	default:
  8831  		var o Overlay
  8832  		err := json.Unmarshal(body, &o)
  8833  		return o, err
  8834  	}
  8835  }
  8836  func unmarshalBasicOverlayArray(body []byte) ([]BasicOverlay, error) {
  8837  	var rawMessages []*json.RawMessage
  8838  	err := json.Unmarshal(body, &rawMessages)
  8839  	if err != nil {
  8840  		return nil, err
  8841  	}
  8842  
  8843  	oArray := make([]BasicOverlay, len(rawMessages))
  8844  
  8845  	for index, rawMessage := range rawMessages {
  8846  		o, err := unmarshalBasicOverlay(*rawMessage)
  8847  		if err != nil {
  8848  			return nil, err
  8849  		}
  8850  		oArray[index] = o
  8851  	}
  8852  	return oArray, nil
  8853  }
  8854  
  8855  // MarshalJSON is the custom marshaler for Overlay.
  8856  func (o Overlay) MarshalJSON() ([]byte, error) {
  8857  	o.OdataType = OdataTypeBasicOverlayOdataTypeOverlay
  8858  	objectMap := make(map[string]interface{})
  8859  	if o.InputLabel != nil {
  8860  		objectMap["inputLabel"] = o.InputLabel
  8861  	}
  8862  	if o.Start != nil {
  8863  		objectMap["start"] = o.Start
  8864  	}
  8865  	if o.End != nil {
  8866  		objectMap["end"] = o.End
  8867  	}
  8868  	if o.FadeInDuration != nil {
  8869  		objectMap["fadeInDuration"] = o.FadeInDuration
  8870  	}
  8871  	if o.FadeOutDuration != nil {
  8872  		objectMap["fadeOutDuration"] = o.FadeOutDuration
  8873  	}
  8874  	if o.AudioGainLevel != nil {
  8875  		objectMap["audioGainLevel"] = o.AudioGainLevel
  8876  	}
  8877  	if o.OdataType != "" {
  8878  		objectMap["@odata.type"] = o.OdataType
  8879  	}
  8880  	return json.Marshal(objectMap)
  8881  }
  8882  
  8883  // AsAudioOverlay is the BasicOverlay implementation for Overlay.
  8884  func (o Overlay) AsAudioOverlay() (*AudioOverlay, bool) {
  8885  	return nil, false
  8886  }
  8887  
  8888  // AsVideoOverlay is the BasicOverlay implementation for Overlay.
  8889  func (o Overlay) AsVideoOverlay() (*VideoOverlay, bool) {
  8890  	return nil, false
  8891  }
  8892  
  8893  // AsOverlay is the BasicOverlay implementation for Overlay.
  8894  func (o Overlay) AsOverlay() (*Overlay, bool) {
  8895  	return &o, true
  8896  }
  8897  
  8898  // AsBasicOverlay is the BasicOverlay implementation for Overlay.
  8899  func (o Overlay) AsBasicOverlay() (BasicOverlay, bool) {
  8900  	return &o, true
  8901  }
  8902  
  8903  // PngFormat describes the settings for producing PNG thumbnails.
  8904  type PngFormat struct {
  8905  	// FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of input video files will be used. If the length of base name of the input video file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename.
  8906  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  8907  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  8908  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  8909  }
  8910  
  8911  // MarshalJSON is the custom marshaler for PngFormat.
  8912  func (pf PngFormat) MarshalJSON() ([]byte, error) {
  8913  	pf.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat
  8914  	objectMap := make(map[string]interface{})
  8915  	if pf.FilenamePattern != nil {
  8916  		objectMap["filenamePattern"] = pf.FilenamePattern
  8917  	}
  8918  	if pf.OdataType != "" {
  8919  		objectMap["@odata.type"] = pf.OdataType
  8920  	}
  8921  	return json.Marshal(objectMap)
  8922  }
  8923  
  8924  // AsImageFormat is the BasicFormat implementation for PngFormat.
  8925  func (pf PngFormat) AsImageFormat() (*ImageFormat, bool) {
  8926  	return nil, false
  8927  }
  8928  
  8929  // AsBasicImageFormat is the BasicFormat implementation for PngFormat.
  8930  func (pf PngFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
  8931  	return &pf, true
  8932  }
  8933  
  8934  // AsJpgFormat is the BasicFormat implementation for PngFormat.
  8935  func (pf PngFormat) AsJpgFormat() (*JpgFormat, bool) {
  8936  	return nil, false
  8937  }
  8938  
  8939  // AsPngFormat is the BasicFormat implementation for PngFormat.
  8940  func (pf PngFormat) AsPngFormat() (*PngFormat, bool) {
  8941  	return &pf, true
  8942  }
  8943  
  8944  // AsMultiBitrateFormat is the BasicFormat implementation for PngFormat.
  8945  func (pf PngFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  8946  	return nil, false
  8947  }
  8948  
  8949  // AsBasicMultiBitrateFormat is the BasicFormat implementation for PngFormat.
  8950  func (pf PngFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  8951  	return nil, false
  8952  }
  8953  
  8954  // AsMp4Format is the BasicFormat implementation for PngFormat.
  8955  func (pf PngFormat) AsMp4Format() (*Mp4Format, bool) {
  8956  	return nil, false
  8957  }
  8958  
  8959  // AsTransportStreamFormat is the BasicFormat implementation for PngFormat.
  8960  func (pf PngFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  8961  	return nil, false
  8962  }
  8963  
  8964  // AsFormat is the BasicFormat implementation for PngFormat.
  8965  func (pf PngFormat) AsFormat() (*Format, bool) {
  8966  	return nil, false
  8967  }
  8968  
  8969  // AsBasicFormat is the BasicFormat implementation for PngFormat.
  8970  func (pf PngFormat) AsBasicFormat() (BasicFormat, bool) {
  8971  	return &pf, true
  8972  }
  8973  
  8974  // PngImage describes the properties for producing a series of PNG images from the input video.
  8975  type PngImage struct {
  8976  	// Layers - A collection of output PNG image layers to be produced by the encoder.
  8977  	Layers *[]PngLayer `json:"layers,omitempty"`
  8978  	// Start - The position in the input video from where to start generating thumbnails. The value can be in ISO 8601 format (For example, PT05S to start at 5 seconds), or a frame count (For example, 10 to start at the 10th frame), or a relative value to stream duration (For example, 10% to start at 10% of stream duration). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video and will only produce one thumbnail, no matter what other settings are for Step and Range. The default value is macro {Best}.
  8979  	Start *string `json:"start,omitempty"`
  8980  	// Step - The intervals at which thumbnails are generated. The value can be in ISO 8601 format (For example, PT05S for one image every 5 seconds), or a frame count (For example, 30 for one image every 30 frames), or a relative value to stream duration (For example, 10% for one image every 10% of stream duration). Note: Step value will affect the first generated thumbnail, which may not be exactly the one specified at transform preset start time. This is due to the encoder, which tries to select the best thumbnail between start time and Step position from start time as the first output. As the default value is 10%, it means if stream has long duration, the first generated thumbnail might be far away from the one specified at start time. Try to select reasonable value for Step if the first thumbnail is expected close to start time, or set Range value at 1 if only one thumbnail is needed at start time.
  8981  	Step *string `json:"step,omitempty"`
  8982  	// Range - The position relative to transform preset start time in the input video at which to stop generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to stop at 5 minutes and 30 seconds from start time), or a frame count (For example, 300 to stop at the 300th frame from the frame at start time. If this value is 1, it means only producing one thumbnail at start time), or a relative value to the stream duration (For example, 50% to stop at half of stream duration from start time). The default value is 100%, which means to stop at the end of the stream.
  8983  	Range *string `json:"range,omitempty"`
  8984  	// KeyFrameInterval - The distance between two key frames. The value should be non-zero in the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will follow the input source setting.
  8985  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  8986  	// 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'
  8987  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  8988  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
  8989  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
  8990  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  8991  	Label *string `json:"label,omitempty"`
  8992  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  8993  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  8994  }
  8995  
  8996  // MarshalJSON is the custom marshaler for PngImage.
  8997  func (pi PngImage) MarshalJSON() ([]byte, error) {
  8998  	pi.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage
  8999  	objectMap := make(map[string]interface{})
  9000  	if pi.Layers != nil {
  9001  		objectMap["layers"] = pi.Layers
  9002  	}
  9003  	if pi.Start != nil {
  9004  		objectMap["start"] = pi.Start
  9005  	}
  9006  	if pi.Step != nil {
  9007  		objectMap["step"] = pi.Step
  9008  	}
  9009  	if pi.Range != nil {
  9010  		objectMap["range"] = pi.Range
  9011  	}
  9012  	if pi.KeyFrameInterval != nil {
  9013  		objectMap["keyFrameInterval"] = pi.KeyFrameInterval
  9014  	}
  9015  	if pi.StretchMode != "" {
  9016  		objectMap["stretchMode"] = pi.StretchMode
  9017  	}
  9018  	if pi.SyncMode != "" {
  9019  		objectMap["syncMode"] = pi.SyncMode
  9020  	}
  9021  	if pi.Label != nil {
  9022  		objectMap["label"] = pi.Label
  9023  	}
  9024  	if pi.OdataType != "" {
  9025  		objectMap["@odata.type"] = pi.OdataType
  9026  	}
  9027  	return json.Marshal(objectMap)
  9028  }
  9029  
  9030  // AsAudio is the BasicCodec implementation for PngImage.
  9031  func (pi PngImage) AsAudio() (*Audio, bool) {
  9032  	return nil, false
  9033  }
  9034  
  9035  // AsBasicAudio is the BasicCodec implementation for PngImage.
  9036  func (pi PngImage) AsBasicAudio() (BasicAudio, bool) {
  9037  	return nil, false
  9038  }
  9039  
  9040  // AsAacAudio is the BasicCodec implementation for PngImage.
  9041  func (pi PngImage) AsAacAudio() (*AacAudio, bool) {
  9042  	return nil, false
  9043  }
  9044  
  9045  // AsVideo is the BasicCodec implementation for PngImage.
  9046  func (pi PngImage) AsVideo() (*Video, bool) {
  9047  	return nil, false
  9048  }
  9049  
  9050  // AsBasicVideo is the BasicCodec implementation for PngImage.
  9051  func (pi PngImage) AsBasicVideo() (BasicVideo, bool) {
  9052  	return &pi, true
  9053  }
  9054  
  9055  // AsH265Video is the BasicCodec implementation for PngImage.
  9056  func (pi PngImage) AsH265Video() (*H265Video, bool) {
  9057  	return nil, false
  9058  }
  9059  
  9060  // AsCopyVideo is the BasicCodec implementation for PngImage.
  9061  func (pi PngImage) AsCopyVideo() (*CopyVideo, bool) {
  9062  	return nil, false
  9063  }
  9064  
  9065  // AsImage is the BasicCodec implementation for PngImage.
  9066  func (pi PngImage) AsImage() (*Image, bool) {
  9067  	return nil, false
  9068  }
  9069  
  9070  // AsBasicImage is the BasicCodec implementation for PngImage.
  9071  func (pi PngImage) AsBasicImage() (BasicImage, bool) {
  9072  	return &pi, true
  9073  }
  9074  
  9075  // AsCopyAudio is the BasicCodec implementation for PngImage.
  9076  func (pi PngImage) AsCopyAudio() (*CopyAudio, bool) {
  9077  	return nil, false
  9078  }
  9079  
  9080  // AsH264Video is the BasicCodec implementation for PngImage.
  9081  func (pi PngImage) AsH264Video() (*H264Video, bool) {
  9082  	return nil, false
  9083  }
  9084  
  9085  // AsJpgImage is the BasicCodec implementation for PngImage.
  9086  func (pi PngImage) AsJpgImage() (*JpgImage, bool) {
  9087  	return nil, false
  9088  }
  9089  
  9090  // AsPngImage is the BasicCodec implementation for PngImage.
  9091  func (pi PngImage) AsPngImage() (*PngImage, bool) {
  9092  	return &pi, true
  9093  }
  9094  
  9095  // AsCodec is the BasicCodec implementation for PngImage.
  9096  func (pi PngImage) AsCodec() (*Codec, bool) {
  9097  	return nil, false
  9098  }
  9099  
  9100  // AsBasicCodec is the BasicCodec implementation for PngImage.
  9101  func (pi PngImage) AsBasicCodec() (BasicCodec, bool) {
  9102  	return &pi, true
  9103  }
  9104  
  9105  // PngLayer describes the settings to produce a PNG image from the input video.
  9106  type PngLayer struct {
  9107  	// 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.
  9108  	Width *string `json:"width,omitempty"`
  9109  	// 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.
  9110  	Height *string `json:"height,omitempty"`
  9111  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  9112  	Label *string `json:"label,omitempty"`
  9113  }
  9114  
  9115  // PresentationTimeRange the presentation time range, this is asset related and not recommended for Account
  9116  // Filter.
  9117  type PresentationTimeRange struct {
  9118  	// StartTimestamp - The absolute start time boundary.
  9119  	StartTimestamp *int64 `json:"startTimestamp,omitempty"`
  9120  	// EndTimestamp - The absolute end time boundary.
  9121  	EndTimestamp *int64 `json:"endTimestamp,omitempty"`
  9122  	// PresentationWindowDuration - The relative to end sliding window.
  9123  	PresentationWindowDuration *int64 `json:"presentationWindowDuration,omitempty"`
  9124  	// LiveBackoffDuration - The relative to end right edge.
  9125  	LiveBackoffDuration *int64 `json:"liveBackoffDuration,omitempty"`
  9126  	// Timescale - The time scale of time stamps.
  9127  	Timescale *int64 `json:"timescale,omitempty"`
  9128  	// ForceEndTimestamp - The indicator of forcing existing of end time stamp.
  9129  	ForceEndTimestamp *bool `json:"forceEndTimestamp,omitempty"`
  9130  }
  9131  
  9132  // BasicPreset base type for all Presets, which define the recipe or instructions on how the input media files should
  9133  // be processed.
  9134  type BasicPreset interface {
  9135  	AsFaceDetectorPreset() (*FaceDetectorPreset, bool)
  9136  	AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool)
  9137  	AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool)
  9138  	AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool)
  9139  	AsStandardEncoderPreset() (*StandardEncoderPreset, bool)
  9140  	AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool)
  9141  	AsPreset() (*Preset, bool)
  9142  }
  9143  
  9144  // Preset base type for all Presets, which define the recipe or instructions on how the input media files
  9145  // should be processed.
  9146  type Preset struct {
  9147  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
  9148  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
  9149  }
  9150  
  9151  func unmarshalBasicPreset(body []byte) (BasicPreset, error) {
  9152  	var m map[string]interface{}
  9153  	err := json.Unmarshal(body, &m)
  9154  	if err != nil {
  9155  		return nil, err
  9156  	}
  9157  
  9158  	switch m["@odata.type"] {
  9159  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset):
  9160  		var fdp FaceDetectorPreset
  9161  		err := json.Unmarshal(body, &fdp)
  9162  		return fdp, err
  9163  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset):
  9164  		var aap AudioAnalyzerPreset
  9165  		err := json.Unmarshal(body, &aap)
  9166  		return aap, err
  9167  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset):
  9168  		var bisep BuiltInStandardEncoderPreset
  9169  		err := json.Unmarshal(body, &bisep)
  9170  		return bisep, err
  9171  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset):
  9172  		var sep StandardEncoderPreset
  9173  		err := json.Unmarshal(body, &sep)
  9174  		return sep, err
  9175  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset):
  9176  		var vap VideoAnalyzerPreset
  9177  		err := json.Unmarshal(body, &vap)
  9178  		return vap, err
  9179  	default:
  9180  		var p Preset
  9181  		err := json.Unmarshal(body, &p)
  9182  		return p, err
  9183  	}
  9184  }
  9185  func unmarshalBasicPresetArray(body []byte) ([]BasicPreset, error) {
  9186  	var rawMessages []*json.RawMessage
  9187  	err := json.Unmarshal(body, &rawMessages)
  9188  	if err != nil {
  9189  		return nil, err
  9190  	}
  9191  
  9192  	pArray := make([]BasicPreset, len(rawMessages))
  9193  
  9194  	for index, rawMessage := range rawMessages {
  9195  		p, err := unmarshalBasicPreset(*rawMessage)
  9196  		if err != nil {
  9197  			return nil, err
  9198  		}
  9199  		pArray[index] = p
  9200  	}
  9201  	return pArray, nil
  9202  }
  9203  
  9204  // MarshalJSON is the custom marshaler for Preset.
  9205  func (p Preset) MarshalJSON() ([]byte, error) {
  9206  	p.OdataType = OdataTypeBasicPresetOdataTypePreset
  9207  	objectMap := make(map[string]interface{})
  9208  	if p.OdataType != "" {
  9209  		objectMap["@odata.type"] = p.OdataType
  9210  	}
  9211  	return json.Marshal(objectMap)
  9212  }
  9213  
  9214  // AsFaceDetectorPreset is the BasicPreset implementation for Preset.
  9215  func (p Preset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
  9216  	return nil, false
  9217  }
  9218  
  9219  // AsAudioAnalyzerPreset is the BasicPreset implementation for Preset.
  9220  func (p Preset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
  9221  	return nil, false
  9222  }
  9223  
  9224  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for Preset.
  9225  func (p Preset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
  9226  	return nil, false
  9227  }
  9228  
  9229  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for Preset.
  9230  func (p Preset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
  9231  	return nil, false
  9232  }
  9233  
  9234  // AsStandardEncoderPreset is the BasicPreset implementation for Preset.
  9235  func (p Preset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
  9236  	return nil, false
  9237  }
  9238  
  9239  // AsVideoAnalyzerPreset is the BasicPreset implementation for Preset.
  9240  func (p Preset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
  9241  	return nil, false
  9242  }
  9243  
  9244  // AsPreset is the BasicPreset implementation for Preset.
  9245  func (p Preset) AsPreset() (*Preset, bool) {
  9246  	return &p, true
  9247  }
  9248  
  9249  // AsBasicPreset is the BasicPreset implementation for Preset.
  9250  func (p Preset) AsBasicPreset() (BasicPreset, bool) {
  9251  	return &p, true
  9252  }
  9253  
  9254  // PresetConfigurations an object of optional configuration settings for encoder.
  9255  type PresetConfigurations struct {
  9256  	// Complexity - Allows you to configure the encoder settings to control the balance between speed and quality. Example: set Complexity as Speed for faster encoding but less compression efficiency. Possible values include: 'ComplexitySpeed', 'ComplexityBalanced', 'ComplexityQuality'
  9257  	Complexity Complexity `json:"complexity,omitempty"`
  9258  	// InterleaveOutput - Sets the interleave mode of the output to control how audio and video are stored in the container format. Example: set InterleavedOutput as NonInterleavedOutput to produce audio-only and video-only outputs in separate MP4 files. Possible values include: 'InterleaveOutputNonInterleavedOutput', 'InterleaveOutputInterleavedOutput'
  9259  	InterleaveOutput InterleaveOutput `json:"interleaveOutput,omitempty"`
  9260  	// KeyFrameIntervalInSeconds - The key frame interval in seconds. Example: set KeyFrameIntervalInSeconds as 2 to reduce the playback buffering for some players.
  9261  	KeyFrameIntervalInSeconds *float64 `json:"keyFrameIntervalInSeconds,omitempty"`
  9262  	// MaxBitrateBps - The maximum bitrate in bits per second (threshold for the top video layer). Example: set MaxBitrateBps as 6000000 to avoid producing very high bitrate outputs for contents with high complexity.
  9263  	MaxBitrateBps *int32 `json:"maxBitrateBps,omitempty"`
  9264  	// MaxHeight - The maximum height of output video layers. Example: set MaxHeight as 720 to produce output layers up to 720P even if the input is 4K.
  9265  	MaxHeight *int32 `json:"maxHeight,omitempty"`
  9266  	// MaxLayers - The maximum number of output video layers. Example: set MaxLayers as 4 to make sure at most 4 output layers are produced to control the overall cost of the encoding job.
  9267  	MaxLayers *int32 `json:"maxLayers,omitempty"`
  9268  	// MinBitrateBps - The minimum bitrate in bits per second (threshold for the bottom video layer). Example: set MinBitrateBps as 200000 to have a bottom layer that covers users with low network bandwidth.
  9269  	MinBitrateBps *int32 `json:"minBitrateBps,omitempty"`
  9270  	// MinHeight - The minimum height of output video layers. Example: set MinHeight as 360 to avoid output layers of smaller resolutions like 180P.
  9271  	MinHeight *int32 `json:"minHeight,omitempty"`
  9272  }
  9273  
  9274  // PrivateEndpoint the Private Endpoint resource.
  9275  type PrivateEndpoint struct {
  9276  	// ID - READ-ONLY; The ARM identifier for Private Endpoint
  9277  	ID *string `json:"id,omitempty"`
  9278  }
  9279  
  9280  // MarshalJSON is the custom marshaler for PrivateEndpoint.
  9281  func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) {
  9282  	objectMap := make(map[string]interface{})
  9283  	return json.Marshal(objectMap)
  9284  }
  9285  
  9286  // PrivateEndpointConnection the Private Endpoint Connection resource.
  9287  type PrivateEndpointConnection struct {
  9288  	autorest.Response `json:"-"`
  9289  	// PrivateEndpointConnectionProperties - Resource properties.
  9290  	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
  9291  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  9292  	ID *string `json:"id,omitempty"`
  9293  	// Name - READ-ONLY; The name of the resource
  9294  	Name *string `json:"name,omitempty"`
  9295  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  9296  	Type *string `json:"type,omitempty"`
  9297  }
  9298  
  9299  // MarshalJSON is the custom marshaler for PrivateEndpointConnection.
  9300  func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
  9301  	objectMap := make(map[string]interface{})
  9302  	if pec.PrivateEndpointConnectionProperties != nil {
  9303  		objectMap["properties"] = pec.PrivateEndpointConnectionProperties
  9304  	}
  9305  	return json.Marshal(objectMap)
  9306  }
  9307  
  9308  // UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
  9309  func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
  9310  	var m map[string]*json.RawMessage
  9311  	err := json.Unmarshal(body, &m)
  9312  	if err != nil {
  9313  		return err
  9314  	}
  9315  	for k, v := range m {
  9316  		switch k {
  9317  		case "properties":
  9318  			if v != nil {
  9319  				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
  9320  				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
  9321  				if err != nil {
  9322  					return err
  9323  				}
  9324  				pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
  9325  			}
  9326  		case "id":
  9327  			if v != nil {
  9328  				var ID string
  9329  				err = json.Unmarshal(*v, &ID)
  9330  				if err != nil {
  9331  					return err
  9332  				}
  9333  				pec.ID = &ID
  9334  			}
  9335  		case "name":
  9336  			if v != nil {
  9337  				var name string
  9338  				err = json.Unmarshal(*v, &name)
  9339  				if err != nil {
  9340  					return err
  9341  				}
  9342  				pec.Name = &name
  9343  			}
  9344  		case "type":
  9345  			if v != nil {
  9346  				var typeVar string
  9347  				err = json.Unmarshal(*v, &typeVar)
  9348  				if err != nil {
  9349  					return err
  9350  				}
  9351  				pec.Type = &typeVar
  9352  			}
  9353  		}
  9354  	}
  9355  
  9356  	return nil
  9357  }
  9358  
  9359  // PrivateEndpointConnectionListResult list of private endpoint connection associated with the specified
  9360  // storage account
  9361  type PrivateEndpointConnectionListResult struct {
  9362  	autorest.Response `json:"-"`
  9363  	// Value - Array of private endpoint connections
  9364  	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
  9365  }
  9366  
  9367  // PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties.
  9368  type PrivateEndpointConnectionProperties struct {
  9369  	// PrivateEndpoint - The resource of private end point.
  9370  	PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
  9371  	// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider.
  9372  	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
  9373  	// ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed'
  9374  	ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"`
  9375  }
  9376  
  9377  // PrivateLinkResource a private link resource
  9378  type PrivateLinkResource struct {
  9379  	autorest.Response `json:"-"`
  9380  	// PrivateLinkResourceProperties - Resource properties.
  9381  	*PrivateLinkResourceProperties `json:"properties,omitempty"`
  9382  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  9383  	ID *string `json:"id,omitempty"`
  9384  	// Name - READ-ONLY; The name of the resource
  9385  	Name *string `json:"name,omitempty"`
  9386  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  9387  	Type *string `json:"type,omitempty"`
  9388  }
  9389  
  9390  // MarshalJSON is the custom marshaler for PrivateLinkResource.
  9391  func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
  9392  	objectMap := make(map[string]interface{})
  9393  	if plr.PrivateLinkResourceProperties != nil {
  9394  		objectMap["properties"] = plr.PrivateLinkResourceProperties
  9395  	}
  9396  	return json.Marshal(objectMap)
  9397  }
  9398  
  9399  // UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct.
  9400  func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error {
  9401  	var m map[string]*json.RawMessage
  9402  	err := json.Unmarshal(body, &m)
  9403  	if err != nil {
  9404  		return err
  9405  	}
  9406  	for k, v := range m {
  9407  		switch k {
  9408  		case "properties":
  9409  			if v != nil {
  9410  				var privateLinkResourceProperties PrivateLinkResourceProperties
  9411  				err = json.Unmarshal(*v, &privateLinkResourceProperties)
  9412  				if err != nil {
  9413  					return err
  9414  				}
  9415  				plr.PrivateLinkResourceProperties = &privateLinkResourceProperties
  9416  			}
  9417  		case "id":
  9418  			if v != nil {
  9419  				var ID string
  9420  				err = json.Unmarshal(*v, &ID)
  9421  				if err != nil {
  9422  					return err
  9423  				}
  9424  				plr.ID = &ID
  9425  			}
  9426  		case "name":
  9427  			if v != nil {
  9428  				var name string
  9429  				err = json.Unmarshal(*v, &name)
  9430  				if err != nil {
  9431  					return err
  9432  				}
  9433  				plr.Name = &name
  9434  			}
  9435  		case "type":
  9436  			if v != nil {
  9437  				var typeVar string
  9438  				err = json.Unmarshal(*v, &typeVar)
  9439  				if err != nil {
  9440  					return err
  9441  				}
  9442  				plr.Type = &typeVar
  9443  			}
  9444  		}
  9445  	}
  9446  
  9447  	return nil
  9448  }
  9449  
  9450  // PrivateLinkResourceListResult a list of private link resources
  9451  type PrivateLinkResourceListResult struct {
  9452  	autorest.Response `json:"-"`
  9453  	// Value - Array of private link resources
  9454  	Value *[]PrivateLinkResource `json:"value,omitempty"`
  9455  }
  9456  
  9457  // PrivateLinkResourceProperties properties of a private link resource.
  9458  type PrivateLinkResourceProperties struct {
  9459  	// GroupID - READ-ONLY; The private link resource group id.
  9460  	GroupID *string `json:"groupId,omitempty"`
  9461  	// RequiredMembers - READ-ONLY; The private link resource required member names.
  9462  	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
  9463  	// RequiredZoneNames - The private link resource Private link DNS zone name.
  9464  	RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
  9465  }
  9466  
  9467  // MarshalJSON is the custom marshaler for PrivateLinkResourceProperties.
  9468  func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
  9469  	objectMap := make(map[string]interface{})
  9470  	if plrp.RequiredZoneNames != nil {
  9471  		objectMap["requiredZoneNames"] = plrp.RequiredZoneNames
  9472  	}
  9473  	return json.Marshal(objectMap)
  9474  }
  9475  
  9476  // PrivateLinkServiceConnectionState a collection of information about the state of the connection between
  9477  // service consumer and provider.
  9478  type PrivateLinkServiceConnectionState struct {
  9479  	// Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'PrivateEndpointServiceConnectionStatusPending', 'PrivateEndpointServiceConnectionStatusApproved', 'PrivateEndpointServiceConnectionStatusRejected'
  9480  	Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"`
  9481  	// Description - The reason for approval/rejection of the connection.
  9482  	Description *string `json:"description,omitempty"`
  9483  	// ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer.
  9484  	ActionsRequired *string `json:"actionsRequired,omitempty"`
  9485  }
  9486  
  9487  // Properties the service specification property.
  9488  type Properties struct {
  9489  	// ServiceSpecification - READ-ONLY; The service specifications.
  9490  	ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"`
  9491  }
  9492  
  9493  // MarshalJSON is the custom marshaler for Properties.
  9494  func (p Properties) MarshalJSON() ([]byte, error) {
  9495  	objectMap := make(map[string]interface{})
  9496  	return json.Marshal(objectMap)
  9497  }
  9498  
  9499  // ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not
  9500  // have tags and a location
  9501  type ProxyResource struct {
  9502  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  9503  	ID *string `json:"id,omitempty"`
  9504  	// Name - READ-ONLY; The name of the resource
  9505  	Name *string `json:"name,omitempty"`
  9506  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  9507  	Type *string `json:"type,omitempty"`
  9508  }
  9509  
  9510  // MarshalJSON is the custom marshaler for ProxyResource.
  9511  func (pr ProxyResource) MarshalJSON() ([]byte, error) {
  9512  	objectMap := make(map[string]interface{})
  9513  	return json.Marshal(objectMap)
  9514  }
  9515  
  9516  // Rectangle describes the properties of a rectangular window applied to the input media before processing
  9517  // it.
  9518  type Rectangle struct {
  9519  	// 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%).
  9520  	Left *string `json:"left,omitempty"`
  9521  	// 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%).
  9522  	Top *string `json:"top,omitempty"`
  9523  	// 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%).
  9524  	Width *string `json:"width,omitempty"`
  9525  	// 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%).
  9526  	Height *string `json:"height,omitempty"`
  9527  }
  9528  
  9529  // Resource common fields that are returned in the response for all Azure Resource Manager resources
  9530  type Resource struct {
  9531  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  9532  	ID *string `json:"id,omitempty"`
  9533  	// Name - READ-ONLY; The name of the resource
  9534  	Name *string `json:"name,omitempty"`
  9535  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  9536  	Type *string `json:"type,omitempty"`
  9537  }
  9538  
  9539  // MarshalJSON is the custom marshaler for Resource.
  9540  func (r Resource) MarshalJSON() ([]byte, error) {
  9541  	objectMap := make(map[string]interface{})
  9542  	return json.Marshal(objectMap)
  9543  }
  9544  
  9545  // ResourceIdentity ...
  9546  type ResourceIdentity struct {
  9547  	// UserAssignedIdentity - The user assigned managed identity's ARM ID to use when accessing a resource.
  9548  	UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"`
  9549  	// UseSystemAssignedIdentity - Indicates whether to use System Assigned Managed Identity. Mutual exclusive with User Assigned Managed Identity.
  9550  	UseSystemAssignedIdentity *bool `json:"useSystemAssignedIdentity,omitempty"`
  9551  }
  9552  
  9553  // SelectAudioTrackByAttribute select audio tracks from the input by specifying an attribute and an
  9554  // attribute filter.
  9555  type SelectAudioTrackByAttribute struct {
  9556  	// Attribute - The TrackAttribute to filter the tracks by. Possible values include: 'TrackAttributeBitrate', 'TrackAttributeLanguage'
  9557  	Attribute TrackAttribute `json:"attribute,omitempty"`
  9558  	// Filter - The type of AttributeFilter to apply to the TrackAttribute in order to select the tracks. Possible values include: 'AttributeFilterAll', 'AttributeFilterTop', 'AttributeFilterBottom', 'AttributeFilterValueEquals'
  9559  	Filter AttributeFilter `json:"filter,omitempty"`
  9560  	// FilterValue - The value to filter the tracks by.  Only used when AttributeFilter.ValueEquals is specified for the Filter property.
  9561  	FilterValue *string `json:"filterValue,omitempty"`
  9562  	// ChannelMapping - Optional designation for single channel audio tracks.  Can be used to combine the tracks into stereo or multi-channel audio tracks. Possible values include: 'ChannelMappingFrontLeft', 'ChannelMappingFrontRight', 'ChannelMappingCenter', 'ChannelMappingLowFrequencyEffects', 'ChannelMappingBackLeft', 'ChannelMappingBackRight', 'ChannelMappingStereoLeft', 'ChannelMappingStereoRight'
  9563  	ChannelMapping ChannelMapping `json:"channelMapping,omitempty"`
  9564  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
  9565  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
  9566  }
  9567  
  9568  // MarshalJSON is the custom marshaler for SelectAudioTrackByAttribute.
  9569  func (satba SelectAudioTrackByAttribute) MarshalJSON() ([]byte, error) {
  9570  	satba.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute
  9571  	objectMap := make(map[string]interface{})
  9572  	if satba.Attribute != "" {
  9573  		objectMap["attribute"] = satba.Attribute
  9574  	}
  9575  	if satba.Filter != "" {
  9576  		objectMap["filter"] = satba.Filter
  9577  	}
  9578  	if satba.FilterValue != nil {
  9579  		objectMap["filterValue"] = satba.FilterValue
  9580  	}
  9581  	if satba.ChannelMapping != "" {
  9582  		objectMap["channelMapping"] = satba.ChannelMapping
  9583  	}
  9584  	if satba.OdataType != "" {
  9585  		objectMap["@odata.type"] = satba.OdataType
  9586  	}
  9587  	return json.Marshal(objectMap)
  9588  }
  9589  
  9590  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9591  func (satba SelectAudioTrackByAttribute) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
  9592  	return nil, false
  9593  }
  9594  
  9595  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9596  func (satba SelectAudioTrackByAttribute) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
  9597  	return &satba, true
  9598  }
  9599  
  9600  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9601  func (satba SelectAudioTrackByAttribute) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
  9602  	return &satba, true
  9603  }
  9604  
  9605  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9606  func (satba SelectAudioTrackByAttribute) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
  9607  	return nil, false
  9608  }
  9609  
  9610  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9611  func (satba SelectAudioTrackByAttribute) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
  9612  	return nil, false
  9613  }
  9614  
  9615  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9616  func (satba SelectAudioTrackByAttribute) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
  9617  	return nil, false
  9618  }
  9619  
  9620  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9621  func (satba SelectAudioTrackByAttribute) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
  9622  	return nil, false
  9623  }
  9624  
  9625  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9626  func (satba SelectAudioTrackByAttribute) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
  9627  	return nil, false
  9628  }
  9629  
  9630  // AsTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9631  func (satba SelectAudioTrackByAttribute) AsTrackDescriptor() (*TrackDescriptor, bool) {
  9632  	return nil, false
  9633  }
  9634  
  9635  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9636  func (satba SelectAudioTrackByAttribute) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
  9637  	return &satba, true
  9638  }
  9639  
  9640  // SelectAudioTrackByID select audio tracks from the input by specifying a track identifier.
  9641  type SelectAudioTrackByID struct {
  9642  	// TrackID - Track identifier to select
  9643  	TrackID *int64 `json:"trackId,omitempty"`
  9644  	// ChannelMapping - Optional designation for single channel audio tracks.  Can be used to combine the tracks into stereo or multi-channel audio tracks. Possible values include: 'ChannelMappingFrontLeft', 'ChannelMappingFrontRight', 'ChannelMappingCenter', 'ChannelMappingLowFrequencyEffects', 'ChannelMappingBackLeft', 'ChannelMappingBackRight', 'ChannelMappingStereoLeft', 'ChannelMappingStereoRight'
  9645  	ChannelMapping ChannelMapping `json:"channelMapping,omitempty"`
  9646  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
  9647  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
  9648  }
  9649  
  9650  // MarshalJSON is the custom marshaler for SelectAudioTrackByID.
  9651  func (satbi SelectAudioTrackByID) MarshalJSON() ([]byte, error) {
  9652  	satbi.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID
  9653  	objectMap := make(map[string]interface{})
  9654  	if satbi.TrackID != nil {
  9655  		objectMap["trackId"] = satbi.TrackID
  9656  	}
  9657  	if satbi.ChannelMapping != "" {
  9658  		objectMap["channelMapping"] = satbi.ChannelMapping
  9659  	}
  9660  	if satbi.OdataType != "" {
  9661  		objectMap["@odata.type"] = satbi.OdataType
  9662  	}
  9663  	return json.Marshal(objectMap)
  9664  }
  9665  
  9666  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9667  func (satbi SelectAudioTrackByID) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
  9668  	return nil, false
  9669  }
  9670  
  9671  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9672  func (satbi SelectAudioTrackByID) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
  9673  	return &satbi, true
  9674  }
  9675  
  9676  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9677  func (satbi SelectAudioTrackByID) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
  9678  	return nil, false
  9679  }
  9680  
  9681  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9682  func (satbi SelectAudioTrackByID) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
  9683  	return &satbi, true
  9684  }
  9685  
  9686  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9687  func (satbi SelectAudioTrackByID) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
  9688  	return nil, false
  9689  }
  9690  
  9691  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9692  func (satbi SelectAudioTrackByID) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
  9693  	return nil, false
  9694  }
  9695  
  9696  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9697  func (satbi SelectAudioTrackByID) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
  9698  	return nil, false
  9699  }
  9700  
  9701  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9702  func (satbi SelectAudioTrackByID) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
  9703  	return nil, false
  9704  }
  9705  
  9706  // AsTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9707  func (satbi SelectAudioTrackByID) AsTrackDescriptor() (*TrackDescriptor, bool) {
  9708  	return nil, false
  9709  }
  9710  
  9711  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9712  func (satbi SelectAudioTrackByID) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
  9713  	return &satbi, true
  9714  }
  9715  
  9716  // SelectVideoTrackByAttribute select video tracks from the input by specifying an attribute and an
  9717  // attribute filter.
  9718  type SelectVideoTrackByAttribute struct {
  9719  	// Attribute - The TrackAttribute to filter the tracks by. Possible values include: 'TrackAttributeBitrate', 'TrackAttributeLanguage'
  9720  	Attribute TrackAttribute `json:"attribute,omitempty"`
  9721  	// Filter - The type of AttributeFilter to apply to the TrackAttribute in order to select the tracks. Possible values include: 'AttributeFilterAll', 'AttributeFilterTop', 'AttributeFilterBottom', 'AttributeFilterValueEquals'
  9722  	Filter AttributeFilter `json:"filter,omitempty"`
  9723  	// FilterValue - The value to filter the tracks by.  Only used when AttributeFilter.ValueEquals is specified for the Filter property. For TrackAttribute.Bitrate, this should be an integer value in bits per second (e.g: '1500000').  The TrackAttribute.Language is not supported for video tracks.
  9724  	FilterValue *string `json:"filterValue,omitempty"`
  9725  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
  9726  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
  9727  }
  9728  
  9729  // MarshalJSON is the custom marshaler for SelectVideoTrackByAttribute.
  9730  func (svtba SelectVideoTrackByAttribute) MarshalJSON() ([]byte, error) {
  9731  	svtba.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute
  9732  	objectMap := make(map[string]interface{})
  9733  	if svtba.Attribute != "" {
  9734  		objectMap["attribute"] = svtba.Attribute
  9735  	}
  9736  	if svtba.Filter != "" {
  9737  		objectMap["filter"] = svtba.Filter
  9738  	}
  9739  	if svtba.FilterValue != nil {
  9740  		objectMap["filterValue"] = svtba.FilterValue
  9741  	}
  9742  	if svtba.OdataType != "" {
  9743  		objectMap["@odata.type"] = svtba.OdataType
  9744  	}
  9745  	return json.Marshal(objectMap)
  9746  }
  9747  
  9748  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
  9749  func (svtba SelectVideoTrackByAttribute) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
  9750  	return nil, false
  9751  }
  9752  
  9753  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
  9754  func (svtba SelectVideoTrackByAttribute) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
  9755  	return nil, false
  9756  }
  9757  
  9758  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
  9759  func (svtba SelectVideoTrackByAttribute) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
  9760  	return nil, false
  9761  }
  9762  
  9763  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
  9764  func (svtba SelectVideoTrackByAttribute) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
  9765  	return nil, false
  9766  }
  9767  
  9768  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
  9769  func (svtba SelectVideoTrackByAttribute) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
  9770  	return nil, false
  9771  }
  9772  
  9773  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
  9774  func (svtba SelectVideoTrackByAttribute) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
  9775  	return &svtba, true
  9776  }
  9777  
  9778  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
  9779  func (svtba SelectVideoTrackByAttribute) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
  9780  	return &svtba, true
  9781  }
  9782  
  9783  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
  9784  func (svtba SelectVideoTrackByAttribute) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
  9785  	return nil, false
  9786  }
  9787  
  9788  // AsTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
  9789  func (svtba SelectVideoTrackByAttribute) AsTrackDescriptor() (*TrackDescriptor, bool) {
  9790  	return nil, false
  9791  }
  9792  
  9793  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
  9794  func (svtba SelectVideoTrackByAttribute) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
  9795  	return &svtba, true
  9796  }
  9797  
  9798  // SelectVideoTrackByID select video tracks from the input by specifying a track identifier.
  9799  type SelectVideoTrackByID struct {
  9800  	// TrackID - Track identifier to select
  9801  	TrackID *int64 `json:"trackId,omitempty"`
  9802  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
  9803  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
  9804  }
  9805  
  9806  // MarshalJSON is the custom marshaler for SelectVideoTrackByID.
  9807  func (svtbi SelectVideoTrackByID) MarshalJSON() ([]byte, error) {
  9808  	svtbi.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID
  9809  	objectMap := make(map[string]interface{})
  9810  	if svtbi.TrackID != nil {
  9811  		objectMap["trackId"] = svtbi.TrackID
  9812  	}
  9813  	if svtbi.OdataType != "" {
  9814  		objectMap["@odata.type"] = svtbi.OdataType
  9815  	}
  9816  	return json.Marshal(objectMap)
  9817  }
  9818  
  9819  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
  9820  func (svtbi SelectVideoTrackByID) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
  9821  	return nil, false
  9822  }
  9823  
  9824  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
  9825  func (svtbi SelectVideoTrackByID) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
  9826  	return nil, false
  9827  }
  9828  
  9829  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
  9830  func (svtbi SelectVideoTrackByID) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
  9831  	return nil, false
  9832  }
  9833  
  9834  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
  9835  func (svtbi SelectVideoTrackByID) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
  9836  	return nil, false
  9837  }
  9838  
  9839  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
  9840  func (svtbi SelectVideoTrackByID) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
  9841  	return nil, false
  9842  }
  9843  
  9844  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
  9845  func (svtbi SelectVideoTrackByID) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
  9846  	return &svtbi, true
  9847  }
  9848  
  9849  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
  9850  func (svtbi SelectVideoTrackByID) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
  9851  	return nil, false
  9852  }
  9853  
  9854  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
  9855  func (svtbi SelectVideoTrackByID) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
  9856  	return &svtbi, true
  9857  }
  9858  
  9859  // AsTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
  9860  func (svtbi SelectVideoTrackByID) AsTrackDescriptor() (*TrackDescriptor, bool) {
  9861  	return nil, false
  9862  }
  9863  
  9864  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
  9865  func (svtbi SelectVideoTrackByID) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
  9866  	return &svtbi, true
  9867  }
  9868  
  9869  // Service a Media Services account.
  9870  type Service struct {
  9871  	autorest.Response `json:"-"`
  9872  	// ServiceProperties - The resource properties.
  9873  	*ServiceProperties `json:"properties,omitempty"`
  9874  	// Identity - The Managed Identity for the Media Services account.
  9875  	Identity *ServiceIdentity `json:"identity,omitempty"`
  9876  	// SystemData - READ-ONLY; The system metadata relating to this resource.
  9877  	SystemData *SystemData `json:"systemData,omitempty"`
  9878  	// Tags - Resource tags.
  9879  	Tags map[string]*string `json:"tags"`
  9880  	// Location - The geo-location where the resource lives
  9881  	Location *string `json:"location,omitempty"`
  9882  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  9883  	ID *string `json:"id,omitempty"`
  9884  	// Name - READ-ONLY; The name of the resource
  9885  	Name *string `json:"name,omitempty"`
  9886  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  9887  	Type *string `json:"type,omitempty"`
  9888  }
  9889  
  9890  // MarshalJSON is the custom marshaler for Service.
  9891  func (s Service) MarshalJSON() ([]byte, error) {
  9892  	objectMap := make(map[string]interface{})
  9893  	if s.ServiceProperties != nil {
  9894  		objectMap["properties"] = s.ServiceProperties
  9895  	}
  9896  	if s.Identity != nil {
  9897  		objectMap["identity"] = s.Identity
  9898  	}
  9899  	if s.Tags != nil {
  9900  		objectMap["tags"] = s.Tags
  9901  	}
  9902  	if s.Location != nil {
  9903  		objectMap["location"] = s.Location
  9904  	}
  9905  	return json.Marshal(objectMap)
  9906  }
  9907  
  9908  // UnmarshalJSON is the custom unmarshaler for Service struct.
  9909  func (s *Service) UnmarshalJSON(body []byte) error {
  9910  	var m map[string]*json.RawMessage
  9911  	err := json.Unmarshal(body, &m)
  9912  	if err != nil {
  9913  		return err
  9914  	}
  9915  	for k, v := range m {
  9916  		switch k {
  9917  		case "properties":
  9918  			if v != nil {
  9919  				var serviceProperties ServiceProperties
  9920  				err = json.Unmarshal(*v, &serviceProperties)
  9921  				if err != nil {
  9922  					return err
  9923  				}
  9924  				s.ServiceProperties = &serviceProperties
  9925  			}
  9926  		case "identity":
  9927  			if v != nil {
  9928  				var identity ServiceIdentity
  9929  				err = json.Unmarshal(*v, &identity)
  9930  				if err != nil {
  9931  					return err
  9932  				}
  9933  				s.Identity = &identity
  9934  			}
  9935  		case "systemData":
  9936  			if v != nil {
  9937  				var systemData SystemData
  9938  				err = json.Unmarshal(*v, &systemData)
  9939  				if err != nil {
  9940  					return err
  9941  				}
  9942  				s.SystemData = &systemData
  9943  			}
  9944  		case "tags":
  9945  			if v != nil {
  9946  				var tags map[string]*string
  9947  				err = json.Unmarshal(*v, &tags)
  9948  				if err != nil {
  9949  					return err
  9950  				}
  9951  				s.Tags = tags
  9952  			}
  9953  		case "location":
  9954  			if v != nil {
  9955  				var location string
  9956  				err = json.Unmarshal(*v, &location)
  9957  				if err != nil {
  9958  					return err
  9959  				}
  9960  				s.Location = &location
  9961  			}
  9962  		case "id":
  9963  			if v != nil {
  9964  				var ID string
  9965  				err = json.Unmarshal(*v, &ID)
  9966  				if err != nil {
  9967  					return err
  9968  				}
  9969  				s.ID = &ID
  9970  			}
  9971  		case "name":
  9972  			if v != nil {
  9973  				var name string
  9974  				err = json.Unmarshal(*v, &name)
  9975  				if err != nil {
  9976  					return err
  9977  				}
  9978  				s.Name = &name
  9979  			}
  9980  		case "type":
  9981  			if v != nil {
  9982  				var typeVar string
  9983  				err = json.Unmarshal(*v, &typeVar)
  9984  				if err != nil {
  9985  					return err
  9986  				}
  9987  				s.Type = &typeVar
  9988  			}
  9989  		}
  9990  	}
  9991  
  9992  	return nil
  9993  }
  9994  
  9995  // ServiceCollection a collection of MediaService items.
  9996  type ServiceCollection struct {
  9997  	autorest.Response `json:"-"`
  9998  	// Value - A collection of MediaService items.
  9999  	Value *[]Service `json:"value,omitempty"`
 10000  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
 10001  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
 10002  }
 10003  
 10004  // ServiceCollectionIterator provides access to a complete listing of Service values.
 10005  type ServiceCollectionIterator struct {
 10006  	i    int
 10007  	page ServiceCollectionPage
 10008  }
 10009  
 10010  // NextWithContext advances to the next value.  If there was an error making
 10011  // the request the iterator does not advance and the error is returned.
 10012  func (iter *ServiceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
 10013  	if tracing.IsEnabled() {
 10014  		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceCollectionIterator.NextWithContext")
 10015  		defer func() {
 10016  			sc := -1
 10017  			if iter.Response().Response.Response != nil {
 10018  				sc = iter.Response().Response.Response.StatusCode
 10019  			}
 10020  			tracing.EndSpan(ctx, sc, err)
 10021  		}()
 10022  	}
 10023  	iter.i++
 10024  	if iter.i < len(iter.page.Values()) {
 10025  		return nil
 10026  	}
 10027  	err = iter.page.NextWithContext(ctx)
 10028  	if err != nil {
 10029  		iter.i--
 10030  		return err
 10031  	}
 10032  	iter.i = 0
 10033  	return nil
 10034  }
 10035  
 10036  // Next advances to the next value.  If there was an error making
 10037  // the request the iterator does not advance and the error is returned.
 10038  // Deprecated: Use NextWithContext() instead.
 10039  func (iter *ServiceCollectionIterator) Next() error {
 10040  	return iter.NextWithContext(context.Background())
 10041  }
 10042  
 10043  // NotDone returns true if the enumeration should be started or is not yet complete.
 10044  func (iter ServiceCollectionIterator) NotDone() bool {
 10045  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
 10046  }
 10047  
 10048  // Response returns the raw server response from the last page request.
 10049  func (iter ServiceCollectionIterator) Response() ServiceCollection {
 10050  	return iter.page.Response()
 10051  }
 10052  
 10053  // Value returns the current value or a zero-initialized value if the
 10054  // iterator has advanced beyond the end of the collection.
 10055  func (iter ServiceCollectionIterator) Value() Service {
 10056  	if !iter.page.NotDone() {
 10057  		return Service{}
 10058  	}
 10059  	return iter.page.Values()[iter.i]
 10060  }
 10061  
 10062  // Creates a new instance of the ServiceCollectionIterator type.
 10063  func NewServiceCollectionIterator(page ServiceCollectionPage) ServiceCollectionIterator {
 10064  	return ServiceCollectionIterator{page: page}
 10065  }
 10066  
 10067  // IsEmpty returns true if the ListResult contains no values.
 10068  func (sc ServiceCollection) IsEmpty() bool {
 10069  	return sc.Value == nil || len(*sc.Value) == 0
 10070  }
 10071  
 10072  // hasNextLink returns true if the NextLink is not empty.
 10073  func (sc ServiceCollection) hasNextLink() bool {
 10074  	return sc.OdataNextLink != nil && len(*sc.OdataNextLink) != 0
 10075  }
 10076  
 10077  // serviceCollectionPreparer prepares a request to retrieve the next set of results.
 10078  // It returns nil if no more results exist.
 10079  func (sc ServiceCollection) serviceCollectionPreparer(ctx context.Context) (*http.Request, error) {
 10080  	if !sc.hasNextLink() {
 10081  		return nil, nil
 10082  	}
 10083  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
 10084  		autorest.AsJSON(),
 10085  		autorest.AsGet(),
 10086  		autorest.WithBaseURL(to.String(sc.OdataNextLink)))
 10087  }
 10088  
 10089  // ServiceCollectionPage contains a page of Service values.
 10090  type ServiceCollectionPage struct {
 10091  	fn func(context.Context, ServiceCollection) (ServiceCollection, error)
 10092  	sc ServiceCollection
 10093  }
 10094  
 10095  // NextWithContext advances to the next page of values.  If there was an error making
 10096  // the request the page does not advance and the error is returned.
 10097  func (page *ServiceCollectionPage) NextWithContext(ctx context.Context) (err error) {
 10098  	if tracing.IsEnabled() {
 10099  		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceCollectionPage.NextWithContext")
 10100  		defer func() {
 10101  			sc := -1
 10102  			if page.Response().Response.Response != nil {
 10103  				sc = page.Response().Response.Response.StatusCode
 10104  			}
 10105  			tracing.EndSpan(ctx, sc, err)
 10106  		}()
 10107  	}
 10108  	for {
 10109  		next, err := page.fn(ctx, page.sc)
 10110  		if err != nil {
 10111  			return err
 10112  		}
 10113  		page.sc = next
 10114  		if !next.hasNextLink() || !next.IsEmpty() {
 10115  			break
 10116  		}
 10117  	}
 10118  	return nil
 10119  }
 10120  
 10121  // Next advances to the next page of values.  If there was an error making
 10122  // the request the page does not advance and the error is returned.
 10123  // Deprecated: Use NextWithContext() instead.
 10124  func (page *ServiceCollectionPage) Next() error {
 10125  	return page.NextWithContext(context.Background())
 10126  }
 10127  
 10128  // NotDone returns true if the page enumeration should be started or is not yet complete.
 10129  func (page ServiceCollectionPage) NotDone() bool {
 10130  	return !page.sc.IsEmpty()
 10131  }
 10132  
 10133  // Response returns the raw server response from the last page request.
 10134  func (page ServiceCollectionPage) Response() ServiceCollection {
 10135  	return page.sc
 10136  }
 10137  
 10138  // Values returns the slice of values for the current page or nil if there are no values.
 10139  func (page ServiceCollectionPage) Values() []Service {
 10140  	if page.sc.IsEmpty() {
 10141  		return nil
 10142  	}
 10143  	return *page.sc.Value
 10144  }
 10145  
 10146  // Creates a new instance of the ServiceCollectionPage type.
 10147  func NewServiceCollectionPage(cur ServiceCollection, getNextPage func(context.Context, ServiceCollection) (ServiceCollection, error)) ServiceCollectionPage {
 10148  	return ServiceCollectionPage{
 10149  		fn: getNextPage,
 10150  		sc: cur,
 10151  	}
 10152  }
 10153  
 10154  // ServiceIdentity ...
 10155  type ServiceIdentity struct {
 10156  	// Type - The identity type.
 10157  	Type *string `json:"type,omitempty"`
 10158  	// PrincipalID - READ-ONLY; The Principal ID of the identity.
 10159  	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
 10160  	// TenantID - READ-ONLY; The Tenant ID of the identity.
 10161  	TenantID *uuid.UUID `json:"tenantId,omitempty"`
 10162  	// UserAssignedIdentities - The user assigned managed identities.
 10163  	UserAssignedIdentities map[string]*UserAssignedManagedIdentity `json:"userAssignedIdentities"`
 10164  }
 10165  
 10166  // MarshalJSON is the custom marshaler for ServiceIdentity.
 10167  func (si ServiceIdentity) MarshalJSON() ([]byte, error) {
 10168  	objectMap := make(map[string]interface{})
 10169  	if si.Type != nil {
 10170  		objectMap["type"] = si.Type
 10171  	}
 10172  	if si.UserAssignedIdentities != nil {
 10173  		objectMap["userAssignedIdentities"] = si.UserAssignedIdentities
 10174  	}
 10175  	return json.Marshal(objectMap)
 10176  }
 10177  
 10178  // ServiceProperties properties of the Media Services account.
 10179  type ServiceProperties struct {
 10180  	// MediaServiceID - READ-ONLY; The Media Services account ID.
 10181  	MediaServiceID *uuid.UUID `json:"mediaServiceId,omitempty"`
 10182  	// StorageAccounts - The storage accounts for this resource.
 10183  	StorageAccounts *[]StorageAccount `json:"storageAccounts,omitempty"`
 10184  	// StorageAuthentication - Possible values include: 'StorageAuthenticationSystem', 'StorageAuthenticationManagedIdentity'
 10185  	StorageAuthentication StorageAuthentication `json:"storageAuthentication,omitempty"`
 10186  	// Encryption - The account encryption properties.
 10187  	Encryption *AccountEncryption `json:"encryption,omitempty"`
 10188  	// KeyDelivery - The Key Delivery properties for Media Services account.
 10189  	KeyDelivery *KeyDelivery `json:"keyDelivery,omitempty"`
 10190  	// PublicNetworkAccess - Whether or not public network access is allowed for resources under the Media Services account. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled'
 10191  	PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
 10192  }
 10193  
 10194  // MarshalJSON is the custom marshaler for ServiceProperties.
 10195  func (sp ServiceProperties) MarshalJSON() ([]byte, error) {
 10196  	objectMap := make(map[string]interface{})
 10197  	if sp.StorageAccounts != nil {
 10198  		objectMap["storageAccounts"] = sp.StorageAccounts
 10199  	}
 10200  	if sp.StorageAuthentication != "" {
 10201  		objectMap["storageAuthentication"] = sp.StorageAuthentication
 10202  	}
 10203  	if sp.Encryption != nil {
 10204  		objectMap["encryption"] = sp.Encryption
 10205  	}
 10206  	if sp.KeyDelivery != nil {
 10207  		objectMap["keyDelivery"] = sp.KeyDelivery
 10208  	}
 10209  	if sp.PublicNetworkAccess != "" {
 10210  		objectMap["publicNetworkAccess"] = sp.PublicNetworkAccess
 10211  	}
 10212  	return json.Marshal(objectMap)
 10213  }
 10214  
 10215  // ServiceSpecification the service metric specifications.
 10216  type ServiceSpecification struct {
 10217  	// LogSpecifications - READ-ONLY; List of log specifications.
 10218  	LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"`
 10219  	// MetricSpecifications - READ-ONLY; List of metric specifications.
 10220  	MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"`
 10221  }
 10222  
 10223  // MarshalJSON is the custom marshaler for ServiceSpecification.
 10224  func (ss ServiceSpecification) MarshalJSON() ([]byte, error) {
 10225  	objectMap := make(map[string]interface{})
 10226  	return json.Marshal(objectMap)
 10227  }
 10228  
 10229  // ServiceUpdate a Media Services account update.
 10230  type ServiceUpdate struct {
 10231  	// Tags - Resource tags.
 10232  	Tags map[string]*string `json:"tags"`
 10233  	// ServiceProperties - The resource properties.
 10234  	*ServiceProperties `json:"properties,omitempty"`
 10235  	// Identity - The Managed Identity for the Media Services account.
 10236  	Identity *ServiceIdentity `json:"identity,omitempty"`
 10237  }
 10238  
 10239  // MarshalJSON is the custom marshaler for ServiceUpdate.
 10240  func (su ServiceUpdate) MarshalJSON() ([]byte, error) {
 10241  	objectMap := make(map[string]interface{})
 10242  	if su.Tags != nil {
 10243  		objectMap["tags"] = su.Tags
 10244  	}
 10245  	if su.ServiceProperties != nil {
 10246  		objectMap["properties"] = su.ServiceProperties
 10247  	}
 10248  	if su.Identity != nil {
 10249  		objectMap["identity"] = su.Identity
 10250  	}
 10251  	return json.Marshal(objectMap)
 10252  }
 10253  
 10254  // UnmarshalJSON is the custom unmarshaler for ServiceUpdate struct.
 10255  func (su *ServiceUpdate) UnmarshalJSON(body []byte) error {
 10256  	var m map[string]*json.RawMessage
 10257  	err := json.Unmarshal(body, &m)
 10258  	if err != nil {
 10259  		return err
 10260  	}
 10261  	for k, v := range m {
 10262  		switch k {
 10263  		case "tags":
 10264  			if v != nil {
 10265  				var tags map[string]*string
 10266  				err = json.Unmarshal(*v, &tags)
 10267  				if err != nil {
 10268  					return err
 10269  				}
 10270  				su.Tags = tags
 10271  			}
 10272  		case "properties":
 10273  			if v != nil {
 10274  				var serviceProperties ServiceProperties
 10275  				err = json.Unmarshal(*v, &serviceProperties)
 10276  				if err != nil {
 10277  					return err
 10278  				}
 10279  				su.ServiceProperties = &serviceProperties
 10280  			}
 10281  		case "identity":
 10282  			if v != nil {
 10283  				var identity ServiceIdentity
 10284  				err = json.Unmarshal(*v, &identity)
 10285  				if err != nil {
 10286  					return err
 10287  				}
 10288  				su.Identity = &identity
 10289  			}
 10290  		}
 10291  	}
 10292  
 10293  	return nil
 10294  }
 10295  
 10296  // StandardEncoderPreset describes all the settings to be used when encoding the input video with the
 10297  // Standard Encoder.
 10298  type StandardEncoderPreset struct {
 10299  	// Filters - One or more filtering operations that are applied to the input media before encoding.
 10300  	Filters *Filters `json:"filters,omitempty"`
 10301  	// Codecs - The list of codecs to be used when encoding the input video.
 10302  	Codecs *[]BasicCodec `json:"codecs,omitempty"`
 10303  	// Formats - The list of outputs to be produced by the encoder.
 10304  	Formats *[]BasicFormat `json:"formats,omitempty"`
 10305  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
 10306  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
 10307  }
 10308  
 10309  // MarshalJSON is the custom marshaler for StandardEncoderPreset.
 10310  func (sep StandardEncoderPreset) MarshalJSON() ([]byte, error) {
 10311  	sep.OdataType = OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset
 10312  	objectMap := make(map[string]interface{})
 10313  	if sep.Filters != nil {
 10314  		objectMap["filters"] = sep.Filters
 10315  	}
 10316  	if sep.Codecs != nil {
 10317  		objectMap["codecs"] = sep.Codecs
 10318  	}
 10319  	if sep.Formats != nil {
 10320  		objectMap["formats"] = sep.Formats
 10321  	}
 10322  	if sep.OdataType != "" {
 10323  		objectMap["@odata.type"] = sep.OdataType
 10324  	}
 10325  	return json.Marshal(objectMap)
 10326  }
 10327  
 10328  // AsFaceDetectorPreset is the BasicPreset implementation for StandardEncoderPreset.
 10329  func (sep StandardEncoderPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
 10330  	return nil, false
 10331  }
 10332  
 10333  // AsAudioAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset.
 10334  func (sep StandardEncoderPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
 10335  	return nil, false
 10336  }
 10337  
 10338  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset.
 10339  func (sep StandardEncoderPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
 10340  	return nil, false
 10341  }
 10342  
 10343  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for StandardEncoderPreset.
 10344  func (sep StandardEncoderPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
 10345  	return nil, false
 10346  }
 10347  
 10348  // AsStandardEncoderPreset is the BasicPreset implementation for StandardEncoderPreset.
 10349  func (sep StandardEncoderPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
 10350  	return &sep, true
 10351  }
 10352  
 10353  // AsVideoAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset.
 10354  func (sep StandardEncoderPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
 10355  	return nil, false
 10356  }
 10357  
 10358  // AsPreset is the BasicPreset implementation for StandardEncoderPreset.
 10359  func (sep StandardEncoderPreset) AsPreset() (*Preset, bool) {
 10360  	return nil, false
 10361  }
 10362  
 10363  // AsBasicPreset is the BasicPreset implementation for StandardEncoderPreset.
 10364  func (sep StandardEncoderPreset) AsBasicPreset() (BasicPreset, bool) {
 10365  	return &sep, true
 10366  }
 10367  
 10368  // UnmarshalJSON is the custom unmarshaler for StandardEncoderPreset struct.
 10369  func (sep *StandardEncoderPreset) UnmarshalJSON(body []byte) error {
 10370  	var m map[string]*json.RawMessage
 10371  	err := json.Unmarshal(body, &m)
 10372  	if err != nil {
 10373  		return err
 10374  	}
 10375  	for k, v := range m {
 10376  		switch k {
 10377  		case "filters":
 10378  			if v != nil {
 10379  				var filters Filters
 10380  				err = json.Unmarshal(*v, &filters)
 10381  				if err != nil {
 10382  					return err
 10383  				}
 10384  				sep.Filters = &filters
 10385  			}
 10386  		case "codecs":
 10387  			if v != nil {
 10388  				codecs, err := unmarshalBasicCodecArray(*v)
 10389  				if err != nil {
 10390  					return err
 10391  				}
 10392  				sep.Codecs = &codecs
 10393  			}
 10394  		case "formats":
 10395  			if v != nil {
 10396  				formats, err := unmarshalBasicFormatArray(*v)
 10397  				if err != nil {
 10398  					return err
 10399  				}
 10400  				sep.Formats = &formats
 10401  			}
 10402  		case "@odata.type":
 10403  			if v != nil {
 10404  				var odataType OdataTypeBasicPreset
 10405  				err = json.Unmarshal(*v, &odataType)
 10406  				if err != nil {
 10407  					return err
 10408  				}
 10409  				sep.OdataType = odataType
 10410  			}
 10411  		}
 10412  	}
 10413  
 10414  	return nil
 10415  }
 10416  
 10417  // StorageAccount the storage account details.
 10418  type StorageAccount struct {
 10419  	// 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.
 10420  	ID *string `json:"id,omitempty"`
 10421  	// Type - The type of the storage account. Possible values include: 'StorageAccountTypePrimary', 'StorageAccountTypeSecondary'
 10422  	Type StorageAccountType `json:"type,omitempty"`
 10423  	// Identity - The storage account identity.
 10424  	Identity *ResourceIdentity `json:"identity,omitempty"`
 10425  	// Status - READ-ONLY; The current status of the storage account mapping.
 10426  	Status *string `json:"status,omitempty"`
 10427  }
 10428  
 10429  // MarshalJSON is the custom marshaler for StorageAccount.
 10430  func (sa StorageAccount) MarshalJSON() ([]byte, error) {
 10431  	objectMap := make(map[string]interface{})
 10432  	if sa.ID != nil {
 10433  		objectMap["id"] = sa.ID
 10434  	}
 10435  	if sa.Type != "" {
 10436  		objectMap["type"] = sa.Type
 10437  	}
 10438  	if sa.Identity != nil {
 10439  		objectMap["identity"] = sa.Identity
 10440  	}
 10441  	return json.Marshal(objectMap)
 10442  }
 10443  
 10444  // StorageEncryptedAssetDecryptionData data needed to decrypt asset files encrypted with legacy storage
 10445  // encryption.
 10446  type StorageEncryptedAssetDecryptionData struct {
 10447  	autorest.Response `json:"-"`
 10448  	// Key - The Asset File storage encryption key.
 10449  	Key *[]byte `json:"key,omitempty"`
 10450  	// AssetFileEncryptionMetadata - Asset File encryption metadata.
 10451  	AssetFileEncryptionMetadata *[]AssetFileEncryptionMetadata `json:"assetFileEncryptionMetadata,omitempty"`
 10452  }
 10453  
 10454  // StreamingEndpoint the streaming endpoint.
 10455  type StreamingEndpoint struct {
 10456  	autorest.Response `json:"-"`
 10457  	// StreamingEndpointProperties - The streaming endpoint properties.
 10458  	*StreamingEndpointProperties `json:"properties,omitempty"`
 10459  	// SystemData - READ-ONLY; The system metadata relating to this resource.
 10460  	SystemData *SystemData `json:"systemData,omitempty"`
 10461  	// Sku - The streaming endpoint sku.
 10462  	Sku *ArmStreamingEndpointCurrentSku `json:"sku,omitempty"`
 10463  	// Tags - Resource tags.
 10464  	Tags map[string]*string `json:"tags"`
 10465  	// Location - The geo-location where the resource lives
 10466  	Location *string `json:"location,omitempty"`
 10467  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 10468  	ID *string `json:"id,omitempty"`
 10469  	// Name - READ-ONLY; The name of the resource
 10470  	Name *string `json:"name,omitempty"`
 10471  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 10472  	Type *string `json:"type,omitempty"`
 10473  }
 10474  
 10475  // MarshalJSON is the custom marshaler for StreamingEndpoint.
 10476  func (se StreamingEndpoint) MarshalJSON() ([]byte, error) {
 10477  	objectMap := make(map[string]interface{})
 10478  	if se.StreamingEndpointProperties != nil {
 10479  		objectMap["properties"] = se.StreamingEndpointProperties
 10480  	}
 10481  	if se.Sku != nil {
 10482  		objectMap["sku"] = se.Sku
 10483  	}
 10484  	if se.Tags != nil {
 10485  		objectMap["tags"] = se.Tags
 10486  	}
 10487  	if se.Location != nil {
 10488  		objectMap["location"] = se.Location
 10489  	}
 10490  	return json.Marshal(objectMap)
 10491  }
 10492  
 10493  // UnmarshalJSON is the custom unmarshaler for StreamingEndpoint struct.
 10494  func (se *StreamingEndpoint) UnmarshalJSON(body []byte) error {
 10495  	var m map[string]*json.RawMessage
 10496  	err := json.Unmarshal(body, &m)
 10497  	if err != nil {
 10498  		return err
 10499  	}
 10500  	for k, v := range m {
 10501  		switch k {
 10502  		case "properties":
 10503  			if v != nil {
 10504  				var streamingEndpointProperties StreamingEndpointProperties
 10505  				err = json.Unmarshal(*v, &streamingEndpointProperties)
 10506  				if err != nil {
 10507  					return err
 10508  				}
 10509  				se.StreamingEndpointProperties = &streamingEndpointProperties
 10510  			}
 10511  		case "systemData":
 10512  			if v != nil {
 10513  				var systemData SystemData
 10514  				err = json.Unmarshal(*v, &systemData)
 10515  				if err != nil {
 10516  					return err
 10517  				}
 10518  				se.SystemData = &systemData
 10519  			}
 10520  		case "sku":
 10521  			if v != nil {
 10522  				var sku ArmStreamingEndpointCurrentSku
 10523  				err = json.Unmarshal(*v, &sku)
 10524  				if err != nil {
 10525  					return err
 10526  				}
 10527  				se.Sku = &sku
 10528  			}
 10529  		case "tags":
 10530  			if v != nil {
 10531  				var tags map[string]*string
 10532  				err = json.Unmarshal(*v, &tags)
 10533  				if err != nil {
 10534  					return err
 10535  				}
 10536  				se.Tags = tags
 10537  			}
 10538  		case "location":
 10539  			if v != nil {
 10540  				var location string
 10541  				err = json.Unmarshal(*v, &location)
 10542  				if err != nil {
 10543  					return err
 10544  				}
 10545  				se.Location = &location
 10546  			}
 10547  		case "id":
 10548  			if v != nil {
 10549  				var ID string
 10550  				err = json.Unmarshal(*v, &ID)
 10551  				if err != nil {
 10552  					return err
 10553  				}
 10554  				se.ID = &ID
 10555  			}
 10556  		case "name":
 10557  			if v != nil {
 10558  				var name string
 10559  				err = json.Unmarshal(*v, &name)
 10560  				if err != nil {
 10561  					return err
 10562  				}
 10563  				se.Name = &name
 10564  			}
 10565  		case "type":
 10566  			if v != nil {
 10567  				var typeVar string
 10568  				err = json.Unmarshal(*v, &typeVar)
 10569  				if err != nil {
 10570  					return err
 10571  				}
 10572  				se.Type = &typeVar
 10573  			}
 10574  		}
 10575  	}
 10576  
 10577  	return nil
 10578  }
 10579  
 10580  // StreamingEndpointAccessControl streaming endpoint access control definition.
 10581  type StreamingEndpointAccessControl struct {
 10582  	// Akamai - The access control of Akamai
 10583  	Akamai *AkamaiAccessControl `json:"akamai,omitempty"`
 10584  	// IP - The IP access control of the streaming endpoint.
 10585  	IP *IPAccessControl `json:"ip,omitempty"`
 10586  }
 10587  
 10588  // StreamingEndpointListResult the streaming endpoint list result.
 10589  type StreamingEndpointListResult struct {
 10590  	autorest.Response `json:"-"`
 10591  	// Value - The result of the List StreamingEndpoint operation.
 10592  	Value *[]StreamingEndpoint `json:"value,omitempty"`
 10593  	// OdataCount - The number of result.
 10594  	OdataCount *int32 `json:"@odata.count,omitempty"`
 10595  	// OdataNextLink - The link to the next set of results. Not empty if value contains incomplete list of streaming endpoints.
 10596  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
 10597  }
 10598  
 10599  // StreamingEndpointListResultIterator provides access to a complete listing of StreamingEndpoint values.
 10600  type StreamingEndpointListResultIterator struct {
 10601  	i    int
 10602  	page StreamingEndpointListResultPage
 10603  }
 10604  
 10605  // NextWithContext advances to the next value.  If there was an error making
 10606  // the request the iterator does not advance and the error is returned.
 10607  func (iter *StreamingEndpointListResultIterator) NextWithContext(ctx context.Context) (err error) {
 10608  	if tracing.IsEnabled() {
 10609  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingEndpointListResultIterator.NextWithContext")
 10610  		defer func() {
 10611  			sc := -1
 10612  			if iter.Response().Response.Response != nil {
 10613  				sc = iter.Response().Response.Response.StatusCode
 10614  			}
 10615  			tracing.EndSpan(ctx, sc, err)
 10616  		}()
 10617  	}
 10618  	iter.i++
 10619  	if iter.i < len(iter.page.Values()) {
 10620  		return nil
 10621  	}
 10622  	err = iter.page.NextWithContext(ctx)
 10623  	if err != nil {
 10624  		iter.i--
 10625  		return err
 10626  	}
 10627  	iter.i = 0
 10628  	return nil
 10629  }
 10630  
 10631  // Next advances to the next value.  If there was an error making
 10632  // the request the iterator does not advance and the error is returned.
 10633  // Deprecated: Use NextWithContext() instead.
 10634  func (iter *StreamingEndpointListResultIterator) Next() error {
 10635  	return iter.NextWithContext(context.Background())
 10636  }
 10637  
 10638  // NotDone returns true if the enumeration should be started or is not yet complete.
 10639  func (iter StreamingEndpointListResultIterator) NotDone() bool {
 10640  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
 10641  }
 10642  
 10643  // Response returns the raw server response from the last page request.
 10644  func (iter StreamingEndpointListResultIterator) Response() StreamingEndpointListResult {
 10645  	return iter.page.Response()
 10646  }
 10647  
 10648  // Value returns the current value or a zero-initialized value if the
 10649  // iterator has advanced beyond the end of the collection.
 10650  func (iter StreamingEndpointListResultIterator) Value() StreamingEndpoint {
 10651  	if !iter.page.NotDone() {
 10652  		return StreamingEndpoint{}
 10653  	}
 10654  	return iter.page.Values()[iter.i]
 10655  }
 10656  
 10657  // Creates a new instance of the StreamingEndpointListResultIterator type.
 10658  func NewStreamingEndpointListResultIterator(page StreamingEndpointListResultPage) StreamingEndpointListResultIterator {
 10659  	return StreamingEndpointListResultIterator{page: page}
 10660  }
 10661  
 10662  // IsEmpty returns true if the ListResult contains no values.
 10663  func (selr StreamingEndpointListResult) IsEmpty() bool {
 10664  	return selr.Value == nil || len(*selr.Value) == 0
 10665  }
 10666  
 10667  // hasNextLink returns true if the NextLink is not empty.
 10668  func (selr StreamingEndpointListResult) hasNextLink() bool {
 10669  	return selr.OdataNextLink != nil && len(*selr.OdataNextLink) != 0
 10670  }
 10671  
 10672  // streamingEndpointListResultPreparer prepares a request to retrieve the next set of results.
 10673  // It returns nil if no more results exist.
 10674  func (selr StreamingEndpointListResult) streamingEndpointListResultPreparer(ctx context.Context) (*http.Request, error) {
 10675  	if !selr.hasNextLink() {
 10676  		return nil, nil
 10677  	}
 10678  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
 10679  		autorest.AsJSON(),
 10680  		autorest.AsGet(),
 10681  		autorest.WithBaseURL(to.String(selr.OdataNextLink)))
 10682  }
 10683  
 10684  // StreamingEndpointListResultPage contains a page of StreamingEndpoint values.
 10685  type StreamingEndpointListResultPage struct {
 10686  	fn   func(context.Context, StreamingEndpointListResult) (StreamingEndpointListResult, error)
 10687  	selr StreamingEndpointListResult
 10688  }
 10689  
 10690  // NextWithContext advances to the next page of values.  If there was an error making
 10691  // the request the page does not advance and the error is returned.
 10692  func (page *StreamingEndpointListResultPage) NextWithContext(ctx context.Context) (err error) {
 10693  	if tracing.IsEnabled() {
 10694  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingEndpointListResultPage.NextWithContext")
 10695  		defer func() {
 10696  			sc := -1
 10697  			if page.Response().Response.Response != nil {
 10698  				sc = page.Response().Response.Response.StatusCode
 10699  			}
 10700  			tracing.EndSpan(ctx, sc, err)
 10701  		}()
 10702  	}
 10703  	for {
 10704  		next, err := page.fn(ctx, page.selr)
 10705  		if err != nil {
 10706  			return err
 10707  		}
 10708  		page.selr = next
 10709  		if !next.hasNextLink() || !next.IsEmpty() {
 10710  			break
 10711  		}
 10712  	}
 10713  	return nil
 10714  }
 10715  
 10716  // Next advances to the next page of values.  If there was an error making
 10717  // the request the page does not advance and the error is returned.
 10718  // Deprecated: Use NextWithContext() instead.
 10719  func (page *StreamingEndpointListResultPage) Next() error {
 10720  	return page.NextWithContext(context.Background())
 10721  }
 10722  
 10723  // NotDone returns true if the page enumeration should be started or is not yet complete.
 10724  func (page StreamingEndpointListResultPage) NotDone() bool {
 10725  	return !page.selr.IsEmpty()
 10726  }
 10727  
 10728  // Response returns the raw server response from the last page request.
 10729  func (page StreamingEndpointListResultPage) Response() StreamingEndpointListResult {
 10730  	return page.selr
 10731  }
 10732  
 10733  // Values returns the slice of values for the current page or nil if there are no values.
 10734  func (page StreamingEndpointListResultPage) Values() []StreamingEndpoint {
 10735  	if page.selr.IsEmpty() {
 10736  		return nil
 10737  	}
 10738  	return *page.selr.Value
 10739  }
 10740  
 10741  // Creates a new instance of the StreamingEndpointListResultPage type.
 10742  func NewStreamingEndpointListResultPage(cur StreamingEndpointListResult, getNextPage func(context.Context, StreamingEndpointListResult) (StreamingEndpointListResult, error)) StreamingEndpointListResultPage {
 10743  	return StreamingEndpointListResultPage{
 10744  		fn:   getNextPage,
 10745  		selr: cur,
 10746  	}
 10747  }
 10748  
 10749  // StreamingEndpointProperties the streaming endpoint properties.
 10750  type StreamingEndpointProperties struct {
 10751  	// Description - The streaming endpoint description.
 10752  	Description *string `json:"description,omitempty"`
 10753  	// ScaleUnits - The number of scale units. Use the Scale operation to adjust this value.
 10754  	ScaleUnits *int32 `json:"scaleUnits,omitempty"`
 10755  	// AvailabilitySetName - This feature is deprecated, do not set a value for this property.
 10756  	AvailabilitySetName *string `json:"availabilitySetName,omitempty"`
 10757  	// AccessControl - The access control definition of the streaming endpoint.
 10758  	AccessControl *StreamingEndpointAccessControl `json:"accessControl,omitempty"`
 10759  	// MaxCacheAge - Max cache age
 10760  	MaxCacheAge *int64 `json:"maxCacheAge,omitempty"`
 10761  	// CustomHostNames - The custom host names of the streaming endpoint
 10762  	CustomHostNames *[]string `json:"customHostNames,omitempty"`
 10763  	// HostName - READ-ONLY; The streaming endpoint host name.
 10764  	HostName *string `json:"hostName,omitempty"`
 10765  	// CdnEnabled - The CDN enabled flag.
 10766  	CdnEnabled *bool `json:"cdnEnabled,omitempty"`
 10767  	// CdnProvider - The CDN provider name.
 10768  	CdnProvider *string `json:"cdnProvider,omitempty"`
 10769  	// CdnProfile - The CDN profile name.
 10770  	CdnProfile *string `json:"cdnProfile,omitempty"`
 10771  	// ProvisioningState - READ-ONLY; The provisioning state of the streaming endpoint.
 10772  	ProvisioningState *string `json:"provisioningState,omitempty"`
 10773  	// ResourceState - READ-ONLY; The resource state of the streaming endpoint. Possible values include: 'StreamingEndpointResourceStateStopped', 'StreamingEndpointResourceStateStarting', 'StreamingEndpointResourceStateRunning', 'StreamingEndpointResourceStateStopping', 'StreamingEndpointResourceStateDeleting', 'StreamingEndpointResourceStateScaling'
 10774  	ResourceState StreamingEndpointResourceState `json:"resourceState,omitempty"`
 10775  	// CrossSiteAccessPolicies - The streaming endpoint access policies.
 10776  	CrossSiteAccessPolicies *CrossSiteAccessPolicies `json:"crossSiteAccessPolicies,omitempty"`
 10777  	// FreeTrialEndTime - READ-ONLY; The free trial expiration time.
 10778  	FreeTrialEndTime *date.Time `json:"freeTrialEndTime,omitempty"`
 10779  	// Created - READ-ONLY; The exact time the streaming endpoint was created.
 10780  	Created *date.Time `json:"created,omitempty"`
 10781  	// LastModified - READ-ONLY; The exact time the streaming endpoint was last modified.
 10782  	LastModified *date.Time `json:"lastModified,omitempty"`
 10783  }
 10784  
 10785  // MarshalJSON is the custom marshaler for StreamingEndpointProperties.
 10786  func (sep StreamingEndpointProperties) MarshalJSON() ([]byte, error) {
 10787  	objectMap := make(map[string]interface{})
 10788  	if sep.Description != nil {
 10789  		objectMap["description"] = sep.Description
 10790  	}
 10791  	if sep.ScaleUnits != nil {
 10792  		objectMap["scaleUnits"] = sep.ScaleUnits
 10793  	}
 10794  	if sep.AvailabilitySetName != nil {
 10795  		objectMap["availabilitySetName"] = sep.AvailabilitySetName
 10796  	}
 10797  	if sep.AccessControl != nil {
 10798  		objectMap["accessControl"] = sep.AccessControl
 10799  	}
 10800  	if sep.MaxCacheAge != nil {
 10801  		objectMap["maxCacheAge"] = sep.MaxCacheAge
 10802  	}
 10803  	if sep.CustomHostNames != nil {
 10804  		objectMap["customHostNames"] = sep.CustomHostNames
 10805  	}
 10806  	if sep.CdnEnabled != nil {
 10807  		objectMap["cdnEnabled"] = sep.CdnEnabled
 10808  	}
 10809  	if sep.CdnProvider != nil {
 10810  		objectMap["cdnProvider"] = sep.CdnProvider
 10811  	}
 10812  	if sep.CdnProfile != nil {
 10813  		objectMap["cdnProfile"] = sep.CdnProfile
 10814  	}
 10815  	if sep.CrossSiteAccessPolicies != nil {
 10816  		objectMap["crossSiteAccessPolicies"] = sep.CrossSiteAccessPolicies
 10817  	}
 10818  	return json.Marshal(objectMap)
 10819  }
 10820  
 10821  // StreamingEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a
 10822  // long-running operation.
 10823  type StreamingEndpointsCreateFuture struct {
 10824  	azure.FutureAPI
 10825  	// Result returns the result of the asynchronous operation.
 10826  	// If the operation has not completed it will return an error.
 10827  	Result func(StreamingEndpointsClient) (StreamingEndpoint, error)
 10828  }
 10829  
 10830  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 10831  func (future *StreamingEndpointsCreateFuture) UnmarshalJSON(body []byte) error {
 10832  	var azFuture azure.Future
 10833  	if err := json.Unmarshal(body, &azFuture); err != nil {
 10834  		return err
 10835  	}
 10836  	future.FutureAPI = &azFuture
 10837  	future.Result = future.result
 10838  	return nil
 10839  }
 10840  
 10841  // result is the default implementation for StreamingEndpointsCreateFuture.Result.
 10842  func (future *StreamingEndpointsCreateFuture) result(client StreamingEndpointsClient) (se StreamingEndpoint, err error) {
 10843  	var done bool
 10844  	done, err = future.DoneWithContext(context.Background(), client)
 10845  	if err != nil {
 10846  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsCreateFuture", "Result", future.Response(), "Polling failure")
 10847  		return
 10848  	}
 10849  	if !done {
 10850  		se.Response.Response = future.Response()
 10851  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsCreateFuture")
 10852  		return
 10853  	}
 10854  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
 10855  	if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent {
 10856  		se, err = client.CreateResponder(se.Response.Response)
 10857  		if err != nil {
 10858  			err = autorest.NewErrorWithError(err, "media.StreamingEndpointsCreateFuture", "Result", se.Response.Response, "Failure responding to request")
 10859  		}
 10860  	}
 10861  	return
 10862  }
 10863  
 10864  // StreamingEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a
 10865  // long-running operation.
 10866  type StreamingEndpointsDeleteFuture struct {
 10867  	azure.FutureAPI
 10868  	// Result returns the result of the asynchronous operation.
 10869  	// If the operation has not completed it will return an error.
 10870  	Result func(StreamingEndpointsClient) (autorest.Response, error)
 10871  }
 10872  
 10873  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 10874  func (future *StreamingEndpointsDeleteFuture) UnmarshalJSON(body []byte) error {
 10875  	var azFuture azure.Future
 10876  	if err := json.Unmarshal(body, &azFuture); err != nil {
 10877  		return err
 10878  	}
 10879  	future.FutureAPI = &azFuture
 10880  	future.Result = future.result
 10881  	return nil
 10882  }
 10883  
 10884  // result is the default implementation for StreamingEndpointsDeleteFuture.Result.
 10885  func (future *StreamingEndpointsDeleteFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
 10886  	var done bool
 10887  	done, err = future.DoneWithContext(context.Background(), client)
 10888  	if err != nil {
 10889  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsDeleteFuture", "Result", future.Response(), "Polling failure")
 10890  		return
 10891  	}
 10892  	if !done {
 10893  		ar.Response = future.Response()
 10894  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsDeleteFuture")
 10895  		return
 10896  	}
 10897  	ar.Response = future.Response()
 10898  	return
 10899  }
 10900  
 10901  // StreamingEndpointSkuInfoListResult ...
 10902  type StreamingEndpointSkuInfoListResult struct {
 10903  	autorest.Response `json:"-"`
 10904  	// Value - The result of the List StreamingEndpoint skus.
 10905  	Value *[]ArmStreamingEndpointSkuInfo `json:"value,omitempty"`
 10906  }
 10907  
 10908  // StreamingEndpointsScaleFuture an abstraction for monitoring and retrieving the results of a long-running
 10909  // operation.
 10910  type StreamingEndpointsScaleFuture struct {
 10911  	azure.FutureAPI
 10912  	// Result returns the result of the asynchronous operation.
 10913  	// If the operation has not completed it will return an error.
 10914  	Result func(StreamingEndpointsClient) (autorest.Response, error)
 10915  }
 10916  
 10917  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 10918  func (future *StreamingEndpointsScaleFuture) UnmarshalJSON(body []byte) error {
 10919  	var azFuture azure.Future
 10920  	if err := json.Unmarshal(body, &azFuture); err != nil {
 10921  		return err
 10922  	}
 10923  	future.FutureAPI = &azFuture
 10924  	future.Result = future.result
 10925  	return nil
 10926  }
 10927  
 10928  // result is the default implementation for StreamingEndpointsScaleFuture.Result.
 10929  func (future *StreamingEndpointsScaleFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
 10930  	var done bool
 10931  	done, err = future.DoneWithContext(context.Background(), client)
 10932  	if err != nil {
 10933  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsScaleFuture", "Result", future.Response(), "Polling failure")
 10934  		return
 10935  	}
 10936  	if !done {
 10937  		ar.Response = future.Response()
 10938  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsScaleFuture")
 10939  		return
 10940  	}
 10941  	ar.Response = future.Response()
 10942  	return
 10943  }
 10944  
 10945  // StreamingEndpointsStartFuture an abstraction for monitoring and retrieving the results of a long-running
 10946  // operation.
 10947  type StreamingEndpointsStartFuture struct {
 10948  	azure.FutureAPI
 10949  	// Result returns the result of the asynchronous operation.
 10950  	// If the operation has not completed it will return an error.
 10951  	Result func(StreamingEndpointsClient) (autorest.Response, error)
 10952  }
 10953  
 10954  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 10955  func (future *StreamingEndpointsStartFuture) UnmarshalJSON(body []byte) error {
 10956  	var azFuture azure.Future
 10957  	if err := json.Unmarshal(body, &azFuture); err != nil {
 10958  		return err
 10959  	}
 10960  	future.FutureAPI = &azFuture
 10961  	future.Result = future.result
 10962  	return nil
 10963  }
 10964  
 10965  // result is the default implementation for StreamingEndpointsStartFuture.Result.
 10966  func (future *StreamingEndpointsStartFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
 10967  	var done bool
 10968  	done, err = future.DoneWithContext(context.Background(), client)
 10969  	if err != nil {
 10970  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsStartFuture", "Result", future.Response(), "Polling failure")
 10971  		return
 10972  	}
 10973  	if !done {
 10974  		ar.Response = future.Response()
 10975  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsStartFuture")
 10976  		return
 10977  	}
 10978  	ar.Response = future.Response()
 10979  	return
 10980  }
 10981  
 10982  // StreamingEndpointsStopFuture an abstraction for monitoring and retrieving the results of a long-running
 10983  // operation.
 10984  type StreamingEndpointsStopFuture struct {
 10985  	azure.FutureAPI
 10986  	// Result returns the result of the asynchronous operation.
 10987  	// If the operation has not completed it will return an error.
 10988  	Result func(StreamingEndpointsClient) (autorest.Response, error)
 10989  }
 10990  
 10991  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 10992  func (future *StreamingEndpointsStopFuture) UnmarshalJSON(body []byte) error {
 10993  	var azFuture azure.Future
 10994  	if err := json.Unmarshal(body, &azFuture); err != nil {
 10995  		return err
 10996  	}
 10997  	future.FutureAPI = &azFuture
 10998  	future.Result = future.result
 10999  	return nil
 11000  }
 11001  
 11002  // result is the default implementation for StreamingEndpointsStopFuture.Result.
 11003  func (future *StreamingEndpointsStopFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
 11004  	var done bool
 11005  	done, err = future.DoneWithContext(context.Background(), client)
 11006  	if err != nil {
 11007  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsStopFuture", "Result", future.Response(), "Polling failure")
 11008  		return
 11009  	}
 11010  	if !done {
 11011  		ar.Response = future.Response()
 11012  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsStopFuture")
 11013  		return
 11014  	}
 11015  	ar.Response = future.Response()
 11016  	return
 11017  }
 11018  
 11019  // StreamingEndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a
 11020  // long-running operation.
 11021  type StreamingEndpointsUpdateFuture struct {
 11022  	azure.FutureAPI
 11023  	// Result returns the result of the asynchronous operation.
 11024  	// If the operation has not completed it will return an error.
 11025  	Result func(StreamingEndpointsClient) (StreamingEndpoint, error)
 11026  }
 11027  
 11028  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 11029  func (future *StreamingEndpointsUpdateFuture) UnmarshalJSON(body []byte) error {
 11030  	var azFuture azure.Future
 11031  	if err := json.Unmarshal(body, &azFuture); err != nil {
 11032  		return err
 11033  	}
 11034  	future.FutureAPI = &azFuture
 11035  	future.Result = future.result
 11036  	return nil
 11037  }
 11038  
 11039  // result is the default implementation for StreamingEndpointsUpdateFuture.Result.
 11040  func (future *StreamingEndpointsUpdateFuture) result(client StreamingEndpointsClient) (se StreamingEndpoint, err error) {
 11041  	var done bool
 11042  	done, err = future.DoneWithContext(context.Background(), client)
 11043  	if err != nil {
 11044  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsUpdateFuture", "Result", future.Response(), "Polling failure")
 11045  		return
 11046  	}
 11047  	if !done {
 11048  		se.Response.Response = future.Response()
 11049  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsUpdateFuture")
 11050  		return
 11051  	}
 11052  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
 11053  	if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent {
 11054  		se, err = client.UpdateResponder(se.Response.Response)
 11055  		if err != nil {
 11056  			err = autorest.NewErrorWithError(err, "media.StreamingEndpointsUpdateFuture", "Result", se.Response.Response, "Failure responding to request")
 11057  		}
 11058  	}
 11059  	return
 11060  }
 11061  
 11062  // StreamingEntityScaleUnit scale units definition
 11063  type StreamingEntityScaleUnit struct {
 11064  	// ScaleUnit - The scale unit number of the streaming endpoint.
 11065  	ScaleUnit *int32 `json:"scaleUnit,omitempty"`
 11066  }
 11067  
 11068  // StreamingLocator a Streaming Locator resource
 11069  type StreamingLocator struct {
 11070  	autorest.Response           `json:"-"`
 11071  	*StreamingLocatorProperties `json:"properties,omitempty"`
 11072  	// SystemData - READ-ONLY; The system metadata relating to this resource.
 11073  	SystemData *SystemData `json:"systemData,omitempty"`
 11074  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 11075  	ID *string `json:"id,omitempty"`
 11076  	// Name - READ-ONLY; The name of the resource
 11077  	Name *string `json:"name,omitempty"`
 11078  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 11079  	Type *string `json:"type,omitempty"`
 11080  }
 11081  
 11082  // MarshalJSON is the custom marshaler for StreamingLocator.
 11083  func (sl StreamingLocator) MarshalJSON() ([]byte, error) {
 11084  	objectMap := make(map[string]interface{})
 11085  	if sl.StreamingLocatorProperties != nil {
 11086  		objectMap["properties"] = sl.StreamingLocatorProperties
 11087  	}
 11088  	return json.Marshal(objectMap)
 11089  }
 11090  
 11091  // UnmarshalJSON is the custom unmarshaler for StreamingLocator struct.
 11092  func (sl *StreamingLocator) UnmarshalJSON(body []byte) error {
 11093  	var m map[string]*json.RawMessage
 11094  	err := json.Unmarshal(body, &m)
 11095  	if err != nil {
 11096  		return err
 11097  	}
 11098  	for k, v := range m {
 11099  		switch k {
 11100  		case "properties":
 11101  			if v != nil {
 11102  				var streamingLocatorProperties StreamingLocatorProperties
 11103  				err = json.Unmarshal(*v, &streamingLocatorProperties)
 11104  				if err != nil {
 11105  					return err
 11106  				}
 11107  				sl.StreamingLocatorProperties = &streamingLocatorProperties
 11108  			}
 11109  		case "systemData":
 11110  			if v != nil {
 11111  				var systemData SystemData
 11112  				err = json.Unmarshal(*v, &systemData)
 11113  				if err != nil {
 11114  					return err
 11115  				}
 11116  				sl.SystemData = &systemData
 11117  			}
 11118  		case "id":
 11119  			if v != nil {
 11120  				var ID string
 11121  				err = json.Unmarshal(*v, &ID)
 11122  				if err != nil {
 11123  					return err
 11124  				}
 11125  				sl.ID = &ID
 11126  			}
 11127  		case "name":
 11128  			if v != nil {
 11129  				var name string
 11130  				err = json.Unmarshal(*v, &name)
 11131  				if err != nil {
 11132  					return err
 11133  				}
 11134  				sl.Name = &name
 11135  			}
 11136  		case "type":
 11137  			if v != nil {
 11138  				var typeVar string
 11139  				err = json.Unmarshal(*v, &typeVar)
 11140  				if err != nil {
 11141  					return err
 11142  				}
 11143  				sl.Type = &typeVar
 11144  			}
 11145  		}
 11146  	}
 11147  
 11148  	return nil
 11149  }
 11150  
 11151  // StreamingLocatorCollection a collection of StreamingLocator items.
 11152  type StreamingLocatorCollection struct {
 11153  	autorest.Response `json:"-"`
 11154  	// Value - A collection of StreamingLocator items.
 11155  	Value *[]StreamingLocator `json:"value,omitempty"`
 11156  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
 11157  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
 11158  }
 11159  
 11160  // StreamingLocatorCollectionIterator provides access to a complete listing of StreamingLocator values.
 11161  type StreamingLocatorCollectionIterator struct {
 11162  	i    int
 11163  	page StreamingLocatorCollectionPage
 11164  }
 11165  
 11166  // NextWithContext advances to the next value.  If there was an error making
 11167  // the request the iterator does not advance and the error is returned.
 11168  func (iter *StreamingLocatorCollectionIterator) NextWithContext(ctx context.Context) (err error) {
 11169  	if tracing.IsEnabled() {
 11170  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorCollectionIterator.NextWithContext")
 11171  		defer func() {
 11172  			sc := -1
 11173  			if iter.Response().Response.Response != nil {
 11174  				sc = iter.Response().Response.Response.StatusCode
 11175  			}
 11176  			tracing.EndSpan(ctx, sc, err)
 11177  		}()
 11178  	}
 11179  	iter.i++
 11180  	if iter.i < len(iter.page.Values()) {
 11181  		return nil
 11182  	}
 11183  	err = iter.page.NextWithContext(ctx)
 11184  	if err != nil {
 11185  		iter.i--
 11186  		return err
 11187  	}
 11188  	iter.i = 0
 11189  	return nil
 11190  }
 11191  
 11192  // Next advances to the next value.  If there was an error making
 11193  // the request the iterator does not advance and the error is returned.
 11194  // Deprecated: Use NextWithContext() instead.
 11195  func (iter *StreamingLocatorCollectionIterator) Next() error {
 11196  	return iter.NextWithContext(context.Background())
 11197  }
 11198  
 11199  // NotDone returns true if the enumeration should be started or is not yet complete.
 11200  func (iter StreamingLocatorCollectionIterator) NotDone() bool {
 11201  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
 11202  }
 11203  
 11204  // Response returns the raw server response from the last page request.
 11205  func (iter StreamingLocatorCollectionIterator) Response() StreamingLocatorCollection {
 11206  	return iter.page.Response()
 11207  }
 11208  
 11209  // Value returns the current value or a zero-initialized value if the
 11210  // iterator has advanced beyond the end of the collection.
 11211  func (iter StreamingLocatorCollectionIterator) Value() StreamingLocator {
 11212  	if !iter.page.NotDone() {
 11213  		return StreamingLocator{}
 11214  	}
 11215  	return iter.page.Values()[iter.i]
 11216  }
 11217  
 11218  // Creates a new instance of the StreamingLocatorCollectionIterator type.
 11219  func NewStreamingLocatorCollectionIterator(page StreamingLocatorCollectionPage) StreamingLocatorCollectionIterator {
 11220  	return StreamingLocatorCollectionIterator{page: page}
 11221  }
 11222  
 11223  // IsEmpty returns true if the ListResult contains no values.
 11224  func (slc StreamingLocatorCollection) IsEmpty() bool {
 11225  	return slc.Value == nil || len(*slc.Value) == 0
 11226  }
 11227  
 11228  // hasNextLink returns true if the NextLink is not empty.
 11229  func (slc StreamingLocatorCollection) hasNextLink() bool {
 11230  	return slc.OdataNextLink != nil && len(*slc.OdataNextLink) != 0
 11231  }
 11232  
 11233  // streamingLocatorCollectionPreparer prepares a request to retrieve the next set of results.
 11234  // It returns nil if no more results exist.
 11235  func (slc StreamingLocatorCollection) streamingLocatorCollectionPreparer(ctx context.Context) (*http.Request, error) {
 11236  	if !slc.hasNextLink() {
 11237  		return nil, nil
 11238  	}
 11239  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
 11240  		autorest.AsJSON(),
 11241  		autorest.AsGet(),
 11242  		autorest.WithBaseURL(to.String(slc.OdataNextLink)))
 11243  }
 11244  
 11245  // StreamingLocatorCollectionPage contains a page of StreamingLocator values.
 11246  type StreamingLocatorCollectionPage struct {
 11247  	fn  func(context.Context, StreamingLocatorCollection) (StreamingLocatorCollection, error)
 11248  	slc StreamingLocatorCollection
 11249  }
 11250  
 11251  // NextWithContext advances to the next page of values.  If there was an error making
 11252  // the request the page does not advance and the error is returned.
 11253  func (page *StreamingLocatorCollectionPage) NextWithContext(ctx context.Context) (err error) {
 11254  	if tracing.IsEnabled() {
 11255  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorCollectionPage.NextWithContext")
 11256  		defer func() {
 11257  			sc := -1
 11258  			if page.Response().Response.Response != nil {
 11259  				sc = page.Response().Response.Response.StatusCode
 11260  			}
 11261  			tracing.EndSpan(ctx, sc, err)
 11262  		}()
 11263  	}
 11264  	for {
 11265  		next, err := page.fn(ctx, page.slc)
 11266  		if err != nil {
 11267  			return err
 11268  		}
 11269  		page.slc = next
 11270  		if !next.hasNextLink() || !next.IsEmpty() {
 11271  			break
 11272  		}
 11273  	}
 11274  	return nil
 11275  }
 11276  
 11277  // Next advances to the next page of values.  If there was an error making
 11278  // the request the page does not advance and the error is returned.
 11279  // Deprecated: Use NextWithContext() instead.
 11280  func (page *StreamingLocatorCollectionPage) Next() error {
 11281  	return page.NextWithContext(context.Background())
 11282  }
 11283  
 11284  // NotDone returns true if the page enumeration should be started or is not yet complete.
 11285  func (page StreamingLocatorCollectionPage) NotDone() bool {
 11286  	return !page.slc.IsEmpty()
 11287  }
 11288  
 11289  // Response returns the raw server response from the last page request.
 11290  func (page StreamingLocatorCollectionPage) Response() StreamingLocatorCollection {
 11291  	return page.slc
 11292  }
 11293  
 11294  // Values returns the slice of values for the current page or nil if there are no values.
 11295  func (page StreamingLocatorCollectionPage) Values() []StreamingLocator {
 11296  	if page.slc.IsEmpty() {
 11297  		return nil
 11298  	}
 11299  	return *page.slc.Value
 11300  }
 11301  
 11302  // Creates a new instance of the StreamingLocatorCollectionPage type.
 11303  func NewStreamingLocatorCollectionPage(cur StreamingLocatorCollection, getNextPage func(context.Context, StreamingLocatorCollection) (StreamingLocatorCollection, error)) StreamingLocatorCollectionPage {
 11304  	return StreamingLocatorCollectionPage{
 11305  		fn:  getNextPage,
 11306  		slc: cur,
 11307  	}
 11308  }
 11309  
 11310  // StreamingLocatorContentKey class for content key in Streaming Locator
 11311  type StreamingLocatorContentKey struct {
 11312  	// ID - ID of Content Key
 11313  	ID *uuid.UUID `json:"id,omitempty"`
 11314  	// Type - READ-ONLY; Encryption type of Content Key. Possible values include: 'StreamingLocatorContentKeyTypeCommonEncryptionCenc', 'StreamingLocatorContentKeyTypeCommonEncryptionCbcs', 'StreamingLocatorContentKeyTypeEnvelopeEncryption'
 11315  	Type StreamingLocatorContentKeyType `json:"type,omitempty"`
 11316  	// LabelReferenceInStreamingPolicy - Label of Content Key as specified in the Streaming Policy
 11317  	LabelReferenceInStreamingPolicy *string `json:"labelReferenceInStreamingPolicy,omitempty"`
 11318  	// Value - Value of Content Key
 11319  	Value *string `json:"value,omitempty"`
 11320  	// PolicyName - READ-ONLY; ContentKeyPolicy used by Content Key
 11321  	PolicyName *string `json:"policyName,omitempty"`
 11322  	// Tracks - READ-ONLY; Tracks which use this Content Key
 11323  	Tracks *[]TrackSelection `json:"tracks,omitempty"`
 11324  }
 11325  
 11326  // MarshalJSON is the custom marshaler for StreamingLocatorContentKey.
 11327  func (slck StreamingLocatorContentKey) MarshalJSON() ([]byte, error) {
 11328  	objectMap := make(map[string]interface{})
 11329  	if slck.ID != nil {
 11330  		objectMap["id"] = slck.ID
 11331  	}
 11332  	if slck.LabelReferenceInStreamingPolicy != nil {
 11333  		objectMap["labelReferenceInStreamingPolicy"] = slck.LabelReferenceInStreamingPolicy
 11334  	}
 11335  	if slck.Value != nil {
 11336  		objectMap["value"] = slck.Value
 11337  	}
 11338  	return json.Marshal(objectMap)
 11339  }
 11340  
 11341  // StreamingLocatorProperties properties of the Streaming Locator.
 11342  type StreamingLocatorProperties struct {
 11343  	// AssetName - Asset Name
 11344  	AssetName *string `json:"assetName,omitempty"`
 11345  	// Created - READ-ONLY; The creation time of the Streaming Locator.
 11346  	Created *date.Time `json:"created,omitempty"`
 11347  	// StartTime - The start time of the Streaming Locator.
 11348  	StartTime *date.Time `json:"startTime,omitempty"`
 11349  	// EndTime - The end time of the Streaming Locator.
 11350  	EndTime *date.Time `json:"endTime,omitempty"`
 11351  	// StreamingLocatorID - The StreamingLocatorId of the Streaming Locator.
 11352  	StreamingLocatorID *uuid.UUID `json:"streamingLocatorId,omitempty"`
 11353  	// 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'
 11354  	StreamingPolicyName *string `json:"streamingPolicyName,omitempty"`
 11355  	// DefaultContentKeyPolicyName - Name of the default ContentKeyPolicy used by this Streaming Locator.
 11356  	DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"`
 11357  	// ContentKeys - The ContentKeys used by this Streaming Locator.
 11358  	ContentKeys *[]StreamingLocatorContentKey `json:"contentKeys,omitempty"`
 11359  	// AlternativeMediaID - Alternative Media ID of this Streaming Locator
 11360  	AlternativeMediaID *string `json:"alternativeMediaId,omitempty"`
 11361  	// Filters - A list of asset or account filters which apply to this streaming locator
 11362  	Filters *[]string `json:"filters,omitempty"`
 11363  }
 11364  
 11365  // MarshalJSON is the custom marshaler for StreamingLocatorProperties.
 11366  func (slp StreamingLocatorProperties) MarshalJSON() ([]byte, error) {
 11367  	objectMap := make(map[string]interface{})
 11368  	if slp.AssetName != nil {
 11369  		objectMap["assetName"] = slp.AssetName
 11370  	}
 11371  	if slp.StartTime != nil {
 11372  		objectMap["startTime"] = slp.StartTime
 11373  	}
 11374  	if slp.EndTime != nil {
 11375  		objectMap["endTime"] = slp.EndTime
 11376  	}
 11377  	if slp.StreamingLocatorID != nil {
 11378  		objectMap["streamingLocatorId"] = slp.StreamingLocatorID
 11379  	}
 11380  	if slp.StreamingPolicyName != nil {
 11381  		objectMap["streamingPolicyName"] = slp.StreamingPolicyName
 11382  	}
 11383  	if slp.DefaultContentKeyPolicyName != nil {
 11384  		objectMap["defaultContentKeyPolicyName"] = slp.DefaultContentKeyPolicyName
 11385  	}
 11386  	if slp.ContentKeys != nil {
 11387  		objectMap["contentKeys"] = slp.ContentKeys
 11388  	}
 11389  	if slp.AlternativeMediaID != nil {
 11390  		objectMap["alternativeMediaId"] = slp.AlternativeMediaID
 11391  	}
 11392  	if slp.Filters != nil {
 11393  		objectMap["filters"] = slp.Filters
 11394  	}
 11395  	return json.Marshal(objectMap)
 11396  }
 11397  
 11398  // StreamingPath class of paths for streaming
 11399  type StreamingPath struct {
 11400  	// StreamingProtocol - Streaming protocol. Possible values include: 'StreamingPolicyStreamingProtocolHls', 'StreamingPolicyStreamingProtocolDash', 'StreamingPolicyStreamingProtocolSmoothStreaming', 'StreamingPolicyStreamingProtocolDownload'
 11401  	StreamingProtocol StreamingPolicyStreamingProtocol `json:"streamingProtocol,omitempty"`
 11402  	// EncryptionScheme - Encryption scheme. Possible values include: 'EncryptionSchemeNoEncryption', 'EncryptionSchemeEnvelopeEncryption', 'EncryptionSchemeCommonEncryptionCenc', 'EncryptionSchemeCommonEncryptionCbcs'
 11403  	EncryptionScheme EncryptionScheme `json:"encryptionScheme,omitempty"`
 11404  	// Paths - Streaming paths for each protocol and encryptionScheme pair
 11405  	Paths *[]string `json:"paths,omitempty"`
 11406  }
 11407  
 11408  // StreamingPolicy a Streaming Policy resource
 11409  type StreamingPolicy struct {
 11410  	autorest.Response          `json:"-"`
 11411  	*StreamingPolicyProperties `json:"properties,omitempty"`
 11412  	// SystemData - READ-ONLY; The system metadata relating to this resource.
 11413  	SystemData *SystemData `json:"systemData,omitempty"`
 11414  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 11415  	ID *string `json:"id,omitempty"`
 11416  	// Name - READ-ONLY; The name of the resource
 11417  	Name *string `json:"name,omitempty"`
 11418  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 11419  	Type *string `json:"type,omitempty"`
 11420  }
 11421  
 11422  // MarshalJSON is the custom marshaler for StreamingPolicy.
 11423  func (sp StreamingPolicy) MarshalJSON() ([]byte, error) {
 11424  	objectMap := make(map[string]interface{})
 11425  	if sp.StreamingPolicyProperties != nil {
 11426  		objectMap["properties"] = sp.StreamingPolicyProperties
 11427  	}
 11428  	return json.Marshal(objectMap)
 11429  }
 11430  
 11431  // UnmarshalJSON is the custom unmarshaler for StreamingPolicy struct.
 11432  func (sp *StreamingPolicy) UnmarshalJSON(body []byte) error {
 11433  	var m map[string]*json.RawMessage
 11434  	err := json.Unmarshal(body, &m)
 11435  	if err != nil {
 11436  		return err
 11437  	}
 11438  	for k, v := range m {
 11439  		switch k {
 11440  		case "properties":
 11441  			if v != nil {
 11442  				var streamingPolicyProperties StreamingPolicyProperties
 11443  				err = json.Unmarshal(*v, &streamingPolicyProperties)
 11444  				if err != nil {
 11445  					return err
 11446  				}
 11447  				sp.StreamingPolicyProperties = &streamingPolicyProperties
 11448  			}
 11449  		case "systemData":
 11450  			if v != nil {
 11451  				var systemData SystemData
 11452  				err = json.Unmarshal(*v, &systemData)
 11453  				if err != nil {
 11454  					return err
 11455  				}
 11456  				sp.SystemData = &systemData
 11457  			}
 11458  		case "id":
 11459  			if v != nil {
 11460  				var ID string
 11461  				err = json.Unmarshal(*v, &ID)
 11462  				if err != nil {
 11463  					return err
 11464  				}
 11465  				sp.ID = &ID
 11466  			}
 11467  		case "name":
 11468  			if v != nil {
 11469  				var name string
 11470  				err = json.Unmarshal(*v, &name)
 11471  				if err != nil {
 11472  					return err
 11473  				}
 11474  				sp.Name = &name
 11475  			}
 11476  		case "type":
 11477  			if v != nil {
 11478  				var typeVar string
 11479  				err = json.Unmarshal(*v, &typeVar)
 11480  				if err != nil {
 11481  					return err
 11482  				}
 11483  				sp.Type = &typeVar
 11484  			}
 11485  		}
 11486  	}
 11487  
 11488  	return nil
 11489  }
 11490  
 11491  // StreamingPolicyCollection a collection of StreamingPolicy items.
 11492  type StreamingPolicyCollection struct {
 11493  	autorest.Response `json:"-"`
 11494  	// Value - A collection of StreamingPolicy items.
 11495  	Value *[]StreamingPolicy `json:"value,omitempty"`
 11496  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
 11497  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
 11498  }
 11499  
 11500  // StreamingPolicyCollectionIterator provides access to a complete listing of StreamingPolicy values.
 11501  type StreamingPolicyCollectionIterator struct {
 11502  	i    int
 11503  	page StreamingPolicyCollectionPage
 11504  }
 11505  
 11506  // NextWithContext advances to the next value.  If there was an error making
 11507  // the request the iterator does not advance and the error is returned.
 11508  func (iter *StreamingPolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) {
 11509  	if tracing.IsEnabled() {
 11510  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingPolicyCollectionIterator.NextWithContext")
 11511  		defer func() {
 11512  			sc := -1
 11513  			if iter.Response().Response.Response != nil {
 11514  				sc = iter.Response().Response.Response.StatusCode
 11515  			}
 11516  			tracing.EndSpan(ctx, sc, err)
 11517  		}()
 11518  	}
 11519  	iter.i++
 11520  	if iter.i < len(iter.page.Values()) {
 11521  		return nil
 11522  	}
 11523  	err = iter.page.NextWithContext(ctx)
 11524  	if err != nil {
 11525  		iter.i--
 11526  		return err
 11527  	}
 11528  	iter.i = 0
 11529  	return nil
 11530  }
 11531  
 11532  // Next advances to the next value.  If there was an error making
 11533  // the request the iterator does not advance and the error is returned.
 11534  // Deprecated: Use NextWithContext() instead.
 11535  func (iter *StreamingPolicyCollectionIterator) Next() error {
 11536  	return iter.NextWithContext(context.Background())
 11537  }
 11538  
 11539  // NotDone returns true if the enumeration should be started or is not yet complete.
 11540  func (iter StreamingPolicyCollectionIterator) NotDone() bool {
 11541  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
 11542  }
 11543  
 11544  // Response returns the raw server response from the last page request.
 11545  func (iter StreamingPolicyCollectionIterator) Response() StreamingPolicyCollection {
 11546  	return iter.page.Response()
 11547  }
 11548  
 11549  // Value returns the current value or a zero-initialized value if the
 11550  // iterator has advanced beyond the end of the collection.
 11551  func (iter StreamingPolicyCollectionIterator) Value() StreamingPolicy {
 11552  	if !iter.page.NotDone() {
 11553  		return StreamingPolicy{}
 11554  	}
 11555  	return iter.page.Values()[iter.i]
 11556  }
 11557  
 11558  // Creates a new instance of the StreamingPolicyCollectionIterator type.
 11559  func NewStreamingPolicyCollectionIterator(page StreamingPolicyCollectionPage) StreamingPolicyCollectionIterator {
 11560  	return StreamingPolicyCollectionIterator{page: page}
 11561  }
 11562  
 11563  // IsEmpty returns true if the ListResult contains no values.
 11564  func (spc StreamingPolicyCollection) IsEmpty() bool {
 11565  	return spc.Value == nil || len(*spc.Value) == 0
 11566  }
 11567  
 11568  // hasNextLink returns true if the NextLink is not empty.
 11569  func (spc StreamingPolicyCollection) hasNextLink() bool {
 11570  	return spc.OdataNextLink != nil && len(*spc.OdataNextLink) != 0
 11571  }
 11572  
 11573  // streamingPolicyCollectionPreparer prepares a request to retrieve the next set of results.
 11574  // It returns nil if no more results exist.
 11575  func (spc StreamingPolicyCollection) streamingPolicyCollectionPreparer(ctx context.Context) (*http.Request, error) {
 11576  	if !spc.hasNextLink() {
 11577  		return nil, nil
 11578  	}
 11579  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
 11580  		autorest.AsJSON(),
 11581  		autorest.AsGet(),
 11582  		autorest.WithBaseURL(to.String(spc.OdataNextLink)))
 11583  }
 11584  
 11585  // StreamingPolicyCollectionPage contains a page of StreamingPolicy values.
 11586  type StreamingPolicyCollectionPage struct {
 11587  	fn  func(context.Context, StreamingPolicyCollection) (StreamingPolicyCollection, error)
 11588  	spc StreamingPolicyCollection
 11589  }
 11590  
 11591  // NextWithContext advances to the next page of values.  If there was an error making
 11592  // the request the page does not advance and the error is returned.
 11593  func (page *StreamingPolicyCollectionPage) NextWithContext(ctx context.Context) (err error) {
 11594  	if tracing.IsEnabled() {
 11595  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingPolicyCollectionPage.NextWithContext")
 11596  		defer func() {
 11597  			sc := -1
 11598  			if page.Response().Response.Response != nil {
 11599  				sc = page.Response().Response.Response.StatusCode
 11600  			}
 11601  			tracing.EndSpan(ctx, sc, err)
 11602  		}()
 11603  	}
 11604  	for {
 11605  		next, err := page.fn(ctx, page.spc)
 11606  		if err != nil {
 11607  			return err
 11608  		}
 11609  		page.spc = next
 11610  		if !next.hasNextLink() || !next.IsEmpty() {
 11611  			break
 11612  		}
 11613  	}
 11614  	return nil
 11615  }
 11616  
 11617  // Next advances to the next page of values.  If there was an error making
 11618  // the request the page does not advance and the error is returned.
 11619  // Deprecated: Use NextWithContext() instead.
 11620  func (page *StreamingPolicyCollectionPage) Next() error {
 11621  	return page.NextWithContext(context.Background())
 11622  }
 11623  
 11624  // NotDone returns true if the page enumeration should be started or is not yet complete.
 11625  func (page StreamingPolicyCollectionPage) NotDone() bool {
 11626  	return !page.spc.IsEmpty()
 11627  }
 11628  
 11629  // Response returns the raw server response from the last page request.
 11630  func (page StreamingPolicyCollectionPage) Response() StreamingPolicyCollection {
 11631  	return page.spc
 11632  }
 11633  
 11634  // Values returns the slice of values for the current page or nil if there are no values.
 11635  func (page StreamingPolicyCollectionPage) Values() []StreamingPolicy {
 11636  	if page.spc.IsEmpty() {
 11637  		return nil
 11638  	}
 11639  	return *page.spc.Value
 11640  }
 11641  
 11642  // Creates a new instance of the StreamingPolicyCollectionPage type.
 11643  func NewStreamingPolicyCollectionPage(cur StreamingPolicyCollection, getNextPage func(context.Context, StreamingPolicyCollection) (StreamingPolicyCollection, error)) StreamingPolicyCollectionPage {
 11644  	return StreamingPolicyCollectionPage{
 11645  		fn:  getNextPage,
 11646  		spc: cur,
 11647  	}
 11648  }
 11649  
 11650  // StreamingPolicyContentKey class to specify properties of content key
 11651  type StreamingPolicyContentKey struct {
 11652  	// Label - Label can be used to specify Content Key when creating a Streaming Locator
 11653  	Label *string `json:"label,omitempty"`
 11654  	// PolicyName - Policy used by Content Key
 11655  	PolicyName *string `json:"policyName,omitempty"`
 11656  	// Tracks - Tracks which use this content key
 11657  	Tracks *[]TrackSelection `json:"tracks,omitempty"`
 11658  }
 11659  
 11660  // StreamingPolicyContentKeys class to specify properties of all content keys in Streaming Policy
 11661  type StreamingPolicyContentKeys struct {
 11662  	// DefaultKey - Default content key for an encryption scheme
 11663  	DefaultKey *DefaultKey `json:"defaultKey,omitempty"`
 11664  	// KeyToTrackMappings - Representing tracks needs separate content key
 11665  	KeyToTrackMappings *[]StreamingPolicyContentKey `json:"keyToTrackMappings,omitempty"`
 11666  }
 11667  
 11668  // StreamingPolicyFairPlayConfiguration class to specify configurations of FairPlay in Streaming Policy
 11669  type StreamingPolicyFairPlayConfiguration struct {
 11670  	// 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.
 11671  	CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"`
 11672  	// AllowPersistentLicense - All license to be persistent or not
 11673  	AllowPersistentLicense *bool `json:"allowPersistentLicense,omitempty"`
 11674  }
 11675  
 11676  // StreamingPolicyPlayReadyConfiguration class to specify configurations of PlayReady in Streaming Policy
 11677  type StreamingPolicyPlayReadyConfiguration struct {
 11678  	// 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.
 11679  	CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"`
 11680  	// PlayReadyCustomAttributes - Custom attributes for PlayReady
 11681  	PlayReadyCustomAttributes *string `json:"playReadyCustomAttributes,omitempty"`
 11682  }
 11683  
 11684  // StreamingPolicyProperties class to specify properties of Streaming Policy
 11685  type StreamingPolicyProperties struct {
 11686  	// Created - READ-ONLY; Creation time of Streaming Policy
 11687  	Created *date.Time `json:"created,omitempty"`
 11688  	// DefaultContentKeyPolicyName - Default ContentKey used by current Streaming Policy
 11689  	DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"`
 11690  	// EnvelopeEncryption - Configuration of EnvelopeEncryption
 11691  	EnvelopeEncryption *EnvelopeEncryption `json:"envelopeEncryption,omitempty"`
 11692  	// CommonEncryptionCenc - Configuration of CommonEncryptionCenc
 11693  	CommonEncryptionCenc *CommonEncryptionCenc `json:"commonEncryptionCenc,omitempty"`
 11694  	// CommonEncryptionCbcs - Configuration of CommonEncryptionCbcs
 11695  	CommonEncryptionCbcs *CommonEncryptionCbcs `json:"commonEncryptionCbcs,omitempty"`
 11696  	// NoEncryption - Configurations of NoEncryption
 11697  	NoEncryption *NoEncryption `json:"noEncryption,omitempty"`
 11698  }
 11699  
 11700  // MarshalJSON is the custom marshaler for StreamingPolicyProperties.
 11701  func (spp StreamingPolicyProperties) MarshalJSON() ([]byte, error) {
 11702  	objectMap := make(map[string]interface{})
 11703  	if spp.DefaultContentKeyPolicyName != nil {
 11704  		objectMap["defaultContentKeyPolicyName"] = spp.DefaultContentKeyPolicyName
 11705  	}
 11706  	if spp.EnvelopeEncryption != nil {
 11707  		objectMap["envelopeEncryption"] = spp.EnvelopeEncryption
 11708  	}
 11709  	if spp.CommonEncryptionCenc != nil {
 11710  		objectMap["commonEncryptionCenc"] = spp.CommonEncryptionCenc
 11711  	}
 11712  	if spp.CommonEncryptionCbcs != nil {
 11713  		objectMap["commonEncryptionCbcs"] = spp.CommonEncryptionCbcs
 11714  	}
 11715  	if spp.NoEncryption != nil {
 11716  		objectMap["noEncryption"] = spp.NoEncryption
 11717  	}
 11718  	return json.Marshal(objectMap)
 11719  }
 11720  
 11721  // StreamingPolicyWidevineConfiguration class to specify configurations of Widevine in Streaming Policy
 11722  type StreamingPolicyWidevineConfiguration struct {
 11723  	// 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.
 11724  	CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"`
 11725  }
 11726  
 11727  // SyncStorageKeysInput the input to the sync storage keys request.
 11728  type SyncStorageKeysInput struct {
 11729  	// ID - The ID of the storage account resource.
 11730  	ID *string `json:"id,omitempty"`
 11731  }
 11732  
 11733  // SystemData metadata pertaining to creation and last modification of the resource.
 11734  type SystemData struct {
 11735  	// CreatedBy - The identity that created the resource.
 11736  	CreatedBy *string `json:"createdBy,omitempty"`
 11737  	// CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
 11738  	CreatedByType CreatedByType `json:"createdByType,omitempty"`
 11739  	// CreatedAt - The timestamp of resource creation (UTC).
 11740  	CreatedAt *date.Time `json:"createdAt,omitempty"`
 11741  	// LastModifiedBy - The identity that last modified the resource.
 11742  	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
 11743  	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
 11744  	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
 11745  	// LastModifiedAt - The timestamp of resource last modification (UTC)
 11746  	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
 11747  }
 11748  
 11749  // TextTrack represents a text track in an asset. A text track is usually used for sparse data related to
 11750  // the audio or video tracks.
 11751  type TextTrack struct {
 11752  	// FileName - The file name to the source file. This file is located in the storage container of the asset.
 11753  	FileName *string `json:"fileName,omitempty"`
 11754  	// DisplayName - The display name of the text track on a video player. In HLS, this maps to the NAME attribute of EXT-X-MEDIA.
 11755  	DisplayName *string `json:"displayName,omitempty"`
 11756  	// LanguageCode - READ-ONLY; The RFC5646 language code for the text track.
 11757  	LanguageCode *string `json:"languageCode,omitempty"`
 11758  	// PlayerVisibility - When PlayerVisibility is set to "Visible", the text track will be present in the DASH manifest or HLS playlist when requested by a client. When the PlayerVisibility is set to "Hidden", the text will not be available to the client. The default value is "Visible". Possible values include: 'VisibilityHidden', 'VisibilityVisible'
 11759  	PlayerVisibility Visibility `json:"playerVisibility,omitempty"`
 11760  	// HlsSettings - The HLS specific setting for the text track.
 11761  	HlsSettings *HlsSettings `json:"hlsSettings,omitempty"`
 11762  	// OdataType - Possible values include: 'OdataTypeTrackBase', 'OdataTypeMicrosoftMediaAudioTrack', 'OdataTypeMicrosoftMediaVideoTrack', 'OdataTypeMicrosoftMediaTextTrack'
 11763  	OdataType OdataType `json:"@odata.type,omitempty"`
 11764  }
 11765  
 11766  // MarshalJSON is the custom marshaler for TextTrack.
 11767  func (tt TextTrack) MarshalJSON() ([]byte, error) {
 11768  	tt.OdataType = OdataTypeMicrosoftMediaTextTrack
 11769  	objectMap := make(map[string]interface{})
 11770  	if tt.FileName != nil {
 11771  		objectMap["fileName"] = tt.FileName
 11772  	}
 11773  	if tt.DisplayName != nil {
 11774  		objectMap["displayName"] = tt.DisplayName
 11775  	}
 11776  	if tt.PlayerVisibility != "" {
 11777  		objectMap["playerVisibility"] = tt.PlayerVisibility
 11778  	}
 11779  	if tt.HlsSettings != nil {
 11780  		objectMap["hlsSettings"] = tt.HlsSettings
 11781  	}
 11782  	if tt.OdataType != "" {
 11783  		objectMap["@odata.type"] = tt.OdataType
 11784  	}
 11785  	return json.Marshal(objectMap)
 11786  }
 11787  
 11788  // AsAudioTrack is the BasicTrackBase implementation for TextTrack.
 11789  func (tt TextTrack) AsAudioTrack() (*AudioTrack, bool) {
 11790  	return nil, false
 11791  }
 11792  
 11793  // AsVideoTrack is the BasicTrackBase implementation for TextTrack.
 11794  func (tt TextTrack) AsVideoTrack() (*VideoTrack, bool) {
 11795  	return nil, false
 11796  }
 11797  
 11798  // AsTextTrack is the BasicTrackBase implementation for TextTrack.
 11799  func (tt TextTrack) AsTextTrack() (*TextTrack, bool) {
 11800  	return &tt, true
 11801  }
 11802  
 11803  // AsTrackBase is the BasicTrackBase implementation for TextTrack.
 11804  func (tt TextTrack) AsTrackBase() (*TrackBase, bool) {
 11805  	return nil, false
 11806  }
 11807  
 11808  // AsBasicTrackBase is the BasicTrackBase implementation for TextTrack.
 11809  func (tt TextTrack) AsBasicTrackBase() (BasicTrackBase, bool) {
 11810  	return &tt, true
 11811  }
 11812  
 11813  // BasicTrackBase base type for concrete track types. A derived type must be used to represent the Track.
 11814  type BasicTrackBase interface {
 11815  	AsAudioTrack() (*AudioTrack, bool)
 11816  	AsVideoTrack() (*VideoTrack, bool)
 11817  	AsTextTrack() (*TextTrack, bool)
 11818  	AsTrackBase() (*TrackBase, bool)
 11819  }
 11820  
 11821  // TrackBase base type for concrete track types. A derived type must be used to represent the Track.
 11822  type TrackBase struct {
 11823  	// OdataType - Possible values include: 'OdataTypeTrackBase', 'OdataTypeMicrosoftMediaAudioTrack', 'OdataTypeMicrosoftMediaVideoTrack', 'OdataTypeMicrosoftMediaTextTrack'
 11824  	OdataType OdataType `json:"@odata.type,omitempty"`
 11825  }
 11826  
 11827  func unmarshalBasicTrackBase(body []byte) (BasicTrackBase, error) {
 11828  	var m map[string]interface{}
 11829  	err := json.Unmarshal(body, &m)
 11830  	if err != nil {
 11831  		return nil, err
 11832  	}
 11833  
 11834  	switch m["@odata.type"] {
 11835  	case string(OdataTypeMicrosoftMediaAudioTrack):
 11836  		var at AudioTrack
 11837  		err := json.Unmarshal(body, &at)
 11838  		return at, err
 11839  	case string(OdataTypeMicrosoftMediaVideoTrack):
 11840  		var vt VideoTrack
 11841  		err := json.Unmarshal(body, &vt)
 11842  		return vt, err
 11843  	case string(OdataTypeMicrosoftMediaTextTrack):
 11844  		var tt TextTrack
 11845  		err := json.Unmarshal(body, &tt)
 11846  		return tt, err
 11847  	default:
 11848  		var tb TrackBase
 11849  		err := json.Unmarshal(body, &tb)
 11850  		return tb, err
 11851  	}
 11852  }
 11853  func unmarshalBasicTrackBaseArray(body []byte) ([]BasicTrackBase, error) {
 11854  	var rawMessages []*json.RawMessage
 11855  	err := json.Unmarshal(body, &rawMessages)
 11856  	if err != nil {
 11857  		return nil, err
 11858  	}
 11859  
 11860  	tbArray := make([]BasicTrackBase, len(rawMessages))
 11861  
 11862  	for index, rawMessage := range rawMessages {
 11863  		tb, err := unmarshalBasicTrackBase(*rawMessage)
 11864  		if err != nil {
 11865  			return nil, err
 11866  		}
 11867  		tbArray[index] = tb
 11868  	}
 11869  	return tbArray, nil
 11870  }
 11871  
 11872  // MarshalJSON is the custom marshaler for TrackBase.
 11873  func (tb TrackBase) MarshalJSON() ([]byte, error) {
 11874  	tb.OdataType = OdataTypeTrackBase
 11875  	objectMap := make(map[string]interface{})
 11876  	if tb.OdataType != "" {
 11877  		objectMap["@odata.type"] = tb.OdataType
 11878  	}
 11879  	return json.Marshal(objectMap)
 11880  }
 11881  
 11882  // AsAudioTrack is the BasicTrackBase implementation for TrackBase.
 11883  func (tb TrackBase) AsAudioTrack() (*AudioTrack, bool) {
 11884  	return nil, false
 11885  }
 11886  
 11887  // AsVideoTrack is the BasicTrackBase implementation for TrackBase.
 11888  func (tb TrackBase) AsVideoTrack() (*VideoTrack, bool) {
 11889  	return nil, false
 11890  }
 11891  
 11892  // AsTextTrack is the BasicTrackBase implementation for TrackBase.
 11893  func (tb TrackBase) AsTextTrack() (*TextTrack, bool) {
 11894  	return nil, false
 11895  }
 11896  
 11897  // AsTrackBase is the BasicTrackBase implementation for TrackBase.
 11898  func (tb TrackBase) AsTrackBase() (*TrackBase, bool) {
 11899  	return &tb, true
 11900  }
 11901  
 11902  // AsBasicTrackBase is the BasicTrackBase implementation for TrackBase.
 11903  func (tb TrackBase) AsBasicTrackBase() (BasicTrackBase, bool) {
 11904  	return &tb, true
 11905  }
 11906  
 11907  // BasicTrackDescriptor base type for all TrackDescriptor types, which define the metadata and selection for tracks
 11908  // that should be processed by a Job
 11909  type BasicTrackDescriptor interface {
 11910  	AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool)
 11911  	AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool)
 11912  	AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool)
 11913  	AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool)
 11914  	AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool)
 11915  	AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool)
 11916  	AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool)
 11917  	AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool)
 11918  	AsTrackDescriptor() (*TrackDescriptor, bool)
 11919  }
 11920  
 11921  // TrackDescriptor base type for all TrackDescriptor types, which define the metadata and selection for tracks
 11922  // that should be processed by a Job
 11923  type TrackDescriptor struct {
 11924  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
 11925  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
 11926  }
 11927  
 11928  func unmarshalBasicTrackDescriptor(body []byte) (BasicTrackDescriptor, error) {
 11929  	var m map[string]interface{}
 11930  	err := json.Unmarshal(body, &m)
 11931  	if err != nil {
 11932  		return nil, err
 11933  	}
 11934  
 11935  	switch m["@odata.type"] {
 11936  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor):
 11937  		var atd AudioTrackDescriptor
 11938  		err := json.Unmarshal(body, &atd)
 11939  		return atd, err
 11940  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute):
 11941  		var satba SelectAudioTrackByAttribute
 11942  		err := json.Unmarshal(body, &satba)
 11943  		return satba, err
 11944  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID):
 11945  		var satbi SelectAudioTrackByID
 11946  		err := json.Unmarshal(body, &satbi)
 11947  		return satbi, err
 11948  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor):
 11949  		var vtd VideoTrackDescriptor
 11950  		err := json.Unmarshal(body, &vtd)
 11951  		return vtd, err
 11952  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute):
 11953  		var svtba SelectVideoTrackByAttribute
 11954  		err := json.Unmarshal(body, &svtba)
 11955  		return svtba, err
 11956  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID):
 11957  		var svtbi SelectVideoTrackByID
 11958  		err := json.Unmarshal(body, &svtbi)
 11959  		return svtbi, err
 11960  	default:
 11961  		var td TrackDescriptor
 11962  		err := json.Unmarshal(body, &td)
 11963  		return td, err
 11964  	}
 11965  }
 11966  func unmarshalBasicTrackDescriptorArray(body []byte) ([]BasicTrackDescriptor, error) {
 11967  	var rawMessages []*json.RawMessage
 11968  	err := json.Unmarshal(body, &rawMessages)
 11969  	if err != nil {
 11970  		return nil, err
 11971  	}
 11972  
 11973  	tdArray := make([]BasicTrackDescriptor, len(rawMessages))
 11974  
 11975  	for index, rawMessage := range rawMessages {
 11976  		td, err := unmarshalBasicTrackDescriptor(*rawMessage)
 11977  		if err != nil {
 11978  			return nil, err
 11979  		}
 11980  		tdArray[index] = td
 11981  	}
 11982  	return tdArray, nil
 11983  }
 11984  
 11985  // MarshalJSON is the custom marshaler for TrackDescriptor.
 11986  func (td TrackDescriptor) MarshalJSON() ([]byte, error) {
 11987  	td.OdataType = OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor
 11988  	objectMap := make(map[string]interface{})
 11989  	if td.OdataType != "" {
 11990  		objectMap["@odata.type"] = td.OdataType
 11991  	}
 11992  	return json.Marshal(objectMap)
 11993  }
 11994  
 11995  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 11996  func (td TrackDescriptor) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
 11997  	return nil, false
 11998  }
 11999  
 12000  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12001  func (td TrackDescriptor) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
 12002  	return nil, false
 12003  }
 12004  
 12005  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for TrackDescriptor.
 12006  func (td TrackDescriptor) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
 12007  	return nil, false
 12008  }
 12009  
 12010  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for TrackDescriptor.
 12011  func (td TrackDescriptor) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
 12012  	return nil, false
 12013  }
 12014  
 12015  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12016  func (td TrackDescriptor) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
 12017  	return nil, false
 12018  }
 12019  
 12020  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12021  func (td TrackDescriptor) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
 12022  	return nil, false
 12023  }
 12024  
 12025  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for TrackDescriptor.
 12026  func (td TrackDescriptor) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
 12027  	return nil, false
 12028  }
 12029  
 12030  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for TrackDescriptor.
 12031  func (td TrackDescriptor) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
 12032  	return nil, false
 12033  }
 12034  
 12035  // AsTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12036  func (td TrackDescriptor) AsTrackDescriptor() (*TrackDescriptor, bool) {
 12037  	return &td, true
 12038  }
 12039  
 12040  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12041  func (td TrackDescriptor) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
 12042  	return &td, true
 12043  }
 12044  
 12045  // TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource
 12046  // which has 'tags' and a 'location'
 12047  type TrackedResource struct {
 12048  	// Tags - Resource tags.
 12049  	Tags map[string]*string `json:"tags"`
 12050  	// Location - The geo-location where the resource lives
 12051  	Location *string `json:"location,omitempty"`
 12052  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 12053  	ID *string `json:"id,omitempty"`
 12054  	// Name - READ-ONLY; The name of the resource
 12055  	Name *string `json:"name,omitempty"`
 12056  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 12057  	Type *string `json:"type,omitempty"`
 12058  }
 12059  
 12060  // MarshalJSON is the custom marshaler for TrackedResource.
 12061  func (tr TrackedResource) MarshalJSON() ([]byte, error) {
 12062  	objectMap := make(map[string]interface{})
 12063  	if tr.Tags != nil {
 12064  		objectMap["tags"] = tr.Tags
 12065  	}
 12066  	if tr.Location != nil {
 12067  		objectMap["location"] = tr.Location
 12068  	}
 12069  	return json.Marshal(objectMap)
 12070  }
 12071  
 12072  // TrackPropertyCondition class to specify one track property condition
 12073  type TrackPropertyCondition struct {
 12074  	// Property - Track property type. Possible values include: 'TrackPropertyTypeUnknown', 'TrackPropertyTypeFourCC'
 12075  	Property TrackPropertyType `json:"property,omitempty"`
 12076  	// Operation - Track property condition operation. Possible values include: 'TrackPropertyCompareOperationUnknown', 'TrackPropertyCompareOperationEqual'
 12077  	Operation TrackPropertyCompareOperation `json:"operation,omitempty"`
 12078  	// Value - Track property value
 12079  	Value *string `json:"value,omitempty"`
 12080  }
 12081  
 12082  // TracksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
 12083  // operation.
 12084  type TracksCreateOrUpdateFuture struct {
 12085  	azure.FutureAPI
 12086  	// Result returns the result of the asynchronous operation.
 12087  	// If the operation has not completed it will return an error.
 12088  	Result func(TracksClient) (AssetTrack, error)
 12089  }
 12090  
 12091  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 12092  func (future *TracksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
 12093  	var azFuture azure.Future
 12094  	if err := json.Unmarshal(body, &azFuture); err != nil {
 12095  		return err
 12096  	}
 12097  	future.FutureAPI = &azFuture
 12098  	future.Result = future.result
 12099  	return nil
 12100  }
 12101  
 12102  // result is the default implementation for TracksCreateOrUpdateFuture.Result.
 12103  func (future *TracksCreateOrUpdateFuture) result(client TracksClient) (at AssetTrack, err error) {
 12104  	var done bool
 12105  	done, err = future.DoneWithContext(context.Background(), client)
 12106  	if err != nil {
 12107  		err = autorest.NewErrorWithError(err, "media.TracksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
 12108  		return
 12109  	}
 12110  	if !done {
 12111  		at.Response.Response = future.Response()
 12112  		err = azure.NewAsyncOpIncompleteError("media.TracksCreateOrUpdateFuture")
 12113  		return
 12114  	}
 12115  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
 12116  	if at.Response.Response, err = future.GetResult(sender); err == nil && at.Response.Response.StatusCode != http.StatusNoContent {
 12117  		at, err = client.CreateOrUpdateResponder(at.Response.Response)
 12118  		if err != nil {
 12119  			err = autorest.NewErrorWithError(err, "media.TracksCreateOrUpdateFuture", "Result", at.Response.Response, "Failure responding to request")
 12120  		}
 12121  	}
 12122  	return
 12123  }
 12124  
 12125  // TracksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
 12126  type TracksDeleteFuture struct {
 12127  	azure.FutureAPI
 12128  	// Result returns the result of the asynchronous operation.
 12129  	// If the operation has not completed it will return an error.
 12130  	Result func(TracksClient) (autorest.Response, error)
 12131  }
 12132  
 12133  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 12134  func (future *TracksDeleteFuture) UnmarshalJSON(body []byte) error {
 12135  	var azFuture azure.Future
 12136  	if err := json.Unmarshal(body, &azFuture); err != nil {
 12137  		return err
 12138  	}
 12139  	future.FutureAPI = &azFuture
 12140  	future.Result = future.result
 12141  	return nil
 12142  }
 12143  
 12144  // result is the default implementation for TracksDeleteFuture.Result.
 12145  func (future *TracksDeleteFuture) result(client TracksClient) (ar autorest.Response, err error) {
 12146  	var done bool
 12147  	done, err = future.DoneWithContext(context.Background(), client)
 12148  	if err != nil {
 12149  		err = autorest.NewErrorWithError(err, "media.TracksDeleteFuture", "Result", future.Response(), "Polling failure")
 12150  		return
 12151  	}
 12152  	if !done {
 12153  		ar.Response = future.Response()
 12154  		err = azure.NewAsyncOpIncompleteError("media.TracksDeleteFuture")
 12155  		return
 12156  	}
 12157  	ar.Response = future.Response()
 12158  	return
 12159  }
 12160  
 12161  // TrackSelection class to select a track
 12162  type TrackSelection struct {
 12163  	// TrackSelections - TrackSelections is a track property condition list which can specify track(s)
 12164  	TrackSelections *[]TrackPropertyCondition `json:"trackSelections,omitempty"`
 12165  }
 12166  
 12167  // TracksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
 12168  type TracksUpdateFuture struct {
 12169  	azure.FutureAPI
 12170  	// Result returns the result of the asynchronous operation.
 12171  	// If the operation has not completed it will return an error.
 12172  	Result func(TracksClient) (AssetTrack, error)
 12173  }
 12174  
 12175  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 12176  func (future *TracksUpdateFuture) UnmarshalJSON(body []byte) error {
 12177  	var azFuture azure.Future
 12178  	if err := json.Unmarshal(body, &azFuture); err != nil {
 12179  		return err
 12180  	}
 12181  	future.FutureAPI = &azFuture
 12182  	future.Result = future.result
 12183  	return nil
 12184  }
 12185  
 12186  // result is the default implementation for TracksUpdateFuture.Result.
 12187  func (future *TracksUpdateFuture) result(client TracksClient) (at AssetTrack, err error) {
 12188  	var done bool
 12189  	done, err = future.DoneWithContext(context.Background(), client)
 12190  	if err != nil {
 12191  		err = autorest.NewErrorWithError(err, "media.TracksUpdateFuture", "Result", future.Response(), "Polling failure")
 12192  		return
 12193  	}
 12194  	if !done {
 12195  		at.Response.Response = future.Response()
 12196  		err = azure.NewAsyncOpIncompleteError("media.TracksUpdateFuture")
 12197  		return
 12198  	}
 12199  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
 12200  	if at.Response.Response, err = future.GetResult(sender); err == nil && at.Response.Response.StatusCode != http.StatusNoContent {
 12201  		at, err = client.UpdateResponder(at.Response.Response)
 12202  		if err != nil {
 12203  			err = autorest.NewErrorWithError(err, "media.TracksUpdateFuture", "Result", at.Response.Response, "Failure responding to request")
 12204  		}
 12205  	}
 12206  	return
 12207  }
 12208  
 12209  // TracksUpdateTrackDataFuture an abstraction for monitoring and retrieving the results of a long-running
 12210  // operation.
 12211  type TracksUpdateTrackDataFuture struct {
 12212  	azure.FutureAPI
 12213  	// Result returns the result of the asynchronous operation.
 12214  	// If the operation has not completed it will return an error.
 12215  	Result func(TracksClient) (autorest.Response, error)
 12216  }
 12217  
 12218  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 12219  func (future *TracksUpdateTrackDataFuture) UnmarshalJSON(body []byte) error {
 12220  	var azFuture azure.Future
 12221  	if err := json.Unmarshal(body, &azFuture); err != nil {
 12222  		return err
 12223  	}
 12224  	future.FutureAPI = &azFuture
 12225  	future.Result = future.result
 12226  	return nil
 12227  }
 12228  
 12229  // result is the default implementation for TracksUpdateTrackDataFuture.Result.
 12230  func (future *TracksUpdateTrackDataFuture) result(client TracksClient) (ar autorest.Response, err error) {
 12231  	var done bool
 12232  	done, err = future.DoneWithContext(context.Background(), client)
 12233  	if err != nil {
 12234  		err = autorest.NewErrorWithError(err, "media.TracksUpdateTrackDataFuture", "Result", future.Response(), "Polling failure")
 12235  		return
 12236  	}
 12237  	if !done {
 12238  		ar.Response = future.Response()
 12239  		err = azure.NewAsyncOpIncompleteError("media.TracksUpdateTrackDataFuture")
 12240  		return
 12241  	}
 12242  	ar.Response = future.Response()
 12243  	return
 12244  }
 12245  
 12246  // Transform a Transform encapsulates the rules or instructions for generating desired outputs from input
 12247  // media, such as by transcoding or by extracting insights. After the Transform is created, it can be
 12248  // applied to input media by creating Jobs.
 12249  type Transform struct {
 12250  	autorest.Response `json:"-"`
 12251  	// TransformProperties - The resource properties.
 12252  	*TransformProperties `json:"properties,omitempty"`
 12253  	// SystemData - READ-ONLY; The system metadata relating to this resource.
 12254  	SystemData *SystemData `json:"systemData,omitempty"`
 12255  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 12256  	ID *string `json:"id,omitempty"`
 12257  	// Name - READ-ONLY; The name of the resource
 12258  	Name *string `json:"name,omitempty"`
 12259  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 12260  	Type *string `json:"type,omitempty"`
 12261  }
 12262  
 12263  // MarshalJSON is the custom marshaler for Transform.
 12264  func (t Transform) MarshalJSON() ([]byte, error) {
 12265  	objectMap := make(map[string]interface{})
 12266  	if t.TransformProperties != nil {
 12267  		objectMap["properties"] = t.TransformProperties
 12268  	}
 12269  	return json.Marshal(objectMap)
 12270  }
 12271  
 12272  // UnmarshalJSON is the custom unmarshaler for Transform struct.
 12273  func (t *Transform) UnmarshalJSON(body []byte) error {
 12274  	var m map[string]*json.RawMessage
 12275  	err := json.Unmarshal(body, &m)
 12276  	if err != nil {
 12277  		return err
 12278  	}
 12279  	for k, v := range m {
 12280  		switch k {
 12281  		case "properties":
 12282  			if v != nil {
 12283  				var transformProperties TransformProperties
 12284  				err = json.Unmarshal(*v, &transformProperties)
 12285  				if err != nil {
 12286  					return err
 12287  				}
 12288  				t.TransformProperties = &transformProperties
 12289  			}
 12290  		case "systemData":
 12291  			if v != nil {
 12292  				var systemData SystemData
 12293  				err = json.Unmarshal(*v, &systemData)
 12294  				if err != nil {
 12295  					return err
 12296  				}
 12297  				t.SystemData = &systemData
 12298  			}
 12299  		case "id":
 12300  			if v != nil {
 12301  				var ID string
 12302  				err = json.Unmarshal(*v, &ID)
 12303  				if err != nil {
 12304  					return err
 12305  				}
 12306  				t.ID = &ID
 12307  			}
 12308  		case "name":
 12309  			if v != nil {
 12310  				var name string
 12311  				err = json.Unmarshal(*v, &name)
 12312  				if err != nil {
 12313  					return err
 12314  				}
 12315  				t.Name = &name
 12316  			}
 12317  		case "type":
 12318  			if v != nil {
 12319  				var typeVar string
 12320  				err = json.Unmarshal(*v, &typeVar)
 12321  				if err != nil {
 12322  					return err
 12323  				}
 12324  				t.Type = &typeVar
 12325  			}
 12326  		}
 12327  	}
 12328  
 12329  	return nil
 12330  }
 12331  
 12332  // TransformCollection a collection of Transform items.
 12333  type TransformCollection struct {
 12334  	autorest.Response `json:"-"`
 12335  	// Value - A collection of Transform items.
 12336  	Value *[]Transform `json:"value,omitempty"`
 12337  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
 12338  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
 12339  }
 12340  
 12341  // TransformCollectionIterator provides access to a complete listing of Transform values.
 12342  type TransformCollectionIterator struct {
 12343  	i    int
 12344  	page TransformCollectionPage
 12345  }
 12346  
 12347  // NextWithContext advances to the next value.  If there was an error making
 12348  // the request the iterator does not advance and the error is returned.
 12349  func (iter *TransformCollectionIterator) NextWithContext(ctx context.Context) (err error) {
 12350  	if tracing.IsEnabled() {
 12351  		ctx = tracing.StartSpan(ctx, fqdn+"/TransformCollectionIterator.NextWithContext")
 12352  		defer func() {
 12353  			sc := -1
 12354  			if iter.Response().Response.Response != nil {
 12355  				sc = iter.Response().Response.Response.StatusCode
 12356  			}
 12357  			tracing.EndSpan(ctx, sc, err)
 12358  		}()
 12359  	}
 12360  	iter.i++
 12361  	if iter.i < len(iter.page.Values()) {
 12362  		return nil
 12363  	}
 12364  	err = iter.page.NextWithContext(ctx)
 12365  	if err != nil {
 12366  		iter.i--
 12367  		return err
 12368  	}
 12369  	iter.i = 0
 12370  	return nil
 12371  }
 12372  
 12373  // Next advances to the next value.  If there was an error making
 12374  // the request the iterator does not advance and the error is returned.
 12375  // Deprecated: Use NextWithContext() instead.
 12376  func (iter *TransformCollectionIterator) Next() error {
 12377  	return iter.NextWithContext(context.Background())
 12378  }
 12379  
 12380  // NotDone returns true if the enumeration should be started or is not yet complete.
 12381  func (iter TransformCollectionIterator) NotDone() bool {
 12382  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
 12383  }
 12384  
 12385  // Response returns the raw server response from the last page request.
 12386  func (iter TransformCollectionIterator) Response() TransformCollection {
 12387  	return iter.page.Response()
 12388  }
 12389  
 12390  // Value returns the current value or a zero-initialized value if the
 12391  // iterator has advanced beyond the end of the collection.
 12392  func (iter TransformCollectionIterator) Value() Transform {
 12393  	if !iter.page.NotDone() {
 12394  		return Transform{}
 12395  	}
 12396  	return iter.page.Values()[iter.i]
 12397  }
 12398  
 12399  // Creates a new instance of the TransformCollectionIterator type.
 12400  func NewTransformCollectionIterator(page TransformCollectionPage) TransformCollectionIterator {
 12401  	return TransformCollectionIterator{page: page}
 12402  }
 12403  
 12404  // IsEmpty returns true if the ListResult contains no values.
 12405  func (tc TransformCollection) IsEmpty() bool {
 12406  	return tc.Value == nil || len(*tc.Value) == 0
 12407  }
 12408  
 12409  // hasNextLink returns true if the NextLink is not empty.
 12410  func (tc TransformCollection) hasNextLink() bool {
 12411  	return tc.OdataNextLink != nil && len(*tc.OdataNextLink) != 0
 12412  }
 12413  
 12414  // transformCollectionPreparer prepares a request to retrieve the next set of results.
 12415  // It returns nil if no more results exist.
 12416  func (tc TransformCollection) transformCollectionPreparer(ctx context.Context) (*http.Request, error) {
 12417  	if !tc.hasNextLink() {
 12418  		return nil, nil
 12419  	}
 12420  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
 12421  		autorest.AsJSON(),
 12422  		autorest.AsGet(),
 12423  		autorest.WithBaseURL(to.String(tc.OdataNextLink)))
 12424  }
 12425  
 12426  // TransformCollectionPage contains a page of Transform values.
 12427  type TransformCollectionPage struct {
 12428  	fn func(context.Context, TransformCollection) (TransformCollection, error)
 12429  	tc TransformCollection
 12430  }
 12431  
 12432  // NextWithContext advances to the next page of values.  If there was an error making
 12433  // the request the page does not advance and the error is returned.
 12434  func (page *TransformCollectionPage) NextWithContext(ctx context.Context) (err error) {
 12435  	if tracing.IsEnabled() {
 12436  		ctx = tracing.StartSpan(ctx, fqdn+"/TransformCollectionPage.NextWithContext")
 12437  		defer func() {
 12438  			sc := -1
 12439  			if page.Response().Response.Response != nil {
 12440  				sc = page.Response().Response.Response.StatusCode
 12441  			}
 12442  			tracing.EndSpan(ctx, sc, err)
 12443  		}()
 12444  	}
 12445  	for {
 12446  		next, err := page.fn(ctx, page.tc)
 12447  		if err != nil {
 12448  			return err
 12449  		}
 12450  		page.tc = next
 12451  		if !next.hasNextLink() || !next.IsEmpty() {
 12452  			break
 12453  		}
 12454  	}
 12455  	return nil
 12456  }
 12457  
 12458  // Next advances to the next page of values.  If there was an error making
 12459  // the request the page does not advance and the error is returned.
 12460  // Deprecated: Use NextWithContext() instead.
 12461  func (page *TransformCollectionPage) Next() error {
 12462  	return page.NextWithContext(context.Background())
 12463  }
 12464  
 12465  // NotDone returns true if the page enumeration should be started or is not yet complete.
 12466  func (page TransformCollectionPage) NotDone() bool {
 12467  	return !page.tc.IsEmpty()
 12468  }
 12469  
 12470  // Response returns the raw server response from the last page request.
 12471  func (page TransformCollectionPage) Response() TransformCollection {
 12472  	return page.tc
 12473  }
 12474  
 12475  // Values returns the slice of values for the current page or nil if there are no values.
 12476  func (page TransformCollectionPage) Values() []Transform {
 12477  	if page.tc.IsEmpty() {
 12478  		return nil
 12479  	}
 12480  	return *page.tc.Value
 12481  }
 12482  
 12483  // Creates a new instance of the TransformCollectionPage type.
 12484  func NewTransformCollectionPage(cur TransformCollection, getNextPage func(context.Context, TransformCollection) (TransformCollection, error)) TransformCollectionPage {
 12485  	return TransformCollectionPage{
 12486  		fn: getNextPage,
 12487  		tc: cur,
 12488  	}
 12489  }
 12490  
 12491  // TransformOutput describes the properties of a TransformOutput, which are the rules to be applied while
 12492  // generating the desired output.
 12493  type TransformOutput struct {
 12494  	// 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: 'OnErrorTypeStopProcessingJob', 'OnErrorTypeContinueJob'
 12495  	OnError OnErrorType `json:"onError,omitempty"`
 12496  	// RelativePriority - Sets the relative priority of the TransformOutputs within a Transform. This sets the priority that the service uses for processing TransformOutputs. The default priority is Normal. Possible values include: 'PriorityLow', 'PriorityNormal', 'PriorityHigh'
 12497  	RelativePriority Priority `json:"relativePriority,omitempty"`
 12498  	// Preset - Preset that describes the operations that will be used to modify, transcode, or extract insights from the source file to generate the output.
 12499  	Preset BasicPreset `json:"preset,omitempty"`
 12500  }
 12501  
 12502  // UnmarshalJSON is the custom unmarshaler for TransformOutput struct.
 12503  func (toVar *TransformOutput) UnmarshalJSON(body []byte) error {
 12504  	var m map[string]*json.RawMessage
 12505  	err := json.Unmarshal(body, &m)
 12506  	if err != nil {
 12507  		return err
 12508  	}
 12509  	for k, v := range m {
 12510  		switch k {
 12511  		case "onError":
 12512  			if v != nil {
 12513  				var onError OnErrorType
 12514  				err = json.Unmarshal(*v, &onError)
 12515  				if err != nil {
 12516  					return err
 12517  				}
 12518  				toVar.OnError = onError
 12519  			}
 12520  		case "relativePriority":
 12521  			if v != nil {
 12522  				var relativePriority Priority
 12523  				err = json.Unmarshal(*v, &relativePriority)
 12524  				if err != nil {
 12525  					return err
 12526  				}
 12527  				toVar.RelativePriority = relativePriority
 12528  			}
 12529  		case "preset":
 12530  			if v != nil {
 12531  				preset, err := unmarshalBasicPreset(*v)
 12532  				if err != nil {
 12533  					return err
 12534  				}
 12535  				toVar.Preset = preset
 12536  			}
 12537  		}
 12538  	}
 12539  
 12540  	return nil
 12541  }
 12542  
 12543  // TransformProperties a Transform.
 12544  type TransformProperties struct {
 12545  	// Created - READ-ONLY; The UTC date and time when the Transform was created, in 'YYYY-MM-DDThh:mm:ssZ' format.
 12546  	Created *date.Time `json:"created,omitempty"`
 12547  	// Description - An optional verbose description of the Transform.
 12548  	Description *string `json:"description,omitempty"`
 12549  	// LastModified - READ-ONLY; The UTC date and time when the Transform was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format.
 12550  	LastModified *date.Time `json:"lastModified,omitempty"`
 12551  	// Outputs - An array of one or more TransformOutputs that the Transform should generate.
 12552  	Outputs *[]TransformOutput `json:"outputs,omitempty"`
 12553  }
 12554  
 12555  // MarshalJSON is the custom marshaler for TransformProperties.
 12556  func (tp TransformProperties) MarshalJSON() ([]byte, error) {
 12557  	objectMap := make(map[string]interface{})
 12558  	if tp.Description != nil {
 12559  		objectMap["description"] = tp.Description
 12560  	}
 12561  	if tp.Outputs != nil {
 12562  		objectMap["outputs"] = tp.Outputs
 12563  	}
 12564  	return json.Marshal(objectMap)
 12565  }
 12566  
 12567  // TransportStreamFormat describes the properties for generating an MPEG-2 Transport Stream (ISO/IEC
 12568  // 13818-1) output video file(s).
 12569  type TransportStreamFormat struct {
 12570  	// 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 .
 12571  	OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
 12572  	// FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of input video files will be used. If the length of base name of the input video file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename.
 12573  	FilenamePattern *string `json:"filenamePattern,omitempty"`
 12574  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
 12575  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
 12576  }
 12577  
 12578  // MarshalJSON is the custom marshaler for TransportStreamFormat.
 12579  func (tsf TransportStreamFormat) MarshalJSON() ([]byte, error) {
 12580  	tsf.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat
 12581  	objectMap := make(map[string]interface{})
 12582  	if tsf.OutputFiles != nil {
 12583  		objectMap["outputFiles"] = tsf.OutputFiles
 12584  	}
 12585  	if tsf.FilenamePattern != nil {
 12586  		objectMap["filenamePattern"] = tsf.FilenamePattern
 12587  	}
 12588  	if tsf.OdataType != "" {
 12589  		objectMap["@odata.type"] = tsf.OdataType
 12590  	}
 12591  	return json.Marshal(objectMap)
 12592  }
 12593  
 12594  // AsImageFormat is the BasicFormat implementation for TransportStreamFormat.
 12595  func (tsf TransportStreamFormat) AsImageFormat() (*ImageFormat, bool) {
 12596  	return nil, false
 12597  }
 12598  
 12599  // AsBasicImageFormat is the BasicFormat implementation for TransportStreamFormat.
 12600  func (tsf TransportStreamFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
 12601  	return nil, false
 12602  }
 12603  
 12604  // AsJpgFormat is the BasicFormat implementation for TransportStreamFormat.
 12605  func (tsf TransportStreamFormat) AsJpgFormat() (*JpgFormat, bool) {
 12606  	return nil, false
 12607  }
 12608  
 12609  // AsPngFormat is the BasicFormat implementation for TransportStreamFormat.
 12610  func (tsf TransportStreamFormat) AsPngFormat() (*PngFormat, bool) {
 12611  	return nil, false
 12612  }
 12613  
 12614  // AsMultiBitrateFormat is the BasicFormat implementation for TransportStreamFormat.
 12615  func (tsf TransportStreamFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
 12616  	return nil, false
 12617  }
 12618  
 12619  // AsBasicMultiBitrateFormat is the BasicFormat implementation for TransportStreamFormat.
 12620  func (tsf TransportStreamFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
 12621  	return &tsf, true
 12622  }
 12623  
 12624  // AsMp4Format is the BasicFormat implementation for TransportStreamFormat.
 12625  func (tsf TransportStreamFormat) AsMp4Format() (*Mp4Format, bool) {
 12626  	return nil, false
 12627  }
 12628  
 12629  // AsTransportStreamFormat is the BasicFormat implementation for TransportStreamFormat.
 12630  func (tsf TransportStreamFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
 12631  	return &tsf, true
 12632  }
 12633  
 12634  // AsFormat is the BasicFormat implementation for TransportStreamFormat.
 12635  func (tsf TransportStreamFormat) AsFormat() (*Format, bool) {
 12636  	return nil, false
 12637  }
 12638  
 12639  // AsBasicFormat is the BasicFormat implementation for TransportStreamFormat.
 12640  func (tsf TransportStreamFormat) AsBasicFormat() (BasicFormat, bool) {
 12641  	return &tsf, true
 12642  }
 12643  
 12644  // UserAssignedManagedIdentity ...
 12645  type UserAssignedManagedIdentity struct {
 12646  	// ClientID - READ-ONLY; The client ID.
 12647  	ClientID *uuid.UUID `json:"clientId,omitempty"`
 12648  	// PrincipalID - READ-ONLY; The principal ID.
 12649  	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
 12650  }
 12651  
 12652  // MarshalJSON is the custom marshaler for UserAssignedManagedIdentity.
 12653  func (uami UserAssignedManagedIdentity) MarshalJSON() ([]byte, error) {
 12654  	objectMap := make(map[string]interface{})
 12655  	return json.Marshal(objectMap)
 12656  }
 12657  
 12658  // UtcClipTime specifies the clip time as a Utc time position in the media file.  The Utc time can point to
 12659  // a different position depending on whether the media file starts from a timestamp of zero or not.
 12660  type UtcClipTime struct {
 12661  	// Time - The time position on the timeline of the input media based on Utc time.
 12662  	Time *date.Time `json:"time,omitempty"`
 12663  	// OdataType - Possible values include: 'OdataTypeBasicClipTimeOdataTypeClipTime', 'OdataTypeBasicClipTimeOdataTypeMicrosoftMediaAbsoluteClipTime', 'OdataTypeBasicClipTimeOdataTypeMicrosoftMediaUtcClipTime'
 12664  	OdataType OdataTypeBasicClipTime `json:"@odata.type,omitempty"`
 12665  }
 12666  
 12667  // MarshalJSON is the custom marshaler for UtcClipTime.
 12668  func (uct UtcClipTime) MarshalJSON() ([]byte, error) {
 12669  	uct.OdataType = OdataTypeBasicClipTimeOdataTypeMicrosoftMediaUtcClipTime
 12670  	objectMap := make(map[string]interface{})
 12671  	if uct.Time != nil {
 12672  		objectMap["time"] = uct.Time
 12673  	}
 12674  	if uct.OdataType != "" {
 12675  		objectMap["@odata.type"] = uct.OdataType
 12676  	}
 12677  	return json.Marshal(objectMap)
 12678  }
 12679  
 12680  // AsAbsoluteClipTime is the BasicClipTime implementation for UtcClipTime.
 12681  func (uct UtcClipTime) AsAbsoluteClipTime() (*AbsoluteClipTime, bool) {
 12682  	return nil, false
 12683  }
 12684  
 12685  // AsUtcClipTime is the BasicClipTime implementation for UtcClipTime.
 12686  func (uct UtcClipTime) AsUtcClipTime() (*UtcClipTime, bool) {
 12687  	return &uct, true
 12688  }
 12689  
 12690  // AsClipTime is the BasicClipTime implementation for UtcClipTime.
 12691  func (uct UtcClipTime) AsClipTime() (*ClipTime, bool) {
 12692  	return nil, false
 12693  }
 12694  
 12695  // AsBasicClipTime is the BasicClipTime implementation for UtcClipTime.
 12696  func (uct UtcClipTime) AsBasicClipTime() (BasicClipTime, bool) {
 12697  	return &uct, true
 12698  }
 12699  
 12700  // BasicVideo describes the basic properties for encoding the input video.
 12701  type BasicVideo interface {
 12702  	AsH265Video() (*H265Video, bool)
 12703  	AsImage() (*Image, bool)
 12704  	AsBasicImage() (BasicImage, bool)
 12705  	AsH264Video() (*H264Video, bool)
 12706  	AsJpgImage() (*JpgImage, bool)
 12707  	AsPngImage() (*PngImage, bool)
 12708  	AsVideo() (*Video, bool)
 12709  }
 12710  
 12711  // Video describes the basic properties for encoding the input video.
 12712  type Video struct {
 12713  	// KeyFrameInterval - The distance between two key frames. The value should be non-zero in the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will follow the input source setting.
 12714  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
 12715  	// 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'
 12716  	StretchMode StretchMode `json:"stretchMode,omitempty"`
 12717  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
 12718  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
 12719  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
 12720  	Label *string `json:"label,omitempty"`
 12721  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
 12722  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
 12723  }
 12724  
 12725  func unmarshalBasicVideo(body []byte) (BasicVideo, error) {
 12726  	var m map[string]interface{}
 12727  	err := json.Unmarshal(body, &m)
 12728  	if err != nil {
 12729  		return nil, err
 12730  	}
 12731  
 12732  	switch m["@odata.type"] {
 12733  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video):
 12734  		var hv H265Video
 12735  		err := json.Unmarshal(body, &hv)
 12736  		return hv, err
 12737  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaImage):
 12738  		var i Image
 12739  		err := json.Unmarshal(body, &i)
 12740  		return i, err
 12741  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video):
 12742  		var hv H264Video
 12743  		err := json.Unmarshal(body, &hv)
 12744  		return hv, err
 12745  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage):
 12746  		var ji JpgImage
 12747  		err := json.Unmarshal(body, &ji)
 12748  		return ji, err
 12749  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage):
 12750  		var pi PngImage
 12751  		err := json.Unmarshal(body, &pi)
 12752  		return pi, err
 12753  	default:
 12754  		var vVar Video
 12755  		err := json.Unmarshal(body, &vVar)
 12756  		return vVar, err
 12757  	}
 12758  }
 12759  func unmarshalBasicVideoArray(body []byte) ([]BasicVideo, error) {
 12760  	var rawMessages []*json.RawMessage
 12761  	err := json.Unmarshal(body, &rawMessages)
 12762  	if err != nil {
 12763  		return nil, err
 12764  	}
 12765  
 12766  	vVarArray := make([]BasicVideo, len(rawMessages))
 12767  
 12768  	for index, rawMessage := range rawMessages {
 12769  		vVar, err := unmarshalBasicVideo(*rawMessage)
 12770  		if err != nil {
 12771  			return nil, err
 12772  		}
 12773  		vVarArray[index] = vVar
 12774  	}
 12775  	return vVarArray, nil
 12776  }
 12777  
 12778  // MarshalJSON is the custom marshaler for Video.
 12779  func (vVar Video) MarshalJSON() ([]byte, error) {
 12780  	vVar.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo
 12781  	objectMap := make(map[string]interface{})
 12782  	if vVar.KeyFrameInterval != nil {
 12783  		objectMap["keyFrameInterval"] = vVar.KeyFrameInterval
 12784  	}
 12785  	if vVar.StretchMode != "" {
 12786  		objectMap["stretchMode"] = vVar.StretchMode
 12787  	}
 12788  	if vVar.SyncMode != "" {
 12789  		objectMap["syncMode"] = vVar.SyncMode
 12790  	}
 12791  	if vVar.Label != nil {
 12792  		objectMap["label"] = vVar.Label
 12793  	}
 12794  	if vVar.OdataType != "" {
 12795  		objectMap["@odata.type"] = vVar.OdataType
 12796  	}
 12797  	return json.Marshal(objectMap)
 12798  }
 12799  
 12800  // AsAudio is the BasicCodec implementation for Video.
 12801  func (vVar Video) AsAudio() (*Audio, bool) {
 12802  	return nil, false
 12803  }
 12804  
 12805  // AsBasicAudio is the BasicCodec implementation for Video.
 12806  func (vVar Video) AsBasicAudio() (BasicAudio, bool) {
 12807  	return nil, false
 12808  }
 12809  
 12810  // AsAacAudio is the BasicCodec implementation for Video.
 12811  func (vVar Video) AsAacAudio() (*AacAudio, bool) {
 12812  	return nil, false
 12813  }
 12814  
 12815  // AsVideo is the BasicCodec implementation for Video.
 12816  func (vVar Video) AsVideo() (*Video, bool) {
 12817  	return &vVar, true
 12818  }
 12819  
 12820  // AsBasicVideo is the BasicCodec implementation for Video.
 12821  func (vVar Video) AsBasicVideo() (BasicVideo, bool) {
 12822  	return &vVar, true
 12823  }
 12824  
 12825  // AsH265Video is the BasicCodec implementation for Video.
 12826  func (vVar Video) AsH265Video() (*H265Video, bool) {
 12827  	return nil, false
 12828  }
 12829  
 12830  // AsCopyVideo is the BasicCodec implementation for Video.
 12831  func (vVar Video) AsCopyVideo() (*CopyVideo, bool) {
 12832  	return nil, false
 12833  }
 12834  
 12835  // AsImage is the BasicCodec implementation for Video.
 12836  func (vVar Video) AsImage() (*Image, bool) {
 12837  	return nil, false
 12838  }
 12839  
 12840  // AsBasicImage is the BasicCodec implementation for Video.
 12841  func (vVar Video) AsBasicImage() (BasicImage, bool) {
 12842  	return nil, false
 12843  }
 12844  
 12845  // AsCopyAudio is the BasicCodec implementation for Video.
 12846  func (vVar Video) AsCopyAudio() (*CopyAudio, bool) {
 12847  	return nil, false
 12848  }
 12849  
 12850  // AsH264Video is the BasicCodec implementation for Video.
 12851  func (vVar Video) AsH264Video() (*H264Video, bool) {
 12852  	return nil, false
 12853  }
 12854  
 12855  // AsJpgImage is the BasicCodec implementation for Video.
 12856  func (vVar Video) AsJpgImage() (*JpgImage, bool) {
 12857  	return nil, false
 12858  }
 12859  
 12860  // AsPngImage is the BasicCodec implementation for Video.
 12861  func (vVar Video) AsPngImage() (*PngImage, bool) {
 12862  	return nil, false
 12863  }
 12864  
 12865  // AsCodec is the BasicCodec implementation for Video.
 12866  func (vVar Video) AsCodec() (*Codec, bool) {
 12867  	return nil, false
 12868  }
 12869  
 12870  // AsBasicCodec is the BasicCodec implementation for Video.
 12871  func (vVar Video) AsBasicCodec() (BasicCodec, bool) {
 12872  	return &vVar, true
 12873  }
 12874  
 12875  // VideoAnalyzerPreset a video analyzer preset that extracts insights (rich metadata) from both audio and
 12876  // video, and outputs a JSON format file.
 12877  type VideoAnalyzerPreset struct {
 12878  	// 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: 'InsightsTypeAudioInsightsOnly', 'InsightsTypeVideoInsightsOnly', 'InsightsTypeAllInsights'
 12879  	InsightsToExtract InsightsType `json:"insightsToExtract,omitempty"`
 12880  	// AudioLanguage - The language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US').  If you know the language of your content, it is recommended that you specify it. The language must be specified explicitly for AudioAnalysisMode::Basic, since automatic language detection is not included in basic mode. If the language isn't specified or set to null, automatic language detection will choose the first language detected and process with the selected language for the duration of the file. It does not currently support dynamically switching between languages after the first language is detected. The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection fails to find the language, transcription would fallback to 'en-US'." The list of supported languages is available here: https://go.microsoft.com/fwlink/?linkid=2109463
 12881  	AudioLanguage *string `json:"audioLanguage,omitempty"`
 12882  	// Mode - Determines the set of audio analysis operations to be performed. If unspecified, the Standard AudioAnalysisMode would be chosen. Possible values include: 'AudioAnalysisModeStandard', 'AudioAnalysisModeBasic'
 12883  	Mode AudioAnalysisMode `json:"mode,omitempty"`
 12884  	// ExperimentalOptions - Dictionary containing key value pairs for parameters not exposed in the preset itself
 12885  	ExperimentalOptions map[string]*string `json:"experimentalOptions"`
 12886  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
 12887  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
 12888  }
 12889  
 12890  // MarshalJSON is the custom marshaler for VideoAnalyzerPreset.
 12891  func (vap VideoAnalyzerPreset) MarshalJSON() ([]byte, error) {
 12892  	vap.OdataType = OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset
 12893  	objectMap := make(map[string]interface{})
 12894  	if vap.InsightsToExtract != "" {
 12895  		objectMap["insightsToExtract"] = vap.InsightsToExtract
 12896  	}
 12897  	if vap.AudioLanguage != nil {
 12898  		objectMap["audioLanguage"] = vap.AudioLanguage
 12899  	}
 12900  	if vap.Mode != "" {
 12901  		objectMap["mode"] = vap.Mode
 12902  	}
 12903  	if vap.ExperimentalOptions != nil {
 12904  		objectMap["experimentalOptions"] = vap.ExperimentalOptions
 12905  	}
 12906  	if vap.OdataType != "" {
 12907  		objectMap["@odata.type"] = vap.OdataType
 12908  	}
 12909  	return json.Marshal(objectMap)
 12910  }
 12911  
 12912  // AsFaceDetectorPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12913  func (vap VideoAnalyzerPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
 12914  	return nil, false
 12915  }
 12916  
 12917  // AsAudioAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12918  func (vap VideoAnalyzerPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
 12919  	return nil, false
 12920  }
 12921  
 12922  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12923  func (vap VideoAnalyzerPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
 12924  	return &vap, true
 12925  }
 12926  
 12927  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12928  func (vap VideoAnalyzerPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
 12929  	return nil, false
 12930  }
 12931  
 12932  // AsStandardEncoderPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12933  func (vap VideoAnalyzerPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
 12934  	return nil, false
 12935  }
 12936  
 12937  // AsVideoAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12938  func (vap VideoAnalyzerPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
 12939  	return &vap, true
 12940  }
 12941  
 12942  // AsPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12943  func (vap VideoAnalyzerPreset) AsPreset() (*Preset, bool) {
 12944  	return nil, false
 12945  }
 12946  
 12947  // AsBasicPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12948  func (vap VideoAnalyzerPreset) AsBasicPreset() (BasicPreset, bool) {
 12949  	return &vap, true
 12950  }
 12951  
 12952  // VideoLayer describes the settings to be used when encoding the input video into a desired output bitrate
 12953  // layer.
 12954  type VideoLayer struct {
 12955  	// Bitrate - The average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field.
 12956  	Bitrate *int32 `json:"bitrate,omitempty"`
 12957  	// 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.
 12958  	MaxBitrate *int32 `json:"maxBitrate,omitempty"`
 12959  	// 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.
 12960  	BFrames *int32 `json:"bFrames,omitempty"`
 12961  	// 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.
 12962  	FrameRate *string `json:"frameRate,omitempty"`
 12963  	// 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.
 12964  	Slices *int32 `json:"slices,omitempty"`
 12965  	// 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.
 12966  	AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
 12967  	// 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.
 12968  	Width *string `json:"width,omitempty"`
 12969  	// 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.
 12970  	Height *string `json:"height,omitempty"`
 12971  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
 12972  	Label *string `json:"label,omitempty"`
 12973  }
 12974  
 12975  // VideoOverlay describes the properties of a video overlay.
 12976  type VideoOverlay struct {
 12977  	// Position - The location in the input video where the overlay is applied.
 12978  	Position *Rectangle `json:"position,omitempty"`
 12979  	// 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.
 12980  	Opacity *float64 `json:"opacity,omitempty"`
 12981  	// CropRectangle - An optional rectangular window used to crop the overlay image or video.
 12982  	CropRectangle *Rectangle `json:"cropRectangle,omitempty"`
 12983  	// InputLabel - The label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG, PNG, GIF or BMP format, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats.
 12984  	InputLabel *string `json:"inputLabel,omitempty"`
 12985  	// Start - The start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds into the input video. If not specified the overlay starts from the beginning of the input video.
 12986  	Start *string `json:"start,omitempty"`
 12987  	// End - The end position, with reference to the input video, at which the overlay ends. The value should be in ISO 8601 format. For example, PT30S to end the overlay at 30 seconds into the input video. If not specified or the value is greater than the input video duration, the overlay will be applied until the end of the input video if the overlay media duration is greater than the input video duration, else the overlay will last as long as the overlay media duration.
 12988  	End *string `json:"end,omitempty"`
 12989  	// 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).
 12990  	FadeInDuration *string `json:"fadeInDuration,omitempty"`
 12991  	// 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).
 12992  	FadeOutDuration *string `json:"fadeOutDuration,omitempty"`
 12993  	// AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0.
 12994  	AudioGainLevel *float64 `json:"audioGainLevel,omitempty"`
 12995  	// OdataType - Possible values include: 'OdataTypeBasicOverlayOdataTypeOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaVideoOverlay'
 12996  	OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"`
 12997  }
 12998  
 12999  // MarshalJSON is the custom marshaler for VideoOverlay.
 13000  func (vo VideoOverlay) MarshalJSON() ([]byte, error) {
 13001  	vo.OdataType = OdataTypeBasicOverlayOdataTypeMicrosoftMediaVideoOverlay
 13002  	objectMap := make(map[string]interface{})
 13003  	if vo.Position != nil {
 13004  		objectMap["position"] = vo.Position
 13005  	}
 13006  	if vo.Opacity != nil {
 13007  		objectMap["opacity"] = vo.Opacity
 13008  	}
 13009  	if vo.CropRectangle != nil {
 13010  		objectMap["cropRectangle"] = vo.CropRectangle
 13011  	}
 13012  	if vo.InputLabel != nil {
 13013  		objectMap["inputLabel"] = vo.InputLabel
 13014  	}
 13015  	if vo.Start != nil {
 13016  		objectMap["start"] = vo.Start
 13017  	}
 13018  	if vo.End != nil {
 13019  		objectMap["end"] = vo.End
 13020  	}
 13021  	if vo.FadeInDuration != nil {
 13022  		objectMap["fadeInDuration"] = vo.FadeInDuration
 13023  	}
 13024  	if vo.FadeOutDuration != nil {
 13025  		objectMap["fadeOutDuration"] = vo.FadeOutDuration
 13026  	}
 13027  	if vo.AudioGainLevel != nil {
 13028  		objectMap["audioGainLevel"] = vo.AudioGainLevel
 13029  	}
 13030  	if vo.OdataType != "" {
 13031  		objectMap["@odata.type"] = vo.OdataType
 13032  	}
 13033  	return json.Marshal(objectMap)
 13034  }
 13035  
 13036  // AsAudioOverlay is the BasicOverlay implementation for VideoOverlay.
 13037  func (vo VideoOverlay) AsAudioOverlay() (*AudioOverlay, bool) {
 13038  	return nil, false
 13039  }
 13040  
 13041  // AsVideoOverlay is the BasicOverlay implementation for VideoOverlay.
 13042  func (vo VideoOverlay) AsVideoOverlay() (*VideoOverlay, bool) {
 13043  	return &vo, true
 13044  }
 13045  
 13046  // AsOverlay is the BasicOverlay implementation for VideoOverlay.
 13047  func (vo VideoOverlay) AsOverlay() (*Overlay, bool) {
 13048  	return nil, false
 13049  }
 13050  
 13051  // AsBasicOverlay is the BasicOverlay implementation for VideoOverlay.
 13052  func (vo VideoOverlay) AsBasicOverlay() (BasicOverlay, bool) {
 13053  	return &vo, true
 13054  }
 13055  
 13056  // VideoTrack represents a video track in the asset.
 13057  type VideoTrack struct {
 13058  	// OdataType - Possible values include: 'OdataTypeTrackBase', 'OdataTypeMicrosoftMediaAudioTrack', 'OdataTypeMicrosoftMediaVideoTrack', 'OdataTypeMicrosoftMediaTextTrack'
 13059  	OdataType OdataType `json:"@odata.type,omitempty"`
 13060  }
 13061  
 13062  // MarshalJSON is the custom marshaler for VideoTrack.
 13063  func (vt VideoTrack) MarshalJSON() ([]byte, error) {
 13064  	vt.OdataType = OdataTypeMicrosoftMediaVideoTrack
 13065  	objectMap := make(map[string]interface{})
 13066  	if vt.OdataType != "" {
 13067  		objectMap["@odata.type"] = vt.OdataType
 13068  	}
 13069  	return json.Marshal(objectMap)
 13070  }
 13071  
 13072  // AsAudioTrack is the BasicTrackBase implementation for VideoTrack.
 13073  func (vt VideoTrack) AsAudioTrack() (*AudioTrack, bool) {
 13074  	return nil, false
 13075  }
 13076  
 13077  // AsVideoTrack is the BasicTrackBase implementation for VideoTrack.
 13078  func (vt VideoTrack) AsVideoTrack() (*VideoTrack, bool) {
 13079  	return &vt, true
 13080  }
 13081  
 13082  // AsTextTrack is the BasicTrackBase implementation for VideoTrack.
 13083  func (vt VideoTrack) AsTextTrack() (*TextTrack, bool) {
 13084  	return nil, false
 13085  }
 13086  
 13087  // AsTrackBase is the BasicTrackBase implementation for VideoTrack.
 13088  func (vt VideoTrack) AsTrackBase() (*TrackBase, bool) {
 13089  	return nil, false
 13090  }
 13091  
 13092  // AsBasicTrackBase is the BasicTrackBase implementation for VideoTrack.
 13093  func (vt VideoTrack) AsBasicTrackBase() (BasicTrackBase, bool) {
 13094  	return &vt, true
 13095  }
 13096  
 13097  // BasicVideoTrackDescriptor a TrackSelection to select video tracks.
 13098  type BasicVideoTrackDescriptor interface {
 13099  	AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool)
 13100  	AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool)
 13101  	AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool)
 13102  }
 13103  
 13104  // VideoTrackDescriptor a TrackSelection to select video tracks.
 13105  type VideoTrackDescriptor struct {
 13106  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
 13107  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
 13108  }
 13109  
 13110  func unmarshalBasicVideoTrackDescriptor(body []byte) (BasicVideoTrackDescriptor, error) {
 13111  	var m map[string]interface{}
 13112  	err := json.Unmarshal(body, &m)
 13113  	if err != nil {
 13114  		return nil, err
 13115  	}
 13116  
 13117  	switch m["@odata.type"] {
 13118  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute):
 13119  		var svtba SelectVideoTrackByAttribute
 13120  		err := json.Unmarshal(body, &svtba)
 13121  		return svtba, err
 13122  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID):
 13123  		var svtbi SelectVideoTrackByID
 13124  		err := json.Unmarshal(body, &svtbi)
 13125  		return svtbi, err
 13126  	default:
 13127  		var vtd VideoTrackDescriptor
 13128  		err := json.Unmarshal(body, &vtd)
 13129  		return vtd, err
 13130  	}
 13131  }
 13132  func unmarshalBasicVideoTrackDescriptorArray(body []byte) ([]BasicVideoTrackDescriptor, error) {
 13133  	var rawMessages []*json.RawMessage
 13134  	err := json.Unmarshal(body, &rawMessages)
 13135  	if err != nil {
 13136  		return nil, err
 13137  	}
 13138  
 13139  	vtdArray := make([]BasicVideoTrackDescriptor, len(rawMessages))
 13140  
 13141  	for index, rawMessage := range rawMessages {
 13142  		vtd, err := unmarshalBasicVideoTrackDescriptor(*rawMessage)
 13143  		if err != nil {
 13144  			return nil, err
 13145  		}
 13146  		vtdArray[index] = vtd
 13147  	}
 13148  	return vtdArray, nil
 13149  }
 13150  
 13151  // MarshalJSON is the custom marshaler for VideoTrackDescriptor.
 13152  func (vtd VideoTrackDescriptor) MarshalJSON() ([]byte, error) {
 13153  	vtd.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor
 13154  	objectMap := make(map[string]interface{})
 13155  	if vtd.OdataType != "" {
 13156  		objectMap["@odata.type"] = vtd.OdataType
 13157  	}
 13158  	return json.Marshal(objectMap)
 13159  }
 13160  
 13161  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13162  func (vtd VideoTrackDescriptor) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
 13163  	return nil, false
 13164  }
 13165  
 13166  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13167  func (vtd VideoTrackDescriptor) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
 13168  	return nil, false
 13169  }
 13170  
 13171  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13172  func (vtd VideoTrackDescriptor) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
 13173  	return nil, false
 13174  }
 13175  
 13176  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13177  func (vtd VideoTrackDescriptor) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
 13178  	return nil, false
 13179  }
 13180  
 13181  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13182  func (vtd VideoTrackDescriptor) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
 13183  	return &vtd, true
 13184  }
 13185  
 13186  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13187  func (vtd VideoTrackDescriptor) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
 13188  	return &vtd, true
 13189  }
 13190  
 13191  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13192  func (vtd VideoTrackDescriptor) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
 13193  	return nil, false
 13194  }
 13195  
 13196  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13197  func (vtd VideoTrackDescriptor) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
 13198  	return nil, false
 13199  }
 13200  
 13201  // AsTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13202  func (vtd VideoTrackDescriptor) AsTrackDescriptor() (*TrackDescriptor, bool) {
 13203  	return nil, false
 13204  }
 13205  
 13206  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13207  func (vtd VideoTrackDescriptor) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
 13208  	return &vtd, true
 13209  }
 13210  

View as plain text