...

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

Documentation: github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-06-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-06-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  // Asset an Asset.
   477  type Asset struct {
   478  	autorest.Response `json:"-"`
   479  	// AssetProperties - The resource properties.
   480  	*AssetProperties `json:"properties,omitempty"`
   481  	// SystemData - READ-ONLY; The system metadata relating to this resource.
   482  	SystemData *SystemData `json:"systemData,omitempty"`
   483  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
   484  	ID *string `json:"id,omitempty"`
   485  	// Name - READ-ONLY; The name of the resource
   486  	Name *string `json:"name,omitempty"`
   487  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
   488  	Type *string `json:"type,omitempty"`
   489  }
   490  
   491  // MarshalJSON is the custom marshaler for Asset.
   492  func (a Asset) MarshalJSON() ([]byte, error) {
   493  	objectMap := make(map[string]interface{})
   494  	if a.AssetProperties != nil {
   495  		objectMap["properties"] = a.AssetProperties
   496  	}
   497  	return json.Marshal(objectMap)
   498  }
   499  
   500  // UnmarshalJSON is the custom unmarshaler for Asset struct.
   501  func (a *Asset) UnmarshalJSON(body []byte) error {
   502  	var m map[string]*json.RawMessage
   503  	err := json.Unmarshal(body, &m)
   504  	if err != nil {
   505  		return err
   506  	}
   507  	for k, v := range m {
   508  		switch k {
   509  		case "properties":
   510  			if v != nil {
   511  				var assetProperties AssetProperties
   512  				err = json.Unmarshal(*v, &assetProperties)
   513  				if err != nil {
   514  					return err
   515  				}
   516  				a.AssetProperties = &assetProperties
   517  			}
   518  		case "systemData":
   519  			if v != nil {
   520  				var systemData SystemData
   521  				err = json.Unmarshal(*v, &systemData)
   522  				if err != nil {
   523  					return err
   524  				}
   525  				a.SystemData = &systemData
   526  			}
   527  		case "id":
   528  			if v != nil {
   529  				var ID string
   530  				err = json.Unmarshal(*v, &ID)
   531  				if err != nil {
   532  					return err
   533  				}
   534  				a.ID = &ID
   535  			}
   536  		case "name":
   537  			if v != nil {
   538  				var name string
   539  				err = json.Unmarshal(*v, &name)
   540  				if err != nil {
   541  					return err
   542  				}
   543  				a.Name = &name
   544  			}
   545  		case "type":
   546  			if v != nil {
   547  				var typeVar string
   548  				err = json.Unmarshal(*v, &typeVar)
   549  				if err != nil {
   550  					return err
   551  				}
   552  				a.Type = &typeVar
   553  			}
   554  		}
   555  	}
   556  
   557  	return nil
   558  }
   559  
   560  // AssetCollection a collection of Asset items.
   561  type AssetCollection struct {
   562  	autorest.Response `json:"-"`
   563  	// Value - A collection of Asset items.
   564  	Value *[]Asset `json:"value,omitempty"`
   565  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
   566  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
   567  }
   568  
   569  // AssetCollectionIterator provides access to a complete listing of Asset values.
   570  type AssetCollectionIterator struct {
   571  	i    int
   572  	page AssetCollectionPage
   573  }
   574  
   575  // NextWithContext advances to the next value.  If there was an error making
   576  // the request the iterator does not advance and the error is returned.
   577  func (iter *AssetCollectionIterator) NextWithContext(ctx context.Context) (err error) {
   578  	if tracing.IsEnabled() {
   579  		ctx = tracing.StartSpan(ctx, fqdn+"/AssetCollectionIterator.NextWithContext")
   580  		defer func() {
   581  			sc := -1
   582  			if iter.Response().Response.Response != nil {
   583  				sc = iter.Response().Response.Response.StatusCode
   584  			}
   585  			tracing.EndSpan(ctx, sc, err)
   586  		}()
   587  	}
   588  	iter.i++
   589  	if iter.i < len(iter.page.Values()) {
   590  		return nil
   591  	}
   592  	err = iter.page.NextWithContext(ctx)
   593  	if err != nil {
   594  		iter.i--
   595  		return err
   596  	}
   597  	iter.i = 0
   598  	return nil
   599  }
   600  
   601  // Next advances to the next value.  If there was an error making
   602  // the request the iterator does not advance and the error is returned.
   603  // Deprecated: Use NextWithContext() instead.
   604  func (iter *AssetCollectionIterator) Next() error {
   605  	return iter.NextWithContext(context.Background())
   606  }
   607  
   608  // NotDone returns true if the enumeration should be started or is not yet complete.
   609  func (iter AssetCollectionIterator) NotDone() bool {
   610  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   611  }
   612  
   613  // Response returns the raw server response from the last page request.
   614  func (iter AssetCollectionIterator) Response() AssetCollection {
   615  	return iter.page.Response()
   616  }
   617  
   618  // Value returns the current value or a zero-initialized value if the
   619  // iterator has advanced beyond the end of the collection.
   620  func (iter AssetCollectionIterator) Value() Asset {
   621  	if !iter.page.NotDone() {
   622  		return Asset{}
   623  	}
   624  	return iter.page.Values()[iter.i]
   625  }
   626  
   627  // Creates a new instance of the AssetCollectionIterator type.
   628  func NewAssetCollectionIterator(page AssetCollectionPage) AssetCollectionIterator {
   629  	return AssetCollectionIterator{page: page}
   630  }
   631  
   632  // IsEmpty returns true if the ListResult contains no values.
   633  func (ac AssetCollection) IsEmpty() bool {
   634  	return ac.Value == nil || len(*ac.Value) == 0
   635  }
   636  
   637  // hasNextLink returns true if the NextLink is not empty.
   638  func (ac AssetCollection) hasNextLink() bool {
   639  	return ac.OdataNextLink != nil && len(*ac.OdataNextLink) != 0
   640  }
   641  
   642  // assetCollectionPreparer prepares a request to retrieve the next set of results.
   643  // It returns nil if no more results exist.
   644  func (ac AssetCollection) assetCollectionPreparer(ctx context.Context) (*http.Request, error) {
   645  	if !ac.hasNextLink() {
   646  		return nil, nil
   647  	}
   648  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   649  		autorest.AsJSON(),
   650  		autorest.AsGet(),
   651  		autorest.WithBaseURL(to.String(ac.OdataNextLink)))
   652  }
   653  
   654  // AssetCollectionPage contains a page of Asset values.
   655  type AssetCollectionPage struct {
   656  	fn func(context.Context, AssetCollection) (AssetCollection, error)
   657  	ac AssetCollection
   658  }
   659  
   660  // NextWithContext advances to the next page of values.  If there was an error making
   661  // the request the page does not advance and the error is returned.
   662  func (page *AssetCollectionPage) NextWithContext(ctx context.Context) (err error) {
   663  	if tracing.IsEnabled() {
   664  		ctx = tracing.StartSpan(ctx, fqdn+"/AssetCollectionPage.NextWithContext")
   665  		defer func() {
   666  			sc := -1
   667  			if page.Response().Response.Response != nil {
   668  				sc = page.Response().Response.Response.StatusCode
   669  			}
   670  			tracing.EndSpan(ctx, sc, err)
   671  		}()
   672  	}
   673  	for {
   674  		next, err := page.fn(ctx, page.ac)
   675  		if err != nil {
   676  			return err
   677  		}
   678  		page.ac = next
   679  		if !next.hasNextLink() || !next.IsEmpty() {
   680  			break
   681  		}
   682  	}
   683  	return nil
   684  }
   685  
   686  // Next advances to the next page of values.  If there was an error making
   687  // the request the page does not advance and the error is returned.
   688  // Deprecated: Use NextWithContext() instead.
   689  func (page *AssetCollectionPage) Next() error {
   690  	return page.NextWithContext(context.Background())
   691  }
   692  
   693  // NotDone returns true if the page enumeration should be started or is not yet complete.
   694  func (page AssetCollectionPage) NotDone() bool {
   695  	return !page.ac.IsEmpty()
   696  }
   697  
   698  // Response returns the raw server response from the last page request.
   699  func (page AssetCollectionPage) Response() AssetCollection {
   700  	return page.ac
   701  }
   702  
   703  // Values returns the slice of values for the current page or nil if there are no values.
   704  func (page AssetCollectionPage) Values() []Asset {
   705  	if page.ac.IsEmpty() {
   706  		return nil
   707  	}
   708  	return *page.ac.Value
   709  }
   710  
   711  // Creates a new instance of the AssetCollectionPage type.
   712  func NewAssetCollectionPage(cur AssetCollection, getNextPage func(context.Context, AssetCollection) (AssetCollection, error)) AssetCollectionPage {
   713  	return AssetCollectionPage{
   714  		fn: getNextPage,
   715  		ac: cur,
   716  	}
   717  }
   718  
   719  // AssetContainerSas the Asset Storage container SAS URLs.
   720  type AssetContainerSas struct {
   721  	autorest.Response `json:"-"`
   722  	// AssetContainerSasUrls - The list of Asset container SAS URLs.
   723  	AssetContainerSasUrls *[]string `json:"assetContainerSasUrls,omitempty"`
   724  }
   725  
   726  // AssetFileEncryptionMetadata the Asset File Storage encryption metadata.
   727  type AssetFileEncryptionMetadata struct {
   728  	// InitializationVector - The Asset File initialization vector.
   729  	InitializationVector *string `json:"initializationVector,omitempty"`
   730  	// AssetFileName - The Asset File name.
   731  	AssetFileName *string `json:"assetFileName,omitempty"`
   732  	// AssetFileID - The Asset File Id.
   733  	AssetFileID *uuid.UUID `json:"assetFileId,omitempty"`
   734  }
   735  
   736  // AssetFilter an Asset Filter.
   737  type AssetFilter struct {
   738  	autorest.Response `json:"-"`
   739  	*FilterProperties `json:"properties,omitempty"`
   740  	// SystemData - READ-ONLY; The system metadata relating to this resource.
   741  	SystemData *SystemData `json:"systemData,omitempty"`
   742  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
   743  	ID *string `json:"id,omitempty"`
   744  	// Name - READ-ONLY; The name of the resource
   745  	Name *string `json:"name,omitempty"`
   746  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
   747  	Type *string `json:"type,omitempty"`
   748  }
   749  
   750  // MarshalJSON is the custom marshaler for AssetFilter.
   751  func (af AssetFilter) MarshalJSON() ([]byte, error) {
   752  	objectMap := make(map[string]interface{})
   753  	if af.FilterProperties != nil {
   754  		objectMap["properties"] = af.FilterProperties
   755  	}
   756  	return json.Marshal(objectMap)
   757  }
   758  
   759  // UnmarshalJSON is the custom unmarshaler for AssetFilter struct.
   760  func (af *AssetFilter) UnmarshalJSON(body []byte) error {
   761  	var m map[string]*json.RawMessage
   762  	err := json.Unmarshal(body, &m)
   763  	if err != nil {
   764  		return err
   765  	}
   766  	for k, v := range m {
   767  		switch k {
   768  		case "properties":
   769  			if v != nil {
   770  				var filterProperties FilterProperties
   771  				err = json.Unmarshal(*v, &filterProperties)
   772  				if err != nil {
   773  					return err
   774  				}
   775  				af.FilterProperties = &filterProperties
   776  			}
   777  		case "systemData":
   778  			if v != nil {
   779  				var systemData SystemData
   780  				err = json.Unmarshal(*v, &systemData)
   781  				if err != nil {
   782  					return err
   783  				}
   784  				af.SystemData = &systemData
   785  			}
   786  		case "id":
   787  			if v != nil {
   788  				var ID string
   789  				err = json.Unmarshal(*v, &ID)
   790  				if err != nil {
   791  					return err
   792  				}
   793  				af.ID = &ID
   794  			}
   795  		case "name":
   796  			if v != nil {
   797  				var name string
   798  				err = json.Unmarshal(*v, &name)
   799  				if err != nil {
   800  					return err
   801  				}
   802  				af.Name = &name
   803  			}
   804  		case "type":
   805  			if v != nil {
   806  				var typeVar string
   807  				err = json.Unmarshal(*v, &typeVar)
   808  				if err != nil {
   809  					return err
   810  				}
   811  				af.Type = &typeVar
   812  			}
   813  		}
   814  	}
   815  
   816  	return nil
   817  }
   818  
   819  // AssetFilterCollection a collection of AssetFilter items.
   820  type AssetFilterCollection struct {
   821  	autorest.Response `json:"-"`
   822  	// Value - A collection of AssetFilter items.
   823  	Value *[]AssetFilter `json:"value,omitempty"`
   824  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
   825  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
   826  }
   827  
   828  // AssetFilterCollectionIterator provides access to a complete listing of AssetFilter values.
   829  type AssetFilterCollectionIterator struct {
   830  	i    int
   831  	page AssetFilterCollectionPage
   832  }
   833  
   834  // NextWithContext advances to the next value.  If there was an error making
   835  // the request the iterator does not advance and the error is returned.
   836  func (iter *AssetFilterCollectionIterator) NextWithContext(ctx context.Context) (err error) {
   837  	if tracing.IsEnabled() {
   838  		ctx = tracing.StartSpan(ctx, fqdn+"/AssetFilterCollectionIterator.NextWithContext")
   839  		defer func() {
   840  			sc := -1
   841  			if iter.Response().Response.Response != nil {
   842  				sc = iter.Response().Response.Response.StatusCode
   843  			}
   844  			tracing.EndSpan(ctx, sc, err)
   845  		}()
   846  	}
   847  	iter.i++
   848  	if iter.i < len(iter.page.Values()) {
   849  		return nil
   850  	}
   851  	err = iter.page.NextWithContext(ctx)
   852  	if err != nil {
   853  		iter.i--
   854  		return err
   855  	}
   856  	iter.i = 0
   857  	return nil
   858  }
   859  
   860  // Next advances to the next value.  If there was an error making
   861  // the request the iterator does not advance and the error is returned.
   862  // Deprecated: Use NextWithContext() instead.
   863  func (iter *AssetFilterCollectionIterator) Next() error {
   864  	return iter.NextWithContext(context.Background())
   865  }
   866  
   867  // NotDone returns true if the enumeration should be started or is not yet complete.
   868  func (iter AssetFilterCollectionIterator) NotDone() bool {
   869  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   870  }
   871  
   872  // Response returns the raw server response from the last page request.
   873  func (iter AssetFilterCollectionIterator) Response() AssetFilterCollection {
   874  	return iter.page.Response()
   875  }
   876  
   877  // Value returns the current value or a zero-initialized value if the
   878  // iterator has advanced beyond the end of the collection.
   879  func (iter AssetFilterCollectionIterator) Value() AssetFilter {
   880  	if !iter.page.NotDone() {
   881  		return AssetFilter{}
   882  	}
   883  	return iter.page.Values()[iter.i]
   884  }
   885  
   886  // Creates a new instance of the AssetFilterCollectionIterator type.
   887  func NewAssetFilterCollectionIterator(page AssetFilterCollectionPage) AssetFilterCollectionIterator {
   888  	return AssetFilterCollectionIterator{page: page}
   889  }
   890  
   891  // IsEmpty returns true if the ListResult contains no values.
   892  func (afc AssetFilterCollection) IsEmpty() bool {
   893  	return afc.Value == nil || len(*afc.Value) == 0
   894  }
   895  
   896  // hasNextLink returns true if the NextLink is not empty.
   897  func (afc AssetFilterCollection) hasNextLink() bool {
   898  	return afc.OdataNextLink != nil && len(*afc.OdataNextLink) != 0
   899  }
   900  
   901  // assetFilterCollectionPreparer prepares a request to retrieve the next set of results.
   902  // It returns nil if no more results exist.
   903  func (afc AssetFilterCollection) assetFilterCollectionPreparer(ctx context.Context) (*http.Request, error) {
   904  	if !afc.hasNextLink() {
   905  		return nil, nil
   906  	}
   907  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   908  		autorest.AsJSON(),
   909  		autorest.AsGet(),
   910  		autorest.WithBaseURL(to.String(afc.OdataNextLink)))
   911  }
   912  
   913  // AssetFilterCollectionPage contains a page of AssetFilter values.
   914  type AssetFilterCollectionPage struct {
   915  	fn  func(context.Context, AssetFilterCollection) (AssetFilterCollection, error)
   916  	afc AssetFilterCollection
   917  }
   918  
   919  // NextWithContext advances to the next page of values.  If there was an error making
   920  // the request the page does not advance and the error is returned.
   921  func (page *AssetFilterCollectionPage) NextWithContext(ctx context.Context) (err error) {
   922  	if tracing.IsEnabled() {
   923  		ctx = tracing.StartSpan(ctx, fqdn+"/AssetFilterCollectionPage.NextWithContext")
   924  		defer func() {
   925  			sc := -1
   926  			if page.Response().Response.Response != nil {
   927  				sc = page.Response().Response.Response.StatusCode
   928  			}
   929  			tracing.EndSpan(ctx, sc, err)
   930  		}()
   931  	}
   932  	for {
   933  		next, err := page.fn(ctx, page.afc)
   934  		if err != nil {
   935  			return err
   936  		}
   937  		page.afc = next
   938  		if !next.hasNextLink() || !next.IsEmpty() {
   939  			break
   940  		}
   941  	}
   942  	return nil
   943  }
   944  
   945  // Next advances to the next page of values.  If there was an error making
   946  // the request the page does not advance and the error is returned.
   947  // Deprecated: Use NextWithContext() instead.
   948  func (page *AssetFilterCollectionPage) Next() error {
   949  	return page.NextWithContext(context.Background())
   950  }
   951  
   952  // NotDone returns true if the page enumeration should be started or is not yet complete.
   953  func (page AssetFilterCollectionPage) NotDone() bool {
   954  	return !page.afc.IsEmpty()
   955  }
   956  
   957  // Response returns the raw server response from the last page request.
   958  func (page AssetFilterCollectionPage) Response() AssetFilterCollection {
   959  	return page.afc
   960  }
   961  
   962  // Values returns the slice of values for the current page or nil if there are no values.
   963  func (page AssetFilterCollectionPage) Values() []AssetFilter {
   964  	if page.afc.IsEmpty() {
   965  		return nil
   966  	}
   967  	return *page.afc.Value
   968  }
   969  
   970  // Creates a new instance of the AssetFilterCollectionPage type.
   971  func NewAssetFilterCollectionPage(cur AssetFilterCollection, getNextPage func(context.Context, AssetFilterCollection) (AssetFilterCollection, error)) AssetFilterCollectionPage {
   972  	return AssetFilterCollectionPage{
   973  		fn:  getNextPage,
   974  		afc: cur,
   975  	}
   976  }
   977  
   978  // AssetProperties the Asset properties.
   979  type AssetProperties struct {
   980  	// AssetID - READ-ONLY; The Asset ID.
   981  	AssetID *uuid.UUID `json:"assetId,omitempty"`
   982  	// Created - READ-ONLY; The creation date of the Asset.
   983  	Created *date.Time `json:"created,omitempty"`
   984  	// LastModified - READ-ONLY; The last modified date of the Asset.
   985  	LastModified *date.Time `json:"lastModified,omitempty"`
   986  	// AlternateID - The alternate ID of the Asset.
   987  	AlternateID *string `json:"alternateId,omitempty"`
   988  	// Description - The Asset description.
   989  	Description *string `json:"description,omitempty"`
   990  	// Container - The name of the asset blob container.
   991  	Container *string `json:"container,omitempty"`
   992  	// StorageAccountName - The name of the storage account.
   993  	StorageAccountName *string `json:"storageAccountName,omitempty"`
   994  	// StorageEncryptionFormat - READ-ONLY; The Asset encryption format. One of None or MediaStorageEncryption. Possible values include: 'AssetStorageEncryptionFormatNone', 'AssetStorageEncryptionFormatMediaStorageClientEncryption'
   995  	StorageEncryptionFormat AssetStorageEncryptionFormat `json:"storageEncryptionFormat,omitempty"`
   996  }
   997  
   998  // MarshalJSON is the custom marshaler for AssetProperties.
   999  func (ap AssetProperties) MarshalJSON() ([]byte, error) {
  1000  	objectMap := make(map[string]interface{})
  1001  	if ap.AlternateID != nil {
  1002  		objectMap["alternateId"] = ap.AlternateID
  1003  	}
  1004  	if ap.Description != nil {
  1005  		objectMap["description"] = ap.Description
  1006  	}
  1007  	if ap.Container != nil {
  1008  		objectMap["container"] = ap.Container
  1009  	}
  1010  	if ap.StorageAccountName != nil {
  1011  		objectMap["storageAccountName"] = ap.StorageAccountName
  1012  	}
  1013  	return json.Marshal(objectMap)
  1014  }
  1015  
  1016  // AssetStreamingLocator properties of the Streaming Locator.
  1017  type AssetStreamingLocator struct {
  1018  	// Name - READ-ONLY; Streaming Locator name.
  1019  	Name *string `json:"name,omitempty"`
  1020  	// AssetName - READ-ONLY; Asset Name.
  1021  	AssetName *string `json:"assetName,omitempty"`
  1022  	// Created - READ-ONLY; The creation time of the Streaming Locator.
  1023  	Created *date.Time `json:"created,omitempty"`
  1024  	// StartTime - READ-ONLY; The start time of the Streaming Locator.
  1025  	StartTime *date.Time `json:"startTime,omitempty"`
  1026  	// EndTime - READ-ONLY; The end time of the Streaming Locator.
  1027  	EndTime *date.Time `json:"endTime,omitempty"`
  1028  	// StreamingLocatorID - READ-ONLY; StreamingLocatorId of the Streaming Locator.
  1029  	StreamingLocatorID *uuid.UUID `json:"streamingLocatorId,omitempty"`
  1030  	// StreamingPolicyName - READ-ONLY; Name of the Streaming Policy used by this Streaming Locator.
  1031  	StreamingPolicyName *string `json:"streamingPolicyName,omitempty"`
  1032  	// DefaultContentKeyPolicyName - READ-ONLY; Name of the default ContentKeyPolicy used by this Streaming Locator.
  1033  	DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"`
  1034  }
  1035  
  1036  // MarshalJSON is the custom marshaler for AssetStreamingLocator.
  1037  func (asl AssetStreamingLocator) MarshalJSON() ([]byte, error) {
  1038  	objectMap := make(map[string]interface{})
  1039  	return json.Marshal(objectMap)
  1040  }
  1041  
  1042  // BasicAudio defines the common properties for all audio codecs.
  1043  type BasicAudio interface {
  1044  	AsAacAudio() (*AacAudio, bool)
  1045  	AsAudio() (*Audio, bool)
  1046  }
  1047  
  1048  // Audio defines the common properties for all audio codecs.
  1049  type Audio struct {
  1050  	// Channels - The number of channels in the audio.
  1051  	Channels *int32 `json:"channels,omitempty"`
  1052  	// SamplingRate - The sampling rate to use for encoding in hertz.
  1053  	SamplingRate *int32 `json:"samplingRate,omitempty"`
  1054  	// Bitrate - The bitrate, in bits per second, of the output encoded audio.
  1055  	Bitrate *int32 `json:"bitrate,omitempty"`
  1056  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  1057  	Label *string `json:"label,omitempty"`
  1058  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  1059  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  1060  }
  1061  
  1062  func unmarshalBasicAudio(body []byte) (BasicAudio, error) {
  1063  	var m map[string]interface{}
  1064  	err := json.Unmarshal(body, &m)
  1065  	if err != nil {
  1066  		return nil, err
  1067  	}
  1068  
  1069  	switch m["@odata.type"] {
  1070  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio):
  1071  		var aa AacAudio
  1072  		err := json.Unmarshal(body, &aa)
  1073  		return aa, err
  1074  	default:
  1075  		var a Audio
  1076  		err := json.Unmarshal(body, &a)
  1077  		return a, err
  1078  	}
  1079  }
  1080  func unmarshalBasicAudioArray(body []byte) ([]BasicAudio, error) {
  1081  	var rawMessages []*json.RawMessage
  1082  	err := json.Unmarshal(body, &rawMessages)
  1083  	if err != nil {
  1084  		return nil, err
  1085  	}
  1086  
  1087  	aArray := make([]BasicAudio, len(rawMessages))
  1088  
  1089  	for index, rawMessage := range rawMessages {
  1090  		a, err := unmarshalBasicAudio(*rawMessage)
  1091  		if err != nil {
  1092  			return nil, err
  1093  		}
  1094  		aArray[index] = a
  1095  	}
  1096  	return aArray, nil
  1097  }
  1098  
  1099  // MarshalJSON is the custom marshaler for Audio.
  1100  func (a Audio) MarshalJSON() ([]byte, error) {
  1101  	a.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio
  1102  	objectMap := make(map[string]interface{})
  1103  	if a.Channels != nil {
  1104  		objectMap["channels"] = a.Channels
  1105  	}
  1106  	if a.SamplingRate != nil {
  1107  		objectMap["samplingRate"] = a.SamplingRate
  1108  	}
  1109  	if a.Bitrate != nil {
  1110  		objectMap["bitrate"] = a.Bitrate
  1111  	}
  1112  	if a.Label != nil {
  1113  		objectMap["label"] = a.Label
  1114  	}
  1115  	if a.OdataType != "" {
  1116  		objectMap["@odata.type"] = a.OdataType
  1117  	}
  1118  	return json.Marshal(objectMap)
  1119  }
  1120  
  1121  // AsAudio is the BasicCodec implementation for Audio.
  1122  func (a Audio) AsAudio() (*Audio, bool) {
  1123  	return &a, true
  1124  }
  1125  
  1126  // AsBasicAudio is the BasicCodec implementation for Audio.
  1127  func (a Audio) AsBasicAudio() (BasicAudio, bool) {
  1128  	return &a, true
  1129  }
  1130  
  1131  // AsAacAudio is the BasicCodec implementation for Audio.
  1132  func (a Audio) AsAacAudio() (*AacAudio, bool) {
  1133  	return nil, false
  1134  }
  1135  
  1136  // AsVideo is the BasicCodec implementation for Audio.
  1137  func (a Audio) AsVideo() (*Video, bool) {
  1138  	return nil, false
  1139  }
  1140  
  1141  // AsBasicVideo is the BasicCodec implementation for Audio.
  1142  func (a Audio) AsBasicVideo() (BasicVideo, bool) {
  1143  	return nil, false
  1144  }
  1145  
  1146  // AsH265Video is the BasicCodec implementation for Audio.
  1147  func (a Audio) AsH265Video() (*H265Video, bool) {
  1148  	return nil, false
  1149  }
  1150  
  1151  // AsCopyVideo is the BasicCodec implementation for Audio.
  1152  func (a Audio) AsCopyVideo() (*CopyVideo, bool) {
  1153  	return nil, false
  1154  }
  1155  
  1156  // AsImage is the BasicCodec implementation for Audio.
  1157  func (a Audio) AsImage() (*Image, bool) {
  1158  	return nil, false
  1159  }
  1160  
  1161  // AsBasicImage is the BasicCodec implementation for Audio.
  1162  func (a Audio) AsBasicImage() (BasicImage, bool) {
  1163  	return nil, false
  1164  }
  1165  
  1166  // AsCopyAudio is the BasicCodec implementation for Audio.
  1167  func (a Audio) AsCopyAudio() (*CopyAudio, bool) {
  1168  	return nil, false
  1169  }
  1170  
  1171  // AsH264Video is the BasicCodec implementation for Audio.
  1172  func (a Audio) AsH264Video() (*H264Video, bool) {
  1173  	return nil, false
  1174  }
  1175  
  1176  // AsJpgImage is the BasicCodec implementation for Audio.
  1177  func (a Audio) AsJpgImage() (*JpgImage, bool) {
  1178  	return nil, false
  1179  }
  1180  
  1181  // AsPngImage is the BasicCodec implementation for Audio.
  1182  func (a Audio) AsPngImage() (*PngImage, bool) {
  1183  	return nil, false
  1184  }
  1185  
  1186  // AsCodec is the BasicCodec implementation for Audio.
  1187  func (a Audio) AsCodec() (*Codec, bool) {
  1188  	return nil, false
  1189  }
  1190  
  1191  // AsBasicCodec is the BasicCodec implementation for Audio.
  1192  func (a Audio) AsBasicCodec() (BasicCodec, bool) {
  1193  	return &a, true
  1194  }
  1195  
  1196  // BasicAudioAnalyzerPreset the Audio Analyzer preset applies a pre-defined set of AI-based analysis operations,
  1197  // including speech transcription. Currently, the preset supports processing of content with a single audio track.
  1198  type BasicAudioAnalyzerPreset interface {
  1199  	AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool)
  1200  	AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool)
  1201  }
  1202  
  1203  // AudioAnalyzerPreset the Audio Analyzer preset applies a pre-defined set of AI-based analysis operations,
  1204  // including speech transcription. Currently, the preset supports processing of content with a single audio
  1205  // track.
  1206  type AudioAnalyzerPreset struct {
  1207  	// 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
  1208  	AudioLanguage *string `json:"audioLanguage,omitempty"`
  1209  	// Mode - Determines the set of audio analysis operations to be performed. If unspecified, the Standard AudioAnalysisMode would be chosen. Possible values include: 'AudioAnalysisModeStandard', 'AudioAnalysisModeBasic'
  1210  	Mode AudioAnalysisMode `json:"mode,omitempty"`
  1211  	// ExperimentalOptions - Dictionary containing key value pairs for parameters not exposed in the preset itself
  1212  	ExperimentalOptions map[string]*string `json:"experimentalOptions"`
  1213  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
  1214  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
  1215  }
  1216  
  1217  func unmarshalBasicAudioAnalyzerPreset(body []byte) (BasicAudioAnalyzerPreset, error) {
  1218  	var m map[string]interface{}
  1219  	err := json.Unmarshal(body, &m)
  1220  	if err != nil {
  1221  		return nil, err
  1222  	}
  1223  
  1224  	switch m["@odata.type"] {
  1225  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset):
  1226  		var vap VideoAnalyzerPreset
  1227  		err := json.Unmarshal(body, &vap)
  1228  		return vap, err
  1229  	default:
  1230  		var aap AudioAnalyzerPreset
  1231  		err := json.Unmarshal(body, &aap)
  1232  		return aap, err
  1233  	}
  1234  }
  1235  func unmarshalBasicAudioAnalyzerPresetArray(body []byte) ([]BasicAudioAnalyzerPreset, error) {
  1236  	var rawMessages []*json.RawMessage
  1237  	err := json.Unmarshal(body, &rawMessages)
  1238  	if err != nil {
  1239  		return nil, err
  1240  	}
  1241  
  1242  	aapArray := make([]BasicAudioAnalyzerPreset, len(rawMessages))
  1243  
  1244  	for index, rawMessage := range rawMessages {
  1245  		aap, err := unmarshalBasicAudioAnalyzerPreset(*rawMessage)
  1246  		if err != nil {
  1247  			return nil, err
  1248  		}
  1249  		aapArray[index] = aap
  1250  	}
  1251  	return aapArray, nil
  1252  }
  1253  
  1254  // MarshalJSON is the custom marshaler for AudioAnalyzerPreset.
  1255  func (aap AudioAnalyzerPreset) MarshalJSON() ([]byte, error) {
  1256  	aap.OdataType = OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset
  1257  	objectMap := make(map[string]interface{})
  1258  	if aap.AudioLanguage != nil {
  1259  		objectMap["audioLanguage"] = aap.AudioLanguage
  1260  	}
  1261  	if aap.Mode != "" {
  1262  		objectMap["mode"] = aap.Mode
  1263  	}
  1264  	if aap.ExperimentalOptions != nil {
  1265  		objectMap["experimentalOptions"] = aap.ExperimentalOptions
  1266  	}
  1267  	if aap.OdataType != "" {
  1268  		objectMap["@odata.type"] = aap.OdataType
  1269  	}
  1270  	return json.Marshal(objectMap)
  1271  }
  1272  
  1273  // AsFaceDetectorPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1274  func (aap AudioAnalyzerPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
  1275  	return nil, false
  1276  }
  1277  
  1278  // AsAudioAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1279  func (aap AudioAnalyzerPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
  1280  	return &aap, true
  1281  }
  1282  
  1283  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1284  func (aap AudioAnalyzerPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
  1285  	return &aap, true
  1286  }
  1287  
  1288  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1289  func (aap AudioAnalyzerPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
  1290  	return nil, false
  1291  }
  1292  
  1293  // AsStandardEncoderPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1294  func (aap AudioAnalyzerPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
  1295  	return nil, false
  1296  }
  1297  
  1298  // AsVideoAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1299  func (aap AudioAnalyzerPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
  1300  	return nil, false
  1301  }
  1302  
  1303  // AsPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1304  func (aap AudioAnalyzerPreset) AsPreset() (*Preset, bool) {
  1305  	return nil, false
  1306  }
  1307  
  1308  // AsBasicPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1309  func (aap AudioAnalyzerPreset) AsBasicPreset() (BasicPreset, bool) {
  1310  	return &aap, true
  1311  }
  1312  
  1313  // AudioOverlay describes the properties of an audio overlay.
  1314  type AudioOverlay struct {
  1315  	// 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.
  1316  	InputLabel *string `json:"inputLabel,omitempty"`
  1317  	// 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.
  1318  	Start *string `json:"start,omitempty"`
  1319  	// 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.
  1320  	End *string `json:"end,omitempty"`
  1321  	// 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).
  1322  	FadeInDuration *string `json:"fadeInDuration,omitempty"`
  1323  	// 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).
  1324  	FadeOutDuration *string `json:"fadeOutDuration,omitempty"`
  1325  	// AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0.
  1326  	AudioGainLevel *float64 `json:"audioGainLevel,omitempty"`
  1327  	// OdataType - Possible values include: 'OdataTypeBasicOverlayOdataTypeOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaVideoOverlay'
  1328  	OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"`
  1329  }
  1330  
  1331  // MarshalJSON is the custom marshaler for AudioOverlay.
  1332  func (ao AudioOverlay) MarshalJSON() ([]byte, error) {
  1333  	ao.OdataType = OdataTypeBasicOverlayOdataTypeMicrosoftMediaAudioOverlay
  1334  	objectMap := make(map[string]interface{})
  1335  	if ao.InputLabel != nil {
  1336  		objectMap["inputLabel"] = ao.InputLabel
  1337  	}
  1338  	if ao.Start != nil {
  1339  		objectMap["start"] = ao.Start
  1340  	}
  1341  	if ao.End != nil {
  1342  		objectMap["end"] = ao.End
  1343  	}
  1344  	if ao.FadeInDuration != nil {
  1345  		objectMap["fadeInDuration"] = ao.FadeInDuration
  1346  	}
  1347  	if ao.FadeOutDuration != nil {
  1348  		objectMap["fadeOutDuration"] = ao.FadeOutDuration
  1349  	}
  1350  	if ao.AudioGainLevel != nil {
  1351  		objectMap["audioGainLevel"] = ao.AudioGainLevel
  1352  	}
  1353  	if ao.OdataType != "" {
  1354  		objectMap["@odata.type"] = ao.OdataType
  1355  	}
  1356  	return json.Marshal(objectMap)
  1357  }
  1358  
  1359  // AsAudioOverlay is the BasicOverlay implementation for AudioOverlay.
  1360  func (ao AudioOverlay) AsAudioOverlay() (*AudioOverlay, bool) {
  1361  	return &ao, true
  1362  }
  1363  
  1364  // AsVideoOverlay is the BasicOverlay implementation for AudioOverlay.
  1365  func (ao AudioOverlay) AsVideoOverlay() (*VideoOverlay, bool) {
  1366  	return nil, false
  1367  }
  1368  
  1369  // AsOverlay is the BasicOverlay implementation for AudioOverlay.
  1370  func (ao AudioOverlay) AsOverlay() (*Overlay, bool) {
  1371  	return nil, false
  1372  }
  1373  
  1374  // AsBasicOverlay is the BasicOverlay implementation for AudioOverlay.
  1375  func (ao AudioOverlay) AsBasicOverlay() (BasicOverlay, bool) {
  1376  	return &ao, true
  1377  }
  1378  
  1379  // BasicAudioTrackDescriptor a TrackSelection to select audio tracks.
  1380  type BasicAudioTrackDescriptor interface {
  1381  	AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool)
  1382  	AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool)
  1383  	AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool)
  1384  }
  1385  
  1386  // AudioTrackDescriptor a TrackSelection to select audio tracks.
  1387  type AudioTrackDescriptor struct {
  1388  	// 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'
  1389  	ChannelMapping ChannelMapping `json:"channelMapping,omitempty"`
  1390  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
  1391  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
  1392  }
  1393  
  1394  func unmarshalBasicAudioTrackDescriptor(body []byte) (BasicAudioTrackDescriptor, error) {
  1395  	var m map[string]interface{}
  1396  	err := json.Unmarshal(body, &m)
  1397  	if err != nil {
  1398  		return nil, err
  1399  	}
  1400  
  1401  	switch m["@odata.type"] {
  1402  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute):
  1403  		var satba SelectAudioTrackByAttribute
  1404  		err := json.Unmarshal(body, &satba)
  1405  		return satba, err
  1406  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID):
  1407  		var satbi SelectAudioTrackByID
  1408  		err := json.Unmarshal(body, &satbi)
  1409  		return satbi, err
  1410  	default:
  1411  		var atd AudioTrackDescriptor
  1412  		err := json.Unmarshal(body, &atd)
  1413  		return atd, err
  1414  	}
  1415  }
  1416  func unmarshalBasicAudioTrackDescriptorArray(body []byte) ([]BasicAudioTrackDescriptor, error) {
  1417  	var rawMessages []*json.RawMessage
  1418  	err := json.Unmarshal(body, &rawMessages)
  1419  	if err != nil {
  1420  		return nil, err
  1421  	}
  1422  
  1423  	atdArray := make([]BasicAudioTrackDescriptor, len(rawMessages))
  1424  
  1425  	for index, rawMessage := range rawMessages {
  1426  		atd, err := unmarshalBasicAudioTrackDescriptor(*rawMessage)
  1427  		if err != nil {
  1428  			return nil, err
  1429  		}
  1430  		atdArray[index] = atd
  1431  	}
  1432  	return atdArray, nil
  1433  }
  1434  
  1435  // MarshalJSON is the custom marshaler for AudioTrackDescriptor.
  1436  func (atd AudioTrackDescriptor) MarshalJSON() ([]byte, error) {
  1437  	atd.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor
  1438  	objectMap := make(map[string]interface{})
  1439  	if atd.ChannelMapping != "" {
  1440  		objectMap["channelMapping"] = atd.ChannelMapping
  1441  	}
  1442  	if atd.OdataType != "" {
  1443  		objectMap["@odata.type"] = atd.OdataType
  1444  	}
  1445  	return json.Marshal(objectMap)
  1446  }
  1447  
  1448  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1449  func (atd AudioTrackDescriptor) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
  1450  	return &atd, true
  1451  }
  1452  
  1453  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1454  func (atd AudioTrackDescriptor) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
  1455  	return &atd, true
  1456  }
  1457  
  1458  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1459  func (atd AudioTrackDescriptor) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
  1460  	return nil, false
  1461  }
  1462  
  1463  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1464  func (atd AudioTrackDescriptor) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
  1465  	return nil, false
  1466  }
  1467  
  1468  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1469  func (atd AudioTrackDescriptor) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
  1470  	return nil, false
  1471  }
  1472  
  1473  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1474  func (atd AudioTrackDescriptor) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
  1475  	return nil, false
  1476  }
  1477  
  1478  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1479  func (atd AudioTrackDescriptor) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
  1480  	return nil, false
  1481  }
  1482  
  1483  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1484  func (atd AudioTrackDescriptor) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
  1485  	return nil, false
  1486  }
  1487  
  1488  // AsTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1489  func (atd AudioTrackDescriptor) AsTrackDescriptor() (*TrackDescriptor, bool) {
  1490  	return nil, false
  1491  }
  1492  
  1493  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1494  func (atd AudioTrackDescriptor) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
  1495  	return &atd, true
  1496  }
  1497  
  1498  // AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
  1499  type AzureEntityResource struct {
  1500  	// Etag - READ-ONLY; Resource Etag.
  1501  	Etag *string `json:"etag,omitempty"`
  1502  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  1503  	ID *string `json:"id,omitempty"`
  1504  	// Name - READ-ONLY; The name of the resource
  1505  	Name *string `json:"name,omitempty"`
  1506  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  1507  	Type *string `json:"type,omitempty"`
  1508  }
  1509  
  1510  // MarshalJSON is the custom marshaler for AzureEntityResource.
  1511  func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
  1512  	objectMap := make(map[string]interface{})
  1513  	return json.Marshal(objectMap)
  1514  }
  1515  
  1516  // BuiltInStandardEncoderPreset describes a built-in preset for encoding the input video with the Standard
  1517  // Encoder.
  1518  type BuiltInStandardEncoderPreset struct {
  1519  	// Configurations - PresetConfigurations are only supported for the ContentAwareEncoding and H265ContentAwareEncoding built-in presets. These settings will not affect other built-in or custom defined presets.
  1520  	Configurations *PresetConfigurations `json:"configurations,omitempty"`
  1521  	// 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'
  1522  	PresetName EncoderNamedPreset `json:"presetName,omitempty"`
  1523  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
  1524  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
  1525  }
  1526  
  1527  // MarshalJSON is the custom marshaler for BuiltInStandardEncoderPreset.
  1528  func (bisep BuiltInStandardEncoderPreset) MarshalJSON() ([]byte, error) {
  1529  	bisep.OdataType = OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset
  1530  	objectMap := make(map[string]interface{})
  1531  	if bisep.Configurations != nil {
  1532  		objectMap["configurations"] = bisep.Configurations
  1533  	}
  1534  	if bisep.PresetName != "" {
  1535  		objectMap["presetName"] = bisep.PresetName
  1536  	}
  1537  	if bisep.OdataType != "" {
  1538  		objectMap["@odata.type"] = bisep.OdataType
  1539  	}
  1540  	return json.Marshal(objectMap)
  1541  }
  1542  
  1543  // AsFaceDetectorPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1544  func (bisep BuiltInStandardEncoderPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
  1545  	return nil, false
  1546  }
  1547  
  1548  // AsAudioAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1549  func (bisep BuiltInStandardEncoderPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
  1550  	return nil, false
  1551  }
  1552  
  1553  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1554  func (bisep BuiltInStandardEncoderPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
  1555  	return nil, false
  1556  }
  1557  
  1558  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1559  func (bisep BuiltInStandardEncoderPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
  1560  	return &bisep, true
  1561  }
  1562  
  1563  // AsStandardEncoderPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1564  func (bisep BuiltInStandardEncoderPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
  1565  	return nil, false
  1566  }
  1567  
  1568  // AsVideoAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1569  func (bisep BuiltInStandardEncoderPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
  1570  	return nil, false
  1571  }
  1572  
  1573  // AsPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1574  func (bisep BuiltInStandardEncoderPreset) AsPreset() (*Preset, bool) {
  1575  	return nil, false
  1576  }
  1577  
  1578  // AsBasicPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1579  func (bisep BuiltInStandardEncoderPreset) AsBasicPreset() (BasicPreset, bool) {
  1580  	return &bisep, true
  1581  }
  1582  
  1583  // CbcsDrmConfiguration class to specify DRM configurations of CommonEncryptionCbcs scheme in Streaming
  1584  // Policy
  1585  type CbcsDrmConfiguration struct {
  1586  	// FairPlay - FairPlay configurations
  1587  	FairPlay *StreamingPolicyFairPlayConfiguration `json:"fairPlay,omitempty"`
  1588  	// PlayReady - PlayReady configurations
  1589  	PlayReady *StreamingPolicyPlayReadyConfiguration `json:"playReady,omitempty"`
  1590  	// Widevine - Widevine configurations
  1591  	Widevine *StreamingPolicyWidevineConfiguration `json:"widevine,omitempty"`
  1592  }
  1593  
  1594  // CencDrmConfiguration class to specify DRM configurations of CommonEncryptionCenc scheme in Streaming
  1595  // Policy
  1596  type CencDrmConfiguration struct {
  1597  	// PlayReady - PlayReady configurations
  1598  	PlayReady *StreamingPolicyPlayReadyConfiguration `json:"playReady,omitempty"`
  1599  	// Widevine - Widevine configurations
  1600  	Widevine *StreamingPolicyWidevineConfiguration `json:"widevine,omitempty"`
  1601  }
  1602  
  1603  // CheckNameAvailabilityInput the input to the check name availability request.
  1604  type CheckNameAvailabilityInput struct {
  1605  	// Name - The account name.
  1606  	Name *string `json:"name,omitempty"`
  1607  	// Type - The account type. For a Media Services account, this should be 'MediaServices'.
  1608  	Type *string `json:"type,omitempty"`
  1609  }
  1610  
  1611  // BasicClipTime base class for specifying a clip time. Use sub classes of this class to specify the time position in
  1612  // the media.
  1613  type BasicClipTime interface {
  1614  	AsAbsoluteClipTime() (*AbsoluteClipTime, bool)
  1615  	AsUtcClipTime() (*UtcClipTime, bool)
  1616  	AsClipTime() (*ClipTime, bool)
  1617  }
  1618  
  1619  // ClipTime base class for specifying a clip time. Use sub classes of this class to specify the time position
  1620  // in the media.
  1621  type ClipTime struct {
  1622  	// OdataType - Possible values include: 'OdataTypeBasicClipTimeOdataTypeClipTime', 'OdataTypeBasicClipTimeOdataTypeMicrosoftMediaAbsoluteClipTime', 'OdataTypeBasicClipTimeOdataTypeMicrosoftMediaUtcClipTime'
  1623  	OdataType OdataTypeBasicClipTime `json:"@odata.type,omitempty"`
  1624  }
  1625  
  1626  func unmarshalBasicClipTime(body []byte) (BasicClipTime, error) {
  1627  	var m map[string]interface{}
  1628  	err := json.Unmarshal(body, &m)
  1629  	if err != nil {
  1630  		return nil, err
  1631  	}
  1632  
  1633  	switch m["@odata.type"] {
  1634  	case string(OdataTypeBasicClipTimeOdataTypeMicrosoftMediaAbsoluteClipTime):
  1635  		var act AbsoluteClipTime
  1636  		err := json.Unmarshal(body, &act)
  1637  		return act, err
  1638  	case string(OdataTypeBasicClipTimeOdataTypeMicrosoftMediaUtcClipTime):
  1639  		var uct UtcClipTime
  1640  		err := json.Unmarshal(body, &uct)
  1641  		return uct, err
  1642  	default:
  1643  		var ct ClipTime
  1644  		err := json.Unmarshal(body, &ct)
  1645  		return ct, err
  1646  	}
  1647  }
  1648  func unmarshalBasicClipTimeArray(body []byte) ([]BasicClipTime, error) {
  1649  	var rawMessages []*json.RawMessage
  1650  	err := json.Unmarshal(body, &rawMessages)
  1651  	if err != nil {
  1652  		return nil, err
  1653  	}
  1654  
  1655  	ctArray := make([]BasicClipTime, len(rawMessages))
  1656  
  1657  	for index, rawMessage := range rawMessages {
  1658  		ct, err := unmarshalBasicClipTime(*rawMessage)
  1659  		if err != nil {
  1660  			return nil, err
  1661  		}
  1662  		ctArray[index] = ct
  1663  	}
  1664  	return ctArray, nil
  1665  }
  1666  
  1667  // MarshalJSON is the custom marshaler for ClipTime.
  1668  func (ct ClipTime) MarshalJSON() ([]byte, error) {
  1669  	ct.OdataType = OdataTypeBasicClipTimeOdataTypeClipTime
  1670  	objectMap := make(map[string]interface{})
  1671  	if ct.OdataType != "" {
  1672  		objectMap["@odata.type"] = ct.OdataType
  1673  	}
  1674  	return json.Marshal(objectMap)
  1675  }
  1676  
  1677  // AsAbsoluteClipTime is the BasicClipTime implementation for ClipTime.
  1678  func (ct ClipTime) AsAbsoluteClipTime() (*AbsoluteClipTime, bool) {
  1679  	return nil, false
  1680  }
  1681  
  1682  // AsUtcClipTime is the BasicClipTime implementation for ClipTime.
  1683  func (ct ClipTime) AsUtcClipTime() (*UtcClipTime, bool) {
  1684  	return nil, false
  1685  }
  1686  
  1687  // AsClipTime is the BasicClipTime implementation for ClipTime.
  1688  func (ct ClipTime) AsClipTime() (*ClipTime, bool) {
  1689  	return &ct, true
  1690  }
  1691  
  1692  // AsBasicClipTime is the BasicClipTime implementation for ClipTime.
  1693  func (ct ClipTime) AsBasicClipTime() (BasicClipTime, bool) {
  1694  	return &ct, true
  1695  }
  1696  
  1697  // BasicCodec describes the basic properties of all codecs.
  1698  type BasicCodec interface {
  1699  	AsAudio() (*Audio, bool)
  1700  	AsBasicAudio() (BasicAudio, bool)
  1701  	AsAacAudio() (*AacAudio, bool)
  1702  	AsVideo() (*Video, bool)
  1703  	AsBasicVideo() (BasicVideo, bool)
  1704  	AsH265Video() (*H265Video, bool)
  1705  	AsCopyVideo() (*CopyVideo, bool)
  1706  	AsImage() (*Image, bool)
  1707  	AsBasicImage() (BasicImage, bool)
  1708  	AsCopyAudio() (*CopyAudio, bool)
  1709  	AsH264Video() (*H264Video, bool)
  1710  	AsJpgImage() (*JpgImage, bool)
  1711  	AsPngImage() (*PngImage, bool)
  1712  	AsCodec() (*Codec, bool)
  1713  }
  1714  
  1715  // Codec describes the basic properties of all codecs.
  1716  type Codec struct {
  1717  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  1718  	Label *string `json:"label,omitempty"`
  1719  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  1720  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  1721  }
  1722  
  1723  func unmarshalBasicCodec(body []byte) (BasicCodec, error) {
  1724  	var m map[string]interface{}
  1725  	err := json.Unmarshal(body, &m)
  1726  	if err != nil {
  1727  		return nil, err
  1728  	}
  1729  
  1730  	switch m["@odata.type"] {
  1731  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio):
  1732  		var a Audio
  1733  		err := json.Unmarshal(body, &a)
  1734  		return a, err
  1735  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio):
  1736  		var aa AacAudio
  1737  		err := json.Unmarshal(body, &aa)
  1738  		return aa, err
  1739  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo):
  1740  		var vVar Video
  1741  		err := json.Unmarshal(body, &vVar)
  1742  		return vVar, err
  1743  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video):
  1744  		var hv H265Video
  1745  		err := json.Unmarshal(body, &hv)
  1746  		return hv, err
  1747  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo):
  1748  		var cv CopyVideo
  1749  		err := json.Unmarshal(body, &cv)
  1750  		return cv, err
  1751  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaImage):
  1752  		var i Image
  1753  		err := json.Unmarshal(body, &i)
  1754  		return i, err
  1755  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio):
  1756  		var ca CopyAudio
  1757  		err := json.Unmarshal(body, &ca)
  1758  		return ca, err
  1759  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video):
  1760  		var hv H264Video
  1761  		err := json.Unmarshal(body, &hv)
  1762  		return hv, err
  1763  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage):
  1764  		var ji JpgImage
  1765  		err := json.Unmarshal(body, &ji)
  1766  		return ji, err
  1767  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage):
  1768  		var pi PngImage
  1769  		err := json.Unmarshal(body, &pi)
  1770  		return pi, err
  1771  	default:
  1772  		var c Codec
  1773  		err := json.Unmarshal(body, &c)
  1774  		return c, err
  1775  	}
  1776  }
  1777  func unmarshalBasicCodecArray(body []byte) ([]BasicCodec, error) {
  1778  	var rawMessages []*json.RawMessage
  1779  	err := json.Unmarshal(body, &rawMessages)
  1780  	if err != nil {
  1781  		return nil, err
  1782  	}
  1783  
  1784  	cArray := make([]BasicCodec, len(rawMessages))
  1785  
  1786  	for index, rawMessage := range rawMessages {
  1787  		c, err := unmarshalBasicCodec(*rawMessage)
  1788  		if err != nil {
  1789  			return nil, err
  1790  		}
  1791  		cArray[index] = c
  1792  	}
  1793  	return cArray, nil
  1794  }
  1795  
  1796  // MarshalJSON is the custom marshaler for Codec.
  1797  func (c Codec) MarshalJSON() ([]byte, error) {
  1798  	c.OdataType = OdataTypeBasicCodecOdataTypeCodec
  1799  	objectMap := make(map[string]interface{})
  1800  	if c.Label != nil {
  1801  		objectMap["label"] = c.Label
  1802  	}
  1803  	if c.OdataType != "" {
  1804  		objectMap["@odata.type"] = c.OdataType
  1805  	}
  1806  	return json.Marshal(objectMap)
  1807  }
  1808  
  1809  // AsAudio is the BasicCodec implementation for Codec.
  1810  func (c Codec) AsAudio() (*Audio, bool) {
  1811  	return nil, false
  1812  }
  1813  
  1814  // AsBasicAudio is the BasicCodec implementation for Codec.
  1815  func (c Codec) AsBasicAudio() (BasicAudio, bool) {
  1816  	return nil, false
  1817  }
  1818  
  1819  // AsAacAudio is the BasicCodec implementation for Codec.
  1820  func (c Codec) AsAacAudio() (*AacAudio, bool) {
  1821  	return nil, false
  1822  }
  1823  
  1824  // AsVideo is the BasicCodec implementation for Codec.
  1825  func (c Codec) AsVideo() (*Video, bool) {
  1826  	return nil, false
  1827  }
  1828  
  1829  // AsBasicVideo is the BasicCodec implementation for Codec.
  1830  func (c Codec) AsBasicVideo() (BasicVideo, bool) {
  1831  	return nil, false
  1832  }
  1833  
  1834  // AsH265Video is the BasicCodec implementation for Codec.
  1835  func (c Codec) AsH265Video() (*H265Video, bool) {
  1836  	return nil, false
  1837  }
  1838  
  1839  // AsCopyVideo is the BasicCodec implementation for Codec.
  1840  func (c Codec) AsCopyVideo() (*CopyVideo, bool) {
  1841  	return nil, false
  1842  }
  1843  
  1844  // AsImage is the BasicCodec implementation for Codec.
  1845  func (c Codec) AsImage() (*Image, bool) {
  1846  	return nil, false
  1847  }
  1848  
  1849  // AsBasicImage is the BasicCodec implementation for Codec.
  1850  func (c Codec) AsBasicImage() (BasicImage, bool) {
  1851  	return nil, false
  1852  }
  1853  
  1854  // AsCopyAudio is the BasicCodec implementation for Codec.
  1855  func (c Codec) AsCopyAudio() (*CopyAudio, bool) {
  1856  	return nil, false
  1857  }
  1858  
  1859  // AsH264Video is the BasicCodec implementation for Codec.
  1860  func (c Codec) AsH264Video() (*H264Video, bool) {
  1861  	return nil, false
  1862  }
  1863  
  1864  // AsJpgImage is the BasicCodec implementation for Codec.
  1865  func (c Codec) AsJpgImage() (*JpgImage, bool) {
  1866  	return nil, false
  1867  }
  1868  
  1869  // AsPngImage is the BasicCodec implementation for Codec.
  1870  func (c Codec) AsPngImage() (*PngImage, bool) {
  1871  	return nil, false
  1872  }
  1873  
  1874  // AsCodec is the BasicCodec implementation for Codec.
  1875  func (c Codec) AsCodec() (*Codec, bool) {
  1876  	return &c, true
  1877  }
  1878  
  1879  // AsBasicCodec is the BasicCodec implementation for Codec.
  1880  func (c Codec) AsBasicCodec() (BasicCodec, bool) {
  1881  	return &c, true
  1882  }
  1883  
  1884  // CommonEncryptionCbcs class for CommonEncryptionCbcs encryption scheme
  1885  type CommonEncryptionCbcs struct {
  1886  	// EnabledProtocols - Representing supported protocols
  1887  	EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
  1888  	// ClearTracks - Representing which tracks should not be encrypted
  1889  	ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"`
  1890  	// ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks
  1891  	ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"`
  1892  	// Drm - Configuration of DRMs for current encryption scheme
  1893  	Drm *CbcsDrmConfiguration `json:"drm,omitempty"`
  1894  }
  1895  
  1896  // CommonEncryptionCenc class for envelope encryption scheme
  1897  type CommonEncryptionCenc struct {
  1898  	// EnabledProtocols - Representing supported protocols
  1899  	EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
  1900  	// ClearTracks - Representing which tracks should not be encrypted
  1901  	ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"`
  1902  	// ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks
  1903  	ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"`
  1904  	// Drm - Configuration of DRMs for CommonEncryptionCenc encryption scheme
  1905  	Drm *CencDrmConfiguration `json:"drm,omitempty"`
  1906  }
  1907  
  1908  // ContentKeyPolicy a Content Key Policy resource.
  1909  type ContentKeyPolicy struct {
  1910  	autorest.Response           `json:"-"`
  1911  	*ContentKeyPolicyProperties `json:"properties,omitempty"`
  1912  	// SystemData - READ-ONLY; The system metadata relating to this resource.
  1913  	SystemData *SystemData `json:"systemData,omitempty"`
  1914  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  1915  	ID *string `json:"id,omitempty"`
  1916  	// Name - READ-ONLY; The name of the resource
  1917  	Name *string `json:"name,omitempty"`
  1918  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  1919  	Type *string `json:"type,omitempty"`
  1920  }
  1921  
  1922  // MarshalJSON is the custom marshaler for ContentKeyPolicy.
  1923  func (ckp ContentKeyPolicy) MarshalJSON() ([]byte, error) {
  1924  	objectMap := make(map[string]interface{})
  1925  	if ckp.ContentKeyPolicyProperties != nil {
  1926  		objectMap["properties"] = ckp.ContentKeyPolicyProperties
  1927  	}
  1928  	return json.Marshal(objectMap)
  1929  }
  1930  
  1931  // UnmarshalJSON is the custom unmarshaler for ContentKeyPolicy struct.
  1932  func (ckp *ContentKeyPolicy) UnmarshalJSON(body []byte) error {
  1933  	var m map[string]*json.RawMessage
  1934  	err := json.Unmarshal(body, &m)
  1935  	if err != nil {
  1936  		return err
  1937  	}
  1938  	for k, v := range m {
  1939  		switch k {
  1940  		case "properties":
  1941  			if v != nil {
  1942  				var contentKeyPolicyProperties ContentKeyPolicyProperties
  1943  				err = json.Unmarshal(*v, &contentKeyPolicyProperties)
  1944  				if err != nil {
  1945  					return err
  1946  				}
  1947  				ckp.ContentKeyPolicyProperties = &contentKeyPolicyProperties
  1948  			}
  1949  		case "systemData":
  1950  			if v != nil {
  1951  				var systemData SystemData
  1952  				err = json.Unmarshal(*v, &systemData)
  1953  				if err != nil {
  1954  					return err
  1955  				}
  1956  				ckp.SystemData = &systemData
  1957  			}
  1958  		case "id":
  1959  			if v != nil {
  1960  				var ID string
  1961  				err = json.Unmarshal(*v, &ID)
  1962  				if err != nil {
  1963  					return err
  1964  				}
  1965  				ckp.ID = &ID
  1966  			}
  1967  		case "name":
  1968  			if v != nil {
  1969  				var name string
  1970  				err = json.Unmarshal(*v, &name)
  1971  				if err != nil {
  1972  					return err
  1973  				}
  1974  				ckp.Name = &name
  1975  			}
  1976  		case "type":
  1977  			if v != nil {
  1978  				var typeVar string
  1979  				err = json.Unmarshal(*v, &typeVar)
  1980  				if err != nil {
  1981  					return err
  1982  				}
  1983  				ckp.Type = &typeVar
  1984  			}
  1985  		}
  1986  	}
  1987  
  1988  	return nil
  1989  }
  1990  
  1991  // ContentKeyPolicyClearKeyConfiguration represents a configuration for non-DRM keys.
  1992  type ContentKeyPolicyClearKeyConfiguration struct {
  1993  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  1994  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  1995  }
  1996  
  1997  // MarshalJSON is the custom marshaler for ContentKeyPolicyClearKeyConfiguration.
  1998  func (ckpckc ContentKeyPolicyClearKeyConfiguration) MarshalJSON() ([]byte, error) {
  1999  	ckpckc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration
  2000  	objectMap := make(map[string]interface{})
  2001  	if ckpckc.OdataType != "" {
  2002  		objectMap["@odata.type"] = ckpckc.OdataType
  2003  	}
  2004  	return json.Marshal(objectMap)
  2005  }
  2006  
  2007  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2008  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  2009  	return &ckpckc, true
  2010  }
  2011  
  2012  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2013  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  2014  	return nil, false
  2015  }
  2016  
  2017  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2018  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  2019  	return nil, false
  2020  }
  2021  
  2022  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2023  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  2024  	return nil, false
  2025  }
  2026  
  2027  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2028  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  2029  	return nil, false
  2030  }
  2031  
  2032  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2033  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  2034  	return nil, false
  2035  }
  2036  
  2037  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2038  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  2039  	return &ckpckc, true
  2040  }
  2041  
  2042  // ContentKeyPolicyCollection a collection of ContentKeyPolicy items.
  2043  type ContentKeyPolicyCollection struct {
  2044  	autorest.Response `json:"-"`
  2045  	// Value - A collection of ContentKeyPolicy items.
  2046  	Value *[]ContentKeyPolicy `json:"value,omitempty"`
  2047  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
  2048  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
  2049  }
  2050  
  2051  // ContentKeyPolicyCollectionIterator provides access to a complete listing of ContentKeyPolicy values.
  2052  type ContentKeyPolicyCollectionIterator struct {
  2053  	i    int
  2054  	page ContentKeyPolicyCollectionPage
  2055  }
  2056  
  2057  // NextWithContext advances to the next value.  If there was an error making
  2058  // the request the iterator does not advance and the error is returned.
  2059  func (iter *ContentKeyPolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) {
  2060  	if tracing.IsEnabled() {
  2061  		ctx = tracing.StartSpan(ctx, fqdn+"/ContentKeyPolicyCollectionIterator.NextWithContext")
  2062  		defer func() {
  2063  			sc := -1
  2064  			if iter.Response().Response.Response != nil {
  2065  				sc = iter.Response().Response.Response.StatusCode
  2066  			}
  2067  			tracing.EndSpan(ctx, sc, err)
  2068  		}()
  2069  	}
  2070  	iter.i++
  2071  	if iter.i < len(iter.page.Values()) {
  2072  		return nil
  2073  	}
  2074  	err = iter.page.NextWithContext(ctx)
  2075  	if err != nil {
  2076  		iter.i--
  2077  		return err
  2078  	}
  2079  	iter.i = 0
  2080  	return nil
  2081  }
  2082  
  2083  // Next advances to the next value.  If there was an error making
  2084  // the request the iterator does not advance and the error is returned.
  2085  // Deprecated: Use NextWithContext() instead.
  2086  func (iter *ContentKeyPolicyCollectionIterator) Next() error {
  2087  	return iter.NextWithContext(context.Background())
  2088  }
  2089  
  2090  // NotDone returns true if the enumeration should be started or is not yet complete.
  2091  func (iter ContentKeyPolicyCollectionIterator) NotDone() bool {
  2092  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  2093  }
  2094  
  2095  // Response returns the raw server response from the last page request.
  2096  func (iter ContentKeyPolicyCollectionIterator) Response() ContentKeyPolicyCollection {
  2097  	return iter.page.Response()
  2098  }
  2099  
  2100  // Value returns the current value or a zero-initialized value if the
  2101  // iterator has advanced beyond the end of the collection.
  2102  func (iter ContentKeyPolicyCollectionIterator) Value() ContentKeyPolicy {
  2103  	if !iter.page.NotDone() {
  2104  		return ContentKeyPolicy{}
  2105  	}
  2106  	return iter.page.Values()[iter.i]
  2107  }
  2108  
  2109  // Creates a new instance of the ContentKeyPolicyCollectionIterator type.
  2110  func NewContentKeyPolicyCollectionIterator(page ContentKeyPolicyCollectionPage) ContentKeyPolicyCollectionIterator {
  2111  	return ContentKeyPolicyCollectionIterator{page: page}
  2112  }
  2113  
  2114  // IsEmpty returns true if the ListResult contains no values.
  2115  func (ckpc ContentKeyPolicyCollection) IsEmpty() bool {
  2116  	return ckpc.Value == nil || len(*ckpc.Value) == 0
  2117  }
  2118  
  2119  // hasNextLink returns true if the NextLink is not empty.
  2120  func (ckpc ContentKeyPolicyCollection) hasNextLink() bool {
  2121  	return ckpc.OdataNextLink != nil && len(*ckpc.OdataNextLink) != 0
  2122  }
  2123  
  2124  // contentKeyPolicyCollectionPreparer prepares a request to retrieve the next set of results.
  2125  // It returns nil if no more results exist.
  2126  func (ckpc ContentKeyPolicyCollection) contentKeyPolicyCollectionPreparer(ctx context.Context) (*http.Request, error) {
  2127  	if !ckpc.hasNextLink() {
  2128  		return nil, nil
  2129  	}
  2130  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  2131  		autorest.AsJSON(),
  2132  		autorest.AsGet(),
  2133  		autorest.WithBaseURL(to.String(ckpc.OdataNextLink)))
  2134  }
  2135  
  2136  // ContentKeyPolicyCollectionPage contains a page of ContentKeyPolicy values.
  2137  type ContentKeyPolicyCollectionPage struct {
  2138  	fn   func(context.Context, ContentKeyPolicyCollection) (ContentKeyPolicyCollection, error)
  2139  	ckpc ContentKeyPolicyCollection
  2140  }
  2141  
  2142  // NextWithContext advances to the next page of values.  If there was an error making
  2143  // the request the page does not advance and the error is returned.
  2144  func (page *ContentKeyPolicyCollectionPage) NextWithContext(ctx context.Context) (err error) {
  2145  	if tracing.IsEnabled() {
  2146  		ctx = tracing.StartSpan(ctx, fqdn+"/ContentKeyPolicyCollectionPage.NextWithContext")
  2147  		defer func() {
  2148  			sc := -1
  2149  			if page.Response().Response.Response != nil {
  2150  				sc = page.Response().Response.Response.StatusCode
  2151  			}
  2152  			tracing.EndSpan(ctx, sc, err)
  2153  		}()
  2154  	}
  2155  	for {
  2156  		next, err := page.fn(ctx, page.ckpc)
  2157  		if err != nil {
  2158  			return err
  2159  		}
  2160  		page.ckpc = next
  2161  		if !next.hasNextLink() || !next.IsEmpty() {
  2162  			break
  2163  		}
  2164  	}
  2165  	return nil
  2166  }
  2167  
  2168  // Next advances to the next page of values.  If there was an error making
  2169  // the request the page does not advance and the error is returned.
  2170  // Deprecated: Use NextWithContext() instead.
  2171  func (page *ContentKeyPolicyCollectionPage) Next() error {
  2172  	return page.NextWithContext(context.Background())
  2173  }
  2174  
  2175  // NotDone returns true if the page enumeration should be started or is not yet complete.
  2176  func (page ContentKeyPolicyCollectionPage) NotDone() bool {
  2177  	return !page.ckpc.IsEmpty()
  2178  }
  2179  
  2180  // Response returns the raw server response from the last page request.
  2181  func (page ContentKeyPolicyCollectionPage) Response() ContentKeyPolicyCollection {
  2182  	return page.ckpc
  2183  }
  2184  
  2185  // Values returns the slice of values for the current page or nil if there are no values.
  2186  func (page ContentKeyPolicyCollectionPage) Values() []ContentKeyPolicy {
  2187  	if page.ckpc.IsEmpty() {
  2188  		return nil
  2189  	}
  2190  	return *page.ckpc.Value
  2191  }
  2192  
  2193  // Creates a new instance of the ContentKeyPolicyCollectionPage type.
  2194  func NewContentKeyPolicyCollectionPage(cur ContentKeyPolicyCollection, getNextPage func(context.Context, ContentKeyPolicyCollection) (ContentKeyPolicyCollection, error)) ContentKeyPolicyCollectionPage {
  2195  	return ContentKeyPolicyCollectionPage{
  2196  		fn:   getNextPage,
  2197  		ckpc: cur,
  2198  	}
  2199  }
  2200  
  2201  // BasicContentKeyPolicyConfiguration base class for Content Key Policy configuration. A derived class must be used to
  2202  // create a configuration.
  2203  type BasicContentKeyPolicyConfiguration interface {
  2204  	AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool)
  2205  	AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool)
  2206  	AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool)
  2207  	AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool)
  2208  	AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool)
  2209  	AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool)
  2210  }
  2211  
  2212  // ContentKeyPolicyConfiguration base class for Content Key Policy configuration. A derived class must be used
  2213  // to create a configuration.
  2214  type ContentKeyPolicyConfiguration struct {
  2215  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  2216  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  2217  }
  2218  
  2219  func unmarshalBasicContentKeyPolicyConfiguration(body []byte) (BasicContentKeyPolicyConfiguration, error) {
  2220  	var m map[string]interface{}
  2221  	err := json.Unmarshal(body, &m)
  2222  	if err != nil {
  2223  		return nil, err
  2224  	}
  2225  
  2226  	switch m["@odata.type"] {
  2227  	case string(OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration):
  2228  		var ckpckc ContentKeyPolicyClearKeyConfiguration
  2229  		err := json.Unmarshal(body, &ckpckc)
  2230  		return ckpckc, err
  2231  	case string(OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration):
  2232  		var ckpuc ContentKeyPolicyUnknownConfiguration
  2233  		err := json.Unmarshal(body, &ckpuc)
  2234  		return ckpuc, err
  2235  	case string(OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration):
  2236  		var ckpwc ContentKeyPolicyWidevineConfiguration
  2237  		err := json.Unmarshal(body, &ckpwc)
  2238  		return ckpwc, err
  2239  	case string(OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration):
  2240  		var ckpprc ContentKeyPolicyPlayReadyConfiguration
  2241  		err := json.Unmarshal(body, &ckpprc)
  2242  		return ckpprc, err
  2243  	case string(OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration):
  2244  		var ckpfpc ContentKeyPolicyFairPlayConfiguration
  2245  		err := json.Unmarshal(body, &ckpfpc)
  2246  		return ckpfpc, err
  2247  	default:
  2248  		var ckpc ContentKeyPolicyConfiguration
  2249  		err := json.Unmarshal(body, &ckpc)
  2250  		return ckpc, err
  2251  	}
  2252  }
  2253  func unmarshalBasicContentKeyPolicyConfigurationArray(body []byte) ([]BasicContentKeyPolicyConfiguration, error) {
  2254  	var rawMessages []*json.RawMessage
  2255  	err := json.Unmarshal(body, &rawMessages)
  2256  	if err != nil {
  2257  		return nil, err
  2258  	}
  2259  
  2260  	ckpcArray := make([]BasicContentKeyPolicyConfiguration, len(rawMessages))
  2261  
  2262  	for index, rawMessage := range rawMessages {
  2263  		ckpc, err := unmarshalBasicContentKeyPolicyConfiguration(*rawMessage)
  2264  		if err != nil {
  2265  			return nil, err
  2266  		}
  2267  		ckpcArray[index] = ckpc
  2268  	}
  2269  	return ckpcArray, nil
  2270  }
  2271  
  2272  // MarshalJSON is the custom marshaler for ContentKeyPolicyConfiguration.
  2273  func (ckpc ContentKeyPolicyConfiguration) MarshalJSON() ([]byte, error) {
  2274  	ckpc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration
  2275  	objectMap := make(map[string]interface{})
  2276  	if ckpc.OdataType != "" {
  2277  		objectMap["@odata.type"] = ckpc.OdataType
  2278  	}
  2279  	return json.Marshal(objectMap)
  2280  }
  2281  
  2282  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2283  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  2284  	return nil, false
  2285  }
  2286  
  2287  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2288  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  2289  	return nil, false
  2290  }
  2291  
  2292  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2293  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  2294  	return nil, false
  2295  }
  2296  
  2297  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2298  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  2299  	return nil, false
  2300  }
  2301  
  2302  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2303  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  2304  	return nil, false
  2305  }
  2306  
  2307  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2308  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  2309  	return &ckpc, true
  2310  }
  2311  
  2312  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2313  func (ckpc ContentKeyPolicyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  2314  	return &ckpc, true
  2315  }
  2316  
  2317  // ContentKeyPolicyFairPlayConfiguration specifies a configuration for FairPlay licenses.
  2318  type ContentKeyPolicyFairPlayConfiguration struct {
  2319  	// Ask - The key that must be used as FairPlay Application Secret key.
  2320  	Ask *[]byte `json:"ask,omitempty"`
  2321  	// FairPlayPfxPassword - The password encrypting FairPlay certificate in PKCS 12 (pfx) format.
  2322  	FairPlayPfxPassword *string `json:"fairPlayPfxPassword,omitempty"`
  2323  	// FairPlayPfx - The Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key).
  2324  	FairPlayPfx *string `json:"fairPlayPfx,omitempty"`
  2325  	// RentalAndLeaseKeyType - The rental and lease key type. Possible values include: 'ContentKeyPolicyFairPlayRentalAndLeaseKeyTypeUnknown', 'ContentKeyPolicyFairPlayRentalAndLeaseKeyTypeUndefined', 'ContentKeyPolicyFairPlayRentalAndLeaseKeyTypeDualExpiry', 'ContentKeyPolicyFairPlayRentalAndLeaseKeyTypePersistentUnlimited', 'ContentKeyPolicyFairPlayRentalAndLeaseKeyTypePersistentLimited'
  2326  	RentalAndLeaseKeyType ContentKeyPolicyFairPlayRentalAndLeaseKeyType `json:"rentalAndLeaseKeyType,omitempty"`
  2327  	// RentalDuration - The rental duration. Must be greater than or equal to 0.
  2328  	RentalDuration *int64 `json:"rentalDuration,omitempty"`
  2329  	// OfflineRentalConfiguration - Offline rental policy
  2330  	OfflineRentalConfiguration *ContentKeyPolicyFairPlayOfflineRentalConfiguration `json:"offlineRentalConfiguration,omitempty"`
  2331  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  2332  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  2333  }
  2334  
  2335  // MarshalJSON is the custom marshaler for ContentKeyPolicyFairPlayConfiguration.
  2336  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) MarshalJSON() ([]byte, error) {
  2337  	ckpfpc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration
  2338  	objectMap := make(map[string]interface{})
  2339  	if ckpfpc.Ask != nil {
  2340  		objectMap["ask"] = ckpfpc.Ask
  2341  	}
  2342  	if ckpfpc.FairPlayPfxPassword != nil {
  2343  		objectMap["fairPlayPfxPassword"] = ckpfpc.FairPlayPfxPassword
  2344  	}
  2345  	if ckpfpc.FairPlayPfx != nil {
  2346  		objectMap["fairPlayPfx"] = ckpfpc.FairPlayPfx
  2347  	}
  2348  	if ckpfpc.RentalAndLeaseKeyType != "" {
  2349  		objectMap["rentalAndLeaseKeyType"] = ckpfpc.RentalAndLeaseKeyType
  2350  	}
  2351  	if ckpfpc.RentalDuration != nil {
  2352  		objectMap["rentalDuration"] = ckpfpc.RentalDuration
  2353  	}
  2354  	if ckpfpc.OfflineRentalConfiguration != nil {
  2355  		objectMap["offlineRentalConfiguration"] = ckpfpc.OfflineRentalConfiguration
  2356  	}
  2357  	if ckpfpc.OdataType != "" {
  2358  		objectMap["@odata.type"] = ckpfpc.OdataType
  2359  	}
  2360  	return json.Marshal(objectMap)
  2361  }
  2362  
  2363  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2364  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  2365  	return nil, false
  2366  }
  2367  
  2368  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2369  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  2370  	return nil, false
  2371  }
  2372  
  2373  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2374  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  2375  	return nil, false
  2376  }
  2377  
  2378  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2379  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  2380  	return nil, false
  2381  }
  2382  
  2383  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2384  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  2385  	return &ckpfpc, true
  2386  }
  2387  
  2388  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2389  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  2390  	return nil, false
  2391  }
  2392  
  2393  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2394  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  2395  	return &ckpfpc, true
  2396  }
  2397  
  2398  // ContentKeyPolicyFairPlayOfflineRentalConfiguration ...
  2399  type ContentKeyPolicyFairPlayOfflineRentalConfiguration struct {
  2400  	// PlaybackDurationSeconds - Playback duration
  2401  	PlaybackDurationSeconds *int64 `json:"playbackDurationSeconds,omitempty"`
  2402  	// StorageDurationSeconds - Storage duration
  2403  	StorageDurationSeconds *int64 `json:"storageDurationSeconds,omitempty"`
  2404  }
  2405  
  2406  // ContentKeyPolicyOpenRestriction represents an open restriction. License or key will be delivered on
  2407  // every request.
  2408  type ContentKeyPolicyOpenRestriction struct {
  2409  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeContentKeyPolicyRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction'
  2410  	OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
  2411  }
  2412  
  2413  // MarshalJSON is the custom marshaler for ContentKeyPolicyOpenRestriction.
  2414  func (ckpor ContentKeyPolicyOpenRestriction) MarshalJSON() ([]byte, error) {
  2415  	ckpor.OdataType = OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction
  2416  	objectMap := make(map[string]interface{})
  2417  	if ckpor.OdataType != "" {
  2418  		objectMap["@odata.type"] = ckpor.OdataType
  2419  	}
  2420  	return json.Marshal(objectMap)
  2421  }
  2422  
  2423  // AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
  2424  func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
  2425  	return &ckpor, true
  2426  }
  2427  
  2428  // AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
  2429  func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
  2430  	return nil, false
  2431  }
  2432  
  2433  // AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
  2434  func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
  2435  	return nil, false
  2436  }
  2437  
  2438  // AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
  2439  func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
  2440  	return nil, false
  2441  }
  2442  
  2443  // AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
  2444  func (ckpor ContentKeyPolicyOpenRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
  2445  	return &ckpor, true
  2446  }
  2447  
  2448  // ContentKeyPolicyOption represents a policy option.
  2449  type ContentKeyPolicyOption struct {
  2450  	// PolicyOptionID - READ-ONLY; The legacy Policy Option ID.
  2451  	PolicyOptionID *uuid.UUID `json:"policyOptionId,omitempty"`
  2452  	// Name - The Policy Option description.
  2453  	Name *string `json:"name,omitempty"`
  2454  	// Configuration - The key delivery configuration.
  2455  	Configuration BasicContentKeyPolicyConfiguration `json:"configuration,omitempty"`
  2456  	// Restriction - The requirements that must be met to deliver keys with this configuration
  2457  	Restriction BasicContentKeyPolicyRestriction `json:"restriction,omitempty"`
  2458  }
  2459  
  2460  // MarshalJSON is the custom marshaler for ContentKeyPolicyOption.
  2461  func (ckpo ContentKeyPolicyOption) MarshalJSON() ([]byte, error) {
  2462  	objectMap := make(map[string]interface{})
  2463  	if ckpo.Name != nil {
  2464  		objectMap["name"] = ckpo.Name
  2465  	}
  2466  	objectMap["configuration"] = ckpo.Configuration
  2467  	objectMap["restriction"] = ckpo.Restriction
  2468  	return json.Marshal(objectMap)
  2469  }
  2470  
  2471  // UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyOption struct.
  2472  func (ckpo *ContentKeyPolicyOption) UnmarshalJSON(body []byte) error {
  2473  	var m map[string]*json.RawMessage
  2474  	err := json.Unmarshal(body, &m)
  2475  	if err != nil {
  2476  		return err
  2477  	}
  2478  	for k, v := range m {
  2479  		switch k {
  2480  		case "policyOptionId":
  2481  			if v != nil {
  2482  				var policyOptionID uuid.UUID
  2483  				err = json.Unmarshal(*v, &policyOptionID)
  2484  				if err != nil {
  2485  					return err
  2486  				}
  2487  				ckpo.PolicyOptionID = &policyOptionID
  2488  			}
  2489  		case "name":
  2490  			if v != nil {
  2491  				var name string
  2492  				err = json.Unmarshal(*v, &name)
  2493  				if err != nil {
  2494  					return err
  2495  				}
  2496  				ckpo.Name = &name
  2497  			}
  2498  		case "configuration":
  2499  			if v != nil {
  2500  				configuration, err := unmarshalBasicContentKeyPolicyConfiguration(*v)
  2501  				if err != nil {
  2502  					return err
  2503  				}
  2504  				ckpo.Configuration = configuration
  2505  			}
  2506  		case "restriction":
  2507  			if v != nil {
  2508  				restriction, err := unmarshalBasicContentKeyPolicyRestriction(*v)
  2509  				if err != nil {
  2510  					return err
  2511  				}
  2512  				ckpo.Restriction = restriction
  2513  			}
  2514  		}
  2515  	}
  2516  
  2517  	return nil
  2518  }
  2519  
  2520  // ContentKeyPolicyPlayReadyConfiguration specifies a configuration for PlayReady licenses.
  2521  type ContentKeyPolicyPlayReadyConfiguration struct {
  2522  	// Licenses - The PlayReady licenses.
  2523  	Licenses *[]ContentKeyPolicyPlayReadyLicense `json:"licenses,omitempty"`
  2524  	// ResponseCustomData - The custom response data.
  2525  	ResponseCustomData *string `json:"responseCustomData,omitempty"`
  2526  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  2527  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  2528  }
  2529  
  2530  // MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyConfiguration.
  2531  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) MarshalJSON() ([]byte, error) {
  2532  	ckpprc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration
  2533  	objectMap := make(map[string]interface{})
  2534  	if ckpprc.Licenses != nil {
  2535  		objectMap["licenses"] = ckpprc.Licenses
  2536  	}
  2537  	if ckpprc.ResponseCustomData != nil {
  2538  		objectMap["responseCustomData"] = ckpprc.ResponseCustomData
  2539  	}
  2540  	if ckpprc.OdataType != "" {
  2541  		objectMap["@odata.type"] = ckpprc.OdataType
  2542  	}
  2543  	return json.Marshal(objectMap)
  2544  }
  2545  
  2546  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2547  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  2548  	return nil, false
  2549  }
  2550  
  2551  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2552  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  2553  	return nil, false
  2554  }
  2555  
  2556  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2557  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  2558  	return nil, false
  2559  }
  2560  
  2561  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2562  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  2563  	return &ckpprc, true
  2564  }
  2565  
  2566  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2567  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  2568  	return nil, false
  2569  }
  2570  
  2571  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2572  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  2573  	return nil, false
  2574  }
  2575  
  2576  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2577  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  2578  	return &ckpprc, true
  2579  }
  2580  
  2581  // ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader specifies that the content key ID is in the
  2582  // PlayReady header.
  2583  type ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader struct {
  2584  	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier'
  2585  	OdataType OdataType `json:"@odata.type,omitempty"`
  2586  }
  2587  
  2588  // MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
  2589  func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) MarshalJSON() ([]byte, error) {
  2590  	ckpprcekfh.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader
  2591  	objectMap := make(map[string]interface{})
  2592  	if ckpprcekfh.OdataType != "" {
  2593  		objectMap["@odata.type"] = ckpprcekfh.OdataType
  2594  	}
  2595  	return json.Marshal(objectMap)
  2596  }
  2597  
  2598  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
  2599  func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) {
  2600  	return &ckpprcekfh, true
  2601  }
  2602  
  2603  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
  2604  func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) {
  2605  	return nil, false
  2606  }
  2607  
  2608  // AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
  2609  func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2610  	return nil, false
  2611  }
  2612  
  2613  // AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
  2614  func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2615  	return &ckpprcekfh, true
  2616  }
  2617  
  2618  // ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier specifies that the content key ID is
  2619  // specified in the PlayReady configuration.
  2620  type ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier struct {
  2621  	// KeyID - The content key ID.
  2622  	KeyID *uuid.UUID `json:"keyId,omitempty"`
  2623  	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier'
  2624  	OdataType OdataType `json:"@odata.type,omitempty"`
  2625  }
  2626  
  2627  // MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
  2628  func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) MarshalJSON() ([]byte, error) {
  2629  	ckpprcekfki.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier
  2630  	objectMap := make(map[string]interface{})
  2631  	if ckpprcekfki.KeyID != nil {
  2632  		objectMap["keyId"] = ckpprcekfki.KeyID
  2633  	}
  2634  	if ckpprcekfki.OdataType != "" {
  2635  		objectMap["@odata.type"] = ckpprcekfki.OdataType
  2636  	}
  2637  	return json.Marshal(objectMap)
  2638  }
  2639  
  2640  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
  2641  func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) {
  2642  	return nil, false
  2643  }
  2644  
  2645  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
  2646  func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) {
  2647  	return &ckpprcekfki, true
  2648  }
  2649  
  2650  // AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
  2651  func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2652  	return nil, false
  2653  }
  2654  
  2655  // AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
  2656  func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2657  	return &ckpprcekfki, true
  2658  }
  2659  
  2660  // BasicContentKeyPolicyPlayReadyContentKeyLocation base class for content key ID location. A derived class must be
  2661  // used to represent the location.
  2662  type BasicContentKeyPolicyPlayReadyContentKeyLocation interface {
  2663  	AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool)
  2664  	AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool)
  2665  	AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool)
  2666  }
  2667  
  2668  // ContentKeyPolicyPlayReadyContentKeyLocation base class for content key ID location. A derived class must be
  2669  // used to represent the location.
  2670  type ContentKeyPolicyPlayReadyContentKeyLocation struct {
  2671  	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier'
  2672  	OdataType OdataType `json:"@odata.type,omitempty"`
  2673  }
  2674  
  2675  func unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(body []byte) (BasicContentKeyPolicyPlayReadyContentKeyLocation, error) {
  2676  	var m map[string]interface{}
  2677  	err := json.Unmarshal(body, &m)
  2678  	if err != nil {
  2679  		return nil, err
  2680  	}
  2681  
  2682  	switch m["@odata.type"] {
  2683  	case string(OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader):
  2684  		var ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader
  2685  		err := json.Unmarshal(body, &ckpprcekfh)
  2686  		return ckpprcekfh, err
  2687  	case string(OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier):
  2688  		var ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier
  2689  		err := json.Unmarshal(body, &ckpprcekfki)
  2690  		return ckpprcekfki, err
  2691  	default:
  2692  		var ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation
  2693  		err := json.Unmarshal(body, &ckpprckl)
  2694  		return ckpprckl, err
  2695  	}
  2696  }
  2697  func unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocationArray(body []byte) ([]BasicContentKeyPolicyPlayReadyContentKeyLocation, error) {
  2698  	var rawMessages []*json.RawMessage
  2699  	err := json.Unmarshal(body, &rawMessages)
  2700  	if err != nil {
  2701  		return nil, err
  2702  	}
  2703  
  2704  	ckpprcklArray := make([]BasicContentKeyPolicyPlayReadyContentKeyLocation, len(rawMessages))
  2705  
  2706  	for index, rawMessage := range rawMessages {
  2707  		ckpprckl, err := unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(*rawMessage)
  2708  		if err != nil {
  2709  			return nil, err
  2710  		}
  2711  		ckpprcklArray[index] = ckpprckl
  2712  	}
  2713  	return ckpprcklArray, nil
  2714  }
  2715  
  2716  // MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentKeyLocation.
  2717  func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) MarshalJSON() ([]byte, error) {
  2718  	ckpprckl.OdataType = OdataTypeContentKeyPolicyPlayReadyContentKeyLocation
  2719  	objectMap := make(map[string]interface{})
  2720  	if ckpprckl.OdataType != "" {
  2721  		objectMap["@odata.type"] = ckpprckl.OdataType
  2722  	}
  2723  	return json.Marshal(objectMap)
  2724  }
  2725  
  2726  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation.
  2727  func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) {
  2728  	return nil, false
  2729  }
  2730  
  2731  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation.
  2732  func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) {
  2733  	return nil, false
  2734  }
  2735  
  2736  // AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation.
  2737  func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2738  	return &ckpprckl, true
  2739  }
  2740  
  2741  // AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation.
  2742  func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2743  	return &ckpprckl, true
  2744  }
  2745  
  2746  // ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction configures the Explicit Analog Television
  2747  // Output Restriction control bits. For further details see the PlayReady Compliance Rules.
  2748  type ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction struct {
  2749  	// BestEffort - Indicates whether this restriction is enforced on a Best Effort basis.
  2750  	BestEffort *bool `json:"bestEffort,omitempty"`
  2751  	// ConfigurationData - Configures the restriction control bits. Must be between 0 and 3 inclusive.
  2752  	ConfigurationData *int32 `json:"configurationData,omitempty"`
  2753  }
  2754  
  2755  // ContentKeyPolicyPlayReadyLicense the PlayReady license
  2756  type ContentKeyPolicyPlayReadyLicense struct {
  2757  	// AllowTestDevices - A flag indicating whether test devices can use the license.
  2758  	AllowTestDevices *bool `json:"allowTestDevices,omitempty"`
  2759  	// BeginDate - The begin date of license
  2760  	BeginDate *date.Time `json:"beginDate,omitempty"`
  2761  	// ExpirationDate - The expiration date of license.
  2762  	ExpirationDate *date.Time `json:"expirationDate,omitempty"`
  2763  	// RelativeBeginDate - The relative begin date of license.
  2764  	RelativeBeginDate *string `json:"relativeBeginDate,omitempty"`
  2765  	// RelativeExpirationDate - The relative expiration date of license.
  2766  	RelativeExpirationDate *string `json:"relativeExpirationDate,omitempty"`
  2767  	// GracePeriod - The grace period of license.
  2768  	GracePeriod *string `json:"gracePeriod,omitempty"`
  2769  	// PlayRight - The license PlayRight
  2770  	PlayRight *ContentKeyPolicyPlayReadyPlayRight `json:"playRight,omitempty"`
  2771  	// LicenseType - The license type. Possible values include: 'ContentKeyPolicyPlayReadyLicenseTypeUnknown', 'ContentKeyPolicyPlayReadyLicenseTypeNonPersistent', 'ContentKeyPolicyPlayReadyLicenseTypePersistent'
  2772  	LicenseType ContentKeyPolicyPlayReadyLicenseType `json:"licenseType,omitempty"`
  2773  	// ContentKeyLocation - The content key location.
  2774  	ContentKeyLocation BasicContentKeyPolicyPlayReadyContentKeyLocation `json:"contentKeyLocation,omitempty"`
  2775  	// ContentType - The PlayReady content type. Possible values include: 'ContentKeyPolicyPlayReadyContentTypeUnknown', 'ContentKeyPolicyPlayReadyContentTypeUnspecified', 'ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload', 'ContentKeyPolicyPlayReadyContentTypeUltraVioletStreaming'
  2776  	ContentType ContentKeyPolicyPlayReadyContentType `json:"contentType,omitempty"`
  2777  }
  2778  
  2779  // UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyPlayReadyLicense struct.
  2780  func (ckpprl *ContentKeyPolicyPlayReadyLicense) UnmarshalJSON(body []byte) error {
  2781  	var m map[string]*json.RawMessage
  2782  	err := json.Unmarshal(body, &m)
  2783  	if err != nil {
  2784  		return err
  2785  	}
  2786  	for k, v := range m {
  2787  		switch k {
  2788  		case "allowTestDevices":
  2789  			if v != nil {
  2790  				var allowTestDevices bool
  2791  				err = json.Unmarshal(*v, &allowTestDevices)
  2792  				if err != nil {
  2793  					return err
  2794  				}
  2795  				ckpprl.AllowTestDevices = &allowTestDevices
  2796  			}
  2797  		case "beginDate":
  2798  			if v != nil {
  2799  				var beginDate date.Time
  2800  				err = json.Unmarshal(*v, &beginDate)
  2801  				if err != nil {
  2802  					return err
  2803  				}
  2804  				ckpprl.BeginDate = &beginDate
  2805  			}
  2806  		case "expirationDate":
  2807  			if v != nil {
  2808  				var expirationDate date.Time
  2809  				err = json.Unmarshal(*v, &expirationDate)
  2810  				if err != nil {
  2811  					return err
  2812  				}
  2813  				ckpprl.ExpirationDate = &expirationDate
  2814  			}
  2815  		case "relativeBeginDate":
  2816  			if v != nil {
  2817  				var relativeBeginDate string
  2818  				err = json.Unmarshal(*v, &relativeBeginDate)
  2819  				if err != nil {
  2820  					return err
  2821  				}
  2822  				ckpprl.RelativeBeginDate = &relativeBeginDate
  2823  			}
  2824  		case "relativeExpirationDate":
  2825  			if v != nil {
  2826  				var relativeExpirationDate string
  2827  				err = json.Unmarshal(*v, &relativeExpirationDate)
  2828  				if err != nil {
  2829  					return err
  2830  				}
  2831  				ckpprl.RelativeExpirationDate = &relativeExpirationDate
  2832  			}
  2833  		case "gracePeriod":
  2834  			if v != nil {
  2835  				var gracePeriod string
  2836  				err = json.Unmarshal(*v, &gracePeriod)
  2837  				if err != nil {
  2838  					return err
  2839  				}
  2840  				ckpprl.GracePeriod = &gracePeriod
  2841  			}
  2842  		case "playRight":
  2843  			if v != nil {
  2844  				var playRight ContentKeyPolicyPlayReadyPlayRight
  2845  				err = json.Unmarshal(*v, &playRight)
  2846  				if err != nil {
  2847  					return err
  2848  				}
  2849  				ckpprl.PlayRight = &playRight
  2850  			}
  2851  		case "licenseType":
  2852  			if v != nil {
  2853  				var licenseType ContentKeyPolicyPlayReadyLicenseType
  2854  				err = json.Unmarshal(*v, &licenseType)
  2855  				if err != nil {
  2856  					return err
  2857  				}
  2858  				ckpprl.LicenseType = licenseType
  2859  			}
  2860  		case "contentKeyLocation":
  2861  			if v != nil {
  2862  				contentKeyLocation, err := unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(*v)
  2863  				if err != nil {
  2864  					return err
  2865  				}
  2866  				ckpprl.ContentKeyLocation = contentKeyLocation
  2867  			}
  2868  		case "contentType":
  2869  			if v != nil {
  2870  				var contentType ContentKeyPolicyPlayReadyContentType
  2871  				err = json.Unmarshal(*v, &contentType)
  2872  				if err != nil {
  2873  					return err
  2874  				}
  2875  				ckpprl.ContentType = contentType
  2876  			}
  2877  		}
  2878  	}
  2879  
  2880  	return nil
  2881  }
  2882  
  2883  // ContentKeyPolicyPlayReadyPlayRight configures the Play Right in the PlayReady license.
  2884  type ContentKeyPolicyPlayReadyPlayRight struct {
  2885  	// FirstPlayExpiration - The amount of time that the license is valid after the license is first used to play content.
  2886  	FirstPlayExpiration *string `json:"firstPlayExpiration,omitempty"`
  2887  	// ScmsRestriction - Configures the Serial Copy Management System (SCMS) in the license. Must be between 0 and 3 inclusive.
  2888  	ScmsRestriction *int32 `json:"scmsRestriction,omitempty"`
  2889  	// AgcAndColorStripeRestriction - Configures Automatic Gain Control (AGC) and Color Stripe in the license. Must be between 0 and 3 inclusive.
  2890  	AgcAndColorStripeRestriction *int32 `json:"agcAndColorStripeRestriction,omitempty"`
  2891  	// ExplicitAnalogTelevisionOutputRestriction - Configures the Explicit Analog Television Output Restriction in the license. Configuration data must be between 0 and 3 inclusive.
  2892  	ExplicitAnalogTelevisionOutputRestriction *ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction `json:"explicitAnalogTelevisionOutputRestriction,omitempty"`
  2893  	// DigitalVideoOnlyContentRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license.
  2894  	DigitalVideoOnlyContentRestriction *bool `json:"digitalVideoOnlyContentRestriction,omitempty"`
  2895  	// ImageConstraintForAnalogComponentVideoRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license.
  2896  	ImageConstraintForAnalogComponentVideoRestriction *bool `json:"imageConstraintForAnalogComponentVideoRestriction,omitempty"`
  2897  	// ImageConstraintForAnalogComputerMonitorRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license.
  2898  	ImageConstraintForAnalogComputerMonitorRestriction *bool `json:"imageConstraintForAnalogComputerMonitorRestriction,omitempty"`
  2899  	// AllowPassingVideoContentToUnknownOutput - Configures Unknown output handling settings of the license. Possible values include: 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionUnknown', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowed', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowedWithVideoConstriction'
  2900  	AllowPassingVideoContentToUnknownOutput ContentKeyPolicyPlayReadyUnknownOutputPassingOption `json:"allowPassingVideoContentToUnknownOutput,omitempty"`
  2901  	// UncompressedDigitalVideoOpl - Specifies the output protection level for uncompressed digital video.
  2902  	UncompressedDigitalVideoOpl *int32 `json:"uncompressedDigitalVideoOpl,omitempty"`
  2903  	// CompressedDigitalVideoOpl - Specifies the output protection level for compressed digital video.
  2904  	CompressedDigitalVideoOpl *int32 `json:"compressedDigitalVideoOpl,omitempty"`
  2905  	// AnalogVideoOpl - Specifies the output protection level for compressed digital audio.
  2906  	AnalogVideoOpl *int32 `json:"analogVideoOpl,omitempty"`
  2907  	// CompressedDigitalAudioOpl - Specifies the output protection level for compressed digital audio.
  2908  	CompressedDigitalAudioOpl *int32 `json:"compressedDigitalAudioOpl,omitempty"`
  2909  	// UncompressedDigitalAudioOpl - Specifies the output protection level for uncompressed digital audio.
  2910  	UncompressedDigitalAudioOpl *int32 `json:"uncompressedDigitalAudioOpl,omitempty"`
  2911  }
  2912  
  2913  // ContentKeyPolicyProperties the properties of the Content Key Policy.
  2914  type ContentKeyPolicyProperties struct {
  2915  	autorest.Response `json:"-"`
  2916  	// PolicyID - READ-ONLY; The legacy Policy ID.
  2917  	PolicyID *uuid.UUID `json:"policyId,omitempty"`
  2918  	// Created - READ-ONLY; The creation date of the Policy
  2919  	Created *date.Time `json:"created,omitempty"`
  2920  	// LastModified - READ-ONLY; The last modified date of the Policy
  2921  	LastModified *date.Time `json:"lastModified,omitempty"`
  2922  	// Description - A description for the Policy.
  2923  	Description *string `json:"description,omitempty"`
  2924  	// Options - The Key Policy options.
  2925  	Options *[]ContentKeyPolicyOption `json:"options,omitempty"`
  2926  }
  2927  
  2928  // MarshalJSON is the custom marshaler for ContentKeyPolicyProperties.
  2929  func (ckpp ContentKeyPolicyProperties) MarshalJSON() ([]byte, error) {
  2930  	objectMap := make(map[string]interface{})
  2931  	if ckpp.Description != nil {
  2932  		objectMap["description"] = ckpp.Description
  2933  	}
  2934  	if ckpp.Options != nil {
  2935  		objectMap["options"] = ckpp.Options
  2936  	}
  2937  	return json.Marshal(objectMap)
  2938  }
  2939  
  2940  // BasicContentKeyPolicyRestriction base class for Content Key Policy restrictions. A derived class must be used to
  2941  // create a restriction.
  2942  type BasicContentKeyPolicyRestriction interface {
  2943  	AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool)
  2944  	AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool)
  2945  	AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool)
  2946  	AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool)
  2947  }
  2948  
  2949  // ContentKeyPolicyRestriction base class for Content Key Policy restrictions. A derived class must be used to
  2950  // create a restriction.
  2951  type ContentKeyPolicyRestriction struct {
  2952  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeContentKeyPolicyRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction'
  2953  	OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
  2954  }
  2955  
  2956  func unmarshalBasicContentKeyPolicyRestriction(body []byte) (BasicContentKeyPolicyRestriction, error) {
  2957  	var m map[string]interface{}
  2958  	err := json.Unmarshal(body, &m)
  2959  	if err != nil {
  2960  		return nil, err
  2961  	}
  2962  
  2963  	switch m["@odata.type"] {
  2964  	case string(OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction):
  2965  		var ckpor ContentKeyPolicyOpenRestriction
  2966  		err := json.Unmarshal(body, &ckpor)
  2967  		return ckpor, err
  2968  	case string(OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction):
  2969  		var ckpur ContentKeyPolicyUnknownRestriction
  2970  		err := json.Unmarshal(body, &ckpur)
  2971  		return ckpur, err
  2972  	case string(OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction):
  2973  		var ckptr ContentKeyPolicyTokenRestriction
  2974  		err := json.Unmarshal(body, &ckptr)
  2975  		return ckptr, err
  2976  	default:
  2977  		var ckpr ContentKeyPolicyRestriction
  2978  		err := json.Unmarshal(body, &ckpr)
  2979  		return ckpr, err
  2980  	}
  2981  }
  2982  func unmarshalBasicContentKeyPolicyRestrictionArray(body []byte) ([]BasicContentKeyPolicyRestriction, error) {
  2983  	var rawMessages []*json.RawMessage
  2984  	err := json.Unmarshal(body, &rawMessages)
  2985  	if err != nil {
  2986  		return nil, err
  2987  	}
  2988  
  2989  	ckprArray := make([]BasicContentKeyPolicyRestriction, len(rawMessages))
  2990  
  2991  	for index, rawMessage := range rawMessages {
  2992  		ckpr, err := unmarshalBasicContentKeyPolicyRestriction(*rawMessage)
  2993  		if err != nil {
  2994  			return nil, err
  2995  		}
  2996  		ckprArray[index] = ckpr
  2997  	}
  2998  	return ckprArray, nil
  2999  }
  3000  
  3001  // MarshalJSON is the custom marshaler for ContentKeyPolicyRestriction.
  3002  func (ckpr ContentKeyPolicyRestriction) MarshalJSON() ([]byte, error) {
  3003  	ckpr.OdataType = OdataTypeBasicContentKeyPolicyRestrictionOdataTypeContentKeyPolicyRestriction
  3004  	objectMap := make(map[string]interface{})
  3005  	if ckpr.OdataType != "" {
  3006  		objectMap["@odata.type"] = ckpr.OdataType
  3007  	}
  3008  	return json.Marshal(objectMap)
  3009  }
  3010  
  3011  // AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
  3012  func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
  3013  	return nil, false
  3014  }
  3015  
  3016  // AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
  3017  func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
  3018  	return nil, false
  3019  }
  3020  
  3021  // AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
  3022  func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
  3023  	return nil, false
  3024  }
  3025  
  3026  // AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
  3027  func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
  3028  	return &ckpr, true
  3029  }
  3030  
  3031  // AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
  3032  func (ckpr ContentKeyPolicyRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
  3033  	return &ckpr, true
  3034  }
  3035  
  3036  // BasicContentKeyPolicyRestrictionTokenKey base class for Content Key Policy key for token validation. A derived class
  3037  // must be used to create a token key.
  3038  type BasicContentKeyPolicyRestrictionTokenKey interface {
  3039  	AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool)
  3040  	AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool)
  3041  	AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool)
  3042  	AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool)
  3043  }
  3044  
  3045  // ContentKeyPolicyRestrictionTokenKey base class for Content Key Policy key for token validation. A derived
  3046  // class must be used to create a token key.
  3047  type ContentKeyPolicyRestrictionTokenKey struct {
  3048  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey'
  3049  	OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
  3050  }
  3051  
  3052  func unmarshalBasicContentKeyPolicyRestrictionTokenKey(body []byte) (BasicContentKeyPolicyRestrictionTokenKey, error) {
  3053  	var m map[string]interface{}
  3054  	err := json.Unmarshal(body, &m)
  3055  	if err != nil {
  3056  		return nil, err
  3057  	}
  3058  
  3059  	switch m["@odata.type"] {
  3060  	case string(OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey):
  3061  		var ckpstk ContentKeyPolicySymmetricTokenKey
  3062  		err := json.Unmarshal(body, &ckpstk)
  3063  		return ckpstk, err
  3064  	case string(OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey):
  3065  		var ckprtk ContentKeyPolicyRsaTokenKey
  3066  		err := json.Unmarshal(body, &ckprtk)
  3067  		return ckprtk, err
  3068  	case string(OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey):
  3069  		var ckpxctk ContentKeyPolicyX509CertificateTokenKey
  3070  		err := json.Unmarshal(body, &ckpxctk)
  3071  		return ckpxctk, err
  3072  	default:
  3073  		var ckprtk ContentKeyPolicyRestrictionTokenKey
  3074  		err := json.Unmarshal(body, &ckprtk)
  3075  		return ckprtk, err
  3076  	}
  3077  }
  3078  func unmarshalBasicContentKeyPolicyRestrictionTokenKeyArray(body []byte) ([]BasicContentKeyPolicyRestrictionTokenKey, error) {
  3079  	var rawMessages []*json.RawMessage
  3080  	err := json.Unmarshal(body, &rawMessages)
  3081  	if err != nil {
  3082  		return nil, err
  3083  	}
  3084  
  3085  	ckprtkArray := make([]BasicContentKeyPolicyRestrictionTokenKey, len(rawMessages))
  3086  
  3087  	for index, rawMessage := range rawMessages {
  3088  		ckprtk, err := unmarshalBasicContentKeyPolicyRestrictionTokenKey(*rawMessage)
  3089  		if err != nil {
  3090  			return nil, err
  3091  		}
  3092  		ckprtkArray[index] = ckprtk
  3093  	}
  3094  	return ckprtkArray, nil
  3095  }
  3096  
  3097  // MarshalJSON is the custom marshaler for ContentKeyPolicyRestrictionTokenKey.
  3098  func (ckprtk ContentKeyPolicyRestrictionTokenKey) MarshalJSON() ([]byte, error) {
  3099  	ckprtk.OdataType = OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeContentKeyPolicyRestrictionTokenKey
  3100  	objectMap := make(map[string]interface{})
  3101  	if ckprtk.OdataType != "" {
  3102  		objectMap["@odata.type"] = ckprtk.OdataType
  3103  	}
  3104  	return json.Marshal(objectMap)
  3105  }
  3106  
  3107  // AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
  3108  func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
  3109  	return nil, false
  3110  }
  3111  
  3112  // AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
  3113  func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
  3114  	return nil, false
  3115  }
  3116  
  3117  // AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
  3118  func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
  3119  	return nil, false
  3120  }
  3121  
  3122  // AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
  3123  func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
  3124  	return &ckprtk, true
  3125  }
  3126  
  3127  // AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
  3128  func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
  3129  	return &ckprtk, true
  3130  }
  3131  
  3132  // ContentKeyPolicyRsaTokenKey specifies a RSA key for token validation
  3133  type ContentKeyPolicyRsaTokenKey struct {
  3134  	// Exponent - The RSA Parameter exponent
  3135  	Exponent *[]byte `json:"exponent,omitempty"`
  3136  	// Modulus - The RSA Parameter modulus
  3137  	Modulus *[]byte `json:"modulus,omitempty"`
  3138  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey'
  3139  	OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
  3140  }
  3141  
  3142  // MarshalJSON is the custom marshaler for ContentKeyPolicyRsaTokenKey.
  3143  func (ckprtk ContentKeyPolicyRsaTokenKey) MarshalJSON() ([]byte, error) {
  3144  	ckprtk.OdataType = OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey
  3145  	objectMap := make(map[string]interface{})
  3146  	if ckprtk.Exponent != nil {
  3147  		objectMap["exponent"] = ckprtk.Exponent
  3148  	}
  3149  	if ckprtk.Modulus != nil {
  3150  		objectMap["modulus"] = ckprtk.Modulus
  3151  	}
  3152  	if ckprtk.OdataType != "" {
  3153  		objectMap["@odata.type"] = ckprtk.OdataType
  3154  	}
  3155  	return json.Marshal(objectMap)
  3156  }
  3157  
  3158  // AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
  3159  func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
  3160  	return nil, false
  3161  }
  3162  
  3163  // AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
  3164  func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
  3165  	return &ckprtk, true
  3166  }
  3167  
  3168  // AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
  3169  func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
  3170  	return nil, false
  3171  }
  3172  
  3173  // AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
  3174  func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
  3175  	return nil, false
  3176  }
  3177  
  3178  // AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
  3179  func (ckprtk ContentKeyPolicyRsaTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
  3180  	return &ckprtk, true
  3181  }
  3182  
  3183  // ContentKeyPolicySymmetricTokenKey specifies a symmetric key for token validation.
  3184  type ContentKeyPolicySymmetricTokenKey struct {
  3185  	// KeyValue - The key value of the key
  3186  	KeyValue *[]byte `json:"keyValue,omitempty"`
  3187  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey'
  3188  	OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
  3189  }
  3190  
  3191  // MarshalJSON is the custom marshaler for ContentKeyPolicySymmetricTokenKey.
  3192  func (ckpstk ContentKeyPolicySymmetricTokenKey) MarshalJSON() ([]byte, error) {
  3193  	ckpstk.OdataType = OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey
  3194  	objectMap := make(map[string]interface{})
  3195  	if ckpstk.KeyValue != nil {
  3196  		objectMap["keyValue"] = ckpstk.KeyValue
  3197  	}
  3198  	if ckpstk.OdataType != "" {
  3199  		objectMap["@odata.type"] = ckpstk.OdataType
  3200  	}
  3201  	return json.Marshal(objectMap)
  3202  }
  3203  
  3204  // AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
  3205  func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
  3206  	return &ckpstk, true
  3207  }
  3208  
  3209  // AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
  3210  func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
  3211  	return nil, false
  3212  }
  3213  
  3214  // AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
  3215  func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
  3216  	return nil, false
  3217  }
  3218  
  3219  // AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
  3220  func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
  3221  	return nil, false
  3222  }
  3223  
  3224  // AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
  3225  func (ckpstk ContentKeyPolicySymmetricTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
  3226  	return &ckpstk, true
  3227  }
  3228  
  3229  // ContentKeyPolicyTokenClaim represents a token claim.
  3230  type ContentKeyPolicyTokenClaim struct {
  3231  	// ClaimType - Token claim type.
  3232  	ClaimType *string `json:"claimType,omitempty"`
  3233  	// ClaimValue - Token claim value.
  3234  	ClaimValue *string `json:"claimValue,omitempty"`
  3235  }
  3236  
  3237  // ContentKeyPolicyTokenRestriction represents a token restriction. Provided token must match these
  3238  // requirements for successful license or key delivery.
  3239  type ContentKeyPolicyTokenRestriction struct {
  3240  	// Issuer - The token issuer.
  3241  	Issuer *string `json:"issuer,omitempty"`
  3242  	// Audience - The audience for the token.
  3243  	Audience *string `json:"audience,omitempty"`
  3244  	// PrimaryVerificationKey - The primary verification key.
  3245  	PrimaryVerificationKey BasicContentKeyPolicyRestrictionTokenKey `json:"primaryVerificationKey,omitempty"`
  3246  	// AlternateVerificationKeys - A list of alternative verification keys.
  3247  	AlternateVerificationKeys *[]BasicContentKeyPolicyRestrictionTokenKey `json:"alternateVerificationKeys,omitempty"`
  3248  	// RequiredClaims - A list of required token claims.
  3249  	RequiredClaims *[]ContentKeyPolicyTokenClaim `json:"requiredClaims,omitempty"`
  3250  	// RestrictionTokenType - The type of token. Possible values include: 'ContentKeyPolicyRestrictionTokenTypeUnknown', 'ContentKeyPolicyRestrictionTokenTypeSwt', 'ContentKeyPolicyRestrictionTokenTypeJwt'
  3251  	RestrictionTokenType ContentKeyPolicyRestrictionTokenType `json:"restrictionTokenType,omitempty"`
  3252  	// OpenIDConnectDiscoveryDocument - The OpenID connect discovery document.
  3253  	OpenIDConnectDiscoveryDocument *string `json:"openIdConnectDiscoveryDocument,omitempty"`
  3254  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeContentKeyPolicyRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction'
  3255  	OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
  3256  }
  3257  
  3258  // MarshalJSON is the custom marshaler for ContentKeyPolicyTokenRestriction.
  3259  func (ckptr ContentKeyPolicyTokenRestriction) MarshalJSON() ([]byte, error) {
  3260  	ckptr.OdataType = OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction
  3261  	objectMap := make(map[string]interface{})
  3262  	if ckptr.Issuer != nil {
  3263  		objectMap["issuer"] = ckptr.Issuer
  3264  	}
  3265  	if ckptr.Audience != nil {
  3266  		objectMap["audience"] = ckptr.Audience
  3267  	}
  3268  	objectMap["primaryVerificationKey"] = ckptr.PrimaryVerificationKey
  3269  	if ckptr.AlternateVerificationKeys != nil {
  3270  		objectMap["alternateVerificationKeys"] = ckptr.AlternateVerificationKeys
  3271  	}
  3272  	if ckptr.RequiredClaims != nil {
  3273  		objectMap["requiredClaims"] = ckptr.RequiredClaims
  3274  	}
  3275  	if ckptr.RestrictionTokenType != "" {
  3276  		objectMap["restrictionTokenType"] = ckptr.RestrictionTokenType
  3277  	}
  3278  	if ckptr.OpenIDConnectDiscoveryDocument != nil {
  3279  		objectMap["openIdConnectDiscoveryDocument"] = ckptr.OpenIDConnectDiscoveryDocument
  3280  	}
  3281  	if ckptr.OdataType != "" {
  3282  		objectMap["@odata.type"] = ckptr.OdataType
  3283  	}
  3284  	return json.Marshal(objectMap)
  3285  }
  3286  
  3287  // AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
  3288  func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
  3289  	return nil, false
  3290  }
  3291  
  3292  // AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
  3293  func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
  3294  	return nil, false
  3295  }
  3296  
  3297  // AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
  3298  func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
  3299  	return &ckptr, true
  3300  }
  3301  
  3302  // AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
  3303  func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
  3304  	return nil, false
  3305  }
  3306  
  3307  // AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
  3308  func (ckptr ContentKeyPolicyTokenRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
  3309  	return &ckptr, true
  3310  }
  3311  
  3312  // UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyTokenRestriction struct.
  3313  func (ckptr *ContentKeyPolicyTokenRestriction) UnmarshalJSON(body []byte) error {
  3314  	var m map[string]*json.RawMessage
  3315  	err := json.Unmarshal(body, &m)
  3316  	if err != nil {
  3317  		return err
  3318  	}
  3319  	for k, v := range m {
  3320  		switch k {
  3321  		case "issuer":
  3322  			if v != nil {
  3323  				var issuer string
  3324  				err = json.Unmarshal(*v, &issuer)
  3325  				if err != nil {
  3326  					return err
  3327  				}
  3328  				ckptr.Issuer = &issuer
  3329  			}
  3330  		case "audience":
  3331  			if v != nil {
  3332  				var audience string
  3333  				err = json.Unmarshal(*v, &audience)
  3334  				if err != nil {
  3335  					return err
  3336  				}
  3337  				ckptr.Audience = &audience
  3338  			}
  3339  		case "primaryVerificationKey":
  3340  			if v != nil {
  3341  				primaryVerificationKey, err := unmarshalBasicContentKeyPolicyRestrictionTokenKey(*v)
  3342  				if err != nil {
  3343  					return err
  3344  				}
  3345  				ckptr.PrimaryVerificationKey = primaryVerificationKey
  3346  			}
  3347  		case "alternateVerificationKeys":
  3348  			if v != nil {
  3349  				alternateVerificationKeys, err := unmarshalBasicContentKeyPolicyRestrictionTokenKeyArray(*v)
  3350  				if err != nil {
  3351  					return err
  3352  				}
  3353  				ckptr.AlternateVerificationKeys = &alternateVerificationKeys
  3354  			}
  3355  		case "requiredClaims":
  3356  			if v != nil {
  3357  				var requiredClaims []ContentKeyPolicyTokenClaim
  3358  				err = json.Unmarshal(*v, &requiredClaims)
  3359  				if err != nil {
  3360  					return err
  3361  				}
  3362  				ckptr.RequiredClaims = &requiredClaims
  3363  			}
  3364  		case "restrictionTokenType":
  3365  			if v != nil {
  3366  				var restrictionTokenType ContentKeyPolicyRestrictionTokenType
  3367  				err = json.Unmarshal(*v, &restrictionTokenType)
  3368  				if err != nil {
  3369  					return err
  3370  				}
  3371  				ckptr.RestrictionTokenType = restrictionTokenType
  3372  			}
  3373  		case "openIdConnectDiscoveryDocument":
  3374  			if v != nil {
  3375  				var openIDConnectDiscoveryDocument string
  3376  				err = json.Unmarshal(*v, &openIDConnectDiscoveryDocument)
  3377  				if err != nil {
  3378  					return err
  3379  				}
  3380  				ckptr.OpenIDConnectDiscoveryDocument = &openIDConnectDiscoveryDocument
  3381  			}
  3382  		case "@odata.type":
  3383  			if v != nil {
  3384  				var odataType OdataTypeBasicContentKeyPolicyRestriction
  3385  				err = json.Unmarshal(*v, &odataType)
  3386  				if err != nil {
  3387  					return err
  3388  				}
  3389  				ckptr.OdataType = odataType
  3390  			}
  3391  		}
  3392  	}
  3393  
  3394  	return nil
  3395  }
  3396  
  3397  // ContentKeyPolicyUnknownConfiguration represents a ContentKeyPolicyConfiguration that is unavailable in
  3398  // the current API version.
  3399  type ContentKeyPolicyUnknownConfiguration struct {
  3400  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  3401  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  3402  }
  3403  
  3404  // MarshalJSON is the custom marshaler for ContentKeyPolicyUnknownConfiguration.
  3405  func (ckpuc ContentKeyPolicyUnknownConfiguration) MarshalJSON() ([]byte, error) {
  3406  	ckpuc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration
  3407  	objectMap := make(map[string]interface{})
  3408  	if ckpuc.OdataType != "" {
  3409  		objectMap["@odata.type"] = ckpuc.OdataType
  3410  	}
  3411  	return json.Marshal(objectMap)
  3412  }
  3413  
  3414  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3415  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  3416  	return nil, false
  3417  }
  3418  
  3419  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3420  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  3421  	return &ckpuc, true
  3422  }
  3423  
  3424  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3425  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  3426  	return nil, false
  3427  }
  3428  
  3429  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3430  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  3431  	return nil, false
  3432  }
  3433  
  3434  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3435  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  3436  	return nil, false
  3437  }
  3438  
  3439  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3440  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  3441  	return nil, false
  3442  }
  3443  
  3444  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3445  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  3446  	return &ckpuc, true
  3447  }
  3448  
  3449  // ContentKeyPolicyUnknownRestriction represents a ContentKeyPolicyRestriction that is unavailable in the
  3450  // current API version.
  3451  type ContentKeyPolicyUnknownRestriction struct {
  3452  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeContentKeyPolicyRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction'
  3453  	OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
  3454  }
  3455  
  3456  // MarshalJSON is the custom marshaler for ContentKeyPolicyUnknownRestriction.
  3457  func (ckpur ContentKeyPolicyUnknownRestriction) MarshalJSON() ([]byte, error) {
  3458  	ckpur.OdataType = OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction
  3459  	objectMap := make(map[string]interface{})
  3460  	if ckpur.OdataType != "" {
  3461  		objectMap["@odata.type"] = ckpur.OdataType
  3462  	}
  3463  	return json.Marshal(objectMap)
  3464  }
  3465  
  3466  // AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
  3467  func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
  3468  	return nil, false
  3469  }
  3470  
  3471  // AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
  3472  func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
  3473  	return &ckpur, true
  3474  }
  3475  
  3476  // AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
  3477  func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
  3478  	return nil, false
  3479  }
  3480  
  3481  // AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
  3482  func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
  3483  	return nil, false
  3484  }
  3485  
  3486  // AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
  3487  func (ckpur ContentKeyPolicyUnknownRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
  3488  	return &ckpur, true
  3489  }
  3490  
  3491  // ContentKeyPolicyWidevineConfiguration specifies a configuration for Widevine licenses.
  3492  type ContentKeyPolicyWidevineConfiguration struct {
  3493  	// WidevineTemplate - The Widevine template.
  3494  	WidevineTemplate *string `json:"widevineTemplate,omitempty"`
  3495  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  3496  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  3497  }
  3498  
  3499  // MarshalJSON is the custom marshaler for ContentKeyPolicyWidevineConfiguration.
  3500  func (ckpwc ContentKeyPolicyWidevineConfiguration) MarshalJSON() ([]byte, error) {
  3501  	ckpwc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration
  3502  	objectMap := make(map[string]interface{})
  3503  	if ckpwc.WidevineTemplate != nil {
  3504  		objectMap["widevineTemplate"] = ckpwc.WidevineTemplate
  3505  	}
  3506  	if ckpwc.OdataType != "" {
  3507  		objectMap["@odata.type"] = ckpwc.OdataType
  3508  	}
  3509  	return json.Marshal(objectMap)
  3510  }
  3511  
  3512  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3513  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  3514  	return nil, false
  3515  }
  3516  
  3517  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3518  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  3519  	return nil, false
  3520  }
  3521  
  3522  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3523  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  3524  	return &ckpwc, true
  3525  }
  3526  
  3527  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3528  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  3529  	return nil, false
  3530  }
  3531  
  3532  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3533  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  3534  	return nil, false
  3535  }
  3536  
  3537  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3538  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  3539  	return nil, false
  3540  }
  3541  
  3542  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3543  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  3544  	return &ckpwc, true
  3545  }
  3546  
  3547  // ContentKeyPolicyX509CertificateTokenKey specifies a certificate for token validation.
  3548  type ContentKeyPolicyX509CertificateTokenKey struct {
  3549  	// RawBody - The raw data field of a certificate in PKCS 12 format (X509Certificate2 in .NET)
  3550  	RawBody *[]byte `json:"rawBody,omitempty"`
  3551  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey'
  3552  	OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
  3553  }
  3554  
  3555  // MarshalJSON is the custom marshaler for ContentKeyPolicyX509CertificateTokenKey.
  3556  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) MarshalJSON() ([]byte, error) {
  3557  	ckpxctk.OdataType = OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey
  3558  	objectMap := make(map[string]interface{})
  3559  	if ckpxctk.RawBody != nil {
  3560  		objectMap["rawBody"] = ckpxctk.RawBody
  3561  	}
  3562  	if ckpxctk.OdataType != "" {
  3563  		objectMap["@odata.type"] = ckpxctk.OdataType
  3564  	}
  3565  	return json.Marshal(objectMap)
  3566  }
  3567  
  3568  // AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
  3569  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
  3570  	return nil, false
  3571  }
  3572  
  3573  // AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
  3574  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
  3575  	return nil, false
  3576  }
  3577  
  3578  // AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
  3579  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
  3580  	return &ckpxctk, true
  3581  }
  3582  
  3583  // AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
  3584  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
  3585  	return nil, false
  3586  }
  3587  
  3588  // AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
  3589  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
  3590  	return &ckpxctk, true
  3591  }
  3592  
  3593  // CopyAudio a codec flag, which tells the encoder to copy the input audio bitstream.
  3594  type CopyAudio struct {
  3595  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  3596  	Label *string `json:"label,omitempty"`
  3597  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  3598  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  3599  }
  3600  
  3601  // MarshalJSON is the custom marshaler for CopyAudio.
  3602  func (ca CopyAudio) MarshalJSON() ([]byte, error) {
  3603  	ca.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio
  3604  	objectMap := make(map[string]interface{})
  3605  	if ca.Label != nil {
  3606  		objectMap["label"] = ca.Label
  3607  	}
  3608  	if ca.OdataType != "" {
  3609  		objectMap["@odata.type"] = ca.OdataType
  3610  	}
  3611  	return json.Marshal(objectMap)
  3612  }
  3613  
  3614  // AsAudio is the BasicCodec implementation for CopyAudio.
  3615  func (ca CopyAudio) AsAudio() (*Audio, bool) {
  3616  	return nil, false
  3617  }
  3618  
  3619  // AsBasicAudio is the BasicCodec implementation for CopyAudio.
  3620  func (ca CopyAudio) AsBasicAudio() (BasicAudio, bool) {
  3621  	return nil, false
  3622  }
  3623  
  3624  // AsAacAudio is the BasicCodec implementation for CopyAudio.
  3625  func (ca CopyAudio) AsAacAudio() (*AacAudio, bool) {
  3626  	return nil, false
  3627  }
  3628  
  3629  // AsVideo is the BasicCodec implementation for CopyAudio.
  3630  func (ca CopyAudio) AsVideo() (*Video, bool) {
  3631  	return nil, false
  3632  }
  3633  
  3634  // AsBasicVideo is the BasicCodec implementation for CopyAudio.
  3635  func (ca CopyAudio) AsBasicVideo() (BasicVideo, bool) {
  3636  	return nil, false
  3637  }
  3638  
  3639  // AsH265Video is the BasicCodec implementation for CopyAudio.
  3640  func (ca CopyAudio) AsH265Video() (*H265Video, bool) {
  3641  	return nil, false
  3642  }
  3643  
  3644  // AsCopyVideo is the BasicCodec implementation for CopyAudio.
  3645  func (ca CopyAudio) AsCopyVideo() (*CopyVideo, bool) {
  3646  	return nil, false
  3647  }
  3648  
  3649  // AsImage is the BasicCodec implementation for CopyAudio.
  3650  func (ca CopyAudio) AsImage() (*Image, bool) {
  3651  	return nil, false
  3652  }
  3653  
  3654  // AsBasicImage is the BasicCodec implementation for CopyAudio.
  3655  func (ca CopyAudio) AsBasicImage() (BasicImage, bool) {
  3656  	return nil, false
  3657  }
  3658  
  3659  // AsCopyAudio is the BasicCodec implementation for CopyAudio.
  3660  func (ca CopyAudio) AsCopyAudio() (*CopyAudio, bool) {
  3661  	return &ca, true
  3662  }
  3663  
  3664  // AsH264Video is the BasicCodec implementation for CopyAudio.
  3665  func (ca CopyAudio) AsH264Video() (*H264Video, bool) {
  3666  	return nil, false
  3667  }
  3668  
  3669  // AsJpgImage is the BasicCodec implementation for CopyAudio.
  3670  func (ca CopyAudio) AsJpgImage() (*JpgImage, bool) {
  3671  	return nil, false
  3672  }
  3673  
  3674  // AsPngImage is the BasicCodec implementation for CopyAudio.
  3675  func (ca CopyAudio) AsPngImage() (*PngImage, bool) {
  3676  	return nil, false
  3677  }
  3678  
  3679  // AsCodec is the BasicCodec implementation for CopyAudio.
  3680  func (ca CopyAudio) AsCodec() (*Codec, bool) {
  3681  	return nil, false
  3682  }
  3683  
  3684  // AsBasicCodec is the BasicCodec implementation for CopyAudio.
  3685  func (ca CopyAudio) AsBasicCodec() (BasicCodec, bool) {
  3686  	return &ca, true
  3687  }
  3688  
  3689  // CopyVideo a codec flag, which tells the encoder to copy the input video bitstream without re-encoding.
  3690  type CopyVideo struct {
  3691  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  3692  	Label *string `json:"label,omitempty"`
  3693  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  3694  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  3695  }
  3696  
  3697  // MarshalJSON is the custom marshaler for CopyVideo.
  3698  func (cv CopyVideo) MarshalJSON() ([]byte, error) {
  3699  	cv.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo
  3700  	objectMap := make(map[string]interface{})
  3701  	if cv.Label != nil {
  3702  		objectMap["label"] = cv.Label
  3703  	}
  3704  	if cv.OdataType != "" {
  3705  		objectMap["@odata.type"] = cv.OdataType
  3706  	}
  3707  	return json.Marshal(objectMap)
  3708  }
  3709  
  3710  // AsAudio is the BasicCodec implementation for CopyVideo.
  3711  func (cv CopyVideo) AsAudio() (*Audio, bool) {
  3712  	return nil, false
  3713  }
  3714  
  3715  // AsBasicAudio is the BasicCodec implementation for CopyVideo.
  3716  func (cv CopyVideo) AsBasicAudio() (BasicAudio, bool) {
  3717  	return nil, false
  3718  }
  3719  
  3720  // AsAacAudio is the BasicCodec implementation for CopyVideo.
  3721  func (cv CopyVideo) AsAacAudio() (*AacAudio, bool) {
  3722  	return nil, false
  3723  }
  3724  
  3725  // AsVideo is the BasicCodec implementation for CopyVideo.
  3726  func (cv CopyVideo) AsVideo() (*Video, bool) {
  3727  	return nil, false
  3728  }
  3729  
  3730  // AsBasicVideo is the BasicCodec implementation for CopyVideo.
  3731  func (cv CopyVideo) AsBasicVideo() (BasicVideo, bool) {
  3732  	return nil, false
  3733  }
  3734  
  3735  // AsH265Video is the BasicCodec implementation for CopyVideo.
  3736  func (cv CopyVideo) AsH265Video() (*H265Video, bool) {
  3737  	return nil, false
  3738  }
  3739  
  3740  // AsCopyVideo is the BasicCodec implementation for CopyVideo.
  3741  func (cv CopyVideo) AsCopyVideo() (*CopyVideo, bool) {
  3742  	return &cv, true
  3743  }
  3744  
  3745  // AsImage is the BasicCodec implementation for CopyVideo.
  3746  func (cv CopyVideo) AsImage() (*Image, bool) {
  3747  	return nil, false
  3748  }
  3749  
  3750  // AsBasicImage is the BasicCodec implementation for CopyVideo.
  3751  func (cv CopyVideo) AsBasicImage() (BasicImage, bool) {
  3752  	return nil, false
  3753  }
  3754  
  3755  // AsCopyAudio is the BasicCodec implementation for CopyVideo.
  3756  func (cv CopyVideo) AsCopyAudio() (*CopyAudio, bool) {
  3757  	return nil, false
  3758  }
  3759  
  3760  // AsH264Video is the BasicCodec implementation for CopyVideo.
  3761  func (cv CopyVideo) AsH264Video() (*H264Video, bool) {
  3762  	return nil, false
  3763  }
  3764  
  3765  // AsJpgImage is the BasicCodec implementation for CopyVideo.
  3766  func (cv CopyVideo) AsJpgImage() (*JpgImage, bool) {
  3767  	return nil, false
  3768  }
  3769  
  3770  // AsPngImage is the BasicCodec implementation for CopyVideo.
  3771  func (cv CopyVideo) AsPngImage() (*PngImage, bool) {
  3772  	return nil, false
  3773  }
  3774  
  3775  // AsCodec is the BasicCodec implementation for CopyVideo.
  3776  func (cv CopyVideo) AsCodec() (*Codec, bool) {
  3777  	return nil, false
  3778  }
  3779  
  3780  // AsBasicCodec is the BasicCodec implementation for CopyVideo.
  3781  func (cv CopyVideo) AsBasicCodec() (BasicCodec, bool) {
  3782  	return &cv, true
  3783  }
  3784  
  3785  // CrossSiteAccessPolicies the client access policy.
  3786  type CrossSiteAccessPolicies struct {
  3787  	// ClientAccessPolicy - The content of clientaccesspolicy.xml used by Silverlight.
  3788  	ClientAccessPolicy *string `json:"clientAccessPolicy,omitempty"`
  3789  	// CrossDomainPolicy - The content of crossdomain.xml used by Silverlight.
  3790  	CrossDomainPolicy *string `json:"crossDomainPolicy,omitempty"`
  3791  }
  3792  
  3793  // DefaultKey class to specify properties of default content key for each encryption scheme
  3794  type DefaultKey struct {
  3795  	// Label - Label can be used to specify Content Key when creating a Streaming Locator
  3796  	Label *string `json:"label,omitempty"`
  3797  	// PolicyName - Policy used by Default Key
  3798  	PolicyName *string `json:"policyName,omitempty"`
  3799  }
  3800  
  3801  // Deinterlace describes the de-interlacing settings.
  3802  type Deinterlace struct {
  3803  	// Parity - The field parity for de-interlacing, defaults to Auto. Possible values include: 'DeinterlaceParityAuto', 'DeinterlaceParityTopFieldFirst', 'DeinterlaceParityBottomFieldFirst'
  3804  	Parity DeinterlaceParity `json:"parity,omitempty"`
  3805  	// Mode - The deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values include: 'DeinterlaceModeOff', 'DeinterlaceModeAutoPixelAdaptive'
  3806  	Mode DeinterlaceMode `json:"mode,omitempty"`
  3807  }
  3808  
  3809  // EdgePolicies ...
  3810  type EdgePolicies struct {
  3811  	autorest.Response         `json:"-"`
  3812  	UsageDataCollectionPolicy *EdgeUsageDataCollectionPolicy `json:"usageDataCollectionPolicy,omitempty"`
  3813  }
  3814  
  3815  // EdgeUsageDataCollectionPolicy ...
  3816  type EdgeUsageDataCollectionPolicy struct {
  3817  	// DataCollectionFrequency - Usage data collection frequency in ISO 8601 duration format e.g. PT10M , PT5H.
  3818  	DataCollectionFrequency *string `json:"dataCollectionFrequency,omitempty"`
  3819  	// DataReportingFrequency - Usage data reporting frequency in ISO 8601 duration format e.g. PT10M , PT5H.
  3820  	DataReportingFrequency *string `json:"dataReportingFrequency,omitempty"`
  3821  	// MaxAllowedUnreportedUsageDuration - Maximum time for which the functionality of the device will not be hampered for not reporting the usage data.
  3822  	MaxAllowedUnreportedUsageDuration *string `json:"maxAllowedUnreportedUsageDuration,omitempty"`
  3823  	// EventHubDetails - Details of Event Hub where the usage will be reported.
  3824  	EventHubDetails *EdgeUsageDataEventHub `json:"eventHubDetails,omitempty"`
  3825  }
  3826  
  3827  // EdgeUsageDataEventHub ...
  3828  type EdgeUsageDataEventHub struct {
  3829  	// Name - Name of the Event Hub where usage will be reported.
  3830  	Name *string `json:"name,omitempty"`
  3831  	// Namespace - Namespace of the Event Hub where usage will be reported.
  3832  	Namespace *string `json:"namespace,omitempty"`
  3833  	// Token - SAS token needed to interact with Event Hub.
  3834  	Token *string `json:"token,omitempty"`
  3835  }
  3836  
  3837  // EnabledProtocols class to specify which protocols are enabled
  3838  type EnabledProtocols struct {
  3839  	// Download - Enable Download protocol or not
  3840  	Download *bool `json:"download,omitempty"`
  3841  	// Dash - Enable DASH protocol or not
  3842  	Dash *bool `json:"dash,omitempty"`
  3843  	// Hls - Enable HLS protocol or not
  3844  	Hls *bool `json:"hls,omitempty"`
  3845  	// SmoothStreaming - Enable SmoothStreaming protocol or not
  3846  	SmoothStreaming *bool `json:"smoothStreaming,omitempty"`
  3847  }
  3848  
  3849  // EntityNameAvailabilityCheckOutput the response from the check name availability request.
  3850  type EntityNameAvailabilityCheckOutput struct {
  3851  	autorest.Response `json:"-"`
  3852  	// NameAvailable - Specifies if the name is available.
  3853  	NameAvailable *bool `json:"nameAvailable,omitempty"`
  3854  	// Reason - Specifies the reason if the name is not available.
  3855  	Reason *string `json:"reason,omitempty"`
  3856  	// Message - Specifies the detailed reason if the name is not available.
  3857  	Message *string `json:"message,omitempty"`
  3858  }
  3859  
  3860  // EnvelopeEncryption class for EnvelopeEncryption encryption scheme
  3861  type EnvelopeEncryption struct {
  3862  	// EnabledProtocols - Representing supported protocols
  3863  	EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
  3864  	// ClearTracks - Representing which tracks should not be encrypted
  3865  	ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"`
  3866  	// ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks
  3867  	ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"`
  3868  	// 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.
  3869  	CustomKeyAcquisitionURLTemplate *string `json:"customKeyAcquisitionUrlTemplate,omitempty"`
  3870  }
  3871  
  3872  // ErrorAdditionalInfo the resource management error additional info.
  3873  type ErrorAdditionalInfo struct {
  3874  	// Type - READ-ONLY; The additional info type.
  3875  	Type *string `json:"type,omitempty"`
  3876  	// Info - READ-ONLY; The additional info.
  3877  	Info interface{} `json:"info,omitempty"`
  3878  }
  3879  
  3880  // MarshalJSON is the custom marshaler for ErrorAdditionalInfo.
  3881  func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
  3882  	objectMap := make(map[string]interface{})
  3883  	return json.Marshal(objectMap)
  3884  }
  3885  
  3886  // ErrorDetail the error detail.
  3887  type ErrorDetail struct {
  3888  	// Code - READ-ONLY; The error code.
  3889  	Code *string `json:"code,omitempty"`
  3890  	// Message - READ-ONLY; The error message.
  3891  	Message *string `json:"message,omitempty"`
  3892  	// Target - READ-ONLY; The error target.
  3893  	Target *string `json:"target,omitempty"`
  3894  	// Details - READ-ONLY; The error details.
  3895  	Details *[]ErrorDetail `json:"details,omitempty"`
  3896  	// AdditionalInfo - READ-ONLY; The error additional info.
  3897  	AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
  3898  }
  3899  
  3900  // MarshalJSON is the custom marshaler for ErrorDetail.
  3901  func (ed ErrorDetail) MarshalJSON() ([]byte, error) {
  3902  	objectMap := make(map[string]interface{})
  3903  	return json.Marshal(objectMap)
  3904  }
  3905  
  3906  // ErrorResponse common error response for all Azure Resource Manager APIs to return error details for
  3907  // failed operations. (This also follows the OData error response format.).
  3908  type ErrorResponse struct {
  3909  	// Error - The error object.
  3910  	Error *ErrorDetail `json:"error,omitempty"`
  3911  }
  3912  
  3913  // FaceDetectorPreset describes all the settings to be used when analyzing a video in order to detect (and
  3914  // optionally redact) all the faces present.
  3915  type FaceDetectorPreset struct {
  3916  	// 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'
  3917  	Resolution AnalysisResolution `json:"resolution,omitempty"`
  3918  	// 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'
  3919  	Mode FaceRedactorMode `json:"mode,omitempty"`
  3920  	// BlurType - Blur type. Possible values include: 'BlurTypeBox', 'BlurTypeLow', 'BlurTypeMed', 'BlurTypeHigh', 'BlurTypeBlack'
  3921  	BlurType BlurType `json:"blurType,omitempty"`
  3922  	// ExperimentalOptions - Dictionary containing key value pairs for parameters not exposed in the preset itself
  3923  	ExperimentalOptions map[string]*string `json:"experimentalOptions"`
  3924  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
  3925  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
  3926  }
  3927  
  3928  // MarshalJSON is the custom marshaler for FaceDetectorPreset.
  3929  func (fdp FaceDetectorPreset) MarshalJSON() ([]byte, error) {
  3930  	fdp.OdataType = OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset
  3931  	objectMap := make(map[string]interface{})
  3932  	if fdp.Resolution != "" {
  3933  		objectMap["resolution"] = fdp.Resolution
  3934  	}
  3935  	if fdp.Mode != "" {
  3936  		objectMap["mode"] = fdp.Mode
  3937  	}
  3938  	if fdp.BlurType != "" {
  3939  		objectMap["blurType"] = fdp.BlurType
  3940  	}
  3941  	if fdp.ExperimentalOptions != nil {
  3942  		objectMap["experimentalOptions"] = fdp.ExperimentalOptions
  3943  	}
  3944  	if fdp.OdataType != "" {
  3945  		objectMap["@odata.type"] = fdp.OdataType
  3946  	}
  3947  	return json.Marshal(objectMap)
  3948  }
  3949  
  3950  // AsFaceDetectorPreset is the BasicPreset implementation for FaceDetectorPreset.
  3951  func (fdp FaceDetectorPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
  3952  	return &fdp, true
  3953  }
  3954  
  3955  // AsAudioAnalyzerPreset is the BasicPreset implementation for FaceDetectorPreset.
  3956  func (fdp FaceDetectorPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
  3957  	return nil, false
  3958  }
  3959  
  3960  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for FaceDetectorPreset.
  3961  func (fdp FaceDetectorPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
  3962  	return nil, false
  3963  }
  3964  
  3965  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for FaceDetectorPreset.
  3966  func (fdp FaceDetectorPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
  3967  	return nil, false
  3968  }
  3969  
  3970  // AsStandardEncoderPreset is the BasicPreset implementation for FaceDetectorPreset.
  3971  func (fdp FaceDetectorPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
  3972  	return nil, false
  3973  }
  3974  
  3975  // AsVideoAnalyzerPreset is the BasicPreset implementation for FaceDetectorPreset.
  3976  func (fdp FaceDetectorPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
  3977  	return nil, false
  3978  }
  3979  
  3980  // AsPreset is the BasicPreset implementation for FaceDetectorPreset.
  3981  func (fdp FaceDetectorPreset) AsPreset() (*Preset, bool) {
  3982  	return nil, false
  3983  }
  3984  
  3985  // AsBasicPreset is the BasicPreset implementation for FaceDetectorPreset.
  3986  func (fdp FaceDetectorPreset) AsBasicPreset() (BasicPreset, bool) {
  3987  	return &fdp, true
  3988  }
  3989  
  3990  // FilterProperties the Media Filter properties.
  3991  type FilterProperties struct {
  3992  	// PresentationTimeRange - The presentation time range.
  3993  	PresentationTimeRange *PresentationTimeRange `json:"presentationTimeRange,omitempty"`
  3994  	// FirstQuality - The first quality.
  3995  	FirstQuality *FirstQuality `json:"firstQuality,omitempty"`
  3996  	// Tracks - The tracks selection conditions.
  3997  	Tracks *[]FilterTrackSelection `json:"tracks,omitempty"`
  3998  }
  3999  
  4000  // Filters describes all the filtering operations, such as de-interlacing, rotation etc. that are to be
  4001  // applied to the input media before encoding.
  4002  type Filters struct {
  4003  	// Deinterlace - The de-interlacing settings.
  4004  	Deinterlace *Deinterlace `json:"deinterlace,omitempty"`
  4005  	// 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'
  4006  	Rotation Rotation `json:"rotation,omitempty"`
  4007  	// Crop - The parameters for the rectangular window with which to crop the input video.
  4008  	Crop *Rectangle `json:"crop,omitempty"`
  4009  	// Overlays - The properties of overlays to be applied to the input video. These could be audio, image or video overlays.
  4010  	Overlays *[]BasicOverlay `json:"overlays,omitempty"`
  4011  }
  4012  
  4013  // UnmarshalJSON is the custom unmarshaler for Filters struct.
  4014  func (f *Filters) UnmarshalJSON(body []byte) error {
  4015  	var m map[string]*json.RawMessage
  4016  	err := json.Unmarshal(body, &m)
  4017  	if err != nil {
  4018  		return err
  4019  	}
  4020  	for k, v := range m {
  4021  		switch k {
  4022  		case "deinterlace":
  4023  			if v != nil {
  4024  				var deinterlace Deinterlace
  4025  				err = json.Unmarshal(*v, &deinterlace)
  4026  				if err != nil {
  4027  					return err
  4028  				}
  4029  				f.Deinterlace = &deinterlace
  4030  			}
  4031  		case "rotation":
  4032  			if v != nil {
  4033  				var rotation Rotation
  4034  				err = json.Unmarshal(*v, &rotation)
  4035  				if err != nil {
  4036  					return err
  4037  				}
  4038  				f.Rotation = rotation
  4039  			}
  4040  		case "crop":
  4041  			if v != nil {
  4042  				var crop Rectangle
  4043  				err = json.Unmarshal(*v, &crop)
  4044  				if err != nil {
  4045  					return err
  4046  				}
  4047  				f.Crop = &crop
  4048  			}
  4049  		case "overlays":
  4050  			if v != nil {
  4051  				overlays, err := unmarshalBasicOverlayArray(*v)
  4052  				if err != nil {
  4053  					return err
  4054  				}
  4055  				f.Overlays = &overlays
  4056  			}
  4057  		}
  4058  	}
  4059  
  4060  	return nil
  4061  }
  4062  
  4063  // FilterTrackPropertyCondition the class to specify one track property condition.
  4064  type FilterTrackPropertyCondition struct {
  4065  	// Property - The track property type. Possible values include: 'FilterTrackPropertyTypeUnknown', 'FilterTrackPropertyTypeType', 'FilterTrackPropertyTypeName', 'FilterTrackPropertyTypeLanguage', 'FilterTrackPropertyTypeFourCC', 'FilterTrackPropertyTypeBitrate'
  4066  	Property FilterTrackPropertyType `json:"property,omitempty"`
  4067  	// Value - The track property value.
  4068  	Value *string `json:"value,omitempty"`
  4069  	// Operation - The track property condition operation. Possible values include: 'FilterTrackPropertyCompareOperationEqual', 'FilterTrackPropertyCompareOperationNotEqual'
  4070  	Operation FilterTrackPropertyCompareOperation `json:"operation,omitempty"`
  4071  }
  4072  
  4073  // FilterTrackSelection representing a list of FilterTrackPropertyConditions to select a track.  The
  4074  // filters are combined using a logical AND operation.
  4075  type FilterTrackSelection struct {
  4076  	// TrackSelections - The track selections.
  4077  	TrackSelections *[]FilterTrackPropertyCondition `json:"trackSelections,omitempty"`
  4078  }
  4079  
  4080  // FirstQuality filter First Quality
  4081  type FirstQuality struct {
  4082  	// Bitrate - The first quality bitrate.
  4083  	Bitrate *int32 `json:"bitrate,omitempty"`
  4084  }
  4085  
  4086  // BasicFormat base class for output.
  4087  type BasicFormat interface {
  4088  	AsImageFormat() (*ImageFormat, bool)
  4089  	AsBasicImageFormat() (BasicImageFormat, bool)
  4090  	AsJpgFormat() (*JpgFormat, bool)
  4091  	AsPngFormat() (*PngFormat, bool)
  4092  	AsMultiBitrateFormat() (*MultiBitrateFormat, bool)
  4093  	AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool)
  4094  	AsMp4Format() (*Mp4Format, bool)
  4095  	AsTransportStreamFormat() (*TransportStreamFormat, bool)
  4096  	AsFormat() (*Format, bool)
  4097  }
  4098  
  4099  // Format base class for output.
  4100  type Format struct {
  4101  	// 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.
  4102  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  4103  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  4104  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  4105  }
  4106  
  4107  func unmarshalBasicFormat(body []byte) (BasicFormat, error) {
  4108  	var m map[string]interface{}
  4109  	err := json.Unmarshal(body, &m)
  4110  	if err != nil {
  4111  		return nil, err
  4112  	}
  4113  
  4114  	switch m["@odata.type"] {
  4115  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat):
  4116  		var ifVar ImageFormat
  4117  		err := json.Unmarshal(body, &ifVar)
  4118  		return ifVar, err
  4119  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat):
  4120  		var jf JpgFormat
  4121  		err := json.Unmarshal(body, &jf)
  4122  		return jf, err
  4123  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat):
  4124  		var pf PngFormat
  4125  		err := json.Unmarshal(body, &pf)
  4126  		return pf, err
  4127  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat):
  4128  		var mbf MultiBitrateFormat
  4129  		err := json.Unmarshal(body, &mbf)
  4130  		return mbf, err
  4131  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format):
  4132  		var m4f Mp4Format
  4133  		err := json.Unmarshal(body, &m4f)
  4134  		return m4f, err
  4135  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat):
  4136  		var tsf TransportStreamFormat
  4137  		err := json.Unmarshal(body, &tsf)
  4138  		return tsf, err
  4139  	default:
  4140  		var f Format
  4141  		err := json.Unmarshal(body, &f)
  4142  		return f, err
  4143  	}
  4144  }
  4145  func unmarshalBasicFormatArray(body []byte) ([]BasicFormat, error) {
  4146  	var rawMessages []*json.RawMessage
  4147  	err := json.Unmarshal(body, &rawMessages)
  4148  	if err != nil {
  4149  		return nil, err
  4150  	}
  4151  
  4152  	fArray := make([]BasicFormat, len(rawMessages))
  4153  
  4154  	for index, rawMessage := range rawMessages {
  4155  		f, err := unmarshalBasicFormat(*rawMessage)
  4156  		if err != nil {
  4157  			return nil, err
  4158  		}
  4159  		fArray[index] = f
  4160  	}
  4161  	return fArray, nil
  4162  }
  4163  
  4164  // MarshalJSON is the custom marshaler for Format.
  4165  func (f Format) MarshalJSON() ([]byte, error) {
  4166  	f.OdataType = OdataTypeBasicFormatOdataTypeFormat
  4167  	objectMap := make(map[string]interface{})
  4168  	if f.FilenamePattern != nil {
  4169  		objectMap["filenamePattern"] = f.FilenamePattern
  4170  	}
  4171  	if f.OdataType != "" {
  4172  		objectMap["@odata.type"] = f.OdataType
  4173  	}
  4174  	return json.Marshal(objectMap)
  4175  }
  4176  
  4177  // AsImageFormat is the BasicFormat implementation for Format.
  4178  func (f Format) AsImageFormat() (*ImageFormat, bool) {
  4179  	return nil, false
  4180  }
  4181  
  4182  // AsBasicImageFormat is the BasicFormat implementation for Format.
  4183  func (f Format) AsBasicImageFormat() (BasicImageFormat, bool) {
  4184  	return nil, false
  4185  }
  4186  
  4187  // AsJpgFormat is the BasicFormat implementation for Format.
  4188  func (f Format) AsJpgFormat() (*JpgFormat, bool) {
  4189  	return nil, false
  4190  }
  4191  
  4192  // AsPngFormat is the BasicFormat implementation for Format.
  4193  func (f Format) AsPngFormat() (*PngFormat, bool) {
  4194  	return nil, false
  4195  }
  4196  
  4197  // AsMultiBitrateFormat is the BasicFormat implementation for Format.
  4198  func (f Format) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  4199  	return nil, false
  4200  }
  4201  
  4202  // AsBasicMultiBitrateFormat is the BasicFormat implementation for Format.
  4203  func (f Format) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  4204  	return nil, false
  4205  }
  4206  
  4207  // AsMp4Format is the BasicFormat implementation for Format.
  4208  func (f Format) AsMp4Format() (*Mp4Format, bool) {
  4209  	return nil, false
  4210  }
  4211  
  4212  // AsTransportStreamFormat is the BasicFormat implementation for Format.
  4213  func (f Format) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  4214  	return nil, false
  4215  }
  4216  
  4217  // AsFormat is the BasicFormat implementation for Format.
  4218  func (f Format) AsFormat() (*Format, bool) {
  4219  	return &f, true
  4220  }
  4221  
  4222  // AsBasicFormat is the BasicFormat implementation for Format.
  4223  func (f Format) AsBasicFormat() (BasicFormat, bool) {
  4224  	return &f, true
  4225  }
  4226  
  4227  // FromAllInputFile an InputDefinition that looks across all of the files provided to select tracks
  4228  // specified by the IncludedTracks property. Generally used with the AudioTrackByAttribute and
  4229  // VideoTrackByAttribute to allow selection of a single track across a set of input files.
  4230  type FromAllInputFile struct {
  4231  	// IncludedTracks - The list of TrackDescriptors which define the metadata and selection of tracks in the input.
  4232  	IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
  4233  	// OdataType - Possible values include: 'OdataTypeBasicInputDefinitionOdataTypeInputDefinition', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile'
  4234  	OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
  4235  }
  4236  
  4237  // MarshalJSON is the custom marshaler for FromAllInputFile.
  4238  func (faif FromAllInputFile) MarshalJSON() ([]byte, error) {
  4239  	faif.OdataType = OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile
  4240  	objectMap := make(map[string]interface{})
  4241  	if faif.IncludedTracks != nil {
  4242  		objectMap["includedTracks"] = faif.IncludedTracks
  4243  	}
  4244  	if faif.OdataType != "" {
  4245  		objectMap["@odata.type"] = faif.OdataType
  4246  	}
  4247  	return json.Marshal(objectMap)
  4248  }
  4249  
  4250  // AsFromAllInputFile is the BasicInputDefinition implementation for FromAllInputFile.
  4251  func (faif FromAllInputFile) AsFromAllInputFile() (*FromAllInputFile, bool) {
  4252  	return &faif, true
  4253  }
  4254  
  4255  // AsFromEachInputFile is the BasicInputDefinition implementation for FromAllInputFile.
  4256  func (faif FromAllInputFile) AsFromEachInputFile() (*FromEachInputFile, bool) {
  4257  	return nil, false
  4258  }
  4259  
  4260  // AsInputFile is the BasicInputDefinition implementation for FromAllInputFile.
  4261  func (faif FromAllInputFile) AsInputFile() (*InputFile, bool) {
  4262  	return nil, false
  4263  }
  4264  
  4265  // AsInputDefinition is the BasicInputDefinition implementation for FromAllInputFile.
  4266  func (faif FromAllInputFile) AsInputDefinition() (*InputDefinition, bool) {
  4267  	return nil, false
  4268  }
  4269  
  4270  // AsBasicInputDefinition is the BasicInputDefinition implementation for FromAllInputFile.
  4271  func (faif FromAllInputFile) AsBasicInputDefinition() (BasicInputDefinition, bool) {
  4272  	return &faif, true
  4273  }
  4274  
  4275  // UnmarshalJSON is the custom unmarshaler for FromAllInputFile struct.
  4276  func (faif *FromAllInputFile) UnmarshalJSON(body []byte) error {
  4277  	var m map[string]*json.RawMessage
  4278  	err := json.Unmarshal(body, &m)
  4279  	if err != nil {
  4280  		return err
  4281  	}
  4282  	for k, v := range m {
  4283  		switch k {
  4284  		case "includedTracks":
  4285  			if v != nil {
  4286  				includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
  4287  				if err != nil {
  4288  					return err
  4289  				}
  4290  				faif.IncludedTracks = &includedTracks
  4291  			}
  4292  		case "@odata.type":
  4293  			if v != nil {
  4294  				var odataType OdataTypeBasicInputDefinition
  4295  				err = json.Unmarshal(*v, &odataType)
  4296  				if err != nil {
  4297  					return err
  4298  				}
  4299  				faif.OdataType = odataType
  4300  			}
  4301  		}
  4302  	}
  4303  
  4304  	return nil
  4305  }
  4306  
  4307  // FromEachInputFile an InputDefinition that looks at each input file provided to select tracks specified
  4308  // by the IncludedTracks property. Generally used with the AudioTrackByAttribute and VideoTrackByAttribute
  4309  // to select tracks from each file given.
  4310  type FromEachInputFile struct {
  4311  	// IncludedTracks - The list of TrackDescriptors which define the metadata and selection of tracks in the input.
  4312  	IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
  4313  	// OdataType - Possible values include: 'OdataTypeBasicInputDefinitionOdataTypeInputDefinition', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile'
  4314  	OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
  4315  }
  4316  
  4317  // MarshalJSON is the custom marshaler for FromEachInputFile.
  4318  func (feif FromEachInputFile) MarshalJSON() ([]byte, error) {
  4319  	feif.OdataType = OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile
  4320  	objectMap := make(map[string]interface{})
  4321  	if feif.IncludedTracks != nil {
  4322  		objectMap["includedTracks"] = feif.IncludedTracks
  4323  	}
  4324  	if feif.OdataType != "" {
  4325  		objectMap["@odata.type"] = feif.OdataType
  4326  	}
  4327  	return json.Marshal(objectMap)
  4328  }
  4329  
  4330  // AsFromAllInputFile is the BasicInputDefinition implementation for FromEachInputFile.
  4331  func (feif FromEachInputFile) AsFromAllInputFile() (*FromAllInputFile, bool) {
  4332  	return nil, false
  4333  }
  4334  
  4335  // AsFromEachInputFile is the BasicInputDefinition implementation for FromEachInputFile.
  4336  func (feif FromEachInputFile) AsFromEachInputFile() (*FromEachInputFile, bool) {
  4337  	return &feif, true
  4338  }
  4339  
  4340  // AsInputFile is the BasicInputDefinition implementation for FromEachInputFile.
  4341  func (feif FromEachInputFile) AsInputFile() (*InputFile, bool) {
  4342  	return nil, false
  4343  }
  4344  
  4345  // AsInputDefinition is the BasicInputDefinition implementation for FromEachInputFile.
  4346  func (feif FromEachInputFile) AsInputDefinition() (*InputDefinition, bool) {
  4347  	return nil, false
  4348  }
  4349  
  4350  // AsBasicInputDefinition is the BasicInputDefinition implementation for FromEachInputFile.
  4351  func (feif FromEachInputFile) AsBasicInputDefinition() (BasicInputDefinition, bool) {
  4352  	return &feif, true
  4353  }
  4354  
  4355  // UnmarshalJSON is the custom unmarshaler for FromEachInputFile struct.
  4356  func (feif *FromEachInputFile) UnmarshalJSON(body []byte) error {
  4357  	var m map[string]*json.RawMessage
  4358  	err := json.Unmarshal(body, &m)
  4359  	if err != nil {
  4360  		return err
  4361  	}
  4362  	for k, v := range m {
  4363  		switch k {
  4364  		case "includedTracks":
  4365  			if v != nil {
  4366  				includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
  4367  				if err != nil {
  4368  					return err
  4369  				}
  4370  				feif.IncludedTracks = &includedTracks
  4371  			}
  4372  		case "@odata.type":
  4373  			if v != nil {
  4374  				var odataType OdataTypeBasicInputDefinition
  4375  				err = json.Unmarshal(*v, &odataType)
  4376  				if err != nil {
  4377  					return err
  4378  				}
  4379  				feif.OdataType = odataType
  4380  			}
  4381  		}
  4382  	}
  4383  
  4384  	return nil
  4385  }
  4386  
  4387  // H264Layer describes the settings to be used when encoding the input video into a desired output bitrate
  4388  // layer with the H.264 video codec.
  4389  type H264Layer struct {
  4390  	// Profile - We currently support Baseline, Main, High, High422, High444. Default is Auto. Possible values include: 'H264VideoProfileAuto', 'H264VideoProfileBaseline', 'H264VideoProfileMain', 'H264VideoProfileHigh', 'H264VideoProfileHigh422', 'H264VideoProfileHigh444'
  4391  	Profile H264VideoProfile `json:"profile,omitempty"`
  4392  	// 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.
  4393  	Level *string `json:"level,omitempty"`
  4394  	// 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).
  4395  	BufferWindow *string `json:"bufferWindow,omitempty"`
  4396  	// 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.
  4397  	ReferenceFrames *int32 `json:"referenceFrames,omitempty"`
  4398  	// 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'
  4399  	EntropyMode EntropyMode `json:"entropyMode,omitempty"`
  4400  	// Bitrate - The average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field.
  4401  	Bitrate *int32 `json:"bitrate,omitempty"`
  4402  	// 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.
  4403  	MaxBitrate *int32 `json:"maxBitrate,omitempty"`
  4404  	// 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.
  4405  	BFrames *int32 `json:"bFrames,omitempty"`
  4406  	// 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.
  4407  	FrameRate *string `json:"frameRate,omitempty"`
  4408  	// 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.
  4409  	Slices *int32 `json:"slices,omitempty"`
  4410  	// 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.
  4411  	AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
  4412  	// 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.
  4413  	Width *string `json:"width,omitempty"`
  4414  	// 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.
  4415  	Height *string `json:"height,omitempty"`
  4416  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  4417  	Label *string `json:"label,omitempty"`
  4418  	// OdataType - Possible values include: 'OdataTypeBasicLayerOdataTypeLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer'
  4419  	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
  4420  }
  4421  
  4422  // MarshalJSON is the custom marshaler for H264Layer.
  4423  func (hl H264Layer) MarshalJSON() ([]byte, error) {
  4424  	hl.OdataType = OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer
  4425  	objectMap := make(map[string]interface{})
  4426  	if hl.Profile != "" {
  4427  		objectMap["profile"] = hl.Profile
  4428  	}
  4429  	if hl.Level != nil {
  4430  		objectMap["level"] = hl.Level
  4431  	}
  4432  	if hl.BufferWindow != nil {
  4433  		objectMap["bufferWindow"] = hl.BufferWindow
  4434  	}
  4435  	if hl.ReferenceFrames != nil {
  4436  		objectMap["referenceFrames"] = hl.ReferenceFrames
  4437  	}
  4438  	if hl.EntropyMode != "" {
  4439  		objectMap["entropyMode"] = hl.EntropyMode
  4440  	}
  4441  	if hl.Bitrate != nil {
  4442  		objectMap["bitrate"] = hl.Bitrate
  4443  	}
  4444  	if hl.MaxBitrate != nil {
  4445  		objectMap["maxBitrate"] = hl.MaxBitrate
  4446  	}
  4447  	if hl.BFrames != nil {
  4448  		objectMap["bFrames"] = hl.BFrames
  4449  	}
  4450  	if hl.FrameRate != nil {
  4451  		objectMap["frameRate"] = hl.FrameRate
  4452  	}
  4453  	if hl.Slices != nil {
  4454  		objectMap["slices"] = hl.Slices
  4455  	}
  4456  	if hl.AdaptiveBFrame != nil {
  4457  		objectMap["adaptiveBFrame"] = hl.AdaptiveBFrame
  4458  	}
  4459  	if hl.Width != nil {
  4460  		objectMap["width"] = hl.Width
  4461  	}
  4462  	if hl.Height != nil {
  4463  		objectMap["height"] = hl.Height
  4464  	}
  4465  	if hl.Label != nil {
  4466  		objectMap["label"] = hl.Label
  4467  	}
  4468  	if hl.OdataType != "" {
  4469  		objectMap["@odata.type"] = hl.OdataType
  4470  	}
  4471  	return json.Marshal(objectMap)
  4472  }
  4473  
  4474  // AsH265VideoLayer is the BasicLayer implementation for H264Layer.
  4475  func (hl H264Layer) AsH265VideoLayer() (*H265VideoLayer, bool) {
  4476  	return nil, false
  4477  }
  4478  
  4479  // AsBasicH265VideoLayer is the BasicLayer implementation for H264Layer.
  4480  func (hl H264Layer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
  4481  	return nil, false
  4482  }
  4483  
  4484  // AsH265Layer is the BasicLayer implementation for H264Layer.
  4485  func (hl H264Layer) AsH265Layer() (*H265Layer, bool) {
  4486  	return nil, false
  4487  }
  4488  
  4489  // AsVideoLayer is the BasicLayer implementation for H264Layer.
  4490  func (hl H264Layer) AsVideoLayer() (*VideoLayer, bool) {
  4491  	return nil, false
  4492  }
  4493  
  4494  // AsBasicVideoLayer is the BasicLayer implementation for H264Layer.
  4495  func (hl H264Layer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
  4496  	return &hl, true
  4497  }
  4498  
  4499  // AsH264Layer is the BasicLayer implementation for H264Layer.
  4500  func (hl H264Layer) AsH264Layer() (*H264Layer, bool) {
  4501  	return &hl, true
  4502  }
  4503  
  4504  // AsJpgLayer is the BasicLayer implementation for H264Layer.
  4505  func (hl H264Layer) AsJpgLayer() (*JpgLayer, bool) {
  4506  	return nil, false
  4507  }
  4508  
  4509  // AsPngLayer is the BasicLayer implementation for H264Layer.
  4510  func (hl H264Layer) AsPngLayer() (*PngLayer, bool) {
  4511  	return nil, false
  4512  }
  4513  
  4514  // AsLayer is the BasicLayer implementation for H264Layer.
  4515  func (hl H264Layer) AsLayer() (*Layer, bool) {
  4516  	return nil, false
  4517  }
  4518  
  4519  // AsBasicLayer is the BasicLayer implementation for H264Layer.
  4520  func (hl H264Layer) AsBasicLayer() (BasicLayer, bool) {
  4521  	return &hl, true
  4522  }
  4523  
  4524  // H264Video describes all the properties for encoding a video with the H.264 codec.
  4525  type H264Video struct {
  4526  	// 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.
  4527  	SceneChangeDetection *bool `json:"sceneChangeDetection,omitempty"`
  4528  	// Complexity - Tells the encoder how to choose its encoding settings. The default value is Balanced. Possible values include: 'H264ComplexitySpeed', 'H264ComplexityBalanced', 'H264ComplexityQuality'
  4529  	Complexity H264Complexity `json:"complexity,omitempty"`
  4530  	// Layers - The collection of output H.264 layers to be produced by the encoder.
  4531  	Layers *[]H264Layer `json:"layers,omitempty"`
  4532  	// 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.
  4533  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  4534  	// 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'
  4535  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  4536  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
  4537  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
  4538  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  4539  	Label *string `json:"label,omitempty"`
  4540  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  4541  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  4542  }
  4543  
  4544  // MarshalJSON is the custom marshaler for H264Video.
  4545  func (hv H264Video) MarshalJSON() ([]byte, error) {
  4546  	hv.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video
  4547  	objectMap := make(map[string]interface{})
  4548  	if hv.SceneChangeDetection != nil {
  4549  		objectMap["sceneChangeDetection"] = hv.SceneChangeDetection
  4550  	}
  4551  	if hv.Complexity != "" {
  4552  		objectMap["complexity"] = hv.Complexity
  4553  	}
  4554  	if hv.Layers != nil {
  4555  		objectMap["layers"] = hv.Layers
  4556  	}
  4557  	if hv.KeyFrameInterval != nil {
  4558  		objectMap["keyFrameInterval"] = hv.KeyFrameInterval
  4559  	}
  4560  	if hv.StretchMode != "" {
  4561  		objectMap["stretchMode"] = hv.StretchMode
  4562  	}
  4563  	if hv.SyncMode != "" {
  4564  		objectMap["syncMode"] = hv.SyncMode
  4565  	}
  4566  	if hv.Label != nil {
  4567  		objectMap["label"] = hv.Label
  4568  	}
  4569  	if hv.OdataType != "" {
  4570  		objectMap["@odata.type"] = hv.OdataType
  4571  	}
  4572  	return json.Marshal(objectMap)
  4573  }
  4574  
  4575  // AsAudio is the BasicCodec implementation for H264Video.
  4576  func (hv H264Video) AsAudio() (*Audio, bool) {
  4577  	return nil, false
  4578  }
  4579  
  4580  // AsBasicAudio is the BasicCodec implementation for H264Video.
  4581  func (hv H264Video) AsBasicAudio() (BasicAudio, bool) {
  4582  	return nil, false
  4583  }
  4584  
  4585  // AsAacAudio is the BasicCodec implementation for H264Video.
  4586  func (hv H264Video) AsAacAudio() (*AacAudio, bool) {
  4587  	return nil, false
  4588  }
  4589  
  4590  // AsVideo is the BasicCodec implementation for H264Video.
  4591  func (hv H264Video) AsVideo() (*Video, bool) {
  4592  	return nil, false
  4593  }
  4594  
  4595  // AsBasicVideo is the BasicCodec implementation for H264Video.
  4596  func (hv H264Video) AsBasicVideo() (BasicVideo, bool) {
  4597  	return &hv, true
  4598  }
  4599  
  4600  // AsH265Video is the BasicCodec implementation for H264Video.
  4601  func (hv H264Video) AsH265Video() (*H265Video, bool) {
  4602  	return nil, false
  4603  }
  4604  
  4605  // AsCopyVideo is the BasicCodec implementation for H264Video.
  4606  func (hv H264Video) AsCopyVideo() (*CopyVideo, bool) {
  4607  	return nil, false
  4608  }
  4609  
  4610  // AsImage is the BasicCodec implementation for H264Video.
  4611  func (hv H264Video) AsImage() (*Image, bool) {
  4612  	return nil, false
  4613  }
  4614  
  4615  // AsBasicImage is the BasicCodec implementation for H264Video.
  4616  func (hv H264Video) AsBasicImage() (BasicImage, bool) {
  4617  	return nil, false
  4618  }
  4619  
  4620  // AsCopyAudio is the BasicCodec implementation for H264Video.
  4621  func (hv H264Video) AsCopyAudio() (*CopyAudio, bool) {
  4622  	return nil, false
  4623  }
  4624  
  4625  // AsH264Video is the BasicCodec implementation for H264Video.
  4626  func (hv H264Video) AsH264Video() (*H264Video, bool) {
  4627  	return &hv, true
  4628  }
  4629  
  4630  // AsJpgImage is the BasicCodec implementation for H264Video.
  4631  func (hv H264Video) AsJpgImage() (*JpgImage, bool) {
  4632  	return nil, false
  4633  }
  4634  
  4635  // AsPngImage is the BasicCodec implementation for H264Video.
  4636  func (hv H264Video) AsPngImage() (*PngImage, bool) {
  4637  	return nil, false
  4638  }
  4639  
  4640  // AsCodec is the BasicCodec implementation for H264Video.
  4641  func (hv H264Video) AsCodec() (*Codec, bool) {
  4642  	return nil, false
  4643  }
  4644  
  4645  // AsBasicCodec is the BasicCodec implementation for H264Video.
  4646  func (hv H264Video) AsBasicCodec() (BasicCodec, bool) {
  4647  	return &hv, true
  4648  }
  4649  
  4650  // H265Layer describes the settings to be used when encoding the input video into a desired output bitrate
  4651  // layer with the H.265 video codec.
  4652  type H265Layer struct {
  4653  	// Profile - We currently support Main. Default is Auto. Possible values include: 'H265VideoProfileAuto', 'H265VideoProfileMain'
  4654  	Profile H265VideoProfile `json:"profile,omitempty"`
  4655  	// 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.
  4656  	Level *string `json:"level,omitempty"`
  4657  	// 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).
  4658  	BufferWindow *string `json:"bufferWindow,omitempty"`
  4659  	// 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.
  4660  	ReferenceFrames *int32 `json:"referenceFrames,omitempty"`
  4661  	// 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.
  4662  	Bitrate *int32 `json:"bitrate,omitempty"`
  4663  	// 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.
  4664  	MaxBitrate *int32 `json:"maxBitrate,omitempty"`
  4665  	// 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.
  4666  	BFrames *int32 `json:"bFrames,omitempty"`
  4667  	// 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.
  4668  	FrameRate *string `json:"frameRate,omitempty"`
  4669  	// 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.
  4670  	Slices *int32 `json:"slices,omitempty"`
  4671  	// 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.
  4672  	AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
  4673  	// 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.
  4674  	Width *string `json:"width,omitempty"`
  4675  	// 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.
  4676  	Height *string `json:"height,omitempty"`
  4677  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  4678  	Label *string `json:"label,omitempty"`
  4679  	// OdataType - Possible values include: 'OdataTypeBasicLayerOdataTypeLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer'
  4680  	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
  4681  }
  4682  
  4683  // MarshalJSON is the custom marshaler for H265Layer.
  4684  func (hl H265Layer) MarshalJSON() ([]byte, error) {
  4685  	hl.OdataType = OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer
  4686  	objectMap := make(map[string]interface{})
  4687  	if hl.Profile != "" {
  4688  		objectMap["profile"] = hl.Profile
  4689  	}
  4690  	if hl.Level != nil {
  4691  		objectMap["level"] = hl.Level
  4692  	}
  4693  	if hl.BufferWindow != nil {
  4694  		objectMap["bufferWindow"] = hl.BufferWindow
  4695  	}
  4696  	if hl.ReferenceFrames != nil {
  4697  		objectMap["referenceFrames"] = hl.ReferenceFrames
  4698  	}
  4699  	if hl.Bitrate != nil {
  4700  		objectMap["bitrate"] = hl.Bitrate
  4701  	}
  4702  	if hl.MaxBitrate != nil {
  4703  		objectMap["maxBitrate"] = hl.MaxBitrate
  4704  	}
  4705  	if hl.BFrames != nil {
  4706  		objectMap["bFrames"] = hl.BFrames
  4707  	}
  4708  	if hl.FrameRate != nil {
  4709  		objectMap["frameRate"] = hl.FrameRate
  4710  	}
  4711  	if hl.Slices != nil {
  4712  		objectMap["slices"] = hl.Slices
  4713  	}
  4714  	if hl.AdaptiveBFrame != nil {
  4715  		objectMap["adaptiveBFrame"] = hl.AdaptiveBFrame
  4716  	}
  4717  	if hl.Width != nil {
  4718  		objectMap["width"] = hl.Width
  4719  	}
  4720  	if hl.Height != nil {
  4721  		objectMap["height"] = hl.Height
  4722  	}
  4723  	if hl.Label != nil {
  4724  		objectMap["label"] = hl.Label
  4725  	}
  4726  	if hl.OdataType != "" {
  4727  		objectMap["@odata.type"] = hl.OdataType
  4728  	}
  4729  	return json.Marshal(objectMap)
  4730  }
  4731  
  4732  // AsH265VideoLayer is the BasicLayer implementation for H265Layer.
  4733  func (hl H265Layer) AsH265VideoLayer() (*H265VideoLayer, bool) {
  4734  	return nil, false
  4735  }
  4736  
  4737  // AsBasicH265VideoLayer is the BasicLayer implementation for H265Layer.
  4738  func (hl H265Layer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
  4739  	return &hl, true
  4740  }
  4741  
  4742  // AsH265Layer is the BasicLayer implementation for H265Layer.
  4743  func (hl H265Layer) AsH265Layer() (*H265Layer, bool) {
  4744  	return &hl, true
  4745  }
  4746  
  4747  // AsVideoLayer is the BasicLayer implementation for H265Layer.
  4748  func (hl H265Layer) AsVideoLayer() (*VideoLayer, bool) {
  4749  	return nil, false
  4750  }
  4751  
  4752  // AsBasicVideoLayer is the BasicLayer implementation for H265Layer.
  4753  func (hl H265Layer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
  4754  	return nil, false
  4755  }
  4756  
  4757  // AsH264Layer is the BasicLayer implementation for H265Layer.
  4758  func (hl H265Layer) AsH264Layer() (*H264Layer, bool) {
  4759  	return nil, false
  4760  }
  4761  
  4762  // AsJpgLayer is the BasicLayer implementation for H265Layer.
  4763  func (hl H265Layer) AsJpgLayer() (*JpgLayer, bool) {
  4764  	return nil, false
  4765  }
  4766  
  4767  // AsPngLayer is the BasicLayer implementation for H265Layer.
  4768  func (hl H265Layer) AsPngLayer() (*PngLayer, bool) {
  4769  	return nil, false
  4770  }
  4771  
  4772  // AsLayer is the BasicLayer implementation for H265Layer.
  4773  func (hl H265Layer) AsLayer() (*Layer, bool) {
  4774  	return nil, false
  4775  }
  4776  
  4777  // AsBasicLayer is the BasicLayer implementation for H265Layer.
  4778  func (hl H265Layer) AsBasicLayer() (BasicLayer, bool) {
  4779  	return &hl, true
  4780  }
  4781  
  4782  // H265Video describes all the properties for encoding a video with the H.265 codec.
  4783  type H265Video struct {
  4784  	// 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.
  4785  	SceneChangeDetection *bool `json:"sceneChangeDetection,omitempty"`
  4786  	// 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'
  4787  	Complexity H265Complexity `json:"complexity,omitempty"`
  4788  	// Layers - The collection of output H.265 layers to be produced by the encoder.
  4789  	Layers *[]H265Layer `json:"layers,omitempty"`
  4790  	// 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.
  4791  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  4792  	// 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'
  4793  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  4794  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
  4795  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
  4796  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  4797  	Label *string `json:"label,omitempty"`
  4798  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  4799  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  4800  }
  4801  
  4802  // MarshalJSON is the custom marshaler for H265Video.
  4803  func (hv H265Video) MarshalJSON() ([]byte, error) {
  4804  	hv.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video
  4805  	objectMap := make(map[string]interface{})
  4806  	if hv.SceneChangeDetection != nil {
  4807  		objectMap["sceneChangeDetection"] = hv.SceneChangeDetection
  4808  	}
  4809  	if hv.Complexity != "" {
  4810  		objectMap["complexity"] = hv.Complexity
  4811  	}
  4812  	if hv.Layers != nil {
  4813  		objectMap["layers"] = hv.Layers
  4814  	}
  4815  	if hv.KeyFrameInterval != nil {
  4816  		objectMap["keyFrameInterval"] = hv.KeyFrameInterval
  4817  	}
  4818  	if hv.StretchMode != "" {
  4819  		objectMap["stretchMode"] = hv.StretchMode
  4820  	}
  4821  	if hv.SyncMode != "" {
  4822  		objectMap["syncMode"] = hv.SyncMode
  4823  	}
  4824  	if hv.Label != nil {
  4825  		objectMap["label"] = hv.Label
  4826  	}
  4827  	if hv.OdataType != "" {
  4828  		objectMap["@odata.type"] = hv.OdataType
  4829  	}
  4830  	return json.Marshal(objectMap)
  4831  }
  4832  
  4833  // AsAudio is the BasicCodec implementation for H265Video.
  4834  func (hv H265Video) AsAudio() (*Audio, bool) {
  4835  	return nil, false
  4836  }
  4837  
  4838  // AsBasicAudio is the BasicCodec implementation for H265Video.
  4839  func (hv H265Video) AsBasicAudio() (BasicAudio, bool) {
  4840  	return nil, false
  4841  }
  4842  
  4843  // AsAacAudio is the BasicCodec implementation for H265Video.
  4844  func (hv H265Video) AsAacAudio() (*AacAudio, bool) {
  4845  	return nil, false
  4846  }
  4847  
  4848  // AsVideo is the BasicCodec implementation for H265Video.
  4849  func (hv H265Video) AsVideo() (*Video, bool) {
  4850  	return nil, false
  4851  }
  4852  
  4853  // AsBasicVideo is the BasicCodec implementation for H265Video.
  4854  func (hv H265Video) AsBasicVideo() (BasicVideo, bool) {
  4855  	return &hv, true
  4856  }
  4857  
  4858  // AsH265Video is the BasicCodec implementation for H265Video.
  4859  func (hv H265Video) AsH265Video() (*H265Video, bool) {
  4860  	return &hv, true
  4861  }
  4862  
  4863  // AsCopyVideo is the BasicCodec implementation for H265Video.
  4864  func (hv H265Video) AsCopyVideo() (*CopyVideo, bool) {
  4865  	return nil, false
  4866  }
  4867  
  4868  // AsImage is the BasicCodec implementation for H265Video.
  4869  func (hv H265Video) AsImage() (*Image, bool) {
  4870  	return nil, false
  4871  }
  4872  
  4873  // AsBasicImage is the BasicCodec implementation for H265Video.
  4874  func (hv H265Video) AsBasicImage() (BasicImage, bool) {
  4875  	return nil, false
  4876  }
  4877  
  4878  // AsCopyAudio is the BasicCodec implementation for H265Video.
  4879  func (hv H265Video) AsCopyAudio() (*CopyAudio, bool) {
  4880  	return nil, false
  4881  }
  4882  
  4883  // AsH264Video is the BasicCodec implementation for H265Video.
  4884  func (hv H265Video) AsH264Video() (*H264Video, bool) {
  4885  	return nil, false
  4886  }
  4887  
  4888  // AsJpgImage is the BasicCodec implementation for H265Video.
  4889  func (hv H265Video) AsJpgImage() (*JpgImage, bool) {
  4890  	return nil, false
  4891  }
  4892  
  4893  // AsPngImage is the BasicCodec implementation for H265Video.
  4894  func (hv H265Video) AsPngImage() (*PngImage, bool) {
  4895  	return nil, false
  4896  }
  4897  
  4898  // AsCodec is the BasicCodec implementation for H265Video.
  4899  func (hv H265Video) AsCodec() (*Codec, bool) {
  4900  	return nil, false
  4901  }
  4902  
  4903  // AsBasicCodec is the BasicCodec implementation for H265Video.
  4904  func (hv H265Video) AsBasicCodec() (BasicCodec, bool) {
  4905  	return &hv, true
  4906  }
  4907  
  4908  // BasicH265VideoLayer describes the settings to be used when encoding the input video into a desired output bitrate
  4909  // layer.
  4910  type BasicH265VideoLayer interface {
  4911  	AsH265Layer() (*H265Layer, bool)
  4912  	AsH265VideoLayer() (*H265VideoLayer, bool)
  4913  }
  4914  
  4915  // H265VideoLayer describes the settings to be used when encoding the input video into a desired output bitrate
  4916  // layer.
  4917  type H265VideoLayer struct {
  4918  	// 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.
  4919  	Bitrate *int32 `json:"bitrate,omitempty"`
  4920  	// 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.
  4921  	MaxBitrate *int32 `json:"maxBitrate,omitempty"`
  4922  	// 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.
  4923  	BFrames *int32 `json:"bFrames,omitempty"`
  4924  	// 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.
  4925  	FrameRate *string `json:"frameRate,omitempty"`
  4926  	// 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.
  4927  	Slices *int32 `json:"slices,omitempty"`
  4928  	// 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.
  4929  	AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
  4930  	// 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.
  4931  	Width *string `json:"width,omitempty"`
  4932  	// 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.
  4933  	Height *string `json:"height,omitempty"`
  4934  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  4935  	Label *string `json:"label,omitempty"`
  4936  	// OdataType - Possible values include: 'OdataTypeBasicLayerOdataTypeLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer'
  4937  	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
  4938  }
  4939  
  4940  func unmarshalBasicH265VideoLayer(body []byte) (BasicH265VideoLayer, error) {
  4941  	var m map[string]interface{}
  4942  	err := json.Unmarshal(body, &m)
  4943  	if err != nil {
  4944  		return nil, err
  4945  	}
  4946  
  4947  	switch m["@odata.type"] {
  4948  	case string(OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer):
  4949  		var hl H265Layer
  4950  		err := json.Unmarshal(body, &hl)
  4951  		return hl, err
  4952  	default:
  4953  		var hvl H265VideoLayer
  4954  		err := json.Unmarshal(body, &hvl)
  4955  		return hvl, err
  4956  	}
  4957  }
  4958  func unmarshalBasicH265VideoLayerArray(body []byte) ([]BasicH265VideoLayer, error) {
  4959  	var rawMessages []*json.RawMessage
  4960  	err := json.Unmarshal(body, &rawMessages)
  4961  	if err != nil {
  4962  		return nil, err
  4963  	}
  4964  
  4965  	hvlArray := make([]BasicH265VideoLayer, len(rawMessages))
  4966  
  4967  	for index, rawMessage := range rawMessages {
  4968  		hvl, err := unmarshalBasicH265VideoLayer(*rawMessage)
  4969  		if err != nil {
  4970  			return nil, err
  4971  		}
  4972  		hvlArray[index] = hvl
  4973  	}
  4974  	return hvlArray, nil
  4975  }
  4976  
  4977  // MarshalJSON is the custom marshaler for H265VideoLayer.
  4978  func (hvl H265VideoLayer) MarshalJSON() ([]byte, error) {
  4979  	hvl.OdataType = OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer
  4980  	objectMap := make(map[string]interface{})
  4981  	if hvl.Bitrate != nil {
  4982  		objectMap["bitrate"] = hvl.Bitrate
  4983  	}
  4984  	if hvl.MaxBitrate != nil {
  4985  		objectMap["maxBitrate"] = hvl.MaxBitrate
  4986  	}
  4987  	if hvl.BFrames != nil {
  4988  		objectMap["bFrames"] = hvl.BFrames
  4989  	}
  4990  	if hvl.FrameRate != nil {
  4991  		objectMap["frameRate"] = hvl.FrameRate
  4992  	}
  4993  	if hvl.Slices != nil {
  4994  		objectMap["slices"] = hvl.Slices
  4995  	}
  4996  	if hvl.AdaptiveBFrame != nil {
  4997  		objectMap["adaptiveBFrame"] = hvl.AdaptiveBFrame
  4998  	}
  4999  	if hvl.Width != nil {
  5000  		objectMap["width"] = hvl.Width
  5001  	}
  5002  	if hvl.Height != nil {
  5003  		objectMap["height"] = hvl.Height
  5004  	}
  5005  	if hvl.Label != nil {
  5006  		objectMap["label"] = hvl.Label
  5007  	}
  5008  	if hvl.OdataType != "" {
  5009  		objectMap["@odata.type"] = hvl.OdataType
  5010  	}
  5011  	return json.Marshal(objectMap)
  5012  }
  5013  
  5014  // AsH265VideoLayer is the BasicLayer implementation for H265VideoLayer.
  5015  func (hvl H265VideoLayer) AsH265VideoLayer() (*H265VideoLayer, bool) {
  5016  	return &hvl, true
  5017  }
  5018  
  5019  // AsBasicH265VideoLayer is the BasicLayer implementation for H265VideoLayer.
  5020  func (hvl H265VideoLayer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
  5021  	return &hvl, true
  5022  }
  5023  
  5024  // AsH265Layer is the BasicLayer implementation for H265VideoLayer.
  5025  func (hvl H265VideoLayer) AsH265Layer() (*H265Layer, bool) {
  5026  	return nil, false
  5027  }
  5028  
  5029  // AsVideoLayer is the BasicLayer implementation for H265VideoLayer.
  5030  func (hvl H265VideoLayer) AsVideoLayer() (*VideoLayer, bool) {
  5031  	return nil, false
  5032  }
  5033  
  5034  // AsBasicVideoLayer is the BasicLayer implementation for H265VideoLayer.
  5035  func (hvl H265VideoLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
  5036  	return nil, false
  5037  }
  5038  
  5039  // AsH264Layer is the BasicLayer implementation for H265VideoLayer.
  5040  func (hvl H265VideoLayer) AsH264Layer() (*H264Layer, bool) {
  5041  	return nil, false
  5042  }
  5043  
  5044  // AsJpgLayer is the BasicLayer implementation for H265VideoLayer.
  5045  func (hvl H265VideoLayer) AsJpgLayer() (*JpgLayer, bool) {
  5046  	return nil, false
  5047  }
  5048  
  5049  // AsPngLayer is the BasicLayer implementation for H265VideoLayer.
  5050  func (hvl H265VideoLayer) AsPngLayer() (*PngLayer, bool) {
  5051  	return nil, false
  5052  }
  5053  
  5054  // AsLayer is the BasicLayer implementation for H265VideoLayer.
  5055  func (hvl H265VideoLayer) AsLayer() (*Layer, bool) {
  5056  	return nil, false
  5057  }
  5058  
  5059  // AsBasicLayer is the BasicLayer implementation for H265VideoLayer.
  5060  func (hvl H265VideoLayer) AsBasicLayer() (BasicLayer, bool) {
  5061  	return &hvl, true
  5062  }
  5063  
  5064  // Hls HTTP Live Streaming (HLS) packing setting for the live output.
  5065  type Hls struct {
  5066  	// 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.
  5067  	FragmentsPerTsSegment *int32 `json:"fragmentsPerTsSegment,omitempty"`
  5068  }
  5069  
  5070  // BasicImage describes the basic properties for generating thumbnails from the input video
  5071  type BasicImage interface {
  5072  	AsJpgImage() (*JpgImage, bool)
  5073  	AsPngImage() (*PngImage, bool)
  5074  	AsImage() (*Image, bool)
  5075  }
  5076  
  5077  // Image describes the basic properties for generating thumbnails from the input video
  5078  type Image struct {
  5079  	// 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}.
  5080  	Start *string `json:"start,omitempty"`
  5081  	// 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.
  5082  	Step *string `json:"step,omitempty"`
  5083  	// 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.
  5084  	Range *string `json:"range,omitempty"`
  5085  	// 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.
  5086  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  5087  	// 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'
  5088  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  5089  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
  5090  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
  5091  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  5092  	Label *string `json:"label,omitempty"`
  5093  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  5094  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  5095  }
  5096  
  5097  func unmarshalBasicImage(body []byte) (BasicImage, error) {
  5098  	var m map[string]interface{}
  5099  	err := json.Unmarshal(body, &m)
  5100  	if err != nil {
  5101  		return nil, err
  5102  	}
  5103  
  5104  	switch m["@odata.type"] {
  5105  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage):
  5106  		var ji JpgImage
  5107  		err := json.Unmarshal(body, &ji)
  5108  		return ji, err
  5109  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage):
  5110  		var pi PngImage
  5111  		err := json.Unmarshal(body, &pi)
  5112  		return pi, err
  5113  	default:
  5114  		var i Image
  5115  		err := json.Unmarshal(body, &i)
  5116  		return i, err
  5117  	}
  5118  }
  5119  func unmarshalBasicImageArray(body []byte) ([]BasicImage, error) {
  5120  	var rawMessages []*json.RawMessage
  5121  	err := json.Unmarshal(body, &rawMessages)
  5122  	if err != nil {
  5123  		return nil, err
  5124  	}
  5125  
  5126  	iArray := make([]BasicImage, len(rawMessages))
  5127  
  5128  	for index, rawMessage := range rawMessages {
  5129  		i, err := unmarshalBasicImage(*rawMessage)
  5130  		if err != nil {
  5131  			return nil, err
  5132  		}
  5133  		iArray[index] = i
  5134  	}
  5135  	return iArray, nil
  5136  }
  5137  
  5138  // MarshalJSON is the custom marshaler for Image.
  5139  func (i Image) MarshalJSON() ([]byte, error) {
  5140  	i.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaImage
  5141  	objectMap := make(map[string]interface{})
  5142  	if i.Start != nil {
  5143  		objectMap["start"] = i.Start
  5144  	}
  5145  	if i.Step != nil {
  5146  		objectMap["step"] = i.Step
  5147  	}
  5148  	if i.Range != nil {
  5149  		objectMap["range"] = i.Range
  5150  	}
  5151  	if i.KeyFrameInterval != nil {
  5152  		objectMap["keyFrameInterval"] = i.KeyFrameInterval
  5153  	}
  5154  	if i.StretchMode != "" {
  5155  		objectMap["stretchMode"] = i.StretchMode
  5156  	}
  5157  	if i.SyncMode != "" {
  5158  		objectMap["syncMode"] = i.SyncMode
  5159  	}
  5160  	if i.Label != nil {
  5161  		objectMap["label"] = i.Label
  5162  	}
  5163  	if i.OdataType != "" {
  5164  		objectMap["@odata.type"] = i.OdataType
  5165  	}
  5166  	return json.Marshal(objectMap)
  5167  }
  5168  
  5169  // AsAudio is the BasicCodec implementation for Image.
  5170  func (i Image) AsAudio() (*Audio, bool) {
  5171  	return nil, false
  5172  }
  5173  
  5174  // AsBasicAudio is the BasicCodec implementation for Image.
  5175  func (i Image) AsBasicAudio() (BasicAudio, bool) {
  5176  	return nil, false
  5177  }
  5178  
  5179  // AsAacAudio is the BasicCodec implementation for Image.
  5180  func (i Image) AsAacAudio() (*AacAudio, bool) {
  5181  	return nil, false
  5182  }
  5183  
  5184  // AsVideo is the BasicCodec implementation for Image.
  5185  func (i Image) AsVideo() (*Video, bool) {
  5186  	return nil, false
  5187  }
  5188  
  5189  // AsBasicVideo is the BasicCodec implementation for Image.
  5190  func (i Image) AsBasicVideo() (BasicVideo, bool) {
  5191  	return &i, true
  5192  }
  5193  
  5194  // AsH265Video is the BasicCodec implementation for Image.
  5195  func (i Image) AsH265Video() (*H265Video, bool) {
  5196  	return nil, false
  5197  }
  5198  
  5199  // AsCopyVideo is the BasicCodec implementation for Image.
  5200  func (i Image) AsCopyVideo() (*CopyVideo, bool) {
  5201  	return nil, false
  5202  }
  5203  
  5204  // AsImage is the BasicCodec implementation for Image.
  5205  func (i Image) AsImage() (*Image, bool) {
  5206  	return &i, true
  5207  }
  5208  
  5209  // AsBasicImage is the BasicCodec implementation for Image.
  5210  func (i Image) AsBasicImage() (BasicImage, bool) {
  5211  	return &i, true
  5212  }
  5213  
  5214  // AsCopyAudio is the BasicCodec implementation for Image.
  5215  func (i Image) AsCopyAudio() (*CopyAudio, bool) {
  5216  	return nil, false
  5217  }
  5218  
  5219  // AsH264Video is the BasicCodec implementation for Image.
  5220  func (i Image) AsH264Video() (*H264Video, bool) {
  5221  	return nil, false
  5222  }
  5223  
  5224  // AsJpgImage is the BasicCodec implementation for Image.
  5225  func (i Image) AsJpgImage() (*JpgImage, bool) {
  5226  	return nil, false
  5227  }
  5228  
  5229  // AsPngImage is the BasicCodec implementation for Image.
  5230  func (i Image) AsPngImage() (*PngImage, bool) {
  5231  	return nil, false
  5232  }
  5233  
  5234  // AsCodec is the BasicCodec implementation for Image.
  5235  func (i Image) AsCodec() (*Codec, bool) {
  5236  	return nil, false
  5237  }
  5238  
  5239  // AsBasicCodec is the BasicCodec implementation for Image.
  5240  func (i Image) AsBasicCodec() (BasicCodec, bool) {
  5241  	return &i, true
  5242  }
  5243  
  5244  // BasicImageFormat describes the properties for an output image file.
  5245  type BasicImageFormat interface {
  5246  	AsJpgFormat() (*JpgFormat, bool)
  5247  	AsPngFormat() (*PngFormat, bool)
  5248  	AsImageFormat() (*ImageFormat, bool)
  5249  }
  5250  
  5251  // ImageFormat describes the properties for an output image file.
  5252  type ImageFormat struct {
  5253  	// 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.
  5254  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  5255  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  5256  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  5257  }
  5258  
  5259  func unmarshalBasicImageFormat(body []byte) (BasicImageFormat, error) {
  5260  	var m map[string]interface{}
  5261  	err := json.Unmarshal(body, &m)
  5262  	if err != nil {
  5263  		return nil, err
  5264  	}
  5265  
  5266  	switch m["@odata.type"] {
  5267  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat):
  5268  		var jf JpgFormat
  5269  		err := json.Unmarshal(body, &jf)
  5270  		return jf, err
  5271  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat):
  5272  		var pf PngFormat
  5273  		err := json.Unmarshal(body, &pf)
  5274  		return pf, err
  5275  	default:
  5276  		var ifVar ImageFormat
  5277  		err := json.Unmarshal(body, &ifVar)
  5278  		return ifVar, err
  5279  	}
  5280  }
  5281  func unmarshalBasicImageFormatArray(body []byte) ([]BasicImageFormat, error) {
  5282  	var rawMessages []*json.RawMessage
  5283  	err := json.Unmarshal(body, &rawMessages)
  5284  	if err != nil {
  5285  		return nil, err
  5286  	}
  5287  
  5288  	ifVarArray := make([]BasicImageFormat, len(rawMessages))
  5289  
  5290  	for index, rawMessage := range rawMessages {
  5291  		ifVar, err := unmarshalBasicImageFormat(*rawMessage)
  5292  		if err != nil {
  5293  			return nil, err
  5294  		}
  5295  		ifVarArray[index] = ifVar
  5296  	}
  5297  	return ifVarArray, nil
  5298  }
  5299  
  5300  // MarshalJSON is the custom marshaler for ImageFormat.
  5301  func (ifVar ImageFormat) MarshalJSON() ([]byte, error) {
  5302  	ifVar.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat
  5303  	objectMap := make(map[string]interface{})
  5304  	if ifVar.FilenamePattern != nil {
  5305  		objectMap["filenamePattern"] = ifVar.FilenamePattern
  5306  	}
  5307  	if ifVar.OdataType != "" {
  5308  		objectMap["@odata.type"] = ifVar.OdataType
  5309  	}
  5310  	return json.Marshal(objectMap)
  5311  }
  5312  
  5313  // AsImageFormat is the BasicFormat implementation for ImageFormat.
  5314  func (ifVar ImageFormat) AsImageFormat() (*ImageFormat, bool) {
  5315  	return &ifVar, true
  5316  }
  5317  
  5318  // AsBasicImageFormat is the BasicFormat implementation for ImageFormat.
  5319  func (ifVar ImageFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
  5320  	return &ifVar, true
  5321  }
  5322  
  5323  // AsJpgFormat is the BasicFormat implementation for ImageFormat.
  5324  func (ifVar ImageFormat) AsJpgFormat() (*JpgFormat, bool) {
  5325  	return nil, false
  5326  }
  5327  
  5328  // AsPngFormat is the BasicFormat implementation for ImageFormat.
  5329  func (ifVar ImageFormat) AsPngFormat() (*PngFormat, bool) {
  5330  	return nil, false
  5331  }
  5332  
  5333  // AsMultiBitrateFormat is the BasicFormat implementation for ImageFormat.
  5334  func (ifVar ImageFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  5335  	return nil, false
  5336  }
  5337  
  5338  // AsBasicMultiBitrateFormat is the BasicFormat implementation for ImageFormat.
  5339  func (ifVar ImageFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  5340  	return nil, false
  5341  }
  5342  
  5343  // AsMp4Format is the BasicFormat implementation for ImageFormat.
  5344  func (ifVar ImageFormat) AsMp4Format() (*Mp4Format, bool) {
  5345  	return nil, false
  5346  }
  5347  
  5348  // AsTransportStreamFormat is the BasicFormat implementation for ImageFormat.
  5349  func (ifVar ImageFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  5350  	return nil, false
  5351  }
  5352  
  5353  // AsFormat is the BasicFormat implementation for ImageFormat.
  5354  func (ifVar ImageFormat) AsFormat() (*Format, bool) {
  5355  	return nil, false
  5356  }
  5357  
  5358  // AsBasicFormat is the BasicFormat implementation for ImageFormat.
  5359  func (ifVar ImageFormat) AsBasicFormat() (BasicFormat, bool) {
  5360  	return &ifVar, true
  5361  }
  5362  
  5363  // BasicInputDefinition base class for defining an input. Use sub classes of this class to specify tracks selections
  5364  // and related metadata.
  5365  type BasicInputDefinition interface {
  5366  	AsFromAllInputFile() (*FromAllInputFile, bool)
  5367  	AsFromEachInputFile() (*FromEachInputFile, bool)
  5368  	AsInputFile() (*InputFile, bool)
  5369  	AsInputDefinition() (*InputDefinition, bool)
  5370  }
  5371  
  5372  // InputDefinition base class for defining an input. Use sub classes of this class to specify tracks selections
  5373  // and related metadata.
  5374  type InputDefinition struct {
  5375  	// IncludedTracks - The list of TrackDescriptors which define the metadata and selection of tracks in the input.
  5376  	IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
  5377  	// OdataType - Possible values include: 'OdataTypeBasicInputDefinitionOdataTypeInputDefinition', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile'
  5378  	OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
  5379  }
  5380  
  5381  func unmarshalBasicInputDefinition(body []byte) (BasicInputDefinition, error) {
  5382  	var m map[string]interface{}
  5383  	err := json.Unmarshal(body, &m)
  5384  	if err != nil {
  5385  		return nil, err
  5386  	}
  5387  
  5388  	switch m["@odata.type"] {
  5389  	case string(OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile):
  5390  		var faif FromAllInputFile
  5391  		err := json.Unmarshal(body, &faif)
  5392  		return faif, err
  5393  	case string(OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile):
  5394  		var feif FromEachInputFile
  5395  		err := json.Unmarshal(body, &feif)
  5396  		return feif, err
  5397  	case string(OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile):
  5398  		var ifVar InputFile
  5399  		err := json.Unmarshal(body, &ifVar)
  5400  		return ifVar, err
  5401  	default:
  5402  		var ID InputDefinition
  5403  		err := json.Unmarshal(body, &ID)
  5404  		return ID, err
  5405  	}
  5406  }
  5407  func unmarshalBasicInputDefinitionArray(body []byte) ([]BasicInputDefinition, error) {
  5408  	var rawMessages []*json.RawMessage
  5409  	err := json.Unmarshal(body, &rawMessages)
  5410  	if err != nil {
  5411  		return nil, err
  5412  	}
  5413  
  5414  	IDArray := make([]BasicInputDefinition, len(rawMessages))
  5415  
  5416  	for index, rawMessage := range rawMessages {
  5417  		ID, err := unmarshalBasicInputDefinition(*rawMessage)
  5418  		if err != nil {
  5419  			return nil, err
  5420  		}
  5421  		IDArray[index] = ID
  5422  	}
  5423  	return IDArray, nil
  5424  }
  5425  
  5426  // MarshalJSON is the custom marshaler for InputDefinition.
  5427  func (ID InputDefinition) MarshalJSON() ([]byte, error) {
  5428  	ID.OdataType = OdataTypeBasicInputDefinitionOdataTypeInputDefinition
  5429  	objectMap := make(map[string]interface{})
  5430  	if ID.IncludedTracks != nil {
  5431  		objectMap["includedTracks"] = ID.IncludedTracks
  5432  	}
  5433  	if ID.OdataType != "" {
  5434  		objectMap["@odata.type"] = ID.OdataType
  5435  	}
  5436  	return json.Marshal(objectMap)
  5437  }
  5438  
  5439  // AsFromAllInputFile is the BasicInputDefinition implementation for InputDefinition.
  5440  func (ID InputDefinition) AsFromAllInputFile() (*FromAllInputFile, bool) {
  5441  	return nil, false
  5442  }
  5443  
  5444  // AsFromEachInputFile is the BasicInputDefinition implementation for InputDefinition.
  5445  func (ID InputDefinition) AsFromEachInputFile() (*FromEachInputFile, bool) {
  5446  	return nil, false
  5447  }
  5448  
  5449  // AsInputFile is the BasicInputDefinition implementation for InputDefinition.
  5450  func (ID InputDefinition) AsInputFile() (*InputFile, bool) {
  5451  	return nil, false
  5452  }
  5453  
  5454  // AsInputDefinition is the BasicInputDefinition implementation for InputDefinition.
  5455  func (ID InputDefinition) AsInputDefinition() (*InputDefinition, bool) {
  5456  	return &ID, true
  5457  }
  5458  
  5459  // AsBasicInputDefinition is the BasicInputDefinition implementation for InputDefinition.
  5460  func (ID InputDefinition) AsBasicInputDefinition() (BasicInputDefinition, bool) {
  5461  	return &ID, true
  5462  }
  5463  
  5464  // UnmarshalJSON is the custom unmarshaler for InputDefinition struct.
  5465  func (ID *InputDefinition) UnmarshalJSON(body []byte) error {
  5466  	var m map[string]*json.RawMessage
  5467  	err := json.Unmarshal(body, &m)
  5468  	if err != nil {
  5469  		return err
  5470  	}
  5471  	for k, v := range m {
  5472  		switch k {
  5473  		case "includedTracks":
  5474  			if v != nil {
  5475  				includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
  5476  				if err != nil {
  5477  					return err
  5478  				}
  5479  				ID.IncludedTracks = &includedTracks
  5480  			}
  5481  		case "@odata.type":
  5482  			if v != nil {
  5483  				var odataType OdataTypeBasicInputDefinition
  5484  				err = json.Unmarshal(*v, &odataType)
  5485  				if err != nil {
  5486  					return err
  5487  				}
  5488  				ID.OdataType = odataType
  5489  			}
  5490  		}
  5491  	}
  5492  
  5493  	return nil
  5494  }
  5495  
  5496  // InputFile an InputDefinition for a single file.  TrackSelections are scoped to the file specified.
  5497  type InputFile struct {
  5498  	// Filename - Name of the file that this input definition applies to.
  5499  	Filename *string `json:"filename,omitempty"`
  5500  	// IncludedTracks - The list of TrackDescriptors which define the metadata and selection of tracks in the input.
  5501  	IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
  5502  	// OdataType - Possible values include: 'OdataTypeBasicInputDefinitionOdataTypeInputDefinition', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile'
  5503  	OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
  5504  }
  5505  
  5506  // MarshalJSON is the custom marshaler for InputFile.
  5507  func (ifVar InputFile) MarshalJSON() ([]byte, error) {
  5508  	ifVar.OdataType = OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile
  5509  	objectMap := make(map[string]interface{})
  5510  	if ifVar.Filename != nil {
  5511  		objectMap["filename"] = ifVar.Filename
  5512  	}
  5513  	if ifVar.IncludedTracks != nil {
  5514  		objectMap["includedTracks"] = ifVar.IncludedTracks
  5515  	}
  5516  	if ifVar.OdataType != "" {
  5517  		objectMap["@odata.type"] = ifVar.OdataType
  5518  	}
  5519  	return json.Marshal(objectMap)
  5520  }
  5521  
  5522  // AsFromAllInputFile is the BasicInputDefinition implementation for InputFile.
  5523  func (ifVar InputFile) AsFromAllInputFile() (*FromAllInputFile, bool) {
  5524  	return nil, false
  5525  }
  5526  
  5527  // AsFromEachInputFile is the BasicInputDefinition implementation for InputFile.
  5528  func (ifVar InputFile) AsFromEachInputFile() (*FromEachInputFile, bool) {
  5529  	return nil, false
  5530  }
  5531  
  5532  // AsInputFile is the BasicInputDefinition implementation for InputFile.
  5533  func (ifVar InputFile) AsInputFile() (*InputFile, bool) {
  5534  	return &ifVar, true
  5535  }
  5536  
  5537  // AsInputDefinition is the BasicInputDefinition implementation for InputFile.
  5538  func (ifVar InputFile) AsInputDefinition() (*InputDefinition, bool) {
  5539  	return nil, false
  5540  }
  5541  
  5542  // AsBasicInputDefinition is the BasicInputDefinition implementation for InputFile.
  5543  func (ifVar InputFile) AsBasicInputDefinition() (BasicInputDefinition, bool) {
  5544  	return &ifVar, true
  5545  }
  5546  
  5547  // UnmarshalJSON is the custom unmarshaler for InputFile struct.
  5548  func (ifVar *InputFile) UnmarshalJSON(body []byte) error {
  5549  	var m map[string]*json.RawMessage
  5550  	err := json.Unmarshal(body, &m)
  5551  	if err != nil {
  5552  		return err
  5553  	}
  5554  	for k, v := range m {
  5555  		switch k {
  5556  		case "filename":
  5557  			if v != nil {
  5558  				var filename string
  5559  				err = json.Unmarshal(*v, &filename)
  5560  				if err != nil {
  5561  					return err
  5562  				}
  5563  				ifVar.Filename = &filename
  5564  			}
  5565  		case "includedTracks":
  5566  			if v != nil {
  5567  				includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
  5568  				if err != nil {
  5569  					return err
  5570  				}
  5571  				ifVar.IncludedTracks = &includedTracks
  5572  			}
  5573  		case "@odata.type":
  5574  			if v != nil {
  5575  				var odataType OdataTypeBasicInputDefinition
  5576  				err = json.Unmarshal(*v, &odataType)
  5577  				if err != nil {
  5578  					return err
  5579  				}
  5580  				ifVar.OdataType = odataType
  5581  			}
  5582  		}
  5583  	}
  5584  
  5585  	return nil
  5586  }
  5587  
  5588  // IPAccessControl the IP access control.
  5589  type IPAccessControl struct {
  5590  	// Allow - The IP allow list.
  5591  	Allow *[]IPRange `json:"allow,omitempty"`
  5592  }
  5593  
  5594  // IPRange the IP address range in the CIDR scheme.
  5595  type IPRange struct {
  5596  	// Name - The friendly name for the IP address range.
  5597  	Name *string `json:"name,omitempty"`
  5598  	// Address - The IP address.
  5599  	Address *string `json:"address,omitempty"`
  5600  	// SubnetPrefixLength - The subnet mask prefix length (see CIDR notation).
  5601  	SubnetPrefixLength *int32 `json:"subnetPrefixLength,omitempty"`
  5602  }
  5603  
  5604  // Job a Job resource type. The progress and state can be obtained by polling a Job or subscribing to
  5605  // events using EventGrid.
  5606  type Job struct {
  5607  	autorest.Response `json:"-"`
  5608  	// JobProperties - The resource properties.
  5609  	*JobProperties `json:"properties,omitempty"`
  5610  	// SystemData - READ-ONLY; The system metadata relating to this resource.
  5611  	SystemData *SystemData `json:"systemData,omitempty"`
  5612  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  5613  	ID *string `json:"id,omitempty"`
  5614  	// Name - READ-ONLY; The name of the resource
  5615  	Name *string `json:"name,omitempty"`
  5616  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  5617  	Type *string `json:"type,omitempty"`
  5618  }
  5619  
  5620  // MarshalJSON is the custom marshaler for Job.
  5621  func (j Job) MarshalJSON() ([]byte, error) {
  5622  	objectMap := make(map[string]interface{})
  5623  	if j.JobProperties != nil {
  5624  		objectMap["properties"] = j.JobProperties
  5625  	}
  5626  	return json.Marshal(objectMap)
  5627  }
  5628  
  5629  // UnmarshalJSON is the custom unmarshaler for Job struct.
  5630  func (j *Job) UnmarshalJSON(body []byte) error {
  5631  	var m map[string]*json.RawMessage
  5632  	err := json.Unmarshal(body, &m)
  5633  	if err != nil {
  5634  		return err
  5635  	}
  5636  	for k, v := range m {
  5637  		switch k {
  5638  		case "properties":
  5639  			if v != nil {
  5640  				var jobProperties JobProperties
  5641  				err = json.Unmarshal(*v, &jobProperties)
  5642  				if err != nil {
  5643  					return err
  5644  				}
  5645  				j.JobProperties = &jobProperties
  5646  			}
  5647  		case "systemData":
  5648  			if v != nil {
  5649  				var systemData SystemData
  5650  				err = json.Unmarshal(*v, &systemData)
  5651  				if err != nil {
  5652  					return err
  5653  				}
  5654  				j.SystemData = &systemData
  5655  			}
  5656  		case "id":
  5657  			if v != nil {
  5658  				var ID string
  5659  				err = json.Unmarshal(*v, &ID)
  5660  				if err != nil {
  5661  					return err
  5662  				}
  5663  				j.ID = &ID
  5664  			}
  5665  		case "name":
  5666  			if v != nil {
  5667  				var name string
  5668  				err = json.Unmarshal(*v, &name)
  5669  				if err != nil {
  5670  					return err
  5671  				}
  5672  				j.Name = &name
  5673  			}
  5674  		case "type":
  5675  			if v != nil {
  5676  				var typeVar string
  5677  				err = json.Unmarshal(*v, &typeVar)
  5678  				if err != nil {
  5679  					return err
  5680  				}
  5681  				j.Type = &typeVar
  5682  			}
  5683  		}
  5684  	}
  5685  
  5686  	return nil
  5687  }
  5688  
  5689  // JobCollection a collection of Job items.
  5690  type JobCollection struct {
  5691  	autorest.Response `json:"-"`
  5692  	// Value - A collection of Job items.
  5693  	Value *[]Job `json:"value,omitempty"`
  5694  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
  5695  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
  5696  }
  5697  
  5698  // JobCollectionIterator provides access to a complete listing of Job values.
  5699  type JobCollectionIterator struct {
  5700  	i    int
  5701  	page JobCollectionPage
  5702  }
  5703  
  5704  // NextWithContext advances to the next value.  If there was an error making
  5705  // the request the iterator does not advance and the error is returned.
  5706  func (iter *JobCollectionIterator) NextWithContext(ctx context.Context) (err error) {
  5707  	if tracing.IsEnabled() {
  5708  		ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionIterator.NextWithContext")
  5709  		defer func() {
  5710  			sc := -1
  5711  			if iter.Response().Response.Response != nil {
  5712  				sc = iter.Response().Response.Response.StatusCode
  5713  			}
  5714  			tracing.EndSpan(ctx, sc, err)
  5715  		}()
  5716  	}
  5717  	iter.i++
  5718  	if iter.i < len(iter.page.Values()) {
  5719  		return nil
  5720  	}
  5721  	err = iter.page.NextWithContext(ctx)
  5722  	if err != nil {
  5723  		iter.i--
  5724  		return err
  5725  	}
  5726  	iter.i = 0
  5727  	return nil
  5728  }
  5729  
  5730  // Next advances to the next value.  If there was an error making
  5731  // the request the iterator does not advance and the error is returned.
  5732  // Deprecated: Use NextWithContext() instead.
  5733  func (iter *JobCollectionIterator) Next() error {
  5734  	return iter.NextWithContext(context.Background())
  5735  }
  5736  
  5737  // NotDone returns true if the enumeration should be started or is not yet complete.
  5738  func (iter JobCollectionIterator) NotDone() bool {
  5739  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  5740  }
  5741  
  5742  // Response returns the raw server response from the last page request.
  5743  func (iter JobCollectionIterator) Response() JobCollection {
  5744  	return iter.page.Response()
  5745  }
  5746  
  5747  // Value returns the current value or a zero-initialized value if the
  5748  // iterator has advanced beyond the end of the collection.
  5749  func (iter JobCollectionIterator) Value() Job {
  5750  	if !iter.page.NotDone() {
  5751  		return Job{}
  5752  	}
  5753  	return iter.page.Values()[iter.i]
  5754  }
  5755  
  5756  // Creates a new instance of the JobCollectionIterator type.
  5757  func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator {
  5758  	return JobCollectionIterator{page: page}
  5759  }
  5760  
  5761  // IsEmpty returns true if the ListResult contains no values.
  5762  func (jc JobCollection) IsEmpty() bool {
  5763  	return jc.Value == nil || len(*jc.Value) == 0
  5764  }
  5765  
  5766  // hasNextLink returns true if the NextLink is not empty.
  5767  func (jc JobCollection) hasNextLink() bool {
  5768  	return jc.OdataNextLink != nil && len(*jc.OdataNextLink) != 0
  5769  }
  5770  
  5771  // jobCollectionPreparer prepares a request to retrieve the next set of results.
  5772  // It returns nil if no more results exist.
  5773  func (jc JobCollection) jobCollectionPreparer(ctx context.Context) (*http.Request, error) {
  5774  	if !jc.hasNextLink() {
  5775  		return nil, nil
  5776  	}
  5777  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  5778  		autorest.AsJSON(),
  5779  		autorest.AsGet(),
  5780  		autorest.WithBaseURL(to.String(jc.OdataNextLink)))
  5781  }
  5782  
  5783  // JobCollectionPage contains a page of Job values.
  5784  type JobCollectionPage struct {
  5785  	fn func(context.Context, JobCollection) (JobCollection, error)
  5786  	jc JobCollection
  5787  }
  5788  
  5789  // NextWithContext advances to the next page of values.  If there was an error making
  5790  // the request the page does not advance and the error is returned.
  5791  func (page *JobCollectionPage) NextWithContext(ctx context.Context) (err error) {
  5792  	if tracing.IsEnabled() {
  5793  		ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionPage.NextWithContext")
  5794  		defer func() {
  5795  			sc := -1
  5796  			if page.Response().Response.Response != nil {
  5797  				sc = page.Response().Response.Response.StatusCode
  5798  			}
  5799  			tracing.EndSpan(ctx, sc, err)
  5800  		}()
  5801  	}
  5802  	for {
  5803  		next, err := page.fn(ctx, page.jc)
  5804  		if err != nil {
  5805  			return err
  5806  		}
  5807  		page.jc = next
  5808  		if !next.hasNextLink() || !next.IsEmpty() {
  5809  			break
  5810  		}
  5811  	}
  5812  	return nil
  5813  }
  5814  
  5815  // Next advances to the next page of values.  If there was an error making
  5816  // the request the page does not advance and the error is returned.
  5817  // Deprecated: Use NextWithContext() instead.
  5818  func (page *JobCollectionPage) Next() error {
  5819  	return page.NextWithContext(context.Background())
  5820  }
  5821  
  5822  // NotDone returns true if the page enumeration should be started or is not yet complete.
  5823  func (page JobCollectionPage) NotDone() bool {
  5824  	return !page.jc.IsEmpty()
  5825  }
  5826  
  5827  // Response returns the raw server response from the last page request.
  5828  func (page JobCollectionPage) Response() JobCollection {
  5829  	return page.jc
  5830  }
  5831  
  5832  // Values returns the slice of values for the current page or nil if there are no values.
  5833  func (page JobCollectionPage) Values() []Job {
  5834  	if page.jc.IsEmpty() {
  5835  		return nil
  5836  	}
  5837  	return *page.jc.Value
  5838  }
  5839  
  5840  // Creates a new instance of the JobCollectionPage type.
  5841  func NewJobCollectionPage(cur JobCollection, getNextPage func(context.Context, JobCollection) (JobCollection, error)) JobCollectionPage {
  5842  	return JobCollectionPage{
  5843  		fn: getNextPage,
  5844  		jc: cur,
  5845  	}
  5846  }
  5847  
  5848  // JobError details of JobOutput errors.
  5849  type JobError struct {
  5850  	// Code - READ-ONLY; Error code describing the error. Possible values include: 'JobErrorCodeServiceError', 'JobErrorCodeServiceTransientError', 'JobErrorCodeDownloadNotAccessible', 'JobErrorCodeDownloadTransientError', 'JobErrorCodeUploadNotAccessible', 'JobErrorCodeUploadTransientError', 'JobErrorCodeConfigurationUnsupported', 'JobErrorCodeContentMalformed', 'JobErrorCodeContentUnsupported'
  5851  	Code JobErrorCode `json:"code,omitempty"`
  5852  	// Message - READ-ONLY; A human-readable language-dependent representation of the error.
  5853  	Message *string `json:"message,omitempty"`
  5854  	// Category - READ-ONLY; Helps with categorization of errors. Possible values include: 'JobErrorCategoryService', 'JobErrorCategoryDownload', 'JobErrorCategoryUpload', 'JobErrorCategoryConfiguration', 'JobErrorCategoryContent'
  5855  	Category JobErrorCategory `json:"category,omitempty"`
  5856  	// 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'
  5857  	Retry JobRetry `json:"retry,omitempty"`
  5858  	// Details - READ-ONLY; An array of details about specific errors that led to this reported error.
  5859  	Details *[]JobErrorDetail `json:"details,omitempty"`
  5860  }
  5861  
  5862  // MarshalJSON is the custom marshaler for JobError.
  5863  func (je JobError) MarshalJSON() ([]byte, error) {
  5864  	objectMap := make(map[string]interface{})
  5865  	return json.Marshal(objectMap)
  5866  }
  5867  
  5868  // JobErrorDetail details of JobOutput errors.
  5869  type JobErrorDetail struct {
  5870  	// Code - READ-ONLY; Code describing the error detail.
  5871  	Code *string `json:"code,omitempty"`
  5872  	// Message - READ-ONLY; A human-readable representation of the error.
  5873  	Message *string `json:"message,omitempty"`
  5874  }
  5875  
  5876  // MarshalJSON is the custom marshaler for JobErrorDetail.
  5877  func (jed JobErrorDetail) MarshalJSON() ([]byte, error) {
  5878  	objectMap := make(map[string]interface{})
  5879  	return json.Marshal(objectMap)
  5880  }
  5881  
  5882  // BasicJobInput base class for inputs to a Job.
  5883  type BasicJobInput interface {
  5884  	AsJobInputClip() (*JobInputClip, bool)
  5885  	AsBasicJobInputClip() (BasicJobInputClip, bool)
  5886  	AsJobInputs() (*JobInputs, bool)
  5887  	AsJobInputAsset() (*JobInputAsset, bool)
  5888  	AsJobInputHTTP() (*JobInputHTTP, bool)
  5889  	AsJobInputSequence() (*JobInputSequence, bool)
  5890  	AsJobInput() (*JobInput, bool)
  5891  }
  5892  
  5893  // JobInput base class for inputs to a Job.
  5894  type JobInput struct {
  5895  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  5896  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  5897  }
  5898  
  5899  func unmarshalBasicJobInput(body []byte) (BasicJobInput, error) {
  5900  	var m map[string]interface{}
  5901  	err := json.Unmarshal(body, &m)
  5902  	if err != nil {
  5903  		return nil, err
  5904  	}
  5905  
  5906  	switch m["@odata.type"] {
  5907  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip):
  5908  		var jic JobInputClip
  5909  		err := json.Unmarshal(body, &jic)
  5910  		return jic, err
  5911  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs):
  5912  		var ji JobInputs
  5913  		err := json.Unmarshal(body, &ji)
  5914  		return ji, err
  5915  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset):
  5916  		var jia JobInputAsset
  5917  		err := json.Unmarshal(body, &jia)
  5918  		return jia, err
  5919  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP):
  5920  		var jih JobInputHTTP
  5921  		err := json.Unmarshal(body, &jih)
  5922  		return jih, err
  5923  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence):
  5924  		var jis JobInputSequence
  5925  		err := json.Unmarshal(body, &jis)
  5926  		return jis, err
  5927  	default:
  5928  		var ji JobInput
  5929  		err := json.Unmarshal(body, &ji)
  5930  		return ji, err
  5931  	}
  5932  }
  5933  func unmarshalBasicJobInputArray(body []byte) ([]BasicJobInput, error) {
  5934  	var rawMessages []*json.RawMessage
  5935  	err := json.Unmarshal(body, &rawMessages)
  5936  	if err != nil {
  5937  		return nil, err
  5938  	}
  5939  
  5940  	jiArray := make([]BasicJobInput, len(rawMessages))
  5941  
  5942  	for index, rawMessage := range rawMessages {
  5943  		ji, err := unmarshalBasicJobInput(*rawMessage)
  5944  		if err != nil {
  5945  			return nil, err
  5946  		}
  5947  		jiArray[index] = ji
  5948  	}
  5949  	return jiArray, nil
  5950  }
  5951  
  5952  // MarshalJSON is the custom marshaler for JobInput.
  5953  func (ji JobInput) MarshalJSON() ([]byte, error) {
  5954  	ji.OdataType = OdataTypeBasicJobInputOdataTypeJobInput
  5955  	objectMap := make(map[string]interface{})
  5956  	if ji.OdataType != "" {
  5957  		objectMap["@odata.type"] = ji.OdataType
  5958  	}
  5959  	return json.Marshal(objectMap)
  5960  }
  5961  
  5962  // AsJobInputClip is the BasicJobInput implementation for JobInput.
  5963  func (ji JobInput) AsJobInputClip() (*JobInputClip, bool) {
  5964  	return nil, false
  5965  }
  5966  
  5967  // AsBasicJobInputClip is the BasicJobInput implementation for JobInput.
  5968  func (ji JobInput) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  5969  	return nil, false
  5970  }
  5971  
  5972  // AsJobInputs is the BasicJobInput implementation for JobInput.
  5973  func (ji JobInput) AsJobInputs() (*JobInputs, bool) {
  5974  	return nil, false
  5975  }
  5976  
  5977  // AsJobInputAsset is the BasicJobInput implementation for JobInput.
  5978  func (ji JobInput) AsJobInputAsset() (*JobInputAsset, bool) {
  5979  	return nil, false
  5980  }
  5981  
  5982  // AsJobInputHTTP is the BasicJobInput implementation for JobInput.
  5983  func (ji JobInput) AsJobInputHTTP() (*JobInputHTTP, bool) {
  5984  	return nil, false
  5985  }
  5986  
  5987  // AsJobInputSequence is the BasicJobInput implementation for JobInput.
  5988  func (ji JobInput) AsJobInputSequence() (*JobInputSequence, bool) {
  5989  	return nil, false
  5990  }
  5991  
  5992  // AsJobInput is the BasicJobInput implementation for JobInput.
  5993  func (ji JobInput) AsJobInput() (*JobInput, bool) {
  5994  	return &ji, true
  5995  }
  5996  
  5997  // AsBasicJobInput is the BasicJobInput implementation for JobInput.
  5998  func (ji JobInput) AsBasicJobInput() (BasicJobInput, bool) {
  5999  	return &ji, true
  6000  }
  6001  
  6002  // JobInputAsset represents an Asset for input into a Job.
  6003  type JobInputAsset struct {
  6004  	// AssetName - The name of the input Asset.
  6005  	AssetName *string `json:"assetName,omitempty"`
  6006  	// 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.
  6007  	Files *[]string `json:"files,omitempty"`
  6008  	// Start - Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.
  6009  	Start BasicClipTime `json:"start,omitempty"`
  6010  	// End - Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.
  6011  	End BasicClipTime `json:"end,omitempty"`
  6012  	// 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'.
  6013  	Label *string `json:"label,omitempty"`
  6014  	// InputDefinitions - Defines a list of InputDefinitions. For each InputDefinition, it defines a list of track selections and related metadata.
  6015  	InputDefinitions *[]BasicInputDefinition `json:"inputDefinitions,omitempty"`
  6016  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  6017  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  6018  }
  6019  
  6020  // MarshalJSON is the custom marshaler for JobInputAsset.
  6021  func (jia JobInputAsset) MarshalJSON() ([]byte, error) {
  6022  	jia.OdataType = OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset
  6023  	objectMap := make(map[string]interface{})
  6024  	if jia.AssetName != nil {
  6025  		objectMap["assetName"] = jia.AssetName
  6026  	}
  6027  	if jia.Files != nil {
  6028  		objectMap["files"] = jia.Files
  6029  	}
  6030  	objectMap["start"] = jia.Start
  6031  	objectMap["end"] = jia.End
  6032  	if jia.Label != nil {
  6033  		objectMap["label"] = jia.Label
  6034  	}
  6035  	if jia.InputDefinitions != nil {
  6036  		objectMap["inputDefinitions"] = jia.InputDefinitions
  6037  	}
  6038  	if jia.OdataType != "" {
  6039  		objectMap["@odata.type"] = jia.OdataType
  6040  	}
  6041  	return json.Marshal(objectMap)
  6042  }
  6043  
  6044  // AsJobInputClip is the BasicJobInput implementation for JobInputAsset.
  6045  func (jia JobInputAsset) AsJobInputClip() (*JobInputClip, bool) {
  6046  	return nil, false
  6047  }
  6048  
  6049  // AsBasicJobInputClip is the BasicJobInput implementation for JobInputAsset.
  6050  func (jia JobInputAsset) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  6051  	return &jia, true
  6052  }
  6053  
  6054  // AsJobInputs is the BasicJobInput implementation for JobInputAsset.
  6055  func (jia JobInputAsset) AsJobInputs() (*JobInputs, bool) {
  6056  	return nil, false
  6057  }
  6058  
  6059  // AsJobInputAsset is the BasicJobInput implementation for JobInputAsset.
  6060  func (jia JobInputAsset) AsJobInputAsset() (*JobInputAsset, bool) {
  6061  	return &jia, true
  6062  }
  6063  
  6064  // AsJobInputHTTP is the BasicJobInput implementation for JobInputAsset.
  6065  func (jia JobInputAsset) AsJobInputHTTP() (*JobInputHTTP, bool) {
  6066  	return nil, false
  6067  }
  6068  
  6069  // AsJobInputSequence is the BasicJobInput implementation for JobInputAsset.
  6070  func (jia JobInputAsset) AsJobInputSequence() (*JobInputSequence, bool) {
  6071  	return nil, false
  6072  }
  6073  
  6074  // AsJobInput is the BasicJobInput implementation for JobInputAsset.
  6075  func (jia JobInputAsset) AsJobInput() (*JobInput, bool) {
  6076  	return nil, false
  6077  }
  6078  
  6079  // AsBasicJobInput is the BasicJobInput implementation for JobInputAsset.
  6080  func (jia JobInputAsset) AsBasicJobInput() (BasicJobInput, bool) {
  6081  	return &jia, true
  6082  }
  6083  
  6084  // UnmarshalJSON is the custom unmarshaler for JobInputAsset struct.
  6085  func (jia *JobInputAsset) UnmarshalJSON(body []byte) error {
  6086  	var m map[string]*json.RawMessage
  6087  	err := json.Unmarshal(body, &m)
  6088  	if err != nil {
  6089  		return err
  6090  	}
  6091  	for k, v := range m {
  6092  		switch k {
  6093  		case "assetName":
  6094  			if v != nil {
  6095  				var assetName string
  6096  				err = json.Unmarshal(*v, &assetName)
  6097  				if err != nil {
  6098  					return err
  6099  				}
  6100  				jia.AssetName = &assetName
  6101  			}
  6102  		case "files":
  6103  			if v != nil {
  6104  				var files []string
  6105  				err = json.Unmarshal(*v, &files)
  6106  				if err != nil {
  6107  					return err
  6108  				}
  6109  				jia.Files = &files
  6110  			}
  6111  		case "start":
  6112  			if v != nil {
  6113  				start, err := unmarshalBasicClipTime(*v)
  6114  				if err != nil {
  6115  					return err
  6116  				}
  6117  				jia.Start = start
  6118  			}
  6119  		case "end":
  6120  			if v != nil {
  6121  				end, err := unmarshalBasicClipTime(*v)
  6122  				if err != nil {
  6123  					return err
  6124  				}
  6125  				jia.End = end
  6126  			}
  6127  		case "label":
  6128  			if v != nil {
  6129  				var label string
  6130  				err = json.Unmarshal(*v, &label)
  6131  				if err != nil {
  6132  					return err
  6133  				}
  6134  				jia.Label = &label
  6135  			}
  6136  		case "inputDefinitions":
  6137  			if v != nil {
  6138  				inputDefinitions, err := unmarshalBasicInputDefinitionArray(*v)
  6139  				if err != nil {
  6140  					return err
  6141  				}
  6142  				jia.InputDefinitions = &inputDefinitions
  6143  			}
  6144  		case "@odata.type":
  6145  			if v != nil {
  6146  				var odataType OdataTypeBasicJobInput
  6147  				err = json.Unmarshal(*v, &odataType)
  6148  				if err != nil {
  6149  					return err
  6150  				}
  6151  				jia.OdataType = odataType
  6152  			}
  6153  		}
  6154  	}
  6155  
  6156  	return nil
  6157  }
  6158  
  6159  // BasicJobInputClip represents input files for a Job.
  6160  type BasicJobInputClip interface {
  6161  	AsJobInputAsset() (*JobInputAsset, bool)
  6162  	AsJobInputHTTP() (*JobInputHTTP, bool)
  6163  	AsJobInputClip() (*JobInputClip, bool)
  6164  }
  6165  
  6166  // JobInputClip represents input files for a Job.
  6167  type JobInputClip struct {
  6168  	// 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.
  6169  	Files *[]string `json:"files,omitempty"`
  6170  	// Start - Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.
  6171  	Start BasicClipTime `json:"start,omitempty"`
  6172  	// End - Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.
  6173  	End BasicClipTime `json:"end,omitempty"`
  6174  	// 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'.
  6175  	Label *string `json:"label,omitempty"`
  6176  	// InputDefinitions - Defines a list of InputDefinitions. For each InputDefinition, it defines a list of track selections and related metadata.
  6177  	InputDefinitions *[]BasicInputDefinition `json:"inputDefinitions,omitempty"`
  6178  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  6179  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  6180  }
  6181  
  6182  func unmarshalBasicJobInputClip(body []byte) (BasicJobInputClip, error) {
  6183  	var m map[string]interface{}
  6184  	err := json.Unmarshal(body, &m)
  6185  	if err != nil {
  6186  		return nil, err
  6187  	}
  6188  
  6189  	switch m["@odata.type"] {
  6190  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset):
  6191  		var jia JobInputAsset
  6192  		err := json.Unmarshal(body, &jia)
  6193  		return jia, err
  6194  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP):
  6195  		var jih JobInputHTTP
  6196  		err := json.Unmarshal(body, &jih)
  6197  		return jih, err
  6198  	default:
  6199  		var jic JobInputClip
  6200  		err := json.Unmarshal(body, &jic)
  6201  		return jic, err
  6202  	}
  6203  }
  6204  func unmarshalBasicJobInputClipArray(body []byte) ([]BasicJobInputClip, error) {
  6205  	var rawMessages []*json.RawMessage
  6206  	err := json.Unmarshal(body, &rawMessages)
  6207  	if err != nil {
  6208  		return nil, err
  6209  	}
  6210  
  6211  	jicArray := make([]BasicJobInputClip, len(rawMessages))
  6212  
  6213  	for index, rawMessage := range rawMessages {
  6214  		jic, err := unmarshalBasicJobInputClip(*rawMessage)
  6215  		if err != nil {
  6216  			return nil, err
  6217  		}
  6218  		jicArray[index] = jic
  6219  	}
  6220  	return jicArray, nil
  6221  }
  6222  
  6223  // MarshalJSON is the custom marshaler for JobInputClip.
  6224  func (jic JobInputClip) MarshalJSON() ([]byte, error) {
  6225  	jic.OdataType = OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip
  6226  	objectMap := make(map[string]interface{})
  6227  	if jic.Files != nil {
  6228  		objectMap["files"] = jic.Files
  6229  	}
  6230  	objectMap["start"] = jic.Start
  6231  	objectMap["end"] = jic.End
  6232  	if jic.Label != nil {
  6233  		objectMap["label"] = jic.Label
  6234  	}
  6235  	if jic.InputDefinitions != nil {
  6236  		objectMap["inputDefinitions"] = jic.InputDefinitions
  6237  	}
  6238  	if jic.OdataType != "" {
  6239  		objectMap["@odata.type"] = jic.OdataType
  6240  	}
  6241  	return json.Marshal(objectMap)
  6242  }
  6243  
  6244  // AsJobInputClip is the BasicJobInput implementation for JobInputClip.
  6245  func (jic JobInputClip) AsJobInputClip() (*JobInputClip, bool) {
  6246  	return &jic, true
  6247  }
  6248  
  6249  // AsBasicJobInputClip is the BasicJobInput implementation for JobInputClip.
  6250  func (jic JobInputClip) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  6251  	return &jic, true
  6252  }
  6253  
  6254  // AsJobInputs is the BasicJobInput implementation for JobInputClip.
  6255  func (jic JobInputClip) AsJobInputs() (*JobInputs, bool) {
  6256  	return nil, false
  6257  }
  6258  
  6259  // AsJobInputAsset is the BasicJobInput implementation for JobInputClip.
  6260  func (jic JobInputClip) AsJobInputAsset() (*JobInputAsset, bool) {
  6261  	return nil, false
  6262  }
  6263  
  6264  // AsJobInputHTTP is the BasicJobInput implementation for JobInputClip.
  6265  func (jic JobInputClip) AsJobInputHTTP() (*JobInputHTTP, bool) {
  6266  	return nil, false
  6267  }
  6268  
  6269  // AsJobInputSequence is the BasicJobInput implementation for JobInputClip.
  6270  func (jic JobInputClip) AsJobInputSequence() (*JobInputSequence, bool) {
  6271  	return nil, false
  6272  }
  6273  
  6274  // AsJobInput is the BasicJobInput implementation for JobInputClip.
  6275  func (jic JobInputClip) AsJobInput() (*JobInput, bool) {
  6276  	return nil, false
  6277  }
  6278  
  6279  // AsBasicJobInput is the BasicJobInput implementation for JobInputClip.
  6280  func (jic JobInputClip) AsBasicJobInput() (BasicJobInput, bool) {
  6281  	return &jic, true
  6282  }
  6283  
  6284  // UnmarshalJSON is the custom unmarshaler for JobInputClip struct.
  6285  func (jic *JobInputClip) UnmarshalJSON(body []byte) error {
  6286  	var m map[string]*json.RawMessage
  6287  	err := json.Unmarshal(body, &m)
  6288  	if err != nil {
  6289  		return err
  6290  	}
  6291  	for k, v := range m {
  6292  		switch k {
  6293  		case "files":
  6294  			if v != nil {
  6295  				var files []string
  6296  				err = json.Unmarshal(*v, &files)
  6297  				if err != nil {
  6298  					return err
  6299  				}
  6300  				jic.Files = &files
  6301  			}
  6302  		case "start":
  6303  			if v != nil {
  6304  				start, err := unmarshalBasicClipTime(*v)
  6305  				if err != nil {
  6306  					return err
  6307  				}
  6308  				jic.Start = start
  6309  			}
  6310  		case "end":
  6311  			if v != nil {
  6312  				end, err := unmarshalBasicClipTime(*v)
  6313  				if err != nil {
  6314  					return err
  6315  				}
  6316  				jic.End = end
  6317  			}
  6318  		case "label":
  6319  			if v != nil {
  6320  				var label string
  6321  				err = json.Unmarshal(*v, &label)
  6322  				if err != nil {
  6323  					return err
  6324  				}
  6325  				jic.Label = &label
  6326  			}
  6327  		case "inputDefinitions":
  6328  			if v != nil {
  6329  				inputDefinitions, err := unmarshalBasicInputDefinitionArray(*v)
  6330  				if err != nil {
  6331  					return err
  6332  				}
  6333  				jic.InputDefinitions = &inputDefinitions
  6334  			}
  6335  		case "@odata.type":
  6336  			if v != nil {
  6337  				var odataType OdataTypeBasicJobInput
  6338  				err = json.Unmarshal(*v, &odataType)
  6339  				if err != nil {
  6340  					return err
  6341  				}
  6342  				jic.OdataType = odataType
  6343  			}
  6344  		}
  6345  	}
  6346  
  6347  	return nil
  6348  }
  6349  
  6350  // JobInputHTTP represents HTTPS job input.
  6351  type JobInputHTTP struct {
  6352  	// 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.
  6353  	BaseURI *string `json:"baseUri,omitempty"`
  6354  	// 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.
  6355  	Files *[]string `json:"files,omitempty"`
  6356  	// Start - Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.
  6357  	Start BasicClipTime `json:"start,omitempty"`
  6358  	// End - Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.
  6359  	End BasicClipTime `json:"end,omitempty"`
  6360  	// 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'.
  6361  	Label *string `json:"label,omitempty"`
  6362  	// InputDefinitions - Defines a list of InputDefinitions. For each InputDefinition, it defines a list of track selections and related metadata.
  6363  	InputDefinitions *[]BasicInputDefinition `json:"inputDefinitions,omitempty"`
  6364  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  6365  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  6366  }
  6367  
  6368  // MarshalJSON is the custom marshaler for JobInputHTTP.
  6369  func (jih JobInputHTTP) MarshalJSON() ([]byte, error) {
  6370  	jih.OdataType = OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP
  6371  	objectMap := make(map[string]interface{})
  6372  	if jih.BaseURI != nil {
  6373  		objectMap["baseUri"] = jih.BaseURI
  6374  	}
  6375  	if jih.Files != nil {
  6376  		objectMap["files"] = jih.Files
  6377  	}
  6378  	objectMap["start"] = jih.Start
  6379  	objectMap["end"] = jih.End
  6380  	if jih.Label != nil {
  6381  		objectMap["label"] = jih.Label
  6382  	}
  6383  	if jih.InputDefinitions != nil {
  6384  		objectMap["inputDefinitions"] = jih.InputDefinitions
  6385  	}
  6386  	if jih.OdataType != "" {
  6387  		objectMap["@odata.type"] = jih.OdataType
  6388  	}
  6389  	return json.Marshal(objectMap)
  6390  }
  6391  
  6392  // AsJobInputClip is the BasicJobInput implementation for JobInputHTTP.
  6393  func (jih JobInputHTTP) AsJobInputClip() (*JobInputClip, bool) {
  6394  	return nil, false
  6395  }
  6396  
  6397  // AsBasicJobInputClip is the BasicJobInput implementation for JobInputHTTP.
  6398  func (jih JobInputHTTP) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  6399  	return &jih, true
  6400  }
  6401  
  6402  // AsJobInputs is the BasicJobInput implementation for JobInputHTTP.
  6403  func (jih JobInputHTTP) AsJobInputs() (*JobInputs, bool) {
  6404  	return nil, false
  6405  }
  6406  
  6407  // AsJobInputAsset is the BasicJobInput implementation for JobInputHTTP.
  6408  func (jih JobInputHTTP) AsJobInputAsset() (*JobInputAsset, bool) {
  6409  	return nil, false
  6410  }
  6411  
  6412  // AsJobInputHTTP is the BasicJobInput implementation for JobInputHTTP.
  6413  func (jih JobInputHTTP) AsJobInputHTTP() (*JobInputHTTP, bool) {
  6414  	return &jih, true
  6415  }
  6416  
  6417  // AsJobInputSequence is the BasicJobInput implementation for JobInputHTTP.
  6418  func (jih JobInputHTTP) AsJobInputSequence() (*JobInputSequence, bool) {
  6419  	return nil, false
  6420  }
  6421  
  6422  // AsJobInput is the BasicJobInput implementation for JobInputHTTP.
  6423  func (jih JobInputHTTP) AsJobInput() (*JobInput, bool) {
  6424  	return nil, false
  6425  }
  6426  
  6427  // AsBasicJobInput is the BasicJobInput implementation for JobInputHTTP.
  6428  func (jih JobInputHTTP) AsBasicJobInput() (BasicJobInput, bool) {
  6429  	return &jih, true
  6430  }
  6431  
  6432  // UnmarshalJSON is the custom unmarshaler for JobInputHTTP struct.
  6433  func (jih *JobInputHTTP) UnmarshalJSON(body []byte) error {
  6434  	var m map[string]*json.RawMessage
  6435  	err := json.Unmarshal(body, &m)
  6436  	if err != nil {
  6437  		return err
  6438  	}
  6439  	for k, v := range m {
  6440  		switch k {
  6441  		case "baseUri":
  6442  			if v != nil {
  6443  				var baseURI string
  6444  				err = json.Unmarshal(*v, &baseURI)
  6445  				if err != nil {
  6446  					return err
  6447  				}
  6448  				jih.BaseURI = &baseURI
  6449  			}
  6450  		case "files":
  6451  			if v != nil {
  6452  				var files []string
  6453  				err = json.Unmarshal(*v, &files)
  6454  				if err != nil {
  6455  					return err
  6456  				}
  6457  				jih.Files = &files
  6458  			}
  6459  		case "start":
  6460  			if v != nil {
  6461  				start, err := unmarshalBasicClipTime(*v)
  6462  				if err != nil {
  6463  					return err
  6464  				}
  6465  				jih.Start = start
  6466  			}
  6467  		case "end":
  6468  			if v != nil {
  6469  				end, err := unmarshalBasicClipTime(*v)
  6470  				if err != nil {
  6471  					return err
  6472  				}
  6473  				jih.End = end
  6474  			}
  6475  		case "label":
  6476  			if v != nil {
  6477  				var label string
  6478  				err = json.Unmarshal(*v, &label)
  6479  				if err != nil {
  6480  					return err
  6481  				}
  6482  				jih.Label = &label
  6483  			}
  6484  		case "inputDefinitions":
  6485  			if v != nil {
  6486  				inputDefinitions, err := unmarshalBasicInputDefinitionArray(*v)
  6487  				if err != nil {
  6488  					return err
  6489  				}
  6490  				jih.InputDefinitions = &inputDefinitions
  6491  			}
  6492  		case "@odata.type":
  6493  			if v != nil {
  6494  				var odataType OdataTypeBasicJobInput
  6495  				err = json.Unmarshal(*v, &odataType)
  6496  				if err != nil {
  6497  					return err
  6498  				}
  6499  				jih.OdataType = odataType
  6500  			}
  6501  		}
  6502  	}
  6503  
  6504  	return nil
  6505  }
  6506  
  6507  // JobInputs describes a list of inputs to a Job.
  6508  type JobInputs struct {
  6509  	// Inputs - List of inputs to a Job.
  6510  	Inputs *[]BasicJobInput `json:"inputs,omitempty"`
  6511  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  6512  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  6513  }
  6514  
  6515  // MarshalJSON is the custom marshaler for JobInputs.
  6516  func (ji JobInputs) MarshalJSON() ([]byte, error) {
  6517  	ji.OdataType = OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs
  6518  	objectMap := make(map[string]interface{})
  6519  	if ji.Inputs != nil {
  6520  		objectMap["inputs"] = ji.Inputs
  6521  	}
  6522  	if ji.OdataType != "" {
  6523  		objectMap["@odata.type"] = ji.OdataType
  6524  	}
  6525  	return json.Marshal(objectMap)
  6526  }
  6527  
  6528  // AsJobInputClip is the BasicJobInput implementation for JobInputs.
  6529  func (ji JobInputs) AsJobInputClip() (*JobInputClip, bool) {
  6530  	return nil, false
  6531  }
  6532  
  6533  // AsBasicJobInputClip is the BasicJobInput implementation for JobInputs.
  6534  func (ji JobInputs) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  6535  	return nil, false
  6536  }
  6537  
  6538  // AsJobInputs is the BasicJobInput implementation for JobInputs.
  6539  func (ji JobInputs) AsJobInputs() (*JobInputs, bool) {
  6540  	return &ji, true
  6541  }
  6542  
  6543  // AsJobInputAsset is the BasicJobInput implementation for JobInputs.
  6544  func (ji JobInputs) AsJobInputAsset() (*JobInputAsset, bool) {
  6545  	return nil, false
  6546  }
  6547  
  6548  // AsJobInputHTTP is the BasicJobInput implementation for JobInputs.
  6549  func (ji JobInputs) AsJobInputHTTP() (*JobInputHTTP, bool) {
  6550  	return nil, false
  6551  }
  6552  
  6553  // AsJobInputSequence is the BasicJobInput implementation for JobInputs.
  6554  func (ji JobInputs) AsJobInputSequence() (*JobInputSequence, bool) {
  6555  	return nil, false
  6556  }
  6557  
  6558  // AsJobInput is the BasicJobInput implementation for JobInputs.
  6559  func (ji JobInputs) AsJobInput() (*JobInput, bool) {
  6560  	return nil, false
  6561  }
  6562  
  6563  // AsBasicJobInput is the BasicJobInput implementation for JobInputs.
  6564  func (ji JobInputs) AsBasicJobInput() (BasicJobInput, bool) {
  6565  	return &ji, true
  6566  }
  6567  
  6568  // UnmarshalJSON is the custom unmarshaler for JobInputs struct.
  6569  func (ji *JobInputs) UnmarshalJSON(body []byte) error {
  6570  	var m map[string]*json.RawMessage
  6571  	err := json.Unmarshal(body, &m)
  6572  	if err != nil {
  6573  		return err
  6574  	}
  6575  	for k, v := range m {
  6576  		switch k {
  6577  		case "inputs":
  6578  			if v != nil {
  6579  				inputs, err := unmarshalBasicJobInputArray(*v)
  6580  				if err != nil {
  6581  					return err
  6582  				}
  6583  				ji.Inputs = &inputs
  6584  			}
  6585  		case "@odata.type":
  6586  			if v != nil {
  6587  				var odataType OdataTypeBasicJobInput
  6588  				err = json.Unmarshal(*v, &odataType)
  6589  				if err != nil {
  6590  					return err
  6591  				}
  6592  				ji.OdataType = odataType
  6593  			}
  6594  		}
  6595  	}
  6596  
  6597  	return nil
  6598  }
  6599  
  6600  // JobInputSequence a Sequence contains an ordered list of Clips where each clip is a JobInput.  The
  6601  // Sequence will be treated as a single input.
  6602  type JobInputSequence struct {
  6603  	// Inputs - JobInputs that make up the timeline.
  6604  	Inputs *[]BasicJobInputClip `json:"inputs,omitempty"`
  6605  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  6606  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  6607  }
  6608  
  6609  // MarshalJSON is the custom marshaler for JobInputSequence.
  6610  func (jis JobInputSequence) MarshalJSON() ([]byte, error) {
  6611  	jis.OdataType = OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence
  6612  	objectMap := make(map[string]interface{})
  6613  	if jis.Inputs != nil {
  6614  		objectMap["inputs"] = jis.Inputs
  6615  	}
  6616  	if jis.OdataType != "" {
  6617  		objectMap["@odata.type"] = jis.OdataType
  6618  	}
  6619  	return json.Marshal(objectMap)
  6620  }
  6621  
  6622  // AsJobInputClip is the BasicJobInput implementation for JobInputSequence.
  6623  func (jis JobInputSequence) AsJobInputClip() (*JobInputClip, bool) {
  6624  	return nil, false
  6625  }
  6626  
  6627  // AsBasicJobInputClip is the BasicJobInput implementation for JobInputSequence.
  6628  func (jis JobInputSequence) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  6629  	return nil, false
  6630  }
  6631  
  6632  // AsJobInputs is the BasicJobInput implementation for JobInputSequence.
  6633  func (jis JobInputSequence) AsJobInputs() (*JobInputs, bool) {
  6634  	return nil, false
  6635  }
  6636  
  6637  // AsJobInputAsset is the BasicJobInput implementation for JobInputSequence.
  6638  func (jis JobInputSequence) AsJobInputAsset() (*JobInputAsset, bool) {
  6639  	return nil, false
  6640  }
  6641  
  6642  // AsJobInputHTTP is the BasicJobInput implementation for JobInputSequence.
  6643  func (jis JobInputSequence) AsJobInputHTTP() (*JobInputHTTP, bool) {
  6644  	return nil, false
  6645  }
  6646  
  6647  // AsJobInputSequence is the BasicJobInput implementation for JobInputSequence.
  6648  func (jis JobInputSequence) AsJobInputSequence() (*JobInputSequence, bool) {
  6649  	return &jis, true
  6650  }
  6651  
  6652  // AsJobInput is the BasicJobInput implementation for JobInputSequence.
  6653  func (jis JobInputSequence) AsJobInput() (*JobInput, bool) {
  6654  	return nil, false
  6655  }
  6656  
  6657  // AsBasicJobInput is the BasicJobInput implementation for JobInputSequence.
  6658  func (jis JobInputSequence) AsBasicJobInput() (BasicJobInput, bool) {
  6659  	return &jis, true
  6660  }
  6661  
  6662  // UnmarshalJSON is the custom unmarshaler for JobInputSequence struct.
  6663  func (jis *JobInputSequence) UnmarshalJSON(body []byte) error {
  6664  	var m map[string]*json.RawMessage
  6665  	err := json.Unmarshal(body, &m)
  6666  	if err != nil {
  6667  		return err
  6668  	}
  6669  	for k, v := range m {
  6670  		switch k {
  6671  		case "inputs":
  6672  			if v != nil {
  6673  				inputs, err := unmarshalBasicJobInputClipArray(*v)
  6674  				if err != nil {
  6675  					return err
  6676  				}
  6677  				jis.Inputs = &inputs
  6678  			}
  6679  		case "@odata.type":
  6680  			if v != nil {
  6681  				var odataType OdataTypeBasicJobInput
  6682  				err = json.Unmarshal(*v, &odataType)
  6683  				if err != nil {
  6684  					return err
  6685  				}
  6686  				jis.OdataType = odataType
  6687  			}
  6688  		}
  6689  	}
  6690  
  6691  	return nil
  6692  }
  6693  
  6694  // BasicJobOutput describes all the properties of a JobOutput.
  6695  type BasicJobOutput interface {
  6696  	AsJobOutputAsset() (*JobOutputAsset, bool)
  6697  	AsJobOutput() (*JobOutput, bool)
  6698  }
  6699  
  6700  // JobOutput describes all the properties of a JobOutput.
  6701  type JobOutput struct {
  6702  	// Error - READ-ONLY; If the JobOutput is in the Error state, it contains the details of the error.
  6703  	Error *JobError `json:"error,omitempty"`
  6704  	// PresetOverride - A preset used to override the preset in the corresponding transform output.
  6705  	PresetOverride BasicPreset `json:"presetOverride,omitempty"`
  6706  	// State - READ-ONLY; Describes the state of the JobOutput. Possible values include: 'JobStateCanceled', 'JobStateCanceling', 'JobStateError', 'JobStateFinished', 'JobStateProcessing', 'JobStateQueued', 'JobStateScheduled'
  6707  	State JobState `json:"state,omitempty"`
  6708  	// 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.
  6709  	Progress *int32 `json:"progress,omitempty"`
  6710  	// 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.
  6711  	Label *string `json:"label,omitempty"`
  6712  	// StartTime - READ-ONLY; The UTC date and time at which this Job Output began processing.
  6713  	StartTime *date.Time `json:"startTime,omitempty"`
  6714  	// EndTime - READ-ONLY; The UTC date and time at which this Job Output finished processing.
  6715  	EndTime *date.Time `json:"endTime,omitempty"`
  6716  	// OdataType - Possible values include: 'OdataTypeBasicJobOutputOdataTypeJobOutput', 'OdataTypeBasicJobOutputOdataTypeMicrosoftMediaJobOutputAsset'
  6717  	OdataType OdataTypeBasicJobOutput `json:"@odata.type,omitempty"`
  6718  }
  6719  
  6720  func unmarshalBasicJobOutput(body []byte) (BasicJobOutput, error) {
  6721  	var m map[string]interface{}
  6722  	err := json.Unmarshal(body, &m)
  6723  	if err != nil {
  6724  		return nil, err
  6725  	}
  6726  
  6727  	switch m["@odata.type"] {
  6728  	case string(OdataTypeBasicJobOutputOdataTypeMicrosoftMediaJobOutputAsset):
  6729  		var joa JobOutputAsset
  6730  		err := json.Unmarshal(body, &joa)
  6731  		return joa, err
  6732  	default:
  6733  		var jo JobOutput
  6734  		err := json.Unmarshal(body, &jo)
  6735  		return jo, err
  6736  	}
  6737  }
  6738  func unmarshalBasicJobOutputArray(body []byte) ([]BasicJobOutput, error) {
  6739  	var rawMessages []*json.RawMessage
  6740  	err := json.Unmarshal(body, &rawMessages)
  6741  	if err != nil {
  6742  		return nil, err
  6743  	}
  6744  
  6745  	joArray := make([]BasicJobOutput, len(rawMessages))
  6746  
  6747  	for index, rawMessage := range rawMessages {
  6748  		jo, err := unmarshalBasicJobOutput(*rawMessage)
  6749  		if err != nil {
  6750  			return nil, err
  6751  		}
  6752  		joArray[index] = jo
  6753  	}
  6754  	return joArray, nil
  6755  }
  6756  
  6757  // MarshalJSON is the custom marshaler for JobOutput.
  6758  func (jo JobOutput) MarshalJSON() ([]byte, error) {
  6759  	jo.OdataType = OdataTypeBasicJobOutputOdataTypeJobOutput
  6760  	objectMap := make(map[string]interface{})
  6761  	objectMap["presetOverride"] = jo.PresetOverride
  6762  	if jo.Label != nil {
  6763  		objectMap["label"] = jo.Label
  6764  	}
  6765  	if jo.OdataType != "" {
  6766  		objectMap["@odata.type"] = jo.OdataType
  6767  	}
  6768  	return json.Marshal(objectMap)
  6769  }
  6770  
  6771  // AsJobOutputAsset is the BasicJobOutput implementation for JobOutput.
  6772  func (jo JobOutput) AsJobOutputAsset() (*JobOutputAsset, bool) {
  6773  	return nil, false
  6774  }
  6775  
  6776  // AsJobOutput is the BasicJobOutput implementation for JobOutput.
  6777  func (jo JobOutput) AsJobOutput() (*JobOutput, bool) {
  6778  	return &jo, true
  6779  }
  6780  
  6781  // AsBasicJobOutput is the BasicJobOutput implementation for JobOutput.
  6782  func (jo JobOutput) AsBasicJobOutput() (BasicJobOutput, bool) {
  6783  	return &jo, true
  6784  }
  6785  
  6786  // UnmarshalJSON is the custom unmarshaler for JobOutput struct.
  6787  func (jo *JobOutput) UnmarshalJSON(body []byte) error {
  6788  	var m map[string]*json.RawMessage
  6789  	err := json.Unmarshal(body, &m)
  6790  	if err != nil {
  6791  		return err
  6792  	}
  6793  	for k, v := range m {
  6794  		switch k {
  6795  		case "error":
  6796  			if v != nil {
  6797  				var errorVar JobError
  6798  				err = json.Unmarshal(*v, &errorVar)
  6799  				if err != nil {
  6800  					return err
  6801  				}
  6802  				jo.Error = &errorVar
  6803  			}
  6804  		case "presetOverride":
  6805  			if v != nil {
  6806  				presetOverride, err := unmarshalBasicPreset(*v)
  6807  				if err != nil {
  6808  					return err
  6809  				}
  6810  				jo.PresetOverride = presetOverride
  6811  			}
  6812  		case "state":
  6813  			if v != nil {
  6814  				var state JobState
  6815  				err = json.Unmarshal(*v, &state)
  6816  				if err != nil {
  6817  					return err
  6818  				}
  6819  				jo.State = state
  6820  			}
  6821  		case "progress":
  6822  			if v != nil {
  6823  				var progress int32
  6824  				err = json.Unmarshal(*v, &progress)
  6825  				if err != nil {
  6826  					return err
  6827  				}
  6828  				jo.Progress = &progress
  6829  			}
  6830  		case "label":
  6831  			if v != nil {
  6832  				var label string
  6833  				err = json.Unmarshal(*v, &label)
  6834  				if err != nil {
  6835  					return err
  6836  				}
  6837  				jo.Label = &label
  6838  			}
  6839  		case "startTime":
  6840  			if v != nil {
  6841  				var startTime date.Time
  6842  				err = json.Unmarshal(*v, &startTime)
  6843  				if err != nil {
  6844  					return err
  6845  				}
  6846  				jo.StartTime = &startTime
  6847  			}
  6848  		case "endTime":
  6849  			if v != nil {
  6850  				var endTime date.Time
  6851  				err = json.Unmarshal(*v, &endTime)
  6852  				if err != nil {
  6853  					return err
  6854  				}
  6855  				jo.EndTime = &endTime
  6856  			}
  6857  		case "@odata.type":
  6858  			if v != nil {
  6859  				var odataType OdataTypeBasicJobOutput
  6860  				err = json.Unmarshal(*v, &odataType)
  6861  				if err != nil {
  6862  					return err
  6863  				}
  6864  				jo.OdataType = odataType
  6865  			}
  6866  		}
  6867  	}
  6868  
  6869  	return nil
  6870  }
  6871  
  6872  // JobOutputAsset represents an Asset used as a JobOutput.
  6873  type JobOutputAsset struct {
  6874  	// AssetName - The name of the output Asset.
  6875  	AssetName *string `json:"assetName,omitempty"`
  6876  	// Error - READ-ONLY; If the JobOutput is in the Error state, it contains the details of the error.
  6877  	Error *JobError `json:"error,omitempty"`
  6878  	// PresetOverride - A preset used to override the preset in the corresponding transform output.
  6879  	PresetOverride BasicPreset `json:"presetOverride,omitempty"`
  6880  	// State - READ-ONLY; Describes the state of the JobOutput. Possible values include: 'JobStateCanceled', 'JobStateCanceling', 'JobStateError', 'JobStateFinished', 'JobStateProcessing', 'JobStateQueued', 'JobStateScheduled'
  6881  	State JobState `json:"state,omitempty"`
  6882  	// 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.
  6883  	Progress *int32 `json:"progress,omitempty"`
  6884  	// 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.
  6885  	Label *string `json:"label,omitempty"`
  6886  	// StartTime - READ-ONLY; The UTC date and time at which this Job Output began processing.
  6887  	StartTime *date.Time `json:"startTime,omitempty"`
  6888  	// EndTime - READ-ONLY; The UTC date and time at which this Job Output finished processing.
  6889  	EndTime *date.Time `json:"endTime,omitempty"`
  6890  	// OdataType - Possible values include: 'OdataTypeBasicJobOutputOdataTypeJobOutput', 'OdataTypeBasicJobOutputOdataTypeMicrosoftMediaJobOutputAsset'
  6891  	OdataType OdataTypeBasicJobOutput `json:"@odata.type,omitempty"`
  6892  }
  6893  
  6894  // MarshalJSON is the custom marshaler for JobOutputAsset.
  6895  func (joa JobOutputAsset) MarshalJSON() ([]byte, error) {
  6896  	joa.OdataType = OdataTypeBasicJobOutputOdataTypeMicrosoftMediaJobOutputAsset
  6897  	objectMap := make(map[string]interface{})
  6898  	if joa.AssetName != nil {
  6899  		objectMap["assetName"] = joa.AssetName
  6900  	}
  6901  	objectMap["presetOverride"] = joa.PresetOverride
  6902  	if joa.Label != nil {
  6903  		objectMap["label"] = joa.Label
  6904  	}
  6905  	if joa.OdataType != "" {
  6906  		objectMap["@odata.type"] = joa.OdataType
  6907  	}
  6908  	return json.Marshal(objectMap)
  6909  }
  6910  
  6911  // AsJobOutputAsset is the BasicJobOutput implementation for JobOutputAsset.
  6912  func (joa JobOutputAsset) AsJobOutputAsset() (*JobOutputAsset, bool) {
  6913  	return &joa, true
  6914  }
  6915  
  6916  // AsJobOutput is the BasicJobOutput implementation for JobOutputAsset.
  6917  func (joa JobOutputAsset) AsJobOutput() (*JobOutput, bool) {
  6918  	return nil, false
  6919  }
  6920  
  6921  // AsBasicJobOutput is the BasicJobOutput implementation for JobOutputAsset.
  6922  func (joa JobOutputAsset) AsBasicJobOutput() (BasicJobOutput, bool) {
  6923  	return &joa, true
  6924  }
  6925  
  6926  // UnmarshalJSON is the custom unmarshaler for JobOutputAsset struct.
  6927  func (joa *JobOutputAsset) UnmarshalJSON(body []byte) error {
  6928  	var m map[string]*json.RawMessage
  6929  	err := json.Unmarshal(body, &m)
  6930  	if err != nil {
  6931  		return err
  6932  	}
  6933  	for k, v := range m {
  6934  		switch k {
  6935  		case "assetName":
  6936  			if v != nil {
  6937  				var assetName string
  6938  				err = json.Unmarshal(*v, &assetName)
  6939  				if err != nil {
  6940  					return err
  6941  				}
  6942  				joa.AssetName = &assetName
  6943  			}
  6944  		case "error":
  6945  			if v != nil {
  6946  				var errorVar JobError
  6947  				err = json.Unmarshal(*v, &errorVar)
  6948  				if err != nil {
  6949  					return err
  6950  				}
  6951  				joa.Error = &errorVar
  6952  			}
  6953  		case "presetOverride":
  6954  			if v != nil {
  6955  				presetOverride, err := unmarshalBasicPreset(*v)
  6956  				if err != nil {
  6957  					return err
  6958  				}
  6959  				joa.PresetOverride = presetOverride
  6960  			}
  6961  		case "state":
  6962  			if v != nil {
  6963  				var state JobState
  6964  				err = json.Unmarshal(*v, &state)
  6965  				if err != nil {
  6966  					return err
  6967  				}
  6968  				joa.State = state
  6969  			}
  6970  		case "progress":
  6971  			if v != nil {
  6972  				var progress int32
  6973  				err = json.Unmarshal(*v, &progress)
  6974  				if err != nil {
  6975  					return err
  6976  				}
  6977  				joa.Progress = &progress
  6978  			}
  6979  		case "label":
  6980  			if v != nil {
  6981  				var label string
  6982  				err = json.Unmarshal(*v, &label)
  6983  				if err != nil {
  6984  					return err
  6985  				}
  6986  				joa.Label = &label
  6987  			}
  6988  		case "startTime":
  6989  			if v != nil {
  6990  				var startTime date.Time
  6991  				err = json.Unmarshal(*v, &startTime)
  6992  				if err != nil {
  6993  					return err
  6994  				}
  6995  				joa.StartTime = &startTime
  6996  			}
  6997  		case "endTime":
  6998  			if v != nil {
  6999  				var endTime date.Time
  7000  				err = json.Unmarshal(*v, &endTime)
  7001  				if err != nil {
  7002  					return err
  7003  				}
  7004  				joa.EndTime = &endTime
  7005  			}
  7006  		case "@odata.type":
  7007  			if v != nil {
  7008  				var odataType OdataTypeBasicJobOutput
  7009  				err = json.Unmarshal(*v, &odataType)
  7010  				if err != nil {
  7011  					return err
  7012  				}
  7013  				joa.OdataType = odataType
  7014  			}
  7015  		}
  7016  	}
  7017  
  7018  	return nil
  7019  }
  7020  
  7021  // JobProperties properties of the Job.
  7022  type JobProperties struct {
  7023  	// Created - READ-ONLY; The UTC date and time when the customer has created the Job, in 'YYYY-MM-DDThh:mm:ssZ' format.
  7024  	Created *date.Time `json:"created,omitempty"`
  7025  	// State - READ-ONLY; The current state of the job. Possible values include: 'JobStateCanceled', 'JobStateCanceling', 'JobStateError', 'JobStateFinished', 'JobStateProcessing', 'JobStateQueued', 'JobStateScheduled'
  7026  	State JobState `json:"state,omitempty"`
  7027  	// Description - Optional customer supplied description of the Job.
  7028  	Description *string `json:"description,omitempty"`
  7029  	// Input - The inputs for the Job.
  7030  	Input BasicJobInput `json:"input,omitempty"`
  7031  	// LastModified - READ-ONLY; The UTC date and time when the customer has last updated the Job, in 'YYYY-MM-DDThh:mm:ssZ' format.
  7032  	LastModified *date.Time `json:"lastModified,omitempty"`
  7033  	// Outputs - The outputs for the Job.
  7034  	Outputs *[]BasicJobOutput `json:"outputs,omitempty"`
  7035  	// 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'
  7036  	Priority Priority `json:"priority,omitempty"`
  7037  	// CorrelationData - Customer provided key, value pairs that will be returned in Job and JobOutput state events.
  7038  	CorrelationData map[string]*string `json:"correlationData"`
  7039  	// StartTime - READ-ONLY; The UTC date and time at which this Job began processing.
  7040  	StartTime *date.Time `json:"startTime,omitempty"`
  7041  	// EndTime - READ-ONLY; The UTC date and time at which this Job finished processing.
  7042  	EndTime *date.Time `json:"endTime,omitempty"`
  7043  }
  7044  
  7045  // MarshalJSON is the custom marshaler for JobProperties.
  7046  func (jp JobProperties) MarshalJSON() ([]byte, error) {
  7047  	objectMap := make(map[string]interface{})
  7048  	if jp.Description != nil {
  7049  		objectMap["description"] = jp.Description
  7050  	}
  7051  	objectMap["input"] = jp.Input
  7052  	if jp.Outputs != nil {
  7053  		objectMap["outputs"] = jp.Outputs
  7054  	}
  7055  	if jp.Priority != "" {
  7056  		objectMap["priority"] = jp.Priority
  7057  	}
  7058  	if jp.CorrelationData != nil {
  7059  		objectMap["correlationData"] = jp.CorrelationData
  7060  	}
  7061  	return json.Marshal(objectMap)
  7062  }
  7063  
  7064  // UnmarshalJSON is the custom unmarshaler for JobProperties struct.
  7065  func (jp *JobProperties) UnmarshalJSON(body []byte) error {
  7066  	var m map[string]*json.RawMessage
  7067  	err := json.Unmarshal(body, &m)
  7068  	if err != nil {
  7069  		return err
  7070  	}
  7071  	for k, v := range m {
  7072  		switch k {
  7073  		case "created":
  7074  			if v != nil {
  7075  				var created date.Time
  7076  				err = json.Unmarshal(*v, &created)
  7077  				if err != nil {
  7078  					return err
  7079  				}
  7080  				jp.Created = &created
  7081  			}
  7082  		case "state":
  7083  			if v != nil {
  7084  				var state JobState
  7085  				err = json.Unmarshal(*v, &state)
  7086  				if err != nil {
  7087  					return err
  7088  				}
  7089  				jp.State = state
  7090  			}
  7091  		case "description":
  7092  			if v != nil {
  7093  				var description string
  7094  				err = json.Unmarshal(*v, &description)
  7095  				if err != nil {
  7096  					return err
  7097  				}
  7098  				jp.Description = &description
  7099  			}
  7100  		case "input":
  7101  			if v != nil {
  7102  				input, err := unmarshalBasicJobInput(*v)
  7103  				if err != nil {
  7104  					return err
  7105  				}
  7106  				jp.Input = input
  7107  			}
  7108  		case "lastModified":
  7109  			if v != nil {
  7110  				var lastModified date.Time
  7111  				err = json.Unmarshal(*v, &lastModified)
  7112  				if err != nil {
  7113  					return err
  7114  				}
  7115  				jp.LastModified = &lastModified
  7116  			}
  7117  		case "outputs":
  7118  			if v != nil {
  7119  				outputs, err := unmarshalBasicJobOutputArray(*v)
  7120  				if err != nil {
  7121  					return err
  7122  				}
  7123  				jp.Outputs = &outputs
  7124  			}
  7125  		case "priority":
  7126  			if v != nil {
  7127  				var priority Priority
  7128  				err = json.Unmarshal(*v, &priority)
  7129  				if err != nil {
  7130  					return err
  7131  				}
  7132  				jp.Priority = priority
  7133  			}
  7134  		case "correlationData":
  7135  			if v != nil {
  7136  				var correlationData map[string]*string
  7137  				err = json.Unmarshal(*v, &correlationData)
  7138  				if err != nil {
  7139  					return err
  7140  				}
  7141  				jp.CorrelationData = correlationData
  7142  			}
  7143  		case "startTime":
  7144  			if v != nil {
  7145  				var startTime date.Time
  7146  				err = json.Unmarshal(*v, &startTime)
  7147  				if err != nil {
  7148  					return err
  7149  				}
  7150  				jp.StartTime = &startTime
  7151  			}
  7152  		case "endTime":
  7153  			if v != nil {
  7154  				var endTime date.Time
  7155  				err = json.Unmarshal(*v, &endTime)
  7156  				if err != nil {
  7157  					return err
  7158  				}
  7159  				jp.EndTime = &endTime
  7160  			}
  7161  		}
  7162  	}
  7163  
  7164  	return nil
  7165  }
  7166  
  7167  // JpgFormat describes the settings for producing JPEG thumbnails.
  7168  type JpgFormat struct {
  7169  	// 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.
  7170  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  7171  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  7172  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  7173  }
  7174  
  7175  // MarshalJSON is the custom marshaler for JpgFormat.
  7176  func (jf JpgFormat) MarshalJSON() ([]byte, error) {
  7177  	jf.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat
  7178  	objectMap := make(map[string]interface{})
  7179  	if jf.FilenamePattern != nil {
  7180  		objectMap["filenamePattern"] = jf.FilenamePattern
  7181  	}
  7182  	if jf.OdataType != "" {
  7183  		objectMap["@odata.type"] = jf.OdataType
  7184  	}
  7185  	return json.Marshal(objectMap)
  7186  }
  7187  
  7188  // AsImageFormat is the BasicFormat implementation for JpgFormat.
  7189  func (jf JpgFormat) AsImageFormat() (*ImageFormat, bool) {
  7190  	return nil, false
  7191  }
  7192  
  7193  // AsBasicImageFormat is the BasicFormat implementation for JpgFormat.
  7194  func (jf JpgFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
  7195  	return &jf, true
  7196  }
  7197  
  7198  // AsJpgFormat is the BasicFormat implementation for JpgFormat.
  7199  func (jf JpgFormat) AsJpgFormat() (*JpgFormat, bool) {
  7200  	return &jf, true
  7201  }
  7202  
  7203  // AsPngFormat is the BasicFormat implementation for JpgFormat.
  7204  func (jf JpgFormat) AsPngFormat() (*PngFormat, bool) {
  7205  	return nil, false
  7206  }
  7207  
  7208  // AsMultiBitrateFormat is the BasicFormat implementation for JpgFormat.
  7209  func (jf JpgFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  7210  	return nil, false
  7211  }
  7212  
  7213  // AsBasicMultiBitrateFormat is the BasicFormat implementation for JpgFormat.
  7214  func (jf JpgFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  7215  	return nil, false
  7216  }
  7217  
  7218  // AsMp4Format is the BasicFormat implementation for JpgFormat.
  7219  func (jf JpgFormat) AsMp4Format() (*Mp4Format, bool) {
  7220  	return nil, false
  7221  }
  7222  
  7223  // AsTransportStreamFormat is the BasicFormat implementation for JpgFormat.
  7224  func (jf JpgFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  7225  	return nil, false
  7226  }
  7227  
  7228  // AsFormat is the BasicFormat implementation for JpgFormat.
  7229  func (jf JpgFormat) AsFormat() (*Format, bool) {
  7230  	return nil, false
  7231  }
  7232  
  7233  // AsBasicFormat is the BasicFormat implementation for JpgFormat.
  7234  func (jf JpgFormat) AsBasicFormat() (BasicFormat, bool) {
  7235  	return &jf, true
  7236  }
  7237  
  7238  // JpgImage describes the properties for producing a series of JPEG images from the input video.
  7239  type JpgImage struct {
  7240  	// Layers - A collection of output JPEG image layers to be produced by the encoder.
  7241  	Layers *[]JpgLayer `json:"layers,omitempty"`
  7242  	// 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.
  7243  	SpriteColumn *int32 `json:"spriteColumn,omitempty"`
  7244  	// 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}.
  7245  	Start *string `json:"start,omitempty"`
  7246  	// 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.
  7247  	Step *string `json:"step,omitempty"`
  7248  	// 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.
  7249  	Range *string `json:"range,omitempty"`
  7250  	// 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.
  7251  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  7252  	// 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'
  7253  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  7254  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
  7255  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
  7256  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  7257  	Label *string `json:"label,omitempty"`
  7258  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  7259  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  7260  }
  7261  
  7262  // MarshalJSON is the custom marshaler for JpgImage.
  7263  func (ji JpgImage) MarshalJSON() ([]byte, error) {
  7264  	ji.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage
  7265  	objectMap := make(map[string]interface{})
  7266  	if ji.Layers != nil {
  7267  		objectMap["layers"] = ji.Layers
  7268  	}
  7269  	if ji.SpriteColumn != nil {
  7270  		objectMap["spriteColumn"] = ji.SpriteColumn
  7271  	}
  7272  	if ji.Start != nil {
  7273  		objectMap["start"] = ji.Start
  7274  	}
  7275  	if ji.Step != nil {
  7276  		objectMap["step"] = ji.Step
  7277  	}
  7278  	if ji.Range != nil {
  7279  		objectMap["range"] = ji.Range
  7280  	}
  7281  	if ji.KeyFrameInterval != nil {
  7282  		objectMap["keyFrameInterval"] = ji.KeyFrameInterval
  7283  	}
  7284  	if ji.StretchMode != "" {
  7285  		objectMap["stretchMode"] = ji.StretchMode
  7286  	}
  7287  	if ji.SyncMode != "" {
  7288  		objectMap["syncMode"] = ji.SyncMode
  7289  	}
  7290  	if ji.Label != nil {
  7291  		objectMap["label"] = ji.Label
  7292  	}
  7293  	if ji.OdataType != "" {
  7294  		objectMap["@odata.type"] = ji.OdataType
  7295  	}
  7296  	return json.Marshal(objectMap)
  7297  }
  7298  
  7299  // AsAudio is the BasicCodec implementation for JpgImage.
  7300  func (ji JpgImage) AsAudio() (*Audio, bool) {
  7301  	return nil, false
  7302  }
  7303  
  7304  // AsBasicAudio is the BasicCodec implementation for JpgImage.
  7305  func (ji JpgImage) AsBasicAudio() (BasicAudio, bool) {
  7306  	return nil, false
  7307  }
  7308  
  7309  // AsAacAudio is the BasicCodec implementation for JpgImage.
  7310  func (ji JpgImage) AsAacAudio() (*AacAudio, bool) {
  7311  	return nil, false
  7312  }
  7313  
  7314  // AsVideo is the BasicCodec implementation for JpgImage.
  7315  func (ji JpgImage) AsVideo() (*Video, bool) {
  7316  	return nil, false
  7317  }
  7318  
  7319  // AsBasicVideo is the BasicCodec implementation for JpgImage.
  7320  func (ji JpgImage) AsBasicVideo() (BasicVideo, bool) {
  7321  	return &ji, true
  7322  }
  7323  
  7324  // AsH265Video is the BasicCodec implementation for JpgImage.
  7325  func (ji JpgImage) AsH265Video() (*H265Video, bool) {
  7326  	return nil, false
  7327  }
  7328  
  7329  // AsCopyVideo is the BasicCodec implementation for JpgImage.
  7330  func (ji JpgImage) AsCopyVideo() (*CopyVideo, bool) {
  7331  	return nil, false
  7332  }
  7333  
  7334  // AsImage is the BasicCodec implementation for JpgImage.
  7335  func (ji JpgImage) AsImage() (*Image, bool) {
  7336  	return nil, false
  7337  }
  7338  
  7339  // AsBasicImage is the BasicCodec implementation for JpgImage.
  7340  func (ji JpgImage) AsBasicImage() (BasicImage, bool) {
  7341  	return &ji, true
  7342  }
  7343  
  7344  // AsCopyAudio is the BasicCodec implementation for JpgImage.
  7345  func (ji JpgImage) AsCopyAudio() (*CopyAudio, bool) {
  7346  	return nil, false
  7347  }
  7348  
  7349  // AsH264Video is the BasicCodec implementation for JpgImage.
  7350  func (ji JpgImage) AsH264Video() (*H264Video, bool) {
  7351  	return nil, false
  7352  }
  7353  
  7354  // AsJpgImage is the BasicCodec implementation for JpgImage.
  7355  func (ji JpgImage) AsJpgImage() (*JpgImage, bool) {
  7356  	return &ji, true
  7357  }
  7358  
  7359  // AsPngImage is the BasicCodec implementation for JpgImage.
  7360  func (ji JpgImage) AsPngImage() (*PngImage, bool) {
  7361  	return nil, false
  7362  }
  7363  
  7364  // AsCodec is the BasicCodec implementation for JpgImage.
  7365  func (ji JpgImage) AsCodec() (*Codec, bool) {
  7366  	return nil, false
  7367  }
  7368  
  7369  // AsBasicCodec is the BasicCodec implementation for JpgImage.
  7370  func (ji JpgImage) AsBasicCodec() (BasicCodec, bool) {
  7371  	return &ji, true
  7372  }
  7373  
  7374  // JpgLayer describes the settings to produce a JPEG image from the input video.
  7375  type JpgLayer struct {
  7376  	// Quality - The compression quality of the JPEG output. Range is from 0-100 and the default is 70.
  7377  	Quality *int32 `json:"quality,omitempty"`
  7378  	// 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.
  7379  	Width *string `json:"width,omitempty"`
  7380  	// 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.
  7381  	Height *string `json:"height,omitempty"`
  7382  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  7383  	Label *string `json:"label,omitempty"`
  7384  	// OdataType - Possible values include: 'OdataTypeBasicLayerOdataTypeLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer'
  7385  	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
  7386  }
  7387  
  7388  // MarshalJSON is the custom marshaler for JpgLayer.
  7389  func (jl JpgLayer) MarshalJSON() ([]byte, error) {
  7390  	jl.OdataType = OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer
  7391  	objectMap := make(map[string]interface{})
  7392  	if jl.Quality != nil {
  7393  		objectMap["quality"] = jl.Quality
  7394  	}
  7395  	if jl.Width != nil {
  7396  		objectMap["width"] = jl.Width
  7397  	}
  7398  	if jl.Height != nil {
  7399  		objectMap["height"] = jl.Height
  7400  	}
  7401  	if jl.Label != nil {
  7402  		objectMap["label"] = jl.Label
  7403  	}
  7404  	if jl.OdataType != "" {
  7405  		objectMap["@odata.type"] = jl.OdataType
  7406  	}
  7407  	return json.Marshal(objectMap)
  7408  }
  7409  
  7410  // AsH265VideoLayer is the BasicLayer implementation for JpgLayer.
  7411  func (jl JpgLayer) AsH265VideoLayer() (*H265VideoLayer, bool) {
  7412  	return nil, false
  7413  }
  7414  
  7415  // AsBasicH265VideoLayer is the BasicLayer implementation for JpgLayer.
  7416  func (jl JpgLayer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
  7417  	return nil, false
  7418  }
  7419  
  7420  // AsH265Layer is the BasicLayer implementation for JpgLayer.
  7421  func (jl JpgLayer) AsH265Layer() (*H265Layer, bool) {
  7422  	return nil, false
  7423  }
  7424  
  7425  // AsVideoLayer is the BasicLayer implementation for JpgLayer.
  7426  func (jl JpgLayer) AsVideoLayer() (*VideoLayer, bool) {
  7427  	return nil, false
  7428  }
  7429  
  7430  // AsBasicVideoLayer is the BasicLayer implementation for JpgLayer.
  7431  func (jl JpgLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
  7432  	return nil, false
  7433  }
  7434  
  7435  // AsH264Layer is the BasicLayer implementation for JpgLayer.
  7436  func (jl JpgLayer) AsH264Layer() (*H264Layer, bool) {
  7437  	return nil, false
  7438  }
  7439  
  7440  // AsJpgLayer is the BasicLayer implementation for JpgLayer.
  7441  func (jl JpgLayer) AsJpgLayer() (*JpgLayer, bool) {
  7442  	return &jl, true
  7443  }
  7444  
  7445  // AsPngLayer is the BasicLayer implementation for JpgLayer.
  7446  func (jl JpgLayer) AsPngLayer() (*PngLayer, bool) {
  7447  	return nil, false
  7448  }
  7449  
  7450  // AsLayer is the BasicLayer implementation for JpgLayer.
  7451  func (jl JpgLayer) AsLayer() (*Layer, bool) {
  7452  	return nil, false
  7453  }
  7454  
  7455  // AsBasicLayer is the BasicLayer implementation for JpgLayer.
  7456  func (jl JpgLayer) AsBasicLayer() (BasicLayer, bool) {
  7457  	return &jl, true
  7458  }
  7459  
  7460  // KeyDelivery ...
  7461  type KeyDelivery struct {
  7462  	// AccessControl - The access control properties for Key Delivery.
  7463  	AccessControl *AccessControl `json:"accessControl,omitempty"`
  7464  }
  7465  
  7466  // KeyVaultProperties ...
  7467  type KeyVaultProperties struct {
  7468  	// 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).
  7469  	KeyIdentifier *string `json:"keyIdentifier,omitempty"`
  7470  	// CurrentKeyIdentifier - READ-ONLY; The current key used to encrypt the Media Services account, including the key version.
  7471  	CurrentKeyIdentifier *string `json:"currentKeyIdentifier,omitempty"`
  7472  }
  7473  
  7474  // MarshalJSON is the custom marshaler for KeyVaultProperties.
  7475  func (kvp KeyVaultProperties) MarshalJSON() ([]byte, error) {
  7476  	objectMap := make(map[string]interface{})
  7477  	if kvp.KeyIdentifier != nil {
  7478  		objectMap["keyIdentifier"] = kvp.KeyIdentifier
  7479  	}
  7480  	return json.Marshal(objectMap)
  7481  }
  7482  
  7483  // BasicLayer the encoder can be configured to produce video and/or images (thumbnails) at different resolutions, by
  7484  // specifying a layer for each desired resolution. A layer represents the properties for the video or image at a
  7485  // resolution.
  7486  type BasicLayer interface {
  7487  	AsH265VideoLayer() (*H265VideoLayer, bool)
  7488  	AsBasicH265VideoLayer() (BasicH265VideoLayer, bool)
  7489  	AsH265Layer() (*H265Layer, bool)
  7490  	AsVideoLayer() (*VideoLayer, bool)
  7491  	AsBasicVideoLayer() (BasicVideoLayer, bool)
  7492  	AsH264Layer() (*H264Layer, bool)
  7493  	AsJpgLayer() (*JpgLayer, bool)
  7494  	AsPngLayer() (*PngLayer, bool)
  7495  	AsLayer() (*Layer, bool)
  7496  }
  7497  
  7498  // Layer the encoder can be configured to produce video and/or images (thumbnails) at different resolutions, by
  7499  // specifying a layer for each desired resolution. A layer represents the properties for the video or image at
  7500  // a resolution.
  7501  type Layer struct {
  7502  	// 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.
  7503  	Width *string `json:"width,omitempty"`
  7504  	// 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.
  7505  	Height *string `json:"height,omitempty"`
  7506  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  7507  	Label *string `json:"label,omitempty"`
  7508  	// OdataType - Possible values include: 'OdataTypeBasicLayerOdataTypeLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer'
  7509  	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
  7510  }
  7511  
  7512  func unmarshalBasicLayer(body []byte) (BasicLayer, error) {
  7513  	var m map[string]interface{}
  7514  	err := json.Unmarshal(body, &m)
  7515  	if err != nil {
  7516  		return nil, err
  7517  	}
  7518  
  7519  	switch m["@odata.type"] {
  7520  	case string(OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer):
  7521  		var hvl H265VideoLayer
  7522  		err := json.Unmarshal(body, &hvl)
  7523  		return hvl, err
  7524  	case string(OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer):
  7525  		var hl H265Layer
  7526  		err := json.Unmarshal(body, &hl)
  7527  		return hl, err
  7528  	case string(OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer):
  7529  		var vl VideoLayer
  7530  		err := json.Unmarshal(body, &vl)
  7531  		return vl, err
  7532  	case string(OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer):
  7533  		var hl H264Layer
  7534  		err := json.Unmarshal(body, &hl)
  7535  		return hl, err
  7536  	case string(OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer):
  7537  		var jl JpgLayer
  7538  		err := json.Unmarshal(body, &jl)
  7539  		return jl, err
  7540  	case string(OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer):
  7541  		var pl PngLayer
  7542  		err := json.Unmarshal(body, &pl)
  7543  		return pl, err
  7544  	default:
  7545  		var l Layer
  7546  		err := json.Unmarshal(body, &l)
  7547  		return l, err
  7548  	}
  7549  }
  7550  func unmarshalBasicLayerArray(body []byte) ([]BasicLayer, error) {
  7551  	var rawMessages []*json.RawMessage
  7552  	err := json.Unmarshal(body, &rawMessages)
  7553  	if err != nil {
  7554  		return nil, err
  7555  	}
  7556  
  7557  	lArray := make([]BasicLayer, len(rawMessages))
  7558  
  7559  	for index, rawMessage := range rawMessages {
  7560  		l, err := unmarshalBasicLayer(*rawMessage)
  7561  		if err != nil {
  7562  			return nil, err
  7563  		}
  7564  		lArray[index] = l
  7565  	}
  7566  	return lArray, nil
  7567  }
  7568  
  7569  // MarshalJSON is the custom marshaler for Layer.
  7570  func (l Layer) MarshalJSON() ([]byte, error) {
  7571  	l.OdataType = OdataTypeBasicLayerOdataTypeLayer
  7572  	objectMap := make(map[string]interface{})
  7573  	if l.Width != nil {
  7574  		objectMap["width"] = l.Width
  7575  	}
  7576  	if l.Height != nil {
  7577  		objectMap["height"] = l.Height
  7578  	}
  7579  	if l.Label != nil {
  7580  		objectMap["label"] = l.Label
  7581  	}
  7582  	if l.OdataType != "" {
  7583  		objectMap["@odata.type"] = l.OdataType
  7584  	}
  7585  	return json.Marshal(objectMap)
  7586  }
  7587  
  7588  // AsH265VideoLayer is the BasicLayer implementation for Layer.
  7589  func (l Layer) AsH265VideoLayer() (*H265VideoLayer, bool) {
  7590  	return nil, false
  7591  }
  7592  
  7593  // AsBasicH265VideoLayer is the BasicLayer implementation for Layer.
  7594  func (l Layer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
  7595  	return nil, false
  7596  }
  7597  
  7598  // AsH265Layer is the BasicLayer implementation for Layer.
  7599  func (l Layer) AsH265Layer() (*H265Layer, bool) {
  7600  	return nil, false
  7601  }
  7602  
  7603  // AsVideoLayer is the BasicLayer implementation for Layer.
  7604  func (l Layer) AsVideoLayer() (*VideoLayer, bool) {
  7605  	return nil, false
  7606  }
  7607  
  7608  // AsBasicVideoLayer is the BasicLayer implementation for Layer.
  7609  func (l Layer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
  7610  	return nil, false
  7611  }
  7612  
  7613  // AsH264Layer is the BasicLayer implementation for Layer.
  7614  func (l Layer) AsH264Layer() (*H264Layer, bool) {
  7615  	return nil, false
  7616  }
  7617  
  7618  // AsJpgLayer is the BasicLayer implementation for Layer.
  7619  func (l Layer) AsJpgLayer() (*JpgLayer, bool) {
  7620  	return nil, false
  7621  }
  7622  
  7623  // AsPngLayer is the BasicLayer implementation for Layer.
  7624  func (l Layer) AsPngLayer() (*PngLayer, bool) {
  7625  	return nil, false
  7626  }
  7627  
  7628  // AsLayer is the BasicLayer implementation for Layer.
  7629  func (l Layer) AsLayer() (*Layer, bool) {
  7630  	return &l, true
  7631  }
  7632  
  7633  // AsBasicLayer is the BasicLayer implementation for Layer.
  7634  func (l Layer) AsBasicLayer() (BasicLayer, bool) {
  7635  	return &l, true
  7636  }
  7637  
  7638  // ListContainerSasInput the parameters to the list SAS request.
  7639  type ListContainerSasInput struct {
  7640  	// Permissions - The permissions to set on the SAS URL. Possible values include: 'AssetContainerPermissionRead', 'AssetContainerPermissionReadWrite', 'AssetContainerPermissionReadWriteDelete'
  7641  	Permissions AssetContainerPermission `json:"permissions,omitempty"`
  7642  	// ExpiryTime - The SAS URL expiration time.  This must be less than 24 hours from the current time.
  7643  	ExpiryTime *date.Time `json:"expiryTime,omitempty"`
  7644  }
  7645  
  7646  // ListContentKeysResponse class of response for listContentKeys action
  7647  type ListContentKeysResponse struct {
  7648  	autorest.Response `json:"-"`
  7649  	// ContentKeys - ContentKeys used by current Streaming Locator
  7650  	ContentKeys *[]StreamingLocatorContentKey `json:"contentKeys,omitempty"`
  7651  }
  7652  
  7653  // ListEdgePoliciesInput ...
  7654  type ListEdgePoliciesInput struct {
  7655  	// DeviceID - Unique identifier of the edge device.
  7656  	DeviceID *string `json:"deviceId,omitempty"`
  7657  }
  7658  
  7659  // ListPathsResponse class of response for listPaths action
  7660  type ListPathsResponse struct {
  7661  	autorest.Response `json:"-"`
  7662  	// StreamingPaths - Streaming Paths supported by current Streaming Locator
  7663  	StreamingPaths *[]StreamingPath `json:"streamingPaths,omitempty"`
  7664  	// DownloadPaths - Download Paths supported by current Streaming Locator
  7665  	DownloadPaths *[]string `json:"downloadPaths,omitempty"`
  7666  }
  7667  
  7668  // ListStreamingLocatorsResponse the Streaming Locators associated with this Asset.
  7669  type ListStreamingLocatorsResponse struct {
  7670  	autorest.Response `json:"-"`
  7671  	// StreamingLocators - READ-ONLY; The list of Streaming Locators.
  7672  	StreamingLocators *[]AssetStreamingLocator `json:"streamingLocators,omitempty"`
  7673  }
  7674  
  7675  // MarshalJSON is the custom marshaler for ListStreamingLocatorsResponse.
  7676  func (lslr ListStreamingLocatorsResponse) MarshalJSON() ([]byte, error) {
  7677  	objectMap := make(map[string]interface{})
  7678  	return json.Marshal(objectMap)
  7679  }
  7680  
  7681  // LiveEvent the live event.
  7682  type LiveEvent struct {
  7683  	autorest.Response `json:"-"`
  7684  	// LiveEventProperties - The live event properties.
  7685  	*LiveEventProperties `json:"properties,omitempty"`
  7686  	// SystemData - READ-ONLY; The system metadata relating to this resource.
  7687  	SystemData *SystemData `json:"systemData,omitempty"`
  7688  	// Tags - Resource tags.
  7689  	Tags map[string]*string `json:"tags"`
  7690  	// Location - The geo-location where the resource lives
  7691  	Location *string `json:"location,omitempty"`
  7692  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  7693  	ID *string `json:"id,omitempty"`
  7694  	// Name - READ-ONLY; The name of the resource
  7695  	Name *string `json:"name,omitempty"`
  7696  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  7697  	Type *string `json:"type,omitempty"`
  7698  }
  7699  
  7700  // MarshalJSON is the custom marshaler for LiveEvent.
  7701  func (le LiveEvent) MarshalJSON() ([]byte, error) {
  7702  	objectMap := make(map[string]interface{})
  7703  	if le.LiveEventProperties != nil {
  7704  		objectMap["properties"] = le.LiveEventProperties
  7705  	}
  7706  	if le.Tags != nil {
  7707  		objectMap["tags"] = le.Tags
  7708  	}
  7709  	if le.Location != nil {
  7710  		objectMap["location"] = le.Location
  7711  	}
  7712  	return json.Marshal(objectMap)
  7713  }
  7714  
  7715  // UnmarshalJSON is the custom unmarshaler for LiveEvent struct.
  7716  func (le *LiveEvent) UnmarshalJSON(body []byte) error {
  7717  	var m map[string]*json.RawMessage
  7718  	err := json.Unmarshal(body, &m)
  7719  	if err != nil {
  7720  		return err
  7721  	}
  7722  	for k, v := range m {
  7723  		switch k {
  7724  		case "properties":
  7725  			if v != nil {
  7726  				var liveEventProperties LiveEventProperties
  7727  				err = json.Unmarshal(*v, &liveEventProperties)
  7728  				if err != nil {
  7729  					return err
  7730  				}
  7731  				le.LiveEventProperties = &liveEventProperties
  7732  			}
  7733  		case "systemData":
  7734  			if v != nil {
  7735  				var systemData SystemData
  7736  				err = json.Unmarshal(*v, &systemData)
  7737  				if err != nil {
  7738  					return err
  7739  				}
  7740  				le.SystemData = &systemData
  7741  			}
  7742  		case "tags":
  7743  			if v != nil {
  7744  				var tags map[string]*string
  7745  				err = json.Unmarshal(*v, &tags)
  7746  				if err != nil {
  7747  					return err
  7748  				}
  7749  				le.Tags = tags
  7750  			}
  7751  		case "location":
  7752  			if v != nil {
  7753  				var location string
  7754  				err = json.Unmarshal(*v, &location)
  7755  				if err != nil {
  7756  					return err
  7757  				}
  7758  				le.Location = &location
  7759  			}
  7760  		case "id":
  7761  			if v != nil {
  7762  				var ID string
  7763  				err = json.Unmarshal(*v, &ID)
  7764  				if err != nil {
  7765  					return err
  7766  				}
  7767  				le.ID = &ID
  7768  			}
  7769  		case "name":
  7770  			if v != nil {
  7771  				var name string
  7772  				err = json.Unmarshal(*v, &name)
  7773  				if err != nil {
  7774  					return err
  7775  				}
  7776  				le.Name = &name
  7777  			}
  7778  		case "type":
  7779  			if v != nil {
  7780  				var typeVar string
  7781  				err = json.Unmarshal(*v, &typeVar)
  7782  				if err != nil {
  7783  					return err
  7784  				}
  7785  				le.Type = &typeVar
  7786  			}
  7787  		}
  7788  	}
  7789  
  7790  	return nil
  7791  }
  7792  
  7793  // LiveEventActionInput the LiveEvent action input parameter definition.
  7794  type LiveEventActionInput struct {
  7795  	// 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.
  7796  	RemoveOutputsOnStop *bool `json:"removeOutputsOnStop,omitempty"`
  7797  }
  7798  
  7799  // LiveEventEncoding specifies the live event type and optional encoding settings for encoding live events.
  7800  type LiveEventEncoding struct {
  7801  	// EncodingType - Live event type. When encodingType is set to None, the service simply passes through the incoming video and audio layer(s) to the output. When encodingType is set to Standard or Premium1080p, a live encoder transcodes the incoming stream into multiple bitrates or layers. See https://go.microsoft.com/fwlink/?linkid=2095101 for more information. This property cannot be modified after the live event is created. Possible values include: 'LiveEventEncodingTypeNone', 'LiveEventEncodingTypeStandard', 'LiveEventEncodingTypePremium1080p', 'LiveEventEncodingTypePassthroughBasic', 'LiveEventEncodingTypePassthroughStandard'
  7802  	EncodingType LiveEventEncodingType `json:"encodingType,omitempty"`
  7803  	// 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’.
  7804  	PresetName *string `json:"presetName,omitempty"`
  7805  	// 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'
  7806  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  7807  	// 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.
  7808  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  7809  }
  7810  
  7811  // LiveEventEndpoint the live event endpoint.
  7812  type LiveEventEndpoint struct {
  7813  	// Protocol - The endpoint protocol.
  7814  	Protocol *string `json:"protocol,omitempty"`
  7815  	// URL - The endpoint URL.
  7816  	URL *string `json:"url,omitempty"`
  7817  }
  7818  
  7819  // LiveEventInput the live event input.
  7820  type LiveEventInput struct {
  7821  	// StreamingProtocol - The input protocol for the live event. This is specified at creation time and cannot be updated. Possible values include: 'LiveEventInputProtocolFragmentedMP4', 'LiveEventInputProtocolRTMP'
  7822  	StreamingProtocol LiveEventInputProtocol `json:"streamingProtocol,omitempty"`
  7823  	// AccessControl - Access control for live event input.
  7824  	AccessControl *LiveEventInputAccessControl `json:"accessControl,omitempty"`
  7825  	// 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.
  7826  	KeyFrameIntervalDuration *string `json:"keyFrameIntervalDuration,omitempty"`
  7827  	// 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.
  7828  	AccessToken *string `json:"accessToken,omitempty"`
  7829  	// Endpoints - The input endpoints for the live event.
  7830  	Endpoints *[]LiveEventEndpoint `json:"endpoints,omitempty"`
  7831  }
  7832  
  7833  // LiveEventInputAccessControl the IP access control for live event input.
  7834  type LiveEventInputAccessControl struct {
  7835  	// IP - The IP access control properties.
  7836  	IP *IPAccessControl `json:"ip,omitempty"`
  7837  }
  7838  
  7839  // LiveEventInputTrackSelection a track selection condition. This property is reserved for future use, any
  7840  // value set on this property will be ignored.
  7841  type LiveEventInputTrackSelection struct {
  7842  	// Property - Property name to select. This property is reserved for future use, any value set on this property will be ignored.
  7843  	Property *string `json:"property,omitempty"`
  7844  	// Operation - Comparing operation. This property is reserved for future use, any value set on this property will be ignored.
  7845  	Operation *string `json:"operation,omitempty"`
  7846  	// Value - Property value to select. This property is reserved for future use, any value set on this property will be ignored.
  7847  	Value *string `json:"value,omitempty"`
  7848  }
  7849  
  7850  // LiveEventListResult the LiveEvent list result.
  7851  type LiveEventListResult struct {
  7852  	autorest.Response `json:"-"`
  7853  	// Value - The result of the List Live Event operation.
  7854  	Value *[]LiveEvent `json:"value,omitempty"`
  7855  	// OdataCount - The number of result.
  7856  	OdataCount *int32 `json:"@odata.count,omitempty"`
  7857  	// OdataNextLink - The link to the next set of results. Not empty if value contains incomplete list of live outputs.
  7858  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
  7859  }
  7860  
  7861  // LiveEventListResultIterator provides access to a complete listing of LiveEvent values.
  7862  type LiveEventListResultIterator struct {
  7863  	i    int
  7864  	page LiveEventListResultPage
  7865  }
  7866  
  7867  // NextWithContext advances to the next value.  If there was an error making
  7868  // the request the iterator does not advance and the error is returned.
  7869  func (iter *LiveEventListResultIterator) NextWithContext(ctx context.Context) (err error) {
  7870  	if tracing.IsEnabled() {
  7871  		ctx = tracing.StartSpan(ctx, fqdn+"/LiveEventListResultIterator.NextWithContext")
  7872  		defer func() {
  7873  			sc := -1
  7874  			if iter.Response().Response.Response != nil {
  7875  				sc = iter.Response().Response.Response.StatusCode
  7876  			}
  7877  			tracing.EndSpan(ctx, sc, err)
  7878  		}()
  7879  	}
  7880  	iter.i++
  7881  	if iter.i < len(iter.page.Values()) {
  7882  		return nil
  7883  	}
  7884  	err = iter.page.NextWithContext(ctx)
  7885  	if err != nil {
  7886  		iter.i--
  7887  		return err
  7888  	}
  7889  	iter.i = 0
  7890  	return nil
  7891  }
  7892  
  7893  // Next advances to the next value.  If there was an error making
  7894  // the request the iterator does not advance and the error is returned.
  7895  // Deprecated: Use NextWithContext() instead.
  7896  func (iter *LiveEventListResultIterator) Next() error {
  7897  	return iter.NextWithContext(context.Background())
  7898  }
  7899  
  7900  // NotDone returns true if the enumeration should be started or is not yet complete.
  7901  func (iter LiveEventListResultIterator) NotDone() bool {
  7902  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  7903  }
  7904  
  7905  // Response returns the raw server response from the last page request.
  7906  func (iter LiveEventListResultIterator) Response() LiveEventListResult {
  7907  	return iter.page.Response()
  7908  }
  7909  
  7910  // Value returns the current value or a zero-initialized value if the
  7911  // iterator has advanced beyond the end of the collection.
  7912  func (iter LiveEventListResultIterator) Value() LiveEvent {
  7913  	if !iter.page.NotDone() {
  7914  		return LiveEvent{}
  7915  	}
  7916  	return iter.page.Values()[iter.i]
  7917  }
  7918  
  7919  // Creates a new instance of the LiveEventListResultIterator type.
  7920  func NewLiveEventListResultIterator(page LiveEventListResultPage) LiveEventListResultIterator {
  7921  	return LiveEventListResultIterator{page: page}
  7922  }
  7923  
  7924  // IsEmpty returns true if the ListResult contains no values.
  7925  func (lelr LiveEventListResult) IsEmpty() bool {
  7926  	return lelr.Value == nil || len(*lelr.Value) == 0
  7927  }
  7928  
  7929  // hasNextLink returns true if the NextLink is not empty.
  7930  func (lelr LiveEventListResult) hasNextLink() bool {
  7931  	return lelr.OdataNextLink != nil && len(*lelr.OdataNextLink) != 0
  7932  }
  7933  
  7934  // liveEventListResultPreparer prepares a request to retrieve the next set of results.
  7935  // It returns nil if no more results exist.
  7936  func (lelr LiveEventListResult) liveEventListResultPreparer(ctx context.Context) (*http.Request, error) {
  7937  	if !lelr.hasNextLink() {
  7938  		return nil, nil
  7939  	}
  7940  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  7941  		autorest.AsJSON(),
  7942  		autorest.AsGet(),
  7943  		autorest.WithBaseURL(to.String(lelr.OdataNextLink)))
  7944  }
  7945  
  7946  // LiveEventListResultPage contains a page of LiveEvent values.
  7947  type LiveEventListResultPage struct {
  7948  	fn   func(context.Context, LiveEventListResult) (LiveEventListResult, error)
  7949  	lelr LiveEventListResult
  7950  }
  7951  
  7952  // NextWithContext advances to the next page of values.  If there was an error making
  7953  // the request the page does not advance and the error is returned.
  7954  func (page *LiveEventListResultPage) NextWithContext(ctx context.Context) (err error) {
  7955  	if tracing.IsEnabled() {
  7956  		ctx = tracing.StartSpan(ctx, fqdn+"/LiveEventListResultPage.NextWithContext")
  7957  		defer func() {
  7958  			sc := -1
  7959  			if page.Response().Response.Response != nil {
  7960  				sc = page.Response().Response.Response.StatusCode
  7961  			}
  7962  			tracing.EndSpan(ctx, sc, err)
  7963  		}()
  7964  	}
  7965  	for {
  7966  		next, err := page.fn(ctx, page.lelr)
  7967  		if err != nil {
  7968  			return err
  7969  		}
  7970  		page.lelr = next
  7971  		if !next.hasNextLink() || !next.IsEmpty() {
  7972  			break
  7973  		}
  7974  	}
  7975  	return nil
  7976  }
  7977  
  7978  // Next advances to the next page of values.  If there was an error making
  7979  // the request the page does not advance and the error is returned.
  7980  // Deprecated: Use NextWithContext() instead.
  7981  func (page *LiveEventListResultPage) Next() error {
  7982  	return page.NextWithContext(context.Background())
  7983  }
  7984  
  7985  // NotDone returns true if the page enumeration should be started or is not yet complete.
  7986  func (page LiveEventListResultPage) NotDone() bool {
  7987  	return !page.lelr.IsEmpty()
  7988  }
  7989  
  7990  // Response returns the raw server response from the last page request.
  7991  func (page LiveEventListResultPage) Response() LiveEventListResult {
  7992  	return page.lelr
  7993  }
  7994  
  7995  // Values returns the slice of values for the current page or nil if there are no values.
  7996  func (page LiveEventListResultPage) Values() []LiveEvent {
  7997  	if page.lelr.IsEmpty() {
  7998  		return nil
  7999  	}
  8000  	return *page.lelr.Value
  8001  }
  8002  
  8003  // Creates a new instance of the LiveEventListResultPage type.
  8004  func NewLiveEventListResultPage(cur LiveEventListResult, getNextPage func(context.Context, LiveEventListResult) (LiveEventListResult, error)) LiveEventListResultPage {
  8005  	return LiveEventListResultPage{
  8006  		fn:   getNextPage,
  8007  		lelr: cur,
  8008  	}
  8009  }
  8010  
  8011  // LiveEventOutputTranscriptionTrack describes a transcription track in the output of a live event,
  8012  // generated using speech-to-text transcription. This property is reserved for future use, any value set on
  8013  // this property will be ignored.
  8014  type LiveEventOutputTranscriptionTrack struct {
  8015  	// TrackName - The output track name. This property is reserved for future use, any value set on this property will be ignored.
  8016  	TrackName *string `json:"trackName,omitempty"`
  8017  }
  8018  
  8019  // LiveEventPreview live event preview settings.
  8020  type LiveEventPreview struct {
  8021  	// Endpoints - The endpoints for preview. Do not share the preview URL with the live event audience.
  8022  	Endpoints *[]LiveEventEndpoint `json:"endpoints,omitempty"`
  8023  	// AccessControl - The access control for live event preview.
  8024  	AccessControl *LiveEventPreviewAccessControl `json:"accessControl,omitempty"`
  8025  	// 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.
  8026  	PreviewLocator *string `json:"previewLocator,omitempty"`
  8027  	// StreamingPolicyName - The name of streaming policy used for the live event preview. This value is specified at creation time and cannot be updated.
  8028  	StreamingPolicyName *string `json:"streamingPolicyName,omitempty"`
  8029  	// 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.
  8030  	AlternativeMediaID *string `json:"alternativeMediaId,omitempty"`
  8031  }
  8032  
  8033  // LiveEventPreviewAccessControl the IP access control for the live event preview endpoint.
  8034  type LiveEventPreviewAccessControl struct {
  8035  	// IP - The IP access control properties.
  8036  	IP *IPAccessControl `json:"ip,omitempty"`
  8037  }
  8038  
  8039  // LiveEventProperties the live event properties.
  8040  type LiveEventProperties struct {
  8041  	// Description - A description for the live event.
  8042  	Description *string `json:"description,omitempty"`
  8043  	// Input - Live event input settings. It defines how the live event receives input from a contribution encoder.
  8044  	Input *LiveEventInput `json:"input,omitempty"`
  8045  	// Preview - Live event preview settings. Preview allows live event producers to preview the live streaming content without creating any live output.
  8046  	Preview *LiveEventPreview `json:"preview,omitempty"`
  8047  	// 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.
  8048  	Encoding *LiveEventEncoding `json:"encoding,omitempty"`
  8049  	// Transcriptions - Live transcription settings for the live event. See https://go.microsoft.com/fwlink/?linkid=2133742 for more information about the live transcription feature.
  8050  	Transcriptions *[]LiveEventTranscription `json:"transcriptions,omitempty"`
  8051  	// ProvisioningState - READ-ONLY; The provisioning state of the live event.
  8052  	ProvisioningState *string `json:"provisioningState,omitempty"`
  8053  	// 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'
  8054  	ResourceState LiveEventResourceState `json:"resourceState,omitempty"`
  8055  	// CrossSiteAccessPolicies - Live event cross site access policies.
  8056  	CrossSiteAccessPolicies *CrossSiteAccessPolicies `json:"crossSiteAccessPolicies,omitempty"`
  8057  	// 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
  8058  	UseStaticHostname *bool `json:"useStaticHostname,omitempty"`
  8059  	// 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.
  8060  	HostnamePrefix *string `json:"hostnamePrefix,omitempty"`
  8061  	// 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'.
  8062  	StreamOptions *[]StreamOptionsFlag `json:"streamOptions,omitempty"`
  8063  	// Created - READ-ONLY; The creation time for the live event
  8064  	Created *date.Time `json:"created,omitempty"`
  8065  	// LastModified - READ-ONLY; The last modified time of the live event.
  8066  	LastModified *date.Time `json:"lastModified,omitempty"`
  8067  }
  8068  
  8069  // MarshalJSON is the custom marshaler for LiveEventProperties.
  8070  func (lep LiveEventProperties) MarshalJSON() ([]byte, error) {
  8071  	objectMap := make(map[string]interface{})
  8072  	if lep.Description != nil {
  8073  		objectMap["description"] = lep.Description
  8074  	}
  8075  	if lep.Input != nil {
  8076  		objectMap["input"] = lep.Input
  8077  	}
  8078  	if lep.Preview != nil {
  8079  		objectMap["preview"] = lep.Preview
  8080  	}
  8081  	if lep.Encoding != nil {
  8082  		objectMap["encoding"] = lep.Encoding
  8083  	}
  8084  	if lep.Transcriptions != nil {
  8085  		objectMap["transcriptions"] = lep.Transcriptions
  8086  	}
  8087  	if lep.CrossSiteAccessPolicies != nil {
  8088  		objectMap["crossSiteAccessPolicies"] = lep.CrossSiteAccessPolicies
  8089  	}
  8090  	if lep.UseStaticHostname != nil {
  8091  		objectMap["useStaticHostname"] = lep.UseStaticHostname
  8092  	}
  8093  	if lep.HostnamePrefix != nil {
  8094  		objectMap["hostnamePrefix"] = lep.HostnamePrefix
  8095  	}
  8096  	if lep.StreamOptions != nil {
  8097  		objectMap["streamOptions"] = lep.StreamOptions
  8098  	}
  8099  	return json.Marshal(objectMap)
  8100  }
  8101  
  8102  // LiveEventsAllocateFuture an abstraction for monitoring and retrieving the results of a long-running
  8103  // operation.
  8104  type LiveEventsAllocateFuture struct {
  8105  	azure.FutureAPI
  8106  	// Result returns the result of the asynchronous operation.
  8107  	// If the operation has not completed it will return an error.
  8108  	Result func(LiveEventsClient) (autorest.Response, error)
  8109  }
  8110  
  8111  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8112  func (future *LiveEventsAllocateFuture) UnmarshalJSON(body []byte) error {
  8113  	var azFuture azure.Future
  8114  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8115  		return err
  8116  	}
  8117  	future.FutureAPI = &azFuture
  8118  	future.Result = future.result
  8119  	return nil
  8120  }
  8121  
  8122  // result is the default implementation for LiveEventsAllocateFuture.Result.
  8123  func (future *LiveEventsAllocateFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
  8124  	var done bool
  8125  	done, err = future.DoneWithContext(context.Background(), client)
  8126  	if err != nil {
  8127  		err = autorest.NewErrorWithError(err, "media.LiveEventsAllocateFuture", "Result", future.Response(), "Polling failure")
  8128  		return
  8129  	}
  8130  	if !done {
  8131  		ar.Response = future.Response()
  8132  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsAllocateFuture")
  8133  		return
  8134  	}
  8135  	ar.Response = future.Response()
  8136  	return
  8137  }
  8138  
  8139  // LiveEventsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
  8140  // operation.
  8141  type LiveEventsCreateFuture struct {
  8142  	azure.FutureAPI
  8143  	// Result returns the result of the asynchronous operation.
  8144  	// If the operation has not completed it will return an error.
  8145  	Result func(LiveEventsClient) (LiveEvent, error)
  8146  }
  8147  
  8148  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8149  func (future *LiveEventsCreateFuture) UnmarshalJSON(body []byte) error {
  8150  	var azFuture azure.Future
  8151  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8152  		return err
  8153  	}
  8154  	future.FutureAPI = &azFuture
  8155  	future.Result = future.result
  8156  	return nil
  8157  }
  8158  
  8159  // result is the default implementation for LiveEventsCreateFuture.Result.
  8160  func (future *LiveEventsCreateFuture) result(client LiveEventsClient) (le LiveEvent, err error) {
  8161  	var done bool
  8162  	done, err = future.DoneWithContext(context.Background(), client)
  8163  	if err != nil {
  8164  		err = autorest.NewErrorWithError(err, "media.LiveEventsCreateFuture", "Result", future.Response(), "Polling failure")
  8165  		return
  8166  	}
  8167  	if !done {
  8168  		le.Response.Response = future.Response()
  8169  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsCreateFuture")
  8170  		return
  8171  	}
  8172  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  8173  	if le.Response.Response, err = future.GetResult(sender); err == nil && le.Response.Response.StatusCode != http.StatusNoContent {
  8174  		le, err = client.CreateResponder(le.Response.Response)
  8175  		if err != nil {
  8176  			err = autorest.NewErrorWithError(err, "media.LiveEventsCreateFuture", "Result", le.Response.Response, "Failure responding to request")
  8177  		}
  8178  	}
  8179  	return
  8180  }
  8181  
  8182  // LiveEventsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  8183  // operation.
  8184  type LiveEventsDeleteFuture struct {
  8185  	azure.FutureAPI
  8186  	// Result returns the result of the asynchronous operation.
  8187  	// If the operation has not completed it will return an error.
  8188  	Result func(LiveEventsClient) (autorest.Response, error)
  8189  }
  8190  
  8191  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8192  func (future *LiveEventsDeleteFuture) UnmarshalJSON(body []byte) error {
  8193  	var azFuture azure.Future
  8194  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8195  		return err
  8196  	}
  8197  	future.FutureAPI = &azFuture
  8198  	future.Result = future.result
  8199  	return nil
  8200  }
  8201  
  8202  // result is the default implementation for LiveEventsDeleteFuture.Result.
  8203  func (future *LiveEventsDeleteFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
  8204  	var done bool
  8205  	done, err = future.DoneWithContext(context.Background(), client)
  8206  	if err != nil {
  8207  		err = autorest.NewErrorWithError(err, "media.LiveEventsDeleteFuture", "Result", future.Response(), "Polling failure")
  8208  		return
  8209  	}
  8210  	if !done {
  8211  		ar.Response = future.Response()
  8212  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsDeleteFuture")
  8213  		return
  8214  	}
  8215  	ar.Response = future.Response()
  8216  	return
  8217  }
  8218  
  8219  // LiveEventsResetFuture an abstraction for monitoring and retrieving the results of a long-running
  8220  // operation.
  8221  type LiveEventsResetFuture struct {
  8222  	azure.FutureAPI
  8223  	// Result returns the result of the asynchronous operation.
  8224  	// If the operation has not completed it will return an error.
  8225  	Result func(LiveEventsClient) (autorest.Response, error)
  8226  }
  8227  
  8228  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8229  func (future *LiveEventsResetFuture) UnmarshalJSON(body []byte) error {
  8230  	var azFuture azure.Future
  8231  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8232  		return err
  8233  	}
  8234  	future.FutureAPI = &azFuture
  8235  	future.Result = future.result
  8236  	return nil
  8237  }
  8238  
  8239  // result is the default implementation for LiveEventsResetFuture.Result.
  8240  func (future *LiveEventsResetFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
  8241  	var done bool
  8242  	done, err = future.DoneWithContext(context.Background(), client)
  8243  	if err != nil {
  8244  		err = autorest.NewErrorWithError(err, "media.LiveEventsResetFuture", "Result", future.Response(), "Polling failure")
  8245  		return
  8246  	}
  8247  	if !done {
  8248  		ar.Response = future.Response()
  8249  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsResetFuture")
  8250  		return
  8251  	}
  8252  	ar.Response = future.Response()
  8253  	return
  8254  }
  8255  
  8256  // LiveEventsStartFuture an abstraction for monitoring and retrieving the results of a long-running
  8257  // operation.
  8258  type LiveEventsStartFuture struct {
  8259  	azure.FutureAPI
  8260  	// Result returns the result of the asynchronous operation.
  8261  	// If the operation has not completed it will return an error.
  8262  	Result func(LiveEventsClient) (autorest.Response, error)
  8263  }
  8264  
  8265  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8266  func (future *LiveEventsStartFuture) UnmarshalJSON(body []byte) error {
  8267  	var azFuture azure.Future
  8268  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8269  		return err
  8270  	}
  8271  	future.FutureAPI = &azFuture
  8272  	future.Result = future.result
  8273  	return nil
  8274  }
  8275  
  8276  // result is the default implementation for LiveEventsStartFuture.Result.
  8277  func (future *LiveEventsStartFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
  8278  	var done bool
  8279  	done, err = future.DoneWithContext(context.Background(), client)
  8280  	if err != nil {
  8281  		err = autorest.NewErrorWithError(err, "media.LiveEventsStartFuture", "Result", future.Response(), "Polling failure")
  8282  		return
  8283  	}
  8284  	if !done {
  8285  		ar.Response = future.Response()
  8286  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsStartFuture")
  8287  		return
  8288  	}
  8289  	ar.Response = future.Response()
  8290  	return
  8291  }
  8292  
  8293  // LiveEventsStopFuture an abstraction for monitoring and retrieving the results of a long-running
  8294  // operation.
  8295  type LiveEventsStopFuture struct {
  8296  	azure.FutureAPI
  8297  	// Result returns the result of the asynchronous operation.
  8298  	// If the operation has not completed it will return an error.
  8299  	Result func(LiveEventsClient) (autorest.Response, error)
  8300  }
  8301  
  8302  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8303  func (future *LiveEventsStopFuture) UnmarshalJSON(body []byte) error {
  8304  	var azFuture azure.Future
  8305  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8306  		return err
  8307  	}
  8308  	future.FutureAPI = &azFuture
  8309  	future.Result = future.result
  8310  	return nil
  8311  }
  8312  
  8313  // result is the default implementation for LiveEventsStopFuture.Result.
  8314  func (future *LiveEventsStopFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
  8315  	var done bool
  8316  	done, err = future.DoneWithContext(context.Background(), client)
  8317  	if err != nil {
  8318  		err = autorest.NewErrorWithError(err, "media.LiveEventsStopFuture", "Result", future.Response(), "Polling failure")
  8319  		return
  8320  	}
  8321  	if !done {
  8322  		ar.Response = future.Response()
  8323  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsStopFuture")
  8324  		return
  8325  	}
  8326  	ar.Response = future.Response()
  8327  	return
  8328  }
  8329  
  8330  // LiveEventsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
  8331  // operation.
  8332  type LiveEventsUpdateFuture struct {
  8333  	azure.FutureAPI
  8334  	// Result returns the result of the asynchronous operation.
  8335  	// If the operation has not completed it will return an error.
  8336  	Result func(LiveEventsClient) (LiveEvent, error)
  8337  }
  8338  
  8339  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8340  func (future *LiveEventsUpdateFuture) UnmarshalJSON(body []byte) error {
  8341  	var azFuture azure.Future
  8342  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8343  		return err
  8344  	}
  8345  	future.FutureAPI = &azFuture
  8346  	future.Result = future.result
  8347  	return nil
  8348  }
  8349  
  8350  // result is the default implementation for LiveEventsUpdateFuture.Result.
  8351  func (future *LiveEventsUpdateFuture) result(client LiveEventsClient) (le LiveEvent, err error) {
  8352  	var done bool
  8353  	done, err = future.DoneWithContext(context.Background(), client)
  8354  	if err != nil {
  8355  		err = autorest.NewErrorWithError(err, "media.LiveEventsUpdateFuture", "Result", future.Response(), "Polling failure")
  8356  		return
  8357  	}
  8358  	if !done {
  8359  		le.Response.Response = future.Response()
  8360  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsUpdateFuture")
  8361  		return
  8362  	}
  8363  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  8364  	if le.Response.Response, err = future.GetResult(sender); err == nil && le.Response.Response.StatusCode != http.StatusNoContent {
  8365  		le, err = client.UpdateResponder(le.Response.Response)
  8366  		if err != nil {
  8367  			err = autorest.NewErrorWithError(err, "media.LiveEventsUpdateFuture", "Result", le.Response.Response, "Failure responding to request")
  8368  		}
  8369  	}
  8370  	return
  8371  }
  8372  
  8373  // LiveEventTranscription describes the transcription tracks in the output of a live event, generated using
  8374  // speech-to-text transcription. This property is reserved for future use, any value set on this property
  8375  // will be ignored.
  8376  type LiveEventTranscription struct {
  8377  	// 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.
  8378  	Language *string `json:"language,omitempty"`
  8379  	// 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.
  8380  	InputTrackSelection *[]LiveEventInputTrackSelection `json:"inputTrackSelection,omitempty"`
  8381  	// 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.
  8382  	OutputTranscriptionTrack *LiveEventOutputTranscriptionTrack `json:"outputTranscriptionTrack,omitempty"`
  8383  }
  8384  
  8385  // LiveOutput the Live Output.
  8386  type LiveOutput struct {
  8387  	autorest.Response `json:"-"`
  8388  	// LiveOutputProperties - Live output properties.
  8389  	*LiveOutputProperties `json:"properties,omitempty"`
  8390  	// SystemData - READ-ONLY; The system metadata relating to this resource.
  8391  	SystemData *SystemData `json:"systemData,omitempty"`
  8392  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  8393  	ID *string `json:"id,omitempty"`
  8394  	// Name - READ-ONLY; The name of the resource
  8395  	Name *string `json:"name,omitempty"`
  8396  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  8397  	Type *string `json:"type,omitempty"`
  8398  }
  8399  
  8400  // MarshalJSON is the custom marshaler for LiveOutput.
  8401  func (lo LiveOutput) MarshalJSON() ([]byte, error) {
  8402  	objectMap := make(map[string]interface{})
  8403  	if lo.LiveOutputProperties != nil {
  8404  		objectMap["properties"] = lo.LiveOutputProperties
  8405  	}
  8406  	return json.Marshal(objectMap)
  8407  }
  8408  
  8409  // UnmarshalJSON is the custom unmarshaler for LiveOutput struct.
  8410  func (lo *LiveOutput) UnmarshalJSON(body []byte) error {
  8411  	var m map[string]*json.RawMessage
  8412  	err := json.Unmarshal(body, &m)
  8413  	if err != nil {
  8414  		return err
  8415  	}
  8416  	for k, v := range m {
  8417  		switch k {
  8418  		case "properties":
  8419  			if v != nil {
  8420  				var liveOutputProperties LiveOutputProperties
  8421  				err = json.Unmarshal(*v, &liveOutputProperties)
  8422  				if err != nil {
  8423  					return err
  8424  				}
  8425  				lo.LiveOutputProperties = &liveOutputProperties
  8426  			}
  8427  		case "systemData":
  8428  			if v != nil {
  8429  				var systemData SystemData
  8430  				err = json.Unmarshal(*v, &systemData)
  8431  				if err != nil {
  8432  					return err
  8433  				}
  8434  				lo.SystemData = &systemData
  8435  			}
  8436  		case "id":
  8437  			if v != nil {
  8438  				var ID string
  8439  				err = json.Unmarshal(*v, &ID)
  8440  				if err != nil {
  8441  					return err
  8442  				}
  8443  				lo.ID = &ID
  8444  			}
  8445  		case "name":
  8446  			if v != nil {
  8447  				var name string
  8448  				err = json.Unmarshal(*v, &name)
  8449  				if err != nil {
  8450  					return err
  8451  				}
  8452  				lo.Name = &name
  8453  			}
  8454  		case "type":
  8455  			if v != nil {
  8456  				var typeVar string
  8457  				err = json.Unmarshal(*v, &typeVar)
  8458  				if err != nil {
  8459  					return err
  8460  				}
  8461  				lo.Type = &typeVar
  8462  			}
  8463  		}
  8464  	}
  8465  
  8466  	return nil
  8467  }
  8468  
  8469  // LiveOutputListResult the LiveOutput list result.
  8470  type LiveOutputListResult struct {
  8471  	autorest.Response `json:"-"`
  8472  	// Value - The result of the List LiveOutput operation.
  8473  	Value *[]LiveOutput `json:"value,omitempty"`
  8474  	// OdataCount - The number of result.
  8475  	OdataCount *int32 `json:"@odata.count,omitempty"`
  8476  	// OdataNextLink - The link to the next set of results. Not empty if value contains incomplete list of live outputs.
  8477  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
  8478  }
  8479  
  8480  // LiveOutputListResultIterator provides access to a complete listing of LiveOutput values.
  8481  type LiveOutputListResultIterator struct {
  8482  	i    int
  8483  	page LiveOutputListResultPage
  8484  }
  8485  
  8486  // NextWithContext advances to the next value.  If there was an error making
  8487  // the request the iterator does not advance and the error is returned.
  8488  func (iter *LiveOutputListResultIterator) NextWithContext(ctx context.Context) (err error) {
  8489  	if tracing.IsEnabled() {
  8490  		ctx = tracing.StartSpan(ctx, fqdn+"/LiveOutputListResultIterator.NextWithContext")
  8491  		defer func() {
  8492  			sc := -1
  8493  			if iter.Response().Response.Response != nil {
  8494  				sc = iter.Response().Response.Response.StatusCode
  8495  			}
  8496  			tracing.EndSpan(ctx, sc, err)
  8497  		}()
  8498  	}
  8499  	iter.i++
  8500  	if iter.i < len(iter.page.Values()) {
  8501  		return nil
  8502  	}
  8503  	err = iter.page.NextWithContext(ctx)
  8504  	if err != nil {
  8505  		iter.i--
  8506  		return err
  8507  	}
  8508  	iter.i = 0
  8509  	return nil
  8510  }
  8511  
  8512  // Next advances to the next value.  If there was an error making
  8513  // the request the iterator does not advance and the error is returned.
  8514  // Deprecated: Use NextWithContext() instead.
  8515  func (iter *LiveOutputListResultIterator) Next() error {
  8516  	return iter.NextWithContext(context.Background())
  8517  }
  8518  
  8519  // NotDone returns true if the enumeration should be started or is not yet complete.
  8520  func (iter LiveOutputListResultIterator) NotDone() bool {
  8521  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  8522  }
  8523  
  8524  // Response returns the raw server response from the last page request.
  8525  func (iter LiveOutputListResultIterator) Response() LiveOutputListResult {
  8526  	return iter.page.Response()
  8527  }
  8528  
  8529  // Value returns the current value or a zero-initialized value if the
  8530  // iterator has advanced beyond the end of the collection.
  8531  func (iter LiveOutputListResultIterator) Value() LiveOutput {
  8532  	if !iter.page.NotDone() {
  8533  		return LiveOutput{}
  8534  	}
  8535  	return iter.page.Values()[iter.i]
  8536  }
  8537  
  8538  // Creates a new instance of the LiveOutputListResultIterator type.
  8539  func NewLiveOutputListResultIterator(page LiveOutputListResultPage) LiveOutputListResultIterator {
  8540  	return LiveOutputListResultIterator{page: page}
  8541  }
  8542  
  8543  // IsEmpty returns true if the ListResult contains no values.
  8544  func (lolr LiveOutputListResult) IsEmpty() bool {
  8545  	return lolr.Value == nil || len(*lolr.Value) == 0
  8546  }
  8547  
  8548  // hasNextLink returns true if the NextLink is not empty.
  8549  func (lolr LiveOutputListResult) hasNextLink() bool {
  8550  	return lolr.OdataNextLink != nil && len(*lolr.OdataNextLink) != 0
  8551  }
  8552  
  8553  // liveOutputListResultPreparer prepares a request to retrieve the next set of results.
  8554  // It returns nil if no more results exist.
  8555  func (lolr LiveOutputListResult) liveOutputListResultPreparer(ctx context.Context) (*http.Request, error) {
  8556  	if !lolr.hasNextLink() {
  8557  		return nil, nil
  8558  	}
  8559  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  8560  		autorest.AsJSON(),
  8561  		autorest.AsGet(),
  8562  		autorest.WithBaseURL(to.String(lolr.OdataNextLink)))
  8563  }
  8564  
  8565  // LiveOutputListResultPage contains a page of LiveOutput values.
  8566  type LiveOutputListResultPage struct {
  8567  	fn   func(context.Context, LiveOutputListResult) (LiveOutputListResult, error)
  8568  	lolr LiveOutputListResult
  8569  }
  8570  
  8571  // NextWithContext advances to the next page of values.  If there was an error making
  8572  // the request the page does not advance and the error is returned.
  8573  func (page *LiveOutputListResultPage) NextWithContext(ctx context.Context) (err error) {
  8574  	if tracing.IsEnabled() {
  8575  		ctx = tracing.StartSpan(ctx, fqdn+"/LiveOutputListResultPage.NextWithContext")
  8576  		defer func() {
  8577  			sc := -1
  8578  			if page.Response().Response.Response != nil {
  8579  				sc = page.Response().Response.Response.StatusCode
  8580  			}
  8581  			tracing.EndSpan(ctx, sc, err)
  8582  		}()
  8583  	}
  8584  	for {
  8585  		next, err := page.fn(ctx, page.lolr)
  8586  		if err != nil {
  8587  			return err
  8588  		}
  8589  		page.lolr = next
  8590  		if !next.hasNextLink() || !next.IsEmpty() {
  8591  			break
  8592  		}
  8593  	}
  8594  	return nil
  8595  }
  8596  
  8597  // Next advances to the next page of values.  If there was an error making
  8598  // the request the page does not advance and the error is returned.
  8599  // Deprecated: Use NextWithContext() instead.
  8600  func (page *LiveOutputListResultPage) Next() error {
  8601  	return page.NextWithContext(context.Background())
  8602  }
  8603  
  8604  // NotDone returns true if the page enumeration should be started or is not yet complete.
  8605  func (page LiveOutputListResultPage) NotDone() bool {
  8606  	return !page.lolr.IsEmpty()
  8607  }
  8608  
  8609  // Response returns the raw server response from the last page request.
  8610  func (page LiveOutputListResultPage) Response() LiveOutputListResult {
  8611  	return page.lolr
  8612  }
  8613  
  8614  // Values returns the slice of values for the current page or nil if there are no values.
  8615  func (page LiveOutputListResultPage) Values() []LiveOutput {
  8616  	if page.lolr.IsEmpty() {
  8617  		return nil
  8618  	}
  8619  	return *page.lolr.Value
  8620  }
  8621  
  8622  // Creates a new instance of the LiveOutputListResultPage type.
  8623  func NewLiveOutputListResultPage(cur LiveOutputListResult, getNextPage func(context.Context, LiveOutputListResult) (LiveOutputListResult, error)) LiveOutputListResultPage {
  8624  	return LiveOutputListResultPage{
  8625  		fn:   getNextPage,
  8626  		lolr: cur,
  8627  	}
  8628  }
  8629  
  8630  // LiveOutputProperties the JSON object that contains the properties required to create a live output.
  8631  type LiveOutputProperties struct {
  8632  	// Description - The description of the live output.
  8633  	Description *string `json:"description,omitempty"`
  8634  	// AssetName - The asset that the live output will write to.
  8635  	AssetName *string `json:"assetName,omitempty"`
  8636  	// 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.
  8637  	ArchiveWindowLength *string `json:"archiveWindowLength,omitempty"`
  8638  	// ManifestName - The manifest file name. If not provided, the service will generate one automatically.
  8639  	ManifestName *string `json:"manifestName,omitempty"`
  8640  	// Hls - HTTP Live Streaming (HLS) packing setting for the live output.
  8641  	Hls *Hls `json:"hls,omitempty"`
  8642  	// OutputSnapTime - The initial timestamp that the live output will start at, any content before this value will not be archived.
  8643  	OutputSnapTime *int64 `json:"outputSnapTime,omitempty"`
  8644  	// Created - READ-ONLY; The creation time the live output.
  8645  	Created *date.Time `json:"created,omitempty"`
  8646  	// LastModified - READ-ONLY; The time the live output was last modified.
  8647  	LastModified *date.Time `json:"lastModified,omitempty"`
  8648  	// ProvisioningState - READ-ONLY; The provisioning state of the live output.
  8649  	ProvisioningState *string `json:"provisioningState,omitempty"`
  8650  	// ResourceState - READ-ONLY; The resource state of the live output. Possible values include: 'LiveOutputResourceStateCreating', 'LiveOutputResourceStateRunning', 'LiveOutputResourceStateDeleting'
  8651  	ResourceState LiveOutputResourceState `json:"resourceState,omitempty"`
  8652  }
  8653  
  8654  // MarshalJSON is the custom marshaler for LiveOutputProperties.
  8655  func (lop LiveOutputProperties) MarshalJSON() ([]byte, error) {
  8656  	objectMap := make(map[string]interface{})
  8657  	if lop.Description != nil {
  8658  		objectMap["description"] = lop.Description
  8659  	}
  8660  	if lop.AssetName != nil {
  8661  		objectMap["assetName"] = lop.AssetName
  8662  	}
  8663  	if lop.ArchiveWindowLength != nil {
  8664  		objectMap["archiveWindowLength"] = lop.ArchiveWindowLength
  8665  	}
  8666  	if lop.ManifestName != nil {
  8667  		objectMap["manifestName"] = lop.ManifestName
  8668  	}
  8669  	if lop.Hls != nil {
  8670  		objectMap["hls"] = lop.Hls
  8671  	}
  8672  	if lop.OutputSnapTime != nil {
  8673  		objectMap["outputSnapTime"] = lop.OutputSnapTime
  8674  	}
  8675  	return json.Marshal(objectMap)
  8676  }
  8677  
  8678  // LiveOutputsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
  8679  // operation.
  8680  type LiveOutputsCreateFuture struct {
  8681  	azure.FutureAPI
  8682  	// Result returns the result of the asynchronous operation.
  8683  	// If the operation has not completed it will return an error.
  8684  	Result func(LiveOutputsClient) (LiveOutput, error)
  8685  }
  8686  
  8687  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8688  func (future *LiveOutputsCreateFuture) UnmarshalJSON(body []byte) error {
  8689  	var azFuture azure.Future
  8690  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8691  		return err
  8692  	}
  8693  	future.FutureAPI = &azFuture
  8694  	future.Result = future.result
  8695  	return nil
  8696  }
  8697  
  8698  // result is the default implementation for LiveOutputsCreateFuture.Result.
  8699  func (future *LiveOutputsCreateFuture) result(client LiveOutputsClient) (lo LiveOutput, err error) {
  8700  	var done bool
  8701  	done, err = future.DoneWithContext(context.Background(), client)
  8702  	if err != nil {
  8703  		err = autorest.NewErrorWithError(err, "media.LiveOutputsCreateFuture", "Result", future.Response(), "Polling failure")
  8704  		return
  8705  	}
  8706  	if !done {
  8707  		lo.Response.Response = future.Response()
  8708  		err = azure.NewAsyncOpIncompleteError("media.LiveOutputsCreateFuture")
  8709  		return
  8710  	}
  8711  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  8712  	if lo.Response.Response, err = future.GetResult(sender); err == nil && lo.Response.Response.StatusCode != http.StatusNoContent {
  8713  		lo, err = client.CreateResponder(lo.Response.Response)
  8714  		if err != nil {
  8715  			err = autorest.NewErrorWithError(err, "media.LiveOutputsCreateFuture", "Result", lo.Response.Response, "Failure responding to request")
  8716  		}
  8717  	}
  8718  	return
  8719  }
  8720  
  8721  // LiveOutputsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  8722  // operation.
  8723  type LiveOutputsDeleteFuture struct {
  8724  	azure.FutureAPI
  8725  	// Result returns the result of the asynchronous operation.
  8726  	// If the operation has not completed it will return an error.
  8727  	Result func(LiveOutputsClient) (autorest.Response, error)
  8728  }
  8729  
  8730  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8731  func (future *LiveOutputsDeleteFuture) UnmarshalJSON(body []byte) error {
  8732  	var azFuture azure.Future
  8733  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8734  		return err
  8735  	}
  8736  	future.FutureAPI = &azFuture
  8737  	future.Result = future.result
  8738  	return nil
  8739  }
  8740  
  8741  // result is the default implementation for LiveOutputsDeleteFuture.Result.
  8742  func (future *LiveOutputsDeleteFuture) result(client LiveOutputsClient) (ar autorest.Response, err error) {
  8743  	var done bool
  8744  	done, err = future.DoneWithContext(context.Background(), client)
  8745  	if err != nil {
  8746  		err = autorest.NewErrorWithError(err, "media.LiveOutputsDeleteFuture", "Result", future.Response(), "Polling failure")
  8747  		return
  8748  	}
  8749  	if !done {
  8750  		ar.Response = future.Response()
  8751  		err = azure.NewAsyncOpIncompleteError("media.LiveOutputsDeleteFuture")
  8752  		return
  8753  	}
  8754  	ar.Response = future.Response()
  8755  	return
  8756  }
  8757  
  8758  // LogSpecification a diagnostic log emitted by service.
  8759  type LogSpecification struct {
  8760  	// Name - READ-ONLY; The diagnostic log category name.
  8761  	Name *string `json:"name,omitempty"`
  8762  	// DisplayName - READ-ONLY; The diagnostic log category display name.
  8763  	DisplayName *string `json:"displayName,omitempty"`
  8764  	// BlobDuration - READ-ONLY; The time range for requests in each blob.
  8765  	BlobDuration *string `json:"blobDuration,omitempty"`
  8766  }
  8767  
  8768  // MarshalJSON is the custom marshaler for LogSpecification.
  8769  func (ls LogSpecification) MarshalJSON() ([]byte, error) {
  8770  	objectMap := make(map[string]interface{})
  8771  	return json.Marshal(objectMap)
  8772  }
  8773  
  8774  // MetricDimension a metric dimension.
  8775  type MetricDimension struct {
  8776  	// Name - READ-ONLY; The metric dimension name.
  8777  	Name *string `json:"name,omitempty"`
  8778  	// DisplayName - READ-ONLY; The display name for the dimension.
  8779  	DisplayName *string `json:"displayName,omitempty"`
  8780  	// ToBeExportedForShoebox - READ-ONLY; Whether to export metric to shoebox.
  8781  	ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"`
  8782  }
  8783  
  8784  // MarshalJSON is the custom marshaler for MetricDimension.
  8785  func (md MetricDimension) MarshalJSON() ([]byte, error) {
  8786  	objectMap := make(map[string]interface{})
  8787  	return json.Marshal(objectMap)
  8788  }
  8789  
  8790  // MetricSpecification a metric emitted by service.
  8791  type MetricSpecification struct {
  8792  	// Name - READ-ONLY; The metric name.
  8793  	Name *string `json:"name,omitempty"`
  8794  	// DisplayName - READ-ONLY; The metric display name.
  8795  	DisplayName *string `json:"displayName,omitempty"`
  8796  	// DisplayDescription - READ-ONLY; The metric display description.
  8797  	DisplayDescription *string `json:"displayDescription,omitempty"`
  8798  	// Unit - READ-ONLY; The metric unit. Possible values include: 'MetricUnitBytes', 'MetricUnitCount', 'MetricUnitMilliseconds'
  8799  	Unit MetricUnit `json:"unit,omitempty"`
  8800  	// AggregationType - READ-ONLY; The metric aggregation type. Possible values include: 'MetricAggregationTypeAverage', 'MetricAggregationTypeCount', 'MetricAggregationTypeTotal'
  8801  	AggregationType MetricAggregationType `json:"aggregationType,omitempty"`
  8802  	// LockAggregationType - READ-ONLY; The metric lock aggregation type. Possible values include: 'MetricAggregationTypeAverage', 'MetricAggregationTypeCount', 'MetricAggregationTypeTotal'
  8803  	LockAggregationType MetricAggregationType `json:"lockAggregationType,omitempty"`
  8804  	// SupportedAggregationTypes - Supported aggregation types.
  8805  	SupportedAggregationTypes *[]string `json:"supportedAggregationTypes,omitempty"`
  8806  	// Dimensions - READ-ONLY; The metric dimensions.
  8807  	Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
  8808  	// EnableRegionalMdmAccount - READ-ONLY; Indicates whether regional MDM account is enabled.
  8809  	EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"`
  8810  	// SourceMdmAccount - READ-ONLY; The source MDM account.
  8811  	SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"`
  8812  	// SourceMdmNamespace - READ-ONLY; The source MDM namespace.
  8813  	SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"`
  8814  	// SupportedTimeGrainTypes - READ-ONLY; The supported time grain types.
  8815  	SupportedTimeGrainTypes *[]string `json:"supportedTimeGrainTypes,omitempty"`
  8816  }
  8817  
  8818  // MarshalJSON is the custom marshaler for MetricSpecification.
  8819  func (ms MetricSpecification) MarshalJSON() ([]byte, error) {
  8820  	objectMap := make(map[string]interface{})
  8821  	if ms.SupportedAggregationTypes != nil {
  8822  		objectMap["supportedAggregationTypes"] = ms.SupportedAggregationTypes
  8823  	}
  8824  	return json.Marshal(objectMap)
  8825  }
  8826  
  8827  // Mp4Format describes the properties for an output ISO MP4 file.
  8828  type Mp4Format struct {
  8829  	// 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 .
  8830  	OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
  8831  	// 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.
  8832  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  8833  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  8834  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  8835  }
  8836  
  8837  // MarshalJSON is the custom marshaler for Mp4Format.
  8838  func (m4f Mp4Format) MarshalJSON() ([]byte, error) {
  8839  	m4f.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format
  8840  	objectMap := make(map[string]interface{})
  8841  	if m4f.OutputFiles != nil {
  8842  		objectMap["outputFiles"] = m4f.OutputFiles
  8843  	}
  8844  	if m4f.FilenamePattern != nil {
  8845  		objectMap["filenamePattern"] = m4f.FilenamePattern
  8846  	}
  8847  	if m4f.OdataType != "" {
  8848  		objectMap["@odata.type"] = m4f.OdataType
  8849  	}
  8850  	return json.Marshal(objectMap)
  8851  }
  8852  
  8853  // AsImageFormat is the BasicFormat implementation for Mp4Format.
  8854  func (m4f Mp4Format) AsImageFormat() (*ImageFormat, bool) {
  8855  	return nil, false
  8856  }
  8857  
  8858  // AsBasicImageFormat is the BasicFormat implementation for Mp4Format.
  8859  func (m4f Mp4Format) AsBasicImageFormat() (BasicImageFormat, bool) {
  8860  	return nil, false
  8861  }
  8862  
  8863  // AsJpgFormat is the BasicFormat implementation for Mp4Format.
  8864  func (m4f Mp4Format) AsJpgFormat() (*JpgFormat, bool) {
  8865  	return nil, false
  8866  }
  8867  
  8868  // AsPngFormat is the BasicFormat implementation for Mp4Format.
  8869  func (m4f Mp4Format) AsPngFormat() (*PngFormat, bool) {
  8870  	return nil, false
  8871  }
  8872  
  8873  // AsMultiBitrateFormat is the BasicFormat implementation for Mp4Format.
  8874  func (m4f Mp4Format) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  8875  	return nil, false
  8876  }
  8877  
  8878  // AsBasicMultiBitrateFormat is the BasicFormat implementation for Mp4Format.
  8879  func (m4f Mp4Format) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  8880  	return &m4f, true
  8881  }
  8882  
  8883  // AsMp4Format is the BasicFormat implementation for Mp4Format.
  8884  func (m4f Mp4Format) AsMp4Format() (*Mp4Format, bool) {
  8885  	return &m4f, true
  8886  }
  8887  
  8888  // AsTransportStreamFormat is the BasicFormat implementation for Mp4Format.
  8889  func (m4f Mp4Format) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  8890  	return nil, false
  8891  }
  8892  
  8893  // AsFormat is the BasicFormat implementation for Mp4Format.
  8894  func (m4f Mp4Format) AsFormat() (*Format, bool) {
  8895  	return nil, false
  8896  }
  8897  
  8898  // AsBasicFormat is the BasicFormat implementation for Mp4Format.
  8899  func (m4f Mp4Format) AsBasicFormat() (BasicFormat, bool) {
  8900  	return &m4f, true
  8901  }
  8902  
  8903  // BasicMultiBitrateFormat describes the properties for producing a collection of GOP aligned multi-bitrate files. The
  8904  // default behavior is to produce one output file for each video layer which is muxed together with all the audios. The
  8905  // exact output files produced can be controlled by specifying the outputFiles collection.
  8906  type BasicMultiBitrateFormat interface {
  8907  	AsMp4Format() (*Mp4Format, bool)
  8908  	AsTransportStreamFormat() (*TransportStreamFormat, bool)
  8909  	AsMultiBitrateFormat() (*MultiBitrateFormat, bool)
  8910  }
  8911  
  8912  // MultiBitrateFormat describes the properties for producing a collection of GOP aligned multi-bitrate files.
  8913  // The default behavior is to produce one output file for each video layer which is muxed together with all the
  8914  // audios. The exact output files produced can be controlled by specifying the outputFiles collection.
  8915  type MultiBitrateFormat struct {
  8916  	// 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 .
  8917  	OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
  8918  	// 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.
  8919  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  8920  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  8921  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  8922  }
  8923  
  8924  func unmarshalBasicMultiBitrateFormat(body []byte) (BasicMultiBitrateFormat, error) {
  8925  	var m map[string]interface{}
  8926  	err := json.Unmarshal(body, &m)
  8927  	if err != nil {
  8928  		return nil, err
  8929  	}
  8930  
  8931  	switch m["@odata.type"] {
  8932  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format):
  8933  		var m4f Mp4Format
  8934  		err := json.Unmarshal(body, &m4f)
  8935  		return m4f, err
  8936  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat):
  8937  		var tsf TransportStreamFormat
  8938  		err := json.Unmarshal(body, &tsf)
  8939  		return tsf, err
  8940  	default:
  8941  		var mbf MultiBitrateFormat
  8942  		err := json.Unmarshal(body, &mbf)
  8943  		return mbf, err
  8944  	}
  8945  }
  8946  func unmarshalBasicMultiBitrateFormatArray(body []byte) ([]BasicMultiBitrateFormat, error) {
  8947  	var rawMessages []*json.RawMessage
  8948  	err := json.Unmarshal(body, &rawMessages)
  8949  	if err != nil {
  8950  		return nil, err
  8951  	}
  8952  
  8953  	mbfArray := make([]BasicMultiBitrateFormat, len(rawMessages))
  8954  
  8955  	for index, rawMessage := range rawMessages {
  8956  		mbf, err := unmarshalBasicMultiBitrateFormat(*rawMessage)
  8957  		if err != nil {
  8958  			return nil, err
  8959  		}
  8960  		mbfArray[index] = mbf
  8961  	}
  8962  	return mbfArray, nil
  8963  }
  8964  
  8965  // MarshalJSON is the custom marshaler for MultiBitrateFormat.
  8966  func (mbf MultiBitrateFormat) MarshalJSON() ([]byte, error) {
  8967  	mbf.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat
  8968  	objectMap := make(map[string]interface{})
  8969  	if mbf.OutputFiles != nil {
  8970  		objectMap["outputFiles"] = mbf.OutputFiles
  8971  	}
  8972  	if mbf.FilenamePattern != nil {
  8973  		objectMap["filenamePattern"] = mbf.FilenamePattern
  8974  	}
  8975  	if mbf.OdataType != "" {
  8976  		objectMap["@odata.type"] = mbf.OdataType
  8977  	}
  8978  	return json.Marshal(objectMap)
  8979  }
  8980  
  8981  // AsImageFormat is the BasicFormat implementation for MultiBitrateFormat.
  8982  func (mbf MultiBitrateFormat) AsImageFormat() (*ImageFormat, bool) {
  8983  	return nil, false
  8984  }
  8985  
  8986  // AsBasicImageFormat is the BasicFormat implementation for MultiBitrateFormat.
  8987  func (mbf MultiBitrateFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
  8988  	return nil, false
  8989  }
  8990  
  8991  // AsJpgFormat is the BasicFormat implementation for MultiBitrateFormat.
  8992  func (mbf MultiBitrateFormat) AsJpgFormat() (*JpgFormat, bool) {
  8993  	return nil, false
  8994  }
  8995  
  8996  // AsPngFormat is the BasicFormat implementation for MultiBitrateFormat.
  8997  func (mbf MultiBitrateFormat) AsPngFormat() (*PngFormat, bool) {
  8998  	return nil, false
  8999  }
  9000  
  9001  // AsMultiBitrateFormat is the BasicFormat implementation for MultiBitrateFormat.
  9002  func (mbf MultiBitrateFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  9003  	return &mbf, true
  9004  }
  9005  
  9006  // AsBasicMultiBitrateFormat is the BasicFormat implementation for MultiBitrateFormat.
  9007  func (mbf MultiBitrateFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  9008  	return &mbf, true
  9009  }
  9010  
  9011  // AsMp4Format is the BasicFormat implementation for MultiBitrateFormat.
  9012  func (mbf MultiBitrateFormat) AsMp4Format() (*Mp4Format, bool) {
  9013  	return nil, false
  9014  }
  9015  
  9016  // AsTransportStreamFormat is the BasicFormat implementation for MultiBitrateFormat.
  9017  func (mbf MultiBitrateFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  9018  	return nil, false
  9019  }
  9020  
  9021  // AsFormat is the BasicFormat implementation for MultiBitrateFormat.
  9022  func (mbf MultiBitrateFormat) AsFormat() (*Format, bool) {
  9023  	return nil, false
  9024  }
  9025  
  9026  // AsBasicFormat is the BasicFormat implementation for MultiBitrateFormat.
  9027  func (mbf MultiBitrateFormat) AsBasicFormat() (BasicFormat, bool) {
  9028  	return &mbf, true
  9029  }
  9030  
  9031  // NoEncryption class for NoEncryption scheme
  9032  type NoEncryption struct {
  9033  	// EnabledProtocols - Representing supported protocols
  9034  	EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
  9035  }
  9036  
  9037  // Operation an operation.
  9038  type Operation struct {
  9039  	// Name - The operation name.
  9040  	Name *string `json:"name,omitempty"`
  9041  	// Display - The operation display name.
  9042  	Display *OperationDisplay `json:"display,omitempty"`
  9043  	// Origin - Origin of the operation.
  9044  	Origin *string `json:"origin,omitempty"`
  9045  	// Properties - Operation properties format.
  9046  	Properties *Properties `json:"properties,omitempty"`
  9047  	// IsDataAction - Whether the operation applies to data-plane.
  9048  	IsDataAction *bool `json:"isDataAction,omitempty"`
  9049  	// ActionType - Indicates the action type. Possible values include: 'ActionTypeInternal'
  9050  	ActionType ActionType `json:"actionType,omitempty"`
  9051  }
  9052  
  9053  // OperationCollection a collection of Operation items.
  9054  type OperationCollection struct {
  9055  	autorest.Response `json:"-"`
  9056  	// Value - A collection of Operation items.
  9057  	Value *[]Operation `json:"value,omitempty"`
  9058  }
  9059  
  9060  // OperationDisplay operation details.
  9061  type OperationDisplay struct {
  9062  	// Provider - The service provider.
  9063  	Provider *string `json:"provider,omitempty"`
  9064  	// Resource - Resource on which the operation is performed.
  9065  	Resource *string `json:"resource,omitempty"`
  9066  	// Operation - The operation type.
  9067  	Operation *string `json:"operation,omitempty"`
  9068  	// Description - The operation description.
  9069  	Description *string `json:"description,omitempty"`
  9070  }
  9071  
  9072  // OutputFile represents an output file produced.
  9073  type OutputFile struct {
  9074  	// 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.
  9075  	Labels *[]string `json:"labels,omitempty"`
  9076  }
  9077  
  9078  // BasicOverlay base type for all overlays - image, audio or video.
  9079  type BasicOverlay interface {
  9080  	AsAudioOverlay() (*AudioOverlay, bool)
  9081  	AsVideoOverlay() (*VideoOverlay, bool)
  9082  	AsOverlay() (*Overlay, bool)
  9083  }
  9084  
  9085  // Overlay base type for all overlays - image, audio or video.
  9086  type Overlay struct {
  9087  	// 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.
  9088  	InputLabel *string `json:"inputLabel,omitempty"`
  9089  	// 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.
  9090  	Start *string `json:"start,omitempty"`
  9091  	// 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.
  9092  	End *string `json:"end,omitempty"`
  9093  	// 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).
  9094  	FadeInDuration *string `json:"fadeInDuration,omitempty"`
  9095  	// 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).
  9096  	FadeOutDuration *string `json:"fadeOutDuration,omitempty"`
  9097  	// AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0.
  9098  	AudioGainLevel *float64 `json:"audioGainLevel,omitempty"`
  9099  	// OdataType - Possible values include: 'OdataTypeBasicOverlayOdataTypeOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaVideoOverlay'
  9100  	OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"`
  9101  }
  9102  
  9103  func unmarshalBasicOverlay(body []byte) (BasicOverlay, error) {
  9104  	var m map[string]interface{}
  9105  	err := json.Unmarshal(body, &m)
  9106  	if err != nil {
  9107  		return nil, err
  9108  	}
  9109  
  9110  	switch m["@odata.type"] {
  9111  	case string(OdataTypeBasicOverlayOdataTypeMicrosoftMediaAudioOverlay):
  9112  		var ao AudioOverlay
  9113  		err := json.Unmarshal(body, &ao)
  9114  		return ao, err
  9115  	case string(OdataTypeBasicOverlayOdataTypeMicrosoftMediaVideoOverlay):
  9116  		var vo VideoOverlay
  9117  		err := json.Unmarshal(body, &vo)
  9118  		return vo, err
  9119  	default:
  9120  		var o Overlay
  9121  		err := json.Unmarshal(body, &o)
  9122  		return o, err
  9123  	}
  9124  }
  9125  func unmarshalBasicOverlayArray(body []byte) ([]BasicOverlay, error) {
  9126  	var rawMessages []*json.RawMessage
  9127  	err := json.Unmarshal(body, &rawMessages)
  9128  	if err != nil {
  9129  		return nil, err
  9130  	}
  9131  
  9132  	oArray := make([]BasicOverlay, len(rawMessages))
  9133  
  9134  	for index, rawMessage := range rawMessages {
  9135  		o, err := unmarshalBasicOverlay(*rawMessage)
  9136  		if err != nil {
  9137  			return nil, err
  9138  		}
  9139  		oArray[index] = o
  9140  	}
  9141  	return oArray, nil
  9142  }
  9143  
  9144  // MarshalJSON is the custom marshaler for Overlay.
  9145  func (o Overlay) MarshalJSON() ([]byte, error) {
  9146  	o.OdataType = OdataTypeBasicOverlayOdataTypeOverlay
  9147  	objectMap := make(map[string]interface{})
  9148  	if o.InputLabel != nil {
  9149  		objectMap["inputLabel"] = o.InputLabel
  9150  	}
  9151  	if o.Start != nil {
  9152  		objectMap["start"] = o.Start
  9153  	}
  9154  	if o.End != nil {
  9155  		objectMap["end"] = o.End
  9156  	}
  9157  	if o.FadeInDuration != nil {
  9158  		objectMap["fadeInDuration"] = o.FadeInDuration
  9159  	}
  9160  	if o.FadeOutDuration != nil {
  9161  		objectMap["fadeOutDuration"] = o.FadeOutDuration
  9162  	}
  9163  	if o.AudioGainLevel != nil {
  9164  		objectMap["audioGainLevel"] = o.AudioGainLevel
  9165  	}
  9166  	if o.OdataType != "" {
  9167  		objectMap["@odata.type"] = o.OdataType
  9168  	}
  9169  	return json.Marshal(objectMap)
  9170  }
  9171  
  9172  // AsAudioOverlay is the BasicOverlay implementation for Overlay.
  9173  func (o Overlay) AsAudioOverlay() (*AudioOverlay, bool) {
  9174  	return nil, false
  9175  }
  9176  
  9177  // AsVideoOverlay is the BasicOverlay implementation for Overlay.
  9178  func (o Overlay) AsVideoOverlay() (*VideoOverlay, bool) {
  9179  	return nil, false
  9180  }
  9181  
  9182  // AsOverlay is the BasicOverlay implementation for Overlay.
  9183  func (o Overlay) AsOverlay() (*Overlay, bool) {
  9184  	return &o, true
  9185  }
  9186  
  9187  // AsBasicOverlay is the BasicOverlay implementation for Overlay.
  9188  func (o Overlay) AsBasicOverlay() (BasicOverlay, bool) {
  9189  	return &o, true
  9190  }
  9191  
  9192  // PngFormat describes the settings for producing PNG thumbnails.
  9193  type PngFormat struct {
  9194  	// 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.
  9195  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  9196  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  9197  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  9198  }
  9199  
  9200  // MarshalJSON is the custom marshaler for PngFormat.
  9201  func (pf PngFormat) MarshalJSON() ([]byte, error) {
  9202  	pf.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat
  9203  	objectMap := make(map[string]interface{})
  9204  	if pf.FilenamePattern != nil {
  9205  		objectMap["filenamePattern"] = pf.FilenamePattern
  9206  	}
  9207  	if pf.OdataType != "" {
  9208  		objectMap["@odata.type"] = pf.OdataType
  9209  	}
  9210  	return json.Marshal(objectMap)
  9211  }
  9212  
  9213  // AsImageFormat is the BasicFormat implementation for PngFormat.
  9214  func (pf PngFormat) AsImageFormat() (*ImageFormat, bool) {
  9215  	return nil, false
  9216  }
  9217  
  9218  // AsBasicImageFormat is the BasicFormat implementation for PngFormat.
  9219  func (pf PngFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
  9220  	return &pf, true
  9221  }
  9222  
  9223  // AsJpgFormat is the BasicFormat implementation for PngFormat.
  9224  func (pf PngFormat) AsJpgFormat() (*JpgFormat, bool) {
  9225  	return nil, false
  9226  }
  9227  
  9228  // AsPngFormat is the BasicFormat implementation for PngFormat.
  9229  func (pf PngFormat) AsPngFormat() (*PngFormat, bool) {
  9230  	return &pf, true
  9231  }
  9232  
  9233  // AsMultiBitrateFormat is the BasicFormat implementation for PngFormat.
  9234  func (pf PngFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  9235  	return nil, false
  9236  }
  9237  
  9238  // AsBasicMultiBitrateFormat is the BasicFormat implementation for PngFormat.
  9239  func (pf PngFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  9240  	return nil, false
  9241  }
  9242  
  9243  // AsMp4Format is the BasicFormat implementation for PngFormat.
  9244  func (pf PngFormat) AsMp4Format() (*Mp4Format, bool) {
  9245  	return nil, false
  9246  }
  9247  
  9248  // AsTransportStreamFormat is the BasicFormat implementation for PngFormat.
  9249  func (pf PngFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  9250  	return nil, false
  9251  }
  9252  
  9253  // AsFormat is the BasicFormat implementation for PngFormat.
  9254  func (pf PngFormat) AsFormat() (*Format, bool) {
  9255  	return nil, false
  9256  }
  9257  
  9258  // AsBasicFormat is the BasicFormat implementation for PngFormat.
  9259  func (pf PngFormat) AsBasicFormat() (BasicFormat, bool) {
  9260  	return &pf, true
  9261  }
  9262  
  9263  // PngImage describes the properties for producing a series of PNG images from the input video.
  9264  type PngImage struct {
  9265  	// Layers - A collection of output PNG image layers to be produced by the encoder.
  9266  	Layers *[]PngLayer `json:"layers,omitempty"`
  9267  	// 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}.
  9268  	Start *string `json:"start,omitempty"`
  9269  	// 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.
  9270  	Step *string `json:"step,omitempty"`
  9271  	// 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.
  9272  	Range *string `json:"range,omitempty"`
  9273  	// 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.
  9274  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  9275  	// 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'
  9276  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  9277  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
  9278  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
  9279  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  9280  	Label *string `json:"label,omitempty"`
  9281  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  9282  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  9283  }
  9284  
  9285  // MarshalJSON is the custom marshaler for PngImage.
  9286  func (pi PngImage) MarshalJSON() ([]byte, error) {
  9287  	pi.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage
  9288  	objectMap := make(map[string]interface{})
  9289  	if pi.Layers != nil {
  9290  		objectMap["layers"] = pi.Layers
  9291  	}
  9292  	if pi.Start != nil {
  9293  		objectMap["start"] = pi.Start
  9294  	}
  9295  	if pi.Step != nil {
  9296  		objectMap["step"] = pi.Step
  9297  	}
  9298  	if pi.Range != nil {
  9299  		objectMap["range"] = pi.Range
  9300  	}
  9301  	if pi.KeyFrameInterval != nil {
  9302  		objectMap["keyFrameInterval"] = pi.KeyFrameInterval
  9303  	}
  9304  	if pi.StretchMode != "" {
  9305  		objectMap["stretchMode"] = pi.StretchMode
  9306  	}
  9307  	if pi.SyncMode != "" {
  9308  		objectMap["syncMode"] = pi.SyncMode
  9309  	}
  9310  	if pi.Label != nil {
  9311  		objectMap["label"] = pi.Label
  9312  	}
  9313  	if pi.OdataType != "" {
  9314  		objectMap["@odata.type"] = pi.OdataType
  9315  	}
  9316  	return json.Marshal(objectMap)
  9317  }
  9318  
  9319  // AsAudio is the BasicCodec implementation for PngImage.
  9320  func (pi PngImage) AsAudio() (*Audio, bool) {
  9321  	return nil, false
  9322  }
  9323  
  9324  // AsBasicAudio is the BasicCodec implementation for PngImage.
  9325  func (pi PngImage) AsBasicAudio() (BasicAudio, bool) {
  9326  	return nil, false
  9327  }
  9328  
  9329  // AsAacAudio is the BasicCodec implementation for PngImage.
  9330  func (pi PngImage) AsAacAudio() (*AacAudio, bool) {
  9331  	return nil, false
  9332  }
  9333  
  9334  // AsVideo is the BasicCodec implementation for PngImage.
  9335  func (pi PngImage) AsVideo() (*Video, bool) {
  9336  	return nil, false
  9337  }
  9338  
  9339  // AsBasicVideo is the BasicCodec implementation for PngImage.
  9340  func (pi PngImage) AsBasicVideo() (BasicVideo, bool) {
  9341  	return &pi, true
  9342  }
  9343  
  9344  // AsH265Video is the BasicCodec implementation for PngImage.
  9345  func (pi PngImage) AsH265Video() (*H265Video, bool) {
  9346  	return nil, false
  9347  }
  9348  
  9349  // AsCopyVideo is the BasicCodec implementation for PngImage.
  9350  func (pi PngImage) AsCopyVideo() (*CopyVideo, bool) {
  9351  	return nil, false
  9352  }
  9353  
  9354  // AsImage is the BasicCodec implementation for PngImage.
  9355  func (pi PngImage) AsImage() (*Image, bool) {
  9356  	return nil, false
  9357  }
  9358  
  9359  // AsBasicImage is the BasicCodec implementation for PngImage.
  9360  func (pi PngImage) AsBasicImage() (BasicImage, bool) {
  9361  	return &pi, true
  9362  }
  9363  
  9364  // AsCopyAudio is the BasicCodec implementation for PngImage.
  9365  func (pi PngImage) AsCopyAudio() (*CopyAudio, bool) {
  9366  	return nil, false
  9367  }
  9368  
  9369  // AsH264Video is the BasicCodec implementation for PngImage.
  9370  func (pi PngImage) AsH264Video() (*H264Video, bool) {
  9371  	return nil, false
  9372  }
  9373  
  9374  // AsJpgImage is the BasicCodec implementation for PngImage.
  9375  func (pi PngImage) AsJpgImage() (*JpgImage, bool) {
  9376  	return nil, false
  9377  }
  9378  
  9379  // AsPngImage is the BasicCodec implementation for PngImage.
  9380  func (pi PngImage) AsPngImage() (*PngImage, bool) {
  9381  	return &pi, true
  9382  }
  9383  
  9384  // AsCodec is the BasicCodec implementation for PngImage.
  9385  func (pi PngImage) AsCodec() (*Codec, bool) {
  9386  	return nil, false
  9387  }
  9388  
  9389  // AsBasicCodec is the BasicCodec implementation for PngImage.
  9390  func (pi PngImage) AsBasicCodec() (BasicCodec, bool) {
  9391  	return &pi, true
  9392  }
  9393  
  9394  // PngLayer describes the settings to produce a PNG image from the input video.
  9395  type PngLayer struct {
  9396  	// 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.
  9397  	Width *string `json:"width,omitempty"`
  9398  	// 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.
  9399  	Height *string `json:"height,omitempty"`
  9400  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  9401  	Label *string `json:"label,omitempty"`
  9402  	// OdataType - Possible values include: 'OdataTypeBasicLayerOdataTypeLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer'
  9403  	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
  9404  }
  9405  
  9406  // MarshalJSON is the custom marshaler for PngLayer.
  9407  func (pl PngLayer) MarshalJSON() ([]byte, error) {
  9408  	pl.OdataType = OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer
  9409  	objectMap := make(map[string]interface{})
  9410  	if pl.Width != nil {
  9411  		objectMap["width"] = pl.Width
  9412  	}
  9413  	if pl.Height != nil {
  9414  		objectMap["height"] = pl.Height
  9415  	}
  9416  	if pl.Label != nil {
  9417  		objectMap["label"] = pl.Label
  9418  	}
  9419  	if pl.OdataType != "" {
  9420  		objectMap["@odata.type"] = pl.OdataType
  9421  	}
  9422  	return json.Marshal(objectMap)
  9423  }
  9424  
  9425  // AsH265VideoLayer is the BasicLayer implementation for PngLayer.
  9426  func (pl PngLayer) AsH265VideoLayer() (*H265VideoLayer, bool) {
  9427  	return nil, false
  9428  }
  9429  
  9430  // AsBasicH265VideoLayer is the BasicLayer implementation for PngLayer.
  9431  func (pl PngLayer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
  9432  	return nil, false
  9433  }
  9434  
  9435  // AsH265Layer is the BasicLayer implementation for PngLayer.
  9436  func (pl PngLayer) AsH265Layer() (*H265Layer, bool) {
  9437  	return nil, false
  9438  }
  9439  
  9440  // AsVideoLayer is the BasicLayer implementation for PngLayer.
  9441  func (pl PngLayer) AsVideoLayer() (*VideoLayer, bool) {
  9442  	return nil, false
  9443  }
  9444  
  9445  // AsBasicVideoLayer is the BasicLayer implementation for PngLayer.
  9446  func (pl PngLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
  9447  	return nil, false
  9448  }
  9449  
  9450  // AsH264Layer is the BasicLayer implementation for PngLayer.
  9451  func (pl PngLayer) AsH264Layer() (*H264Layer, bool) {
  9452  	return nil, false
  9453  }
  9454  
  9455  // AsJpgLayer is the BasicLayer implementation for PngLayer.
  9456  func (pl PngLayer) AsJpgLayer() (*JpgLayer, bool) {
  9457  	return nil, false
  9458  }
  9459  
  9460  // AsPngLayer is the BasicLayer implementation for PngLayer.
  9461  func (pl PngLayer) AsPngLayer() (*PngLayer, bool) {
  9462  	return &pl, true
  9463  }
  9464  
  9465  // AsLayer is the BasicLayer implementation for PngLayer.
  9466  func (pl PngLayer) AsLayer() (*Layer, bool) {
  9467  	return nil, false
  9468  }
  9469  
  9470  // AsBasicLayer is the BasicLayer implementation for PngLayer.
  9471  func (pl PngLayer) AsBasicLayer() (BasicLayer, bool) {
  9472  	return &pl, true
  9473  }
  9474  
  9475  // PresentationTimeRange the presentation time range, this is asset related and not recommended for Account
  9476  // Filter.
  9477  type PresentationTimeRange struct {
  9478  	// StartTimestamp - The absolute start time boundary.
  9479  	StartTimestamp *int64 `json:"startTimestamp,omitempty"`
  9480  	// EndTimestamp - The absolute end time boundary.
  9481  	EndTimestamp *int64 `json:"endTimestamp,omitempty"`
  9482  	// PresentationWindowDuration - The relative to end sliding window.
  9483  	PresentationWindowDuration *int64 `json:"presentationWindowDuration,omitempty"`
  9484  	// LiveBackoffDuration - The relative to end right edge.
  9485  	LiveBackoffDuration *int64 `json:"liveBackoffDuration,omitempty"`
  9486  	// Timescale - The time scale of time stamps.
  9487  	Timescale *int64 `json:"timescale,omitempty"`
  9488  	// ForceEndTimestamp - The indicator of forcing existing of end time stamp.
  9489  	ForceEndTimestamp *bool `json:"forceEndTimestamp,omitempty"`
  9490  }
  9491  
  9492  // BasicPreset base type for all Presets, which define the recipe or instructions on how the input media files should
  9493  // be processed.
  9494  type BasicPreset interface {
  9495  	AsFaceDetectorPreset() (*FaceDetectorPreset, bool)
  9496  	AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool)
  9497  	AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool)
  9498  	AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool)
  9499  	AsStandardEncoderPreset() (*StandardEncoderPreset, bool)
  9500  	AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool)
  9501  	AsPreset() (*Preset, bool)
  9502  }
  9503  
  9504  // Preset base type for all Presets, which define the recipe or instructions on how the input media files
  9505  // should be processed.
  9506  type Preset struct {
  9507  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
  9508  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
  9509  }
  9510  
  9511  func unmarshalBasicPreset(body []byte) (BasicPreset, error) {
  9512  	var m map[string]interface{}
  9513  	err := json.Unmarshal(body, &m)
  9514  	if err != nil {
  9515  		return nil, err
  9516  	}
  9517  
  9518  	switch m["@odata.type"] {
  9519  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset):
  9520  		var fdp FaceDetectorPreset
  9521  		err := json.Unmarshal(body, &fdp)
  9522  		return fdp, err
  9523  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset):
  9524  		var aap AudioAnalyzerPreset
  9525  		err := json.Unmarshal(body, &aap)
  9526  		return aap, err
  9527  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset):
  9528  		var bisep BuiltInStandardEncoderPreset
  9529  		err := json.Unmarshal(body, &bisep)
  9530  		return bisep, err
  9531  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset):
  9532  		var sep StandardEncoderPreset
  9533  		err := json.Unmarshal(body, &sep)
  9534  		return sep, err
  9535  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset):
  9536  		var vap VideoAnalyzerPreset
  9537  		err := json.Unmarshal(body, &vap)
  9538  		return vap, err
  9539  	default:
  9540  		var p Preset
  9541  		err := json.Unmarshal(body, &p)
  9542  		return p, err
  9543  	}
  9544  }
  9545  func unmarshalBasicPresetArray(body []byte) ([]BasicPreset, error) {
  9546  	var rawMessages []*json.RawMessage
  9547  	err := json.Unmarshal(body, &rawMessages)
  9548  	if err != nil {
  9549  		return nil, err
  9550  	}
  9551  
  9552  	pArray := make([]BasicPreset, len(rawMessages))
  9553  
  9554  	for index, rawMessage := range rawMessages {
  9555  		p, err := unmarshalBasicPreset(*rawMessage)
  9556  		if err != nil {
  9557  			return nil, err
  9558  		}
  9559  		pArray[index] = p
  9560  	}
  9561  	return pArray, nil
  9562  }
  9563  
  9564  // MarshalJSON is the custom marshaler for Preset.
  9565  func (p Preset) MarshalJSON() ([]byte, error) {
  9566  	p.OdataType = OdataTypeBasicPresetOdataTypePreset
  9567  	objectMap := make(map[string]interface{})
  9568  	if p.OdataType != "" {
  9569  		objectMap["@odata.type"] = p.OdataType
  9570  	}
  9571  	return json.Marshal(objectMap)
  9572  }
  9573  
  9574  // AsFaceDetectorPreset is the BasicPreset implementation for Preset.
  9575  func (p Preset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
  9576  	return nil, false
  9577  }
  9578  
  9579  // AsAudioAnalyzerPreset is the BasicPreset implementation for Preset.
  9580  func (p Preset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
  9581  	return nil, false
  9582  }
  9583  
  9584  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for Preset.
  9585  func (p Preset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
  9586  	return nil, false
  9587  }
  9588  
  9589  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for Preset.
  9590  func (p Preset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
  9591  	return nil, false
  9592  }
  9593  
  9594  // AsStandardEncoderPreset is the BasicPreset implementation for Preset.
  9595  func (p Preset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
  9596  	return nil, false
  9597  }
  9598  
  9599  // AsVideoAnalyzerPreset is the BasicPreset implementation for Preset.
  9600  func (p Preset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
  9601  	return nil, false
  9602  }
  9603  
  9604  // AsPreset is the BasicPreset implementation for Preset.
  9605  func (p Preset) AsPreset() (*Preset, bool) {
  9606  	return &p, true
  9607  }
  9608  
  9609  // AsBasicPreset is the BasicPreset implementation for Preset.
  9610  func (p Preset) AsBasicPreset() (BasicPreset, bool) {
  9611  	return &p, true
  9612  }
  9613  
  9614  // PresetConfigurations an object of optional configuration settings for encoder.
  9615  type PresetConfigurations struct {
  9616  	// 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'
  9617  	Complexity Complexity `json:"complexity,omitempty"`
  9618  	// 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'
  9619  	InterleaveOutput InterleaveOutput `json:"interleaveOutput,omitempty"`
  9620  	// KeyFrameIntervalInSeconds - The key frame interval in seconds. Example: set KeyFrameIntervalInSeconds as 2 to reduce the playback buffering for some players.
  9621  	KeyFrameIntervalInSeconds *float64 `json:"keyFrameIntervalInSeconds,omitempty"`
  9622  	// 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.
  9623  	MaxBitrateBps *int32 `json:"maxBitrateBps,omitempty"`
  9624  	// 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.
  9625  	MaxHeight *int32 `json:"maxHeight,omitempty"`
  9626  	// 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.
  9627  	MaxLayers *int32 `json:"maxLayers,omitempty"`
  9628  	// 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.
  9629  	MinBitrateBps *int32 `json:"minBitrateBps,omitempty"`
  9630  	// MinHeight - The minimum height of output video layers. Example: set MinHeight as 360 to avoid output layers of smaller resolutions like 180P.
  9631  	MinHeight *int32 `json:"minHeight,omitempty"`
  9632  }
  9633  
  9634  // PrivateEndpoint the Private Endpoint resource.
  9635  type PrivateEndpoint struct {
  9636  	// ID - READ-ONLY; The ARM identifier for Private Endpoint
  9637  	ID *string `json:"id,omitempty"`
  9638  }
  9639  
  9640  // MarshalJSON is the custom marshaler for PrivateEndpoint.
  9641  func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) {
  9642  	objectMap := make(map[string]interface{})
  9643  	return json.Marshal(objectMap)
  9644  }
  9645  
  9646  // PrivateEndpointConnection the Private Endpoint Connection resource.
  9647  type PrivateEndpointConnection struct {
  9648  	autorest.Response `json:"-"`
  9649  	// PrivateEndpointConnectionProperties - Resource properties.
  9650  	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
  9651  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  9652  	ID *string `json:"id,omitempty"`
  9653  	// Name - READ-ONLY; The name of the resource
  9654  	Name *string `json:"name,omitempty"`
  9655  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  9656  	Type *string `json:"type,omitempty"`
  9657  }
  9658  
  9659  // MarshalJSON is the custom marshaler for PrivateEndpointConnection.
  9660  func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
  9661  	objectMap := make(map[string]interface{})
  9662  	if pec.PrivateEndpointConnectionProperties != nil {
  9663  		objectMap["properties"] = pec.PrivateEndpointConnectionProperties
  9664  	}
  9665  	return json.Marshal(objectMap)
  9666  }
  9667  
  9668  // UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
  9669  func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
  9670  	var m map[string]*json.RawMessage
  9671  	err := json.Unmarshal(body, &m)
  9672  	if err != nil {
  9673  		return err
  9674  	}
  9675  	for k, v := range m {
  9676  		switch k {
  9677  		case "properties":
  9678  			if v != nil {
  9679  				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
  9680  				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
  9681  				if err != nil {
  9682  					return err
  9683  				}
  9684  				pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
  9685  			}
  9686  		case "id":
  9687  			if v != nil {
  9688  				var ID string
  9689  				err = json.Unmarshal(*v, &ID)
  9690  				if err != nil {
  9691  					return err
  9692  				}
  9693  				pec.ID = &ID
  9694  			}
  9695  		case "name":
  9696  			if v != nil {
  9697  				var name string
  9698  				err = json.Unmarshal(*v, &name)
  9699  				if err != nil {
  9700  					return err
  9701  				}
  9702  				pec.Name = &name
  9703  			}
  9704  		case "type":
  9705  			if v != nil {
  9706  				var typeVar string
  9707  				err = json.Unmarshal(*v, &typeVar)
  9708  				if err != nil {
  9709  					return err
  9710  				}
  9711  				pec.Type = &typeVar
  9712  			}
  9713  		}
  9714  	}
  9715  
  9716  	return nil
  9717  }
  9718  
  9719  // PrivateEndpointConnectionListResult list of private endpoint connection associated with the specified
  9720  // storage account
  9721  type PrivateEndpointConnectionListResult struct {
  9722  	autorest.Response `json:"-"`
  9723  	// Value - Array of private endpoint connections
  9724  	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
  9725  }
  9726  
  9727  // PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties.
  9728  type PrivateEndpointConnectionProperties struct {
  9729  	// PrivateEndpoint - The resource of private end point.
  9730  	PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
  9731  	// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider.
  9732  	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
  9733  	// ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed'
  9734  	ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"`
  9735  }
  9736  
  9737  // PrivateLinkResource a private link resource
  9738  type PrivateLinkResource struct {
  9739  	autorest.Response `json:"-"`
  9740  	// PrivateLinkResourceProperties - Resource properties.
  9741  	*PrivateLinkResourceProperties `json:"properties,omitempty"`
  9742  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  9743  	ID *string `json:"id,omitempty"`
  9744  	// Name - READ-ONLY; The name of the resource
  9745  	Name *string `json:"name,omitempty"`
  9746  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  9747  	Type *string `json:"type,omitempty"`
  9748  }
  9749  
  9750  // MarshalJSON is the custom marshaler for PrivateLinkResource.
  9751  func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
  9752  	objectMap := make(map[string]interface{})
  9753  	if plr.PrivateLinkResourceProperties != nil {
  9754  		objectMap["properties"] = plr.PrivateLinkResourceProperties
  9755  	}
  9756  	return json.Marshal(objectMap)
  9757  }
  9758  
  9759  // UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct.
  9760  func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error {
  9761  	var m map[string]*json.RawMessage
  9762  	err := json.Unmarshal(body, &m)
  9763  	if err != nil {
  9764  		return err
  9765  	}
  9766  	for k, v := range m {
  9767  		switch k {
  9768  		case "properties":
  9769  			if v != nil {
  9770  				var privateLinkResourceProperties PrivateLinkResourceProperties
  9771  				err = json.Unmarshal(*v, &privateLinkResourceProperties)
  9772  				if err != nil {
  9773  					return err
  9774  				}
  9775  				plr.PrivateLinkResourceProperties = &privateLinkResourceProperties
  9776  			}
  9777  		case "id":
  9778  			if v != nil {
  9779  				var ID string
  9780  				err = json.Unmarshal(*v, &ID)
  9781  				if err != nil {
  9782  					return err
  9783  				}
  9784  				plr.ID = &ID
  9785  			}
  9786  		case "name":
  9787  			if v != nil {
  9788  				var name string
  9789  				err = json.Unmarshal(*v, &name)
  9790  				if err != nil {
  9791  					return err
  9792  				}
  9793  				plr.Name = &name
  9794  			}
  9795  		case "type":
  9796  			if v != nil {
  9797  				var typeVar string
  9798  				err = json.Unmarshal(*v, &typeVar)
  9799  				if err != nil {
  9800  					return err
  9801  				}
  9802  				plr.Type = &typeVar
  9803  			}
  9804  		}
  9805  	}
  9806  
  9807  	return nil
  9808  }
  9809  
  9810  // PrivateLinkResourceListResult a list of private link resources
  9811  type PrivateLinkResourceListResult struct {
  9812  	autorest.Response `json:"-"`
  9813  	// Value - Array of private link resources
  9814  	Value *[]PrivateLinkResource `json:"value,omitempty"`
  9815  }
  9816  
  9817  // PrivateLinkResourceProperties properties of a private link resource.
  9818  type PrivateLinkResourceProperties struct {
  9819  	// GroupID - READ-ONLY; The private link resource group id.
  9820  	GroupID *string `json:"groupId,omitempty"`
  9821  	// RequiredMembers - READ-ONLY; The private link resource required member names.
  9822  	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
  9823  	// RequiredZoneNames - The private link resource Private link DNS zone name.
  9824  	RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
  9825  }
  9826  
  9827  // MarshalJSON is the custom marshaler for PrivateLinkResourceProperties.
  9828  func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
  9829  	objectMap := make(map[string]interface{})
  9830  	if plrp.RequiredZoneNames != nil {
  9831  		objectMap["requiredZoneNames"] = plrp.RequiredZoneNames
  9832  	}
  9833  	return json.Marshal(objectMap)
  9834  }
  9835  
  9836  // PrivateLinkServiceConnectionState a collection of information about the state of the connection between
  9837  // service consumer and provider.
  9838  type PrivateLinkServiceConnectionState struct {
  9839  	// Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'PrivateEndpointServiceConnectionStatusPending', 'PrivateEndpointServiceConnectionStatusApproved', 'PrivateEndpointServiceConnectionStatusRejected'
  9840  	Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"`
  9841  	// Description - The reason for approval/rejection of the connection.
  9842  	Description *string `json:"description,omitempty"`
  9843  	// ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer.
  9844  	ActionsRequired *string `json:"actionsRequired,omitempty"`
  9845  }
  9846  
  9847  // Properties the service specification property.
  9848  type Properties struct {
  9849  	// ServiceSpecification - READ-ONLY; The service specifications.
  9850  	ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"`
  9851  }
  9852  
  9853  // MarshalJSON is the custom marshaler for Properties.
  9854  func (p Properties) MarshalJSON() ([]byte, error) {
  9855  	objectMap := make(map[string]interface{})
  9856  	return json.Marshal(objectMap)
  9857  }
  9858  
  9859  // ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not
  9860  // have tags and a location
  9861  type ProxyResource struct {
  9862  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  9863  	ID *string `json:"id,omitempty"`
  9864  	// Name - READ-ONLY; The name of the resource
  9865  	Name *string `json:"name,omitempty"`
  9866  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  9867  	Type *string `json:"type,omitempty"`
  9868  }
  9869  
  9870  // MarshalJSON is the custom marshaler for ProxyResource.
  9871  func (pr ProxyResource) MarshalJSON() ([]byte, error) {
  9872  	objectMap := make(map[string]interface{})
  9873  	return json.Marshal(objectMap)
  9874  }
  9875  
  9876  // Rectangle describes the properties of a rectangular window applied to the input media before processing
  9877  // it.
  9878  type Rectangle struct {
  9879  	// 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%).
  9880  	Left *string `json:"left,omitempty"`
  9881  	// 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%).
  9882  	Top *string `json:"top,omitempty"`
  9883  	// 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%).
  9884  	Width *string `json:"width,omitempty"`
  9885  	// 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%).
  9886  	Height *string `json:"height,omitempty"`
  9887  }
  9888  
  9889  // Resource common fields that are returned in the response for all Azure Resource Manager resources
  9890  type Resource struct {
  9891  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  9892  	ID *string `json:"id,omitempty"`
  9893  	// Name - READ-ONLY; The name of the resource
  9894  	Name *string `json:"name,omitempty"`
  9895  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  9896  	Type *string `json:"type,omitempty"`
  9897  }
  9898  
  9899  // MarshalJSON is the custom marshaler for Resource.
  9900  func (r Resource) MarshalJSON() ([]byte, error) {
  9901  	objectMap := make(map[string]interface{})
  9902  	return json.Marshal(objectMap)
  9903  }
  9904  
  9905  // ResourceIdentity ...
  9906  type ResourceIdentity struct {
  9907  	// UserAssignedIdentity - The user assigned managed identity's ARM ID to use when accessing a resource.
  9908  	UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"`
  9909  	// UseSystemAssignedIdentity - Indicates whether to use System Assigned Managed Identity. Mutual exclusive with User Assigned Managed Identity.
  9910  	UseSystemAssignedIdentity *bool `json:"useSystemAssignedIdentity,omitempty"`
  9911  }
  9912  
  9913  // SelectAudioTrackByAttribute select audio tracks from the input by specifying an attribute and an
  9914  // attribute filter.
  9915  type SelectAudioTrackByAttribute struct {
  9916  	// Attribute - The TrackAttribute to filter the tracks by. Possible values include: 'TrackAttributeBitrate', 'TrackAttributeLanguage'
  9917  	Attribute TrackAttribute `json:"attribute,omitempty"`
  9918  	// Filter - The type of AttributeFilter to apply to the TrackAttribute in order to select the tracks. Possible values include: 'AttributeFilterAll', 'AttributeFilterTop', 'AttributeFilterBottom', 'AttributeFilterValueEquals'
  9919  	Filter AttributeFilter `json:"filter,omitempty"`
  9920  	// FilterValue - The value to filter the tracks by.  Only used when AttributeFilter.ValueEquals is specified for the Filter property.
  9921  	FilterValue *string `json:"filterValue,omitempty"`
  9922  	// 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'
  9923  	ChannelMapping ChannelMapping `json:"channelMapping,omitempty"`
  9924  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
  9925  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
  9926  }
  9927  
  9928  // MarshalJSON is the custom marshaler for SelectAudioTrackByAttribute.
  9929  func (satba SelectAudioTrackByAttribute) MarshalJSON() ([]byte, error) {
  9930  	satba.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute
  9931  	objectMap := make(map[string]interface{})
  9932  	if satba.Attribute != "" {
  9933  		objectMap["attribute"] = satba.Attribute
  9934  	}
  9935  	if satba.Filter != "" {
  9936  		objectMap["filter"] = satba.Filter
  9937  	}
  9938  	if satba.FilterValue != nil {
  9939  		objectMap["filterValue"] = satba.FilterValue
  9940  	}
  9941  	if satba.ChannelMapping != "" {
  9942  		objectMap["channelMapping"] = satba.ChannelMapping
  9943  	}
  9944  	if satba.OdataType != "" {
  9945  		objectMap["@odata.type"] = satba.OdataType
  9946  	}
  9947  	return json.Marshal(objectMap)
  9948  }
  9949  
  9950  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9951  func (satba SelectAudioTrackByAttribute) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
  9952  	return nil, false
  9953  }
  9954  
  9955  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9956  func (satba SelectAudioTrackByAttribute) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
  9957  	return &satba, true
  9958  }
  9959  
  9960  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9961  func (satba SelectAudioTrackByAttribute) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
  9962  	return &satba, true
  9963  }
  9964  
  9965  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9966  func (satba SelectAudioTrackByAttribute) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
  9967  	return nil, false
  9968  }
  9969  
  9970  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9971  func (satba SelectAudioTrackByAttribute) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
  9972  	return nil, false
  9973  }
  9974  
  9975  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9976  func (satba SelectAudioTrackByAttribute) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
  9977  	return nil, false
  9978  }
  9979  
  9980  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9981  func (satba SelectAudioTrackByAttribute) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
  9982  	return nil, false
  9983  }
  9984  
  9985  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9986  func (satba SelectAudioTrackByAttribute) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
  9987  	return nil, false
  9988  }
  9989  
  9990  // AsTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9991  func (satba SelectAudioTrackByAttribute) AsTrackDescriptor() (*TrackDescriptor, bool) {
  9992  	return nil, false
  9993  }
  9994  
  9995  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9996  func (satba SelectAudioTrackByAttribute) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
  9997  	return &satba, true
  9998  }
  9999  
 10000  // SelectAudioTrackByID select audio tracks from the input by specifying a track identifier.
 10001  type SelectAudioTrackByID struct {
 10002  	// TrackID - Track identifier to select
 10003  	TrackID *int64 `json:"trackId,omitempty"`
 10004  	// 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'
 10005  	ChannelMapping ChannelMapping `json:"channelMapping,omitempty"`
 10006  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
 10007  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
 10008  }
 10009  
 10010  // MarshalJSON is the custom marshaler for SelectAudioTrackByID.
 10011  func (satbi SelectAudioTrackByID) MarshalJSON() ([]byte, error) {
 10012  	satbi.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID
 10013  	objectMap := make(map[string]interface{})
 10014  	if satbi.TrackID != nil {
 10015  		objectMap["trackId"] = satbi.TrackID
 10016  	}
 10017  	if satbi.ChannelMapping != "" {
 10018  		objectMap["channelMapping"] = satbi.ChannelMapping
 10019  	}
 10020  	if satbi.OdataType != "" {
 10021  		objectMap["@odata.type"] = satbi.OdataType
 10022  	}
 10023  	return json.Marshal(objectMap)
 10024  }
 10025  
 10026  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
 10027  func (satbi SelectAudioTrackByID) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
 10028  	return nil, false
 10029  }
 10030  
 10031  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
 10032  func (satbi SelectAudioTrackByID) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
 10033  	return &satbi, true
 10034  }
 10035  
 10036  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
 10037  func (satbi SelectAudioTrackByID) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
 10038  	return nil, false
 10039  }
 10040  
 10041  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
 10042  func (satbi SelectAudioTrackByID) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
 10043  	return &satbi, true
 10044  }
 10045  
 10046  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
 10047  func (satbi SelectAudioTrackByID) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
 10048  	return nil, false
 10049  }
 10050  
 10051  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
 10052  func (satbi SelectAudioTrackByID) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
 10053  	return nil, false
 10054  }
 10055  
 10056  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
 10057  func (satbi SelectAudioTrackByID) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
 10058  	return nil, false
 10059  }
 10060  
 10061  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
 10062  func (satbi SelectAudioTrackByID) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
 10063  	return nil, false
 10064  }
 10065  
 10066  // AsTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
 10067  func (satbi SelectAudioTrackByID) AsTrackDescriptor() (*TrackDescriptor, bool) {
 10068  	return nil, false
 10069  }
 10070  
 10071  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
 10072  func (satbi SelectAudioTrackByID) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
 10073  	return &satbi, true
 10074  }
 10075  
 10076  // SelectVideoTrackByAttribute select video tracks from the input by specifying an attribute and an
 10077  // attribute filter.
 10078  type SelectVideoTrackByAttribute struct {
 10079  	// Attribute - The TrackAttribute to filter the tracks by. Possible values include: 'TrackAttributeBitrate', 'TrackAttributeLanguage'
 10080  	Attribute TrackAttribute `json:"attribute,omitempty"`
 10081  	// Filter - The type of AttributeFilter to apply to the TrackAttribute in order to select the tracks. Possible values include: 'AttributeFilterAll', 'AttributeFilterTop', 'AttributeFilterBottom', 'AttributeFilterValueEquals'
 10082  	Filter AttributeFilter `json:"filter,omitempty"`
 10083  	// 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.
 10084  	FilterValue *string `json:"filterValue,omitempty"`
 10085  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
 10086  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
 10087  }
 10088  
 10089  // MarshalJSON is the custom marshaler for SelectVideoTrackByAttribute.
 10090  func (svtba SelectVideoTrackByAttribute) MarshalJSON() ([]byte, error) {
 10091  	svtba.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute
 10092  	objectMap := make(map[string]interface{})
 10093  	if svtba.Attribute != "" {
 10094  		objectMap["attribute"] = svtba.Attribute
 10095  	}
 10096  	if svtba.Filter != "" {
 10097  		objectMap["filter"] = svtba.Filter
 10098  	}
 10099  	if svtba.FilterValue != nil {
 10100  		objectMap["filterValue"] = svtba.FilterValue
 10101  	}
 10102  	if svtba.OdataType != "" {
 10103  		objectMap["@odata.type"] = svtba.OdataType
 10104  	}
 10105  	return json.Marshal(objectMap)
 10106  }
 10107  
 10108  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10109  func (svtba SelectVideoTrackByAttribute) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
 10110  	return nil, false
 10111  }
 10112  
 10113  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10114  func (svtba SelectVideoTrackByAttribute) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
 10115  	return nil, false
 10116  }
 10117  
 10118  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10119  func (svtba SelectVideoTrackByAttribute) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
 10120  	return nil, false
 10121  }
 10122  
 10123  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10124  func (svtba SelectVideoTrackByAttribute) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
 10125  	return nil, false
 10126  }
 10127  
 10128  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10129  func (svtba SelectVideoTrackByAttribute) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
 10130  	return nil, false
 10131  }
 10132  
 10133  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10134  func (svtba SelectVideoTrackByAttribute) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
 10135  	return &svtba, true
 10136  }
 10137  
 10138  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10139  func (svtba SelectVideoTrackByAttribute) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
 10140  	return &svtba, true
 10141  }
 10142  
 10143  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10144  func (svtba SelectVideoTrackByAttribute) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
 10145  	return nil, false
 10146  }
 10147  
 10148  // AsTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10149  func (svtba SelectVideoTrackByAttribute) AsTrackDescriptor() (*TrackDescriptor, bool) {
 10150  	return nil, false
 10151  }
 10152  
 10153  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10154  func (svtba SelectVideoTrackByAttribute) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
 10155  	return &svtba, true
 10156  }
 10157  
 10158  // SelectVideoTrackByID select video tracks from the input by specifying a track identifier.
 10159  type SelectVideoTrackByID struct {
 10160  	// TrackID - Track identifier to select
 10161  	TrackID *int64 `json:"trackId,omitempty"`
 10162  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
 10163  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
 10164  }
 10165  
 10166  // MarshalJSON is the custom marshaler for SelectVideoTrackByID.
 10167  func (svtbi SelectVideoTrackByID) MarshalJSON() ([]byte, error) {
 10168  	svtbi.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID
 10169  	objectMap := make(map[string]interface{})
 10170  	if svtbi.TrackID != nil {
 10171  		objectMap["trackId"] = svtbi.TrackID
 10172  	}
 10173  	if svtbi.OdataType != "" {
 10174  		objectMap["@odata.type"] = svtbi.OdataType
 10175  	}
 10176  	return json.Marshal(objectMap)
 10177  }
 10178  
 10179  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10180  func (svtbi SelectVideoTrackByID) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
 10181  	return nil, false
 10182  }
 10183  
 10184  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10185  func (svtbi SelectVideoTrackByID) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
 10186  	return nil, false
 10187  }
 10188  
 10189  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10190  func (svtbi SelectVideoTrackByID) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
 10191  	return nil, false
 10192  }
 10193  
 10194  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10195  func (svtbi SelectVideoTrackByID) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
 10196  	return nil, false
 10197  }
 10198  
 10199  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10200  func (svtbi SelectVideoTrackByID) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
 10201  	return nil, false
 10202  }
 10203  
 10204  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10205  func (svtbi SelectVideoTrackByID) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
 10206  	return &svtbi, true
 10207  }
 10208  
 10209  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10210  func (svtbi SelectVideoTrackByID) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
 10211  	return nil, false
 10212  }
 10213  
 10214  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10215  func (svtbi SelectVideoTrackByID) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
 10216  	return &svtbi, true
 10217  }
 10218  
 10219  // AsTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10220  func (svtbi SelectVideoTrackByID) AsTrackDescriptor() (*TrackDescriptor, bool) {
 10221  	return nil, false
 10222  }
 10223  
 10224  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10225  func (svtbi SelectVideoTrackByID) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
 10226  	return &svtbi, true
 10227  }
 10228  
 10229  // Service a Media Services account.
 10230  type Service struct {
 10231  	autorest.Response `json:"-"`
 10232  	// ServiceProperties - The resource properties.
 10233  	*ServiceProperties `json:"properties,omitempty"`
 10234  	// Identity - The Managed Identity for the Media Services account.
 10235  	Identity *ServiceIdentity `json:"identity,omitempty"`
 10236  	// SystemData - READ-ONLY; The system metadata relating to this resource.
 10237  	SystemData *SystemData `json:"systemData,omitempty"`
 10238  	// Tags - Resource tags.
 10239  	Tags map[string]*string `json:"tags"`
 10240  	// Location - The geo-location where the resource lives
 10241  	Location *string `json:"location,omitempty"`
 10242  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 10243  	ID *string `json:"id,omitempty"`
 10244  	// Name - READ-ONLY; The name of the resource
 10245  	Name *string `json:"name,omitempty"`
 10246  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 10247  	Type *string `json:"type,omitempty"`
 10248  }
 10249  
 10250  // MarshalJSON is the custom marshaler for Service.
 10251  func (s Service) MarshalJSON() ([]byte, error) {
 10252  	objectMap := make(map[string]interface{})
 10253  	if s.ServiceProperties != nil {
 10254  		objectMap["properties"] = s.ServiceProperties
 10255  	}
 10256  	if s.Identity != nil {
 10257  		objectMap["identity"] = s.Identity
 10258  	}
 10259  	if s.Tags != nil {
 10260  		objectMap["tags"] = s.Tags
 10261  	}
 10262  	if s.Location != nil {
 10263  		objectMap["location"] = s.Location
 10264  	}
 10265  	return json.Marshal(objectMap)
 10266  }
 10267  
 10268  // UnmarshalJSON is the custom unmarshaler for Service struct.
 10269  func (s *Service) UnmarshalJSON(body []byte) error {
 10270  	var m map[string]*json.RawMessage
 10271  	err := json.Unmarshal(body, &m)
 10272  	if err != nil {
 10273  		return err
 10274  	}
 10275  	for k, v := range m {
 10276  		switch k {
 10277  		case "properties":
 10278  			if v != nil {
 10279  				var serviceProperties ServiceProperties
 10280  				err = json.Unmarshal(*v, &serviceProperties)
 10281  				if err != nil {
 10282  					return err
 10283  				}
 10284  				s.ServiceProperties = &serviceProperties
 10285  			}
 10286  		case "identity":
 10287  			if v != nil {
 10288  				var identity ServiceIdentity
 10289  				err = json.Unmarshal(*v, &identity)
 10290  				if err != nil {
 10291  					return err
 10292  				}
 10293  				s.Identity = &identity
 10294  			}
 10295  		case "systemData":
 10296  			if v != nil {
 10297  				var systemData SystemData
 10298  				err = json.Unmarshal(*v, &systemData)
 10299  				if err != nil {
 10300  					return err
 10301  				}
 10302  				s.SystemData = &systemData
 10303  			}
 10304  		case "tags":
 10305  			if v != nil {
 10306  				var tags map[string]*string
 10307  				err = json.Unmarshal(*v, &tags)
 10308  				if err != nil {
 10309  					return err
 10310  				}
 10311  				s.Tags = tags
 10312  			}
 10313  		case "location":
 10314  			if v != nil {
 10315  				var location string
 10316  				err = json.Unmarshal(*v, &location)
 10317  				if err != nil {
 10318  					return err
 10319  				}
 10320  				s.Location = &location
 10321  			}
 10322  		case "id":
 10323  			if v != nil {
 10324  				var ID string
 10325  				err = json.Unmarshal(*v, &ID)
 10326  				if err != nil {
 10327  					return err
 10328  				}
 10329  				s.ID = &ID
 10330  			}
 10331  		case "name":
 10332  			if v != nil {
 10333  				var name string
 10334  				err = json.Unmarshal(*v, &name)
 10335  				if err != nil {
 10336  					return err
 10337  				}
 10338  				s.Name = &name
 10339  			}
 10340  		case "type":
 10341  			if v != nil {
 10342  				var typeVar string
 10343  				err = json.Unmarshal(*v, &typeVar)
 10344  				if err != nil {
 10345  					return err
 10346  				}
 10347  				s.Type = &typeVar
 10348  			}
 10349  		}
 10350  	}
 10351  
 10352  	return nil
 10353  }
 10354  
 10355  // ServiceCollection a collection of MediaService items.
 10356  type ServiceCollection struct {
 10357  	autorest.Response `json:"-"`
 10358  	// Value - A collection of MediaService items.
 10359  	Value *[]Service `json:"value,omitempty"`
 10360  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
 10361  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
 10362  }
 10363  
 10364  // ServiceCollectionIterator provides access to a complete listing of Service values.
 10365  type ServiceCollectionIterator struct {
 10366  	i    int
 10367  	page ServiceCollectionPage
 10368  }
 10369  
 10370  // NextWithContext advances to the next value.  If there was an error making
 10371  // the request the iterator does not advance and the error is returned.
 10372  func (iter *ServiceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
 10373  	if tracing.IsEnabled() {
 10374  		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceCollectionIterator.NextWithContext")
 10375  		defer func() {
 10376  			sc := -1
 10377  			if iter.Response().Response.Response != nil {
 10378  				sc = iter.Response().Response.Response.StatusCode
 10379  			}
 10380  			tracing.EndSpan(ctx, sc, err)
 10381  		}()
 10382  	}
 10383  	iter.i++
 10384  	if iter.i < len(iter.page.Values()) {
 10385  		return nil
 10386  	}
 10387  	err = iter.page.NextWithContext(ctx)
 10388  	if err != nil {
 10389  		iter.i--
 10390  		return err
 10391  	}
 10392  	iter.i = 0
 10393  	return nil
 10394  }
 10395  
 10396  // Next advances to the next value.  If there was an error making
 10397  // the request the iterator does not advance and the error is returned.
 10398  // Deprecated: Use NextWithContext() instead.
 10399  func (iter *ServiceCollectionIterator) Next() error {
 10400  	return iter.NextWithContext(context.Background())
 10401  }
 10402  
 10403  // NotDone returns true if the enumeration should be started or is not yet complete.
 10404  func (iter ServiceCollectionIterator) NotDone() bool {
 10405  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
 10406  }
 10407  
 10408  // Response returns the raw server response from the last page request.
 10409  func (iter ServiceCollectionIterator) Response() ServiceCollection {
 10410  	return iter.page.Response()
 10411  }
 10412  
 10413  // Value returns the current value or a zero-initialized value if the
 10414  // iterator has advanced beyond the end of the collection.
 10415  func (iter ServiceCollectionIterator) Value() Service {
 10416  	if !iter.page.NotDone() {
 10417  		return Service{}
 10418  	}
 10419  	return iter.page.Values()[iter.i]
 10420  }
 10421  
 10422  // Creates a new instance of the ServiceCollectionIterator type.
 10423  func NewServiceCollectionIterator(page ServiceCollectionPage) ServiceCollectionIterator {
 10424  	return ServiceCollectionIterator{page: page}
 10425  }
 10426  
 10427  // IsEmpty returns true if the ListResult contains no values.
 10428  func (sc ServiceCollection) IsEmpty() bool {
 10429  	return sc.Value == nil || len(*sc.Value) == 0
 10430  }
 10431  
 10432  // hasNextLink returns true if the NextLink is not empty.
 10433  func (sc ServiceCollection) hasNextLink() bool {
 10434  	return sc.OdataNextLink != nil && len(*sc.OdataNextLink) != 0
 10435  }
 10436  
 10437  // serviceCollectionPreparer prepares a request to retrieve the next set of results.
 10438  // It returns nil if no more results exist.
 10439  func (sc ServiceCollection) serviceCollectionPreparer(ctx context.Context) (*http.Request, error) {
 10440  	if !sc.hasNextLink() {
 10441  		return nil, nil
 10442  	}
 10443  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
 10444  		autorest.AsJSON(),
 10445  		autorest.AsGet(),
 10446  		autorest.WithBaseURL(to.String(sc.OdataNextLink)))
 10447  }
 10448  
 10449  // ServiceCollectionPage contains a page of Service values.
 10450  type ServiceCollectionPage struct {
 10451  	fn func(context.Context, ServiceCollection) (ServiceCollection, error)
 10452  	sc ServiceCollection
 10453  }
 10454  
 10455  // NextWithContext advances to the next page of values.  If there was an error making
 10456  // the request the page does not advance and the error is returned.
 10457  func (page *ServiceCollectionPage) NextWithContext(ctx context.Context) (err error) {
 10458  	if tracing.IsEnabled() {
 10459  		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceCollectionPage.NextWithContext")
 10460  		defer func() {
 10461  			sc := -1
 10462  			if page.Response().Response.Response != nil {
 10463  				sc = page.Response().Response.Response.StatusCode
 10464  			}
 10465  			tracing.EndSpan(ctx, sc, err)
 10466  		}()
 10467  	}
 10468  	for {
 10469  		next, err := page.fn(ctx, page.sc)
 10470  		if err != nil {
 10471  			return err
 10472  		}
 10473  		page.sc = next
 10474  		if !next.hasNextLink() || !next.IsEmpty() {
 10475  			break
 10476  		}
 10477  	}
 10478  	return nil
 10479  }
 10480  
 10481  // Next advances to the next page of values.  If there was an error making
 10482  // the request the page does not advance and the error is returned.
 10483  // Deprecated: Use NextWithContext() instead.
 10484  func (page *ServiceCollectionPage) Next() error {
 10485  	return page.NextWithContext(context.Background())
 10486  }
 10487  
 10488  // NotDone returns true if the page enumeration should be started or is not yet complete.
 10489  func (page ServiceCollectionPage) NotDone() bool {
 10490  	return !page.sc.IsEmpty()
 10491  }
 10492  
 10493  // Response returns the raw server response from the last page request.
 10494  func (page ServiceCollectionPage) Response() ServiceCollection {
 10495  	return page.sc
 10496  }
 10497  
 10498  // Values returns the slice of values for the current page or nil if there are no values.
 10499  func (page ServiceCollectionPage) Values() []Service {
 10500  	if page.sc.IsEmpty() {
 10501  		return nil
 10502  	}
 10503  	return *page.sc.Value
 10504  }
 10505  
 10506  // Creates a new instance of the ServiceCollectionPage type.
 10507  func NewServiceCollectionPage(cur ServiceCollection, getNextPage func(context.Context, ServiceCollection) (ServiceCollection, error)) ServiceCollectionPage {
 10508  	return ServiceCollectionPage{
 10509  		fn: getNextPage,
 10510  		sc: cur,
 10511  	}
 10512  }
 10513  
 10514  // ServiceIdentity ...
 10515  type ServiceIdentity struct {
 10516  	// Type - The identity type.
 10517  	Type *string `json:"type,omitempty"`
 10518  	// PrincipalID - READ-ONLY; The Principal ID of the identity.
 10519  	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
 10520  	// TenantID - READ-ONLY; The Tenant ID of the identity.
 10521  	TenantID *uuid.UUID `json:"tenantId,omitempty"`
 10522  	// UserAssignedIdentities - The user assigned managed identities.
 10523  	UserAssignedIdentities map[string]*UserAssignedManagedIdentity `json:"userAssignedIdentities"`
 10524  }
 10525  
 10526  // MarshalJSON is the custom marshaler for ServiceIdentity.
 10527  func (si ServiceIdentity) MarshalJSON() ([]byte, error) {
 10528  	objectMap := make(map[string]interface{})
 10529  	if si.Type != nil {
 10530  		objectMap["type"] = si.Type
 10531  	}
 10532  	if si.UserAssignedIdentities != nil {
 10533  		objectMap["userAssignedIdentities"] = si.UserAssignedIdentities
 10534  	}
 10535  	return json.Marshal(objectMap)
 10536  }
 10537  
 10538  // ServiceProperties properties of the Media Services account.
 10539  type ServiceProperties struct {
 10540  	// MediaServiceID - READ-ONLY; The Media Services account ID.
 10541  	MediaServiceID *uuid.UUID `json:"mediaServiceId,omitempty"`
 10542  	// StorageAccounts - The storage accounts for this resource.
 10543  	StorageAccounts *[]StorageAccount `json:"storageAccounts,omitempty"`
 10544  	// StorageAuthentication - Possible values include: 'StorageAuthenticationSystem', 'StorageAuthenticationManagedIdentity'
 10545  	StorageAuthentication StorageAuthentication `json:"storageAuthentication,omitempty"`
 10546  	// Encryption - The account encryption properties.
 10547  	Encryption *AccountEncryption `json:"encryption,omitempty"`
 10548  	// KeyDelivery - The Key Delivery properties for Media Services account.
 10549  	KeyDelivery *KeyDelivery `json:"keyDelivery,omitempty"`
 10550  	// PublicNetworkAccess - Whether or not public network access is allowed for resources under the Media Services account. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled'
 10551  	PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
 10552  }
 10553  
 10554  // MarshalJSON is the custom marshaler for ServiceProperties.
 10555  func (sp ServiceProperties) MarshalJSON() ([]byte, error) {
 10556  	objectMap := make(map[string]interface{})
 10557  	if sp.StorageAccounts != nil {
 10558  		objectMap["storageAccounts"] = sp.StorageAccounts
 10559  	}
 10560  	if sp.StorageAuthentication != "" {
 10561  		objectMap["storageAuthentication"] = sp.StorageAuthentication
 10562  	}
 10563  	if sp.Encryption != nil {
 10564  		objectMap["encryption"] = sp.Encryption
 10565  	}
 10566  	if sp.KeyDelivery != nil {
 10567  		objectMap["keyDelivery"] = sp.KeyDelivery
 10568  	}
 10569  	if sp.PublicNetworkAccess != "" {
 10570  		objectMap["publicNetworkAccess"] = sp.PublicNetworkAccess
 10571  	}
 10572  	return json.Marshal(objectMap)
 10573  }
 10574  
 10575  // ServiceSpecification the service metric specifications.
 10576  type ServiceSpecification struct {
 10577  	// LogSpecifications - READ-ONLY; List of log specifications.
 10578  	LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"`
 10579  	// MetricSpecifications - READ-ONLY; List of metric specifications.
 10580  	MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"`
 10581  }
 10582  
 10583  // MarshalJSON is the custom marshaler for ServiceSpecification.
 10584  func (ss ServiceSpecification) MarshalJSON() ([]byte, error) {
 10585  	objectMap := make(map[string]interface{})
 10586  	return json.Marshal(objectMap)
 10587  }
 10588  
 10589  // ServiceUpdate a Media Services account update.
 10590  type ServiceUpdate struct {
 10591  	// Tags - Resource tags.
 10592  	Tags map[string]*string `json:"tags"`
 10593  	// ServiceProperties - The resource properties.
 10594  	*ServiceProperties `json:"properties,omitempty"`
 10595  	// Identity - The Managed Identity for the Media Services account.
 10596  	Identity *ServiceIdentity `json:"identity,omitempty"`
 10597  }
 10598  
 10599  // MarshalJSON is the custom marshaler for ServiceUpdate.
 10600  func (su ServiceUpdate) MarshalJSON() ([]byte, error) {
 10601  	objectMap := make(map[string]interface{})
 10602  	if su.Tags != nil {
 10603  		objectMap["tags"] = su.Tags
 10604  	}
 10605  	if su.ServiceProperties != nil {
 10606  		objectMap["properties"] = su.ServiceProperties
 10607  	}
 10608  	if su.Identity != nil {
 10609  		objectMap["identity"] = su.Identity
 10610  	}
 10611  	return json.Marshal(objectMap)
 10612  }
 10613  
 10614  // UnmarshalJSON is the custom unmarshaler for ServiceUpdate struct.
 10615  func (su *ServiceUpdate) UnmarshalJSON(body []byte) error {
 10616  	var m map[string]*json.RawMessage
 10617  	err := json.Unmarshal(body, &m)
 10618  	if err != nil {
 10619  		return err
 10620  	}
 10621  	for k, v := range m {
 10622  		switch k {
 10623  		case "tags":
 10624  			if v != nil {
 10625  				var tags map[string]*string
 10626  				err = json.Unmarshal(*v, &tags)
 10627  				if err != nil {
 10628  					return err
 10629  				}
 10630  				su.Tags = tags
 10631  			}
 10632  		case "properties":
 10633  			if v != nil {
 10634  				var serviceProperties ServiceProperties
 10635  				err = json.Unmarshal(*v, &serviceProperties)
 10636  				if err != nil {
 10637  					return err
 10638  				}
 10639  				su.ServiceProperties = &serviceProperties
 10640  			}
 10641  		case "identity":
 10642  			if v != nil {
 10643  				var identity ServiceIdentity
 10644  				err = json.Unmarshal(*v, &identity)
 10645  				if err != nil {
 10646  					return err
 10647  				}
 10648  				su.Identity = &identity
 10649  			}
 10650  		}
 10651  	}
 10652  
 10653  	return nil
 10654  }
 10655  
 10656  // StandardEncoderPreset describes all the settings to be used when encoding the input video with the
 10657  // Standard Encoder.
 10658  type StandardEncoderPreset struct {
 10659  	// Filters - One or more filtering operations that are applied to the input media before encoding.
 10660  	Filters *Filters `json:"filters,omitempty"`
 10661  	// Codecs - The list of codecs to be used when encoding the input video.
 10662  	Codecs *[]BasicCodec `json:"codecs,omitempty"`
 10663  	// Formats - The list of outputs to be produced by the encoder.
 10664  	Formats *[]BasicFormat `json:"formats,omitempty"`
 10665  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
 10666  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
 10667  }
 10668  
 10669  // MarshalJSON is the custom marshaler for StandardEncoderPreset.
 10670  func (sep StandardEncoderPreset) MarshalJSON() ([]byte, error) {
 10671  	sep.OdataType = OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset
 10672  	objectMap := make(map[string]interface{})
 10673  	if sep.Filters != nil {
 10674  		objectMap["filters"] = sep.Filters
 10675  	}
 10676  	if sep.Codecs != nil {
 10677  		objectMap["codecs"] = sep.Codecs
 10678  	}
 10679  	if sep.Formats != nil {
 10680  		objectMap["formats"] = sep.Formats
 10681  	}
 10682  	if sep.OdataType != "" {
 10683  		objectMap["@odata.type"] = sep.OdataType
 10684  	}
 10685  	return json.Marshal(objectMap)
 10686  }
 10687  
 10688  // AsFaceDetectorPreset is the BasicPreset implementation for StandardEncoderPreset.
 10689  func (sep StandardEncoderPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
 10690  	return nil, false
 10691  }
 10692  
 10693  // AsAudioAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset.
 10694  func (sep StandardEncoderPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
 10695  	return nil, false
 10696  }
 10697  
 10698  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset.
 10699  func (sep StandardEncoderPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
 10700  	return nil, false
 10701  }
 10702  
 10703  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for StandardEncoderPreset.
 10704  func (sep StandardEncoderPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
 10705  	return nil, false
 10706  }
 10707  
 10708  // AsStandardEncoderPreset is the BasicPreset implementation for StandardEncoderPreset.
 10709  func (sep StandardEncoderPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
 10710  	return &sep, true
 10711  }
 10712  
 10713  // AsVideoAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset.
 10714  func (sep StandardEncoderPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
 10715  	return nil, false
 10716  }
 10717  
 10718  // AsPreset is the BasicPreset implementation for StandardEncoderPreset.
 10719  func (sep StandardEncoderPreset) AsPreset() (*Preset, bool) {
 10720  	return nil, false
 10721  }
 10722  
 10723  // AsBasicPreset is the BasicPreset implementation for StandardEncoderPreset.
 10724  func (sep StandardEncoderPreset) AsBasicPreset() (BasicPreset, bool) {
 10725  	return &sep, true
 10726  }
 10727  
 10728  // UnmarshalJSON is the custom unmarshaler for StandardEncoderPreset struct.
 10729  func (sep *StandardEncoderPreset) UnmarshalJSON(body []byte) error {
 10730  	var m map[string]*json.RawMessage
 10731  	err := json.Unmarshal(body, &m)
 10732  	if err != nil {
 10733  		return err
 10734  	}
 10735  	for k, v := range m {
 10736  		switch k {
 10737  		case "filters":
 10738  			if v != nil {
 10739  				var filters Filters
 10740  				err = json.Unmarshal(*v, &filters)
 10741  				if err != nil {
 10742  					return err
 10743  				}
 10744  				sep.Filters = &filters
 10745  			}
 10746  		case "codecs":
 10747  			if v != nil {
 10748  				codecs, err := unmarshalBasicCodecArray(*v)
 10749  				if err != nil {
 10750  					return err
 10751  				}
 10752  				sep.Codecs = &codecs
 10753  			}
 10754  		case "formats":
 10755  			if v != nil {
 10756  				formats, err := unmarshalBasicFormatArray(*v)
 10757  				if err != nil {
 10758  					return err
 10759  				}
 10760  				sep.Formats = &formats
 10761  			}
 10762  		case "@odata.type":
 10763  			if v != nil {
 10764  				var odataType OdataTypeBasicPreset
 10765  				err = json.Unmarshal(*v, &odataType)
 10766  				if err != nil {
 10767  					return err
 10768  				}
 10769  				sep.OdataType = odataType
 10770  			}
 10771  		}
 10772  	}
 10773  
 10774  	return nil
 10775  }
 10776  
 10777  // StorageAccount the storage account details.
 10778  type StorageAccount struct {
 10779  	// 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.
 10780  	ID *string `json:"id,omitempty"`
 10781  	// Type - The type of the storage account. Possible values include: 'StorageAccountTypePrimary', 'StorageAccountTypeSecondary'
 10782  	Type StorageAccountType `json:"type,omitempty"`
 10783  	// Identity - The storage account identity.
 10784  	Identity *ResourceIdentity `json:"identity,omitempty"`
 10785  	// Status - READ-ONLY; The current status of the storage account mapping.
 10786  	Status *string `json:"status,omitempty"`
 10787  }
 10788  
 10789  // MarshalJSON is the custom marshaler for StorageAccount.
 10790  func (sa StorageAccount) MarshalJSON() ([]byte, error) {
 10791  	objectMap := make(map[string]interface{})
 10792  	if sa.ID != nil {
 10793  		objectMap["id"] = sa.ID
 10794  	}
 10795  	if sa.Type != "" {
 10796  		objectMap["type"] = sa.Type
 10797  	}
 10798  	if sa.Identity != nil {
 10799  		objectMap["identity"] = sa.Identity
 10800  	}
 10801  	return json.Marshal(objectMap)
 10802  }
 10803  
 10804  // StorageEncryptedAssetDecryptionData data needed to decrypt asset files encrypted with legacy storage
 10805  // encryption.
 10806  type StorageEncryptedAssetDecryptionData struct {
 10807  	autorest.Response `json:"-"`
 10808  	// Key - The Asset File storage encryption key.
 10809  	Key *[]byte `json:"key,omitempty"`
 10810  	// AssetFileEncryptionMetadata - Asset File encryption metadata.
 10811  	AssetFileEncryptionMetadata *[]AssetFileEncryptionMetadata `json:"assetFileEncryptionMetadata,omitempty"`
 10812  }
 10813  
 10814  // StreamingEndpoint the streaming endpoint.
 10815  type StreamingEndpoint struct {
 10816  	autorest.Response `json:"-"`
 10817  	// StreamingEndpointProperties - The streaming endpoint properties.
 10818  	*StreamingEndpointProperties `json:"properties,omitempty"`
 10819  	// SystemData - READ-ONLY; The system metadata relating to this resource.
 10820  	SystemData *SystemData `json:"systemData,omitempty"`
 10821  	// Tags - Resource tags.
 10822  	Tags map[string]*string `json:"tags"`
 10823  	// Location - The geo-location where the resource lives
 10824  	Location *string `json:"location,omitempty"`
 10825  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 10826  	ID *string `json:"id,omitempty"`
 10827  	// Name - READ-ONLY; The name of the resource
 10828  	Name *string `json:"name,omitempty"`
 10829  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 10830  	Type *string `json:"type,omitempty"`
 10831  }
 10832  
 10833  // MarshalJSON is the custom marshaler for StreamingEndpoint.
 10834  func (se StreamingEndpoint) MarshalJSON() ([]byte, error) {
 10835  	objectMap := make(map[string]interface{})
 10836  	if se.StreamingEndpointProperties != nil {
 10837  		objectMap["properties"] = se.StreamingEndpointProperties
 10838  	}
 10839  	if se.Tags != nil {
 10840  		objectMap["tags"] = se.Tags
 10841  	}
 10842  	if se.Location != nil {
 10843  		objectMap["location"] = se.Location
 10844  	}
 10845  	return json.Marshal(objectMap)
 10846  }
 10847  
 10848  // UnmarshalJSON is the custom unmarshaler for StreamingEndpoint struct.
 10849  func (se *StreamingEndpoint) UnmarshalJSON(body []byte) error {
 10850  	var m map[string]*json.RawMessage
 10851  	err := json.Unmarshal(body, &m)
 10852  	if err != nil {
 10853  		return err
 10854  	}
 10855  	for k, v := range m {
 10856  		switch k {
 10857  		case "properties":
 10858  			if v != nil {
 10859  				var streamingEndpointProperties StreamingEndpointProperties
 10860  				err = json.Unmarshal(*v, &streamingEndpointProperties)
 10861  				if err != nil {
 10862  					return err
 10863  				}
 10864  				se.StreamingEndpointProperties = &streamingEndpointProperties
 10865  			}
 10866  		case "systemData":
 10867  			if v != nil {
 10868  				var systemData SystemData
 10869  				err = json.Unmarshal(*v, &systemData)
 10870  				if err != nil {
 10871  					return err
 10872  				}
 10873  				se.SystemData = &systemData
 10874  			}
 10875  		case "tags":
 10876  			if v != nil {
 10877  				var tags map[string]*string
 10878  				err = json.Unmarshal(*v, &tags)
 10879  				if err != nil {
 10880  					return err
 10881  				}
 10882  				se.Tags = tags
 10883  			}
 10884  		case "location":
 10885  			if v != nil {
 10886  				var location string
 10887  				err = json.Unmarshal(*v, &location)
 10888  				if err != nil {
 10889  					return err
 10890  				}
 10891  				se.Location = &location
 10892  			}
 10893  		case "id":
 10894  			if v != nil {
 10895  				var ID string
 10896  				err = json.Unmarshal(*v, &ID)
 10897  				if err != nil {
 10898  					return err
 10899  				}
 10900  				se.ID = &ID
 10901  			}
 10902  		case "name":
 10903  			if v != nil {
 10904  				var name string
 10905  				err = json.Unmarshal(*v, &name)
 10906  				if err != nil {
 10907  					return err
 10908  				}
 10909  				se.Name = &name
 10910  			}
 10911  		case "type":
 10912  			if v != nil {
 10913  				var typeVar string
 10914  				err = json.Unmarshal(*v, &typeVar)
 10915  				if err != nil {
 10916  					return err
 10917  				}
 10918  				se.Type = &typeVar
 10919  			}
 10920  		}
 10921  	}
 10922  
 10923  	return nil
 10924  }
 10925  
 10926  // StreamingEndpointAccessControl streaming endpoint access control definition.
 10927  type StreamingEndpointAccessControl struct {
 10928  	// Akamai - The access control of Akamai
 10929  	Akamai *AkamaiAccessControl `json:"akamai,omitempty"`
 10930  	// IP - The IP access control of the streaming endpoint.
 10931  	IP *IPAccessControl `json:"ip,omitempty"`
 10932  }
 10933  
 10934  // StreamingEndpointListResult the streaming endpoint list result.
 10935  type StreamingEndpointListResult struct {
 10936  	autorest.Response `json:"-"`
 10937  	// Value - The result of the List StreamingEndpoint operation.
 10938  	Value *[]StreamingEndpoint `json:"value,omitempty"`
 10939  	// OdataCount - The number of result.
 10940  	OdataCount *int32 `json:"@odata.count,omitempty"`
 10941  	// OdataNextLink - The link to the next set of results. Not empty if value contains incomplete list of streaming endpoints.
 10942  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
 10943  }
 10944  
 10945  // StreamingEndpointListResultIterator provides access to a complete listing of StreamingEndpoint values.
 10946  type StreamingEndpointListResultIterator struct {
 10947  	i    int
 10948  	page StreamingEndpointListResultPage
 10949  }
 10950  
 10951  // NextWithContext advances to the next value.  If there was an error making
 10952  // the request the iterator does not advance and the error is returned.
 10953  func (iter *StreamingEndpointListResultIterator) NextWithContext(ctx context.Context) (err error) {
 10954  	if tracing.IsEnabled() {
 10955  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingEndpointListResultIterator.NextWithContext")
 10956  		defer func() {
 10957  			sc := -1
 10958  			if iter.Response().Response.Response != nil {
 10959  				sc = iter.Response().Response.Response.StatusCode
 10960  			}
 10961  			tracing.EndSpan(ctx, sc, err)
 10962  		}()
 10963  	}
 10964  	iter.i++
 10965  	if iter.i < len(iter.page.Values()) {
 10966  		return nil
 10967  	}
 10968  	err = iter.page.NextWithContext(ctx)
 10969  	if err != nil {
 10970  		iter.i--
 10971  		return err
 10972  	}
 10973  	iter.i = 0
 10974  	return nil
 10975  }
 10976  
 10977  // Next advances to the next value.  If there was an error making
 10978  // the request the iterator does not advance and the error is returned.
 10979  // Deprecated: Use NextWithContext() instead.
 10980  func (iter *StreamingEndpointListResultIterator) Next() error {
 10981  	return iter.NextWithContext(context.Background())
 10982  }
 10983  
 10984  // NotDone returns true if the enumeration should be started or is not yet complete.
 10985  func (iter StreamingEndpointListResultIterator) NotDone() bool {
 10986  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
 10987  }
 10988  
 10989  // Response returns the raw server response from the last page request.
 10990  func (iter StreamingEndpointListResultIterator) Response() StreamingEndpointListResult {
 10991  	return iter.page.Response()
 10992  }
 10993  
 10994  // Value returns the current value or a zero-initialized value if the
 10995  // iterator has advanced beyond the end of the collection.
 10996  func (iter StreamingEndpointListResultIterator) Value() StreamingEndpoint {
 10997  	if !iter.page.NotDone() {
 10998  		return StreamingEndpoint{}
 10999  	}
 11000  	return iter.page.Values()[iter.i]
 11001  }
 11002  
 11003  // Creates a new instance of the StreamingEndpointListResultIterator type.
 11004  func NewStreamingEndpointListResultIterator(page StreamingEndpointListResultPage) StreamingEndpointListResultIterator {
 11005  	return StreamingEndpointListResultIterator{page: page}
 11006  }
 11007  
 11008  // IsEmpty returns true if the ListResult contains no values.
 11009  func (selr StreamingEndpointListResult) IsEmpty() bool {
 11010  	return selr.Value == nil || len(*selr.Value) == 0
 11011  }
 11012  
 11013  // hasNextLink returns true if the NextLink is not empty.
 11014  func (selr StreamingEndpointListResult) hasNextLink() bool {
 11015  	return selr.OdataNextLink != nil && len(*selr.OdataNextLink) != 0
 11016  }
 11017  
 11018  // streamingEndpointListResultPreparer prepares a request to retrieve the next set of results.
 11019  // It returns nil if no more results exist.
 11020  func (selr StreamingEndpointListResult) streamingEndpointListResultPreparer(ctx context.Context) (*http.Request, error) {
 11021  	if !selr.hasNextLink() {
 11022  		return nil, nil
 11023  	}
 11024  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
 11025  		autorest.AsJSON(),
 11026  		autorest.AsGet(),
 11027  		autorest.WithBaseURL(to.String(selr.OdataNextLink)))
 11028  }
 11029  
 11030  // StreamingEndpointListResultPage contains a page of StreamingEndpoint values.
 11031  type StreamingEndpointListResultPage struct {
 11032  	fn   func(context.Context, StreamingEndpointListResult) (StreamingEndpointListResult, error)
 11033  	selr StreamingEndpointListResult
 11034  }
 11035  
 11036  // NextWithContext advances to the next page of values.  If there was an error making
 11037  // the request the page does not advance and the error is returned.
 11038  func (page *StreamingEndpointListResultPage) NextWithContext(ctx context.Context) (err error) {
 11039  	if tracing.IsEnabled() {
 11040  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingEndpointListResultPage.NextWithContext")
 11041  		defer func() {
 11042  			sc := -1
 11043  			if page.Response().Response.Response != nil {
 11044  				sc = page.Response().Response.Response.StatusCode
 11045  			}
 11046  			tracing.EndSpan(ctx, sc, err)
 11047  		}()
 11048  	}
 11049  	for {
 11050  		next, err := page.fn(ctx, page.selr)
 11051  		if err != nil {
 11052  			return err
 11053  		}
 11054  		page.selr = next
 11055  		if !next.hasNextLink() || !next.IsEmpty() {
 11056  			break
 11057  		}
 11058  	}
 11059  	return nil
 11060  }
 11061  
 11062  // Next advances to the next page of values.  If there was an error making
 11063  // the request the page does not advance and the error is returned.
 11064  // Deprecated: Use NextWithContext() instead.
 11065  func (page *StreamingEndpointListResultPage) Next() error {
 11066  	return page.NextWithContext(context.Background())
 11067  }
 11068  
 11069  // NotDone returns true if the page enumeration should be started or is not yet complete.
 11070  func (page StreamingEndpointListResultPage) NotDone() bool {
 11071  	return !page.selr.IsEmpty()
 11072  }
 11073  
 11074  // Response returns the raw server response from the last page request.
 11075  func (page StreamingEndpointListResultPage) Response() StreamingEndpointListResult {
 11076  	return page.selr
 11077  }
 11078  
 11079  // Values returns the slice of values for the current page or nil if there are no values.
 11080  func (page StreamingEndpointListResultPage) Values() []StreamingEndpoint {
 11081  	if page.selr.IsEmpty() {
 11082  		return nil
 11083  	}
 11084  	return *page.selr.Value
 11085  }
 11086  
 11087  // Creates a new instance of the StreamingEndpointListResultPage type.
 11088  func NewStreamingEndpointListResultPage(cur StreamingEndpointListResult, getNextPage func(context.Context, StreamingEndpointListResult) (StreamingEndpointListResult, error)) StreamingEndpointListResultPage {
 11089  	return StreamingEndpointListResultPage{
 11090  		fn:   getNextPage,
 11091  		selr: cur,
 11092  	}
 11093  }
 11094  
 11095  // StreamingEndpointProperties the streaming endpoint properties.
 11096  type StreamingEndpointProperties struct {
 11097  	// Description - The streaming endpoint description.
 11098  	Description *string `json:"description,omitempty"`
 11099  	// ScaleUnits - The number of scale units. Use the Scale operation to adjust this value.
 11100  	ScaleUnits *int32 `json:"scaleUnits,omitempty"`
 11101  	// AvailabilitySetName - This feature is deprecated, do not set a value for this property.
 11102  	AvailabilitySetName *string `json:"availabilitySetName,omitempty"`
 11103  	// AccessControl - The access control definition of the streaming endpoint.
 11104  	AccessControl *StreamingEndpointAccessControl `json:"accessControl,omitempty"`
 11105  	// MaxCacheAge - Max cache age
 11106  	MaxCacheAge *int64 `json:"maxCacheAge,omitempty"`
 11107  	// CustomHostNames - The custom host names of the streaming endpoint
 11108  	CustomHostNames *[]string `json:"customHostNames,omitempty"`
 11109  	// HostName - READ-ONLY; The streaming endpoint host name.
 11110  	HostName *string `json:"hostName,omitempty"`
 11111  	// CdnEnabled - The CDN enabled flag.
 11112  	CdnEnabled *bool `json:"cdnEnabled,omitempty"`
 11113  	// CdnProvider - The CDN provider name.
 11114  	CdnProvider *string `json:"cdnProvider,omitempty"`
 11115  	// CdnProfile - The CDN profile name.
 11116  	CdnProfile *string `json:"cdnProfile,omitempty"`
 11117  	// ProvisioningState - READ-ONLY; The provisioning state of the streaming endpoint.
 11118  	ProvisioningState *string `json:"provisioningState,omitempty"`
 11119  	// ResourceState - READ-ONLY; The resource state of the streaming endpoint. Possible values include: 'StreamingEndpointResourceStateStopped', 'StreamingEndpointResourceStateStarting', 'StreamingEndpointResourceStateRunning', 'StreamingEndpointResourceStateStopping', 'StreamingEndpointResourceStateDeleting', 'StreamingEndpointResourceStateScaling'
 11120  	ResourceState StreamingEndpointResourceState `json:"resourceState,omitempty"`
 11121  	// CrossSiteAccessPolicies - The streaming endpoint access policies.
 11122  	CrossSiteAccessPolicies *CrossSiteAccessPolicies `json:"crossSiteAccessPolicies,omitempty"`
 11123  	// FreeTrialEndTime - READ-ONLY; The free trial expiration time.
 11124  	FreeTrialEndTime *date.Time `json:"freeTrialEndTime,omitempty"`
 11125  	// Created - READ-ONLY; The exact time the streaming endpoint was created.
 11126  	Created *date.Time `json:"created,omitempty"`
 11127  	// LastModified - READ-ONLY; The exact time the streaming endpoint was last modified.
 11128  	LastModified *date.Time `json:"lastModified,omitempty"`
 11129  }
 11130  
 11131  // MarshalJSON is the custom marshaler for StreamingEndpointProperties.
 11132  func (sep StreamingEndpointProperties) MarshalJSON() ([]byte, error) {
 11133  	objectMap := make(map[string]interface{})
 11134  	if sep.Description != nil {
 11135  		objectMap["description"] = sep.Description
 11136  	}
 11137  	if sep.ScaleUnits != nil {
 11138  		objectMap["scaleUnits"] = sep.ScaleUnits
 11139  	}
 11140  	if sep.AvailabilitySetName != nil {
 11141  		objectMap["availabilitySetName"] = sep.AvailabilitySetName
 11142  	}
 11143  	if sep.AccessControl != nil {
 11144  		objectMap["accessControl"] = sep.AccessControl
 11145  	}
 11146  	if sep.MaxCacheAge != nil {
 11147  		objectMap["maxCacheAge"] = sep.MaxCacheAge
 11148  	}
 11149  	if sep.CustomHostNames != nil {
 11150  		objectMap["customHostNames"] = sep.CustomHostNames
 11151  	}
 11152  	if sep.CdnEnabled != nil {
 11153  		objectMap["cdnEnabled"] = sep.CdnEnabled
 11154  	}
 11155  	if sep.CdnProvider != nil {
 11156  		objectMap["cdnProvider"] = sep.CdnProvider
 11157  	}
 11158  	if sep.CdnProfile != nil {
 11159  		objectMap["cdnProfile"] = sep.CdnProfile
 11160  	}
 11161  	if sep.CrossSiteAccessPolicies != nil {
 11162  		objectMap["crossSiteAccessPolicies"] = sep.CrossSiteAccessPolicies
 11163  	}
 11164  	return json.Marshal(objectMap)
 11165  }
 11166  
 11167  // StreamingEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a
 11168  // long-running operation.
 11169  type StreamingEndpointsCreateFuture struct {
 11170  	azure.FutureAPI
 11171  	// Result returns the result of the asynchronous operation.
 11172  	// If the operation has not completed it will return an error.
 11173  	Result func(StreamingEndpointsClient) (StreamingEndpoint, error)
 11174  }
 11175  
 11176  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 11177  func (future *StreamingEndpointsCreateFuture) UnmarshalJSON(body []byte) error {
 11178  	var azFuture azure.Future
 11179  	if err := json.Unmarshal(body, &azFuture); err != nil {
 11180  		return err
 11181  	}
 11182  	future.FutureAPI = &azFuture
 11183  	future.Result = future.result
 11184  	return nil
 11185  }
 11186  
 11187  // result is the default implementation for StreamingEndpointsCreateFuture.Result.
 11188  func (future *StreamingEndpointsCreateFuture) result(client StreamingEndpointsClient) (se StreamingEndpoint, err error) {
 11189  	var done bool
 11190  	done, err = future.DoneWithContext(context.Background(), client)
 11191  	if err != nil {
 11192  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsCreateFuture", "Result", future.Response(), "Polling failure")
 11193  		return
 11194  	}
 11195  	if !done {
 11196  		se.Response.Response = future.Response()
 11197  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsCreateFuture")
 11198  		return
 11199  	}
 11200  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
 11201  	if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent {
 11202  		se, err = client.CreateResponder(se.Response.Response)
 11203  		if err != nil {
 11204  			err = autorest.NewErrorWithError(err, "media.StreamingEndpointsCreateFuture", "Result", se.Response.Response, "Failure responding to request")
 11205  		}
 11206  	}
 11207  	return
 11208  }
 11209  
 11210  // StreamingEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a
 11211  // long-running operation.
 11212  type StreamingEndpointsDeleteFuture struct {
 11213  	azure.FutureAPI
 11214  	// Result returns the result of the asynchronous operation.
 11215  	// If the operation has not completed it will return an error.
 11216  	Result func(StreamingEndpointsClient) (autorest.Response, error)
 11217  }
 11218  
 11219  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 11220  func (future *StreamingEndpointsDeleteFuture) UnmarshalJSON(body []byte) error {
 11221  	var azFuture azure.Future
 11222  	if err := json.Unmarshal(body, &azFuture); err != nil {
 11223  		return err
 11224  	}
 11225  	future.FutureAPI = &azFuture
 11226  	future.Result = future.result
 11227  	return nil
 11228  }
 11229  
 11230  // result is the default implementation for StreamingEndpointsDeleteFuture.Result.
 11231  func (future *StreamingEndpointsDeleteFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
 11232  	var done bool
 11233  	done, err = future.DoneWithContext(context.Background(), client)
 11234  	if err != nil {
 11235  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsDeleteFuture", "Result", future.Response(), "Polling failure")
 11236  		return
 11237  	}
 11238  	if !done {
 11239  		ar.Response = future.Response()
 11240  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsDeleteFuture")
 11241  		return
 11242  	}
 11243  	ar.Response = future.Response()
 11244  	return
 11245  }
 11246  
 11247  // StreamingEndpointsScaleFuture an abstraction for monitoring and retrieving the results of a long-running
 11248  // operation.
 11249  type StreamingEndpointsScaleFuture struct {
 11250  	azure.FutureAPI
 11251  	// Result returns the result of the asynchronous operation.
 11252  	// If the operation has not completed it will return an error.
 11253  	Result func(StreamingEndpointsClient) (autorest.Response, error)
 11254  }
 11255  
 11256  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 11257  func (future *StreamingEndpointsScaleFuture) UnmarshalJSON(body []byte) error {
 11258  	var azFuture azure.Future
 11259  	if err := json.Unmarshal(body, &azFuture); err != nil {
 11260  		return err
 11261  	}
 11262  	future.FutureAPI = &azFuture
 11263  	future.Result = future.result
 11264  	return nil
 11265  }
 11266  
 11267  // result is the default implementation for StreamingEndpointsScaleFuture.Result.
 11268  func (future *StreamingEndpointsScaleFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
 11269  	var done bool
 11270  	done, err = future.DoneWithContext(context.Background(), client)
 11271  	if err != nil {
 11272  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsScaleFuture", "Result", future.Response(), "Polling failure")
 11273  		return
 11274  	}
 11275  	if !done {
 11276  		ar.Response = future.Response()
 11277  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsScaleFuture")
 11278  		return
 11279  	}
 11280  	ar.Response = future.Response()
 11281  	return
 11282  }
 11283  
 11284  // StreamingEndpointsStartFuture an abstraction for monitoring and retrieving the results of a long-running
 11285  // operation.
 11286  type StreamingEndpointsStartFuture struct {
 11287  	azure.FutureAPI
 11288  	// Result returns the result of the asynchronous operation.
 11289  	// If the operation has not completed it will return an error.
 11290  	Result func(StreamingEndpointsClient) (autorest.Response, error)
 11291  }
 11292  
 11293  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 11294  func (future *StreamingEndpointsStartFuture) UnmarshalJSON(body []byte) error {
 11295  	var azFuture azure.Future
 11296  	if err := json.Unmarshal(body, &azFuture); err != nil {
 11297  		return err
 11298  	}
 11299  	future.FutureAPI = &azFuture
 11300  	future.Result = future.result
 11301  	return nil
 11302  }
 11303  
 11304  // result is the default implementation for StreamingEndpointsStartFuture.Result.
 11305  func (future *StreamingEndpointsStartFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
 11306  	var done bool
 11307  	done, err = future.DoneWithContext(context.Background(), client)
 11308  	if err != nil {
 11309  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsStartFuture", "Result", future.Response(), "Polling failure")
 11310  		return
 11311  	}
 11312  	if !done {
 11313  		ar.Response = future.Response()
 11314  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsStartFuture")
 11315  		return
 11316  	}
 11317  	ar.Response = future.Response()
 11318  	return
 11319  }
 11320  
 11321  // StreamingEndpointsStopFuture an abstraction for monitoring and retrieving the results of a long-running
 11322  // operation.
 11323  type StreamingEndpointsStopFuture struct {
 11324  	azure.FutureAPI
 11325  	// Result returns the result of the asynchronous operation.
 11326  	// If the operation has not completed it will return an error.
 11327  	Result func(StreamingEndpointsClient) (autorest.Response, error)
 11328  }
 11329  
 11330  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 11331  func (future *StreamingEndpointsStopFuture) UnmarshalJSON(body []byte) error {
 11332  	var azFuture azure.Future
 11333  	if err := json.Unmarshal(body, &azFuture); err != nil {
 11334  		return err
 11335  	}
 11336  	future.FutureAPI = &azFuture
 11337  	future.Result = future.result
 11338  	return nil
 11339  }
 11340  
 11341  // result is the default implementation for StreamingEndpointsStopFuture.Result.
 11342  func (future *StreamingEndpointsStopFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
 11343  	var done bool
 11344  	done, err = future.DoneWithContext(context.Background(), client)
 11345  	if err != nil {
 11346  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsStopFuture", "Result", future.Response(), "Polling failure")
 11347  		return
 11348  	}
 11349  	if !done {
 11350  		ar.Response = future.Response()
 11351  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsStopFuture")
 11352  		return
 11353  	}
 11354  	ar.Response = future.Response()
 11355  	return
 11356  }
 11357  
 11358  // StreamingEndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a
 11359  // long-running operation.
 11360  type StreamingEndpointsUpdateFuture struct {
 11361  	azure.FutureAPI
 11362  	// Result returns the result of the asynchronous operation.
 11363  	// If the operation has not completed it will return an error.
 11364  	Result func(StreamingEndpointsClient) (StreamingEndpoint, error)
 11365  }
 11366  
 11367  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 11368  func (future *StreamingEndpointsUpdateFuture) UnmarshalJSON(body []byte) error {
 11369  	var azFuture azure.Future
 11370  	if err := json.Unmarshal(body, &azFuture); err != nil {
 11371  		return err
 11372  	}
 11373  	future.FutureAPI = &azFuture
 11374  	future.Result = future.result
 11375  	return nil
 11376  }
 11377  
 11378  // result is the default implementation for StreamingEndpointsUpdateFuture.Result.
 11379  func (future *StreamingEndpointsUpdateFuture) result(client StreamingEndpointsClient) (se StreamingEndpoint, err error) {
 11380  	var done bool
 11381  	done, err = future.DoneWithContext(context.Background(), client)
 11382  	if err != nil {
 11383  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsUpdateFuture", "Result", future.Response(), "Polling failure")
 11384  		return
 11385  	}
 11386  	if !done {
 11387  		se.Response.Response = future.Response()
 11388  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsUpdateFuture")
 11389  		return
 11390  	}
 11391  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
 11392  	if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent {
 11393  		se, err = client.UpdateResponder(se.Response.Response)
 11394  		if err != nil {
 11395  			err = autorest.NewErrorWithError(err, "media.StreamingEndpointsUpdateFuture", "Result", se.Response.Response, "Failure responding to request")
 11396  		}
 11397  	}
 11398  	return
 11399  }
 11400  
 11401  // StreamingEntityScaleUnit scale units definition
 11402  type StreamingEntityScaleUnit struct {
 11403  	// ScaleUnit - The scale unit number of the streaming endpoint.
 11404  	ScaleUnit *int32 `json:"scaleUnit,omitempty"`
 11405  }
 11406  
 11407  // StreamingLocator a Streaming Locator resource
 11408  type StreamingLocator struct {
 11409  	autorest.Response           `json:"-"`
 11410  	*StreamingLocatorProperties `json:"properties,omitempty"`
 11411  	// SystemData - READ-ONLY; The system metadata relating to this resource.
 11412  	SystemData *SystemData `json:"systemData,omitempty"`
 11413  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 11414  	ID *string `json:"id,omitempty"`
 11415  	// Name - READ-ONLY; The name of the resource
 11416  	Name *string `json:"name,omitempty"`
 11417  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 11418  	Type *string `json:"type,omitempty"`
 11419  }
 11420  
 11421  // MarshalJSON is the custom marshaler for StreamingLocator.
 11422  func (sl StreamingLocator) MarshalJSON() ([]byte, error) {
 11423  	objectMap := make(map[string]interface{})
 11424  	if sl.StreamingLocatorProperties != nil {
 11425  		objectMap["properties"] = sl.StreamingLocatorProperties
 11426  	}
 11427  	return json.Marshal(objectMap)
 11428  }
 11429  
 11430  // UnmarshalJSON is the custom unmarshaler for StreamingLocator struct.
 11431  func (sl *StreamingLocator) UnmarshalJSON(body []byte) error {
 11432  	var m map[string]*json.RawMessage
 11433  	err := json.Unmarshal(body, &m)
 11434  	if err != nil {
 11435  		return err
 11436  	}
 11437  	for k, v := range m {
 11438  		switch k {
 11439  		case "properties":
 11440  			if v != nil {
 11441  				var streamingLocatorProperties StreamingLocatorProperties
 11442  				err = json.Unmarshal(*v, &streamingLocatorProperties)
 11443  				if err != nil {
 11444  					return err
 11445  				}
 11446  				sl.StreamingLocatorProperties = &streamingLocatorProperties
 11447  			}
 11448  		case "systemData":
 11449  			if v != nil {
 11450  				var systemData SystemData
 11451  				err = json.Unmarshal(*v, &systemData)
 11452  				if err != nil {
 11453  					return err
 11454  				}
 11455  				sl.SystemData = &systemData
 11456  			}
 11457  		case "id":
 11458  			if v != nil {
 11459  				var ID string
 11460  				err = json.Unmarshal(*v, &ID)
 11461  				if err != nil {
 11462  					return err
 11463  				}
 11464  				sl.ID = &ID
 11465  			}
 11466  		case "name":
 11467  			if v != nil {
 11468  				var name string
 11469  				err = json.Unmarshal(*v, &name)
 11470  				if err != nil {
 11471  					return err
 11472  				}
 11473  				sl.Name = &name
 11474  			}
 11475  		case "type":
 11476  			if v != nil {
 11477  				var typeVar string
 11478  				err = json.Unmarshal(*v, &typeVar)
 11479  				if err != nil {
 11480  					return err
 11481  				}
 11482  				sl.Type = &typeVar
 11483  			}
 11484  		}
 11485  	}
 11486  
 11487  	return nil
 11488  }
 11489  
 11490  // StreamingLocatorCollection a collection of StreamingLocator items.
 11491  type StreamingLocatorCollection struct {
 11492  	autorest.Response `json:"-"`
 11493  	// Value - A collection of StreamingLocator items.
 11494  	Value *[]StreamingLocator `json:"value,omitempty"`
 11495  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
 11496  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
 11497  }
 11498  
 11499  // StreamingLocatorCollectionIterator provides access to a complete listing of StreamingLocator values.
 11500  type StreamingLocatorCollectionIterator struct {
 11501  	i    int
 11502  	page StreamingLocatorCollectionPage
 11503  }
 11504  
 11505  // NextWithContext advances to the next value.  If there was an error making
 11506  // the request the iterator does not advance and the error is returned.
 11507  func (iter *StreamingLocatorCollectionIterator) NextWithContext(ctx context.Context) (err error) {
 11508  	if tracing.IsEnabled() {
 11509  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorCollectionIterator.NextWithContext")
 11510  		defer func() {
 11511  			sc := -1
 11512  			if iter.Response().Response.Response != nil {
 11513  				sc = iter.Response().Response.Response.StatusCode
 11514  			}
 11515  			tracing.EndSpan(ctx, sc, err)
 11516  		}()
 11517  	}
 11518  	iter.i++
 11519  	if iter.i < len(iter.page.Values()) {
 11520  		return nil
 11521  	}
 11522  	err = iter.page.NextWithContext(ctx)
 11523  	if err != nil {
 11524  		iter.i--
 11525  		return err
 11526  	}
 11527  	iter.i = 0
 11528  	return nil
 11529  }
 11530  
 11531  // Next advances to the next value.  If there was an error making
 11532  // the request the iterator does not advance and the error is returned.
 11533  // Deprecated: Use NextWithContext() instead.
 11534  func (iter *StreamingLocatorCollectionIterator) Next() error {
 11535  	return iter.NextWithContext(context.Background())
 11536  }
 11537  
 11538  // NotDone returns true if the enumeration should be started or is not yet complete.
 11539  func (iter StreamingLocatorCollectionIterator) NotDone() bool {
 11540  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
 11541  }
 11542  
 11543  // Response returns the raw server response from the last page request.
 11544  func (iter StreamingLocatorCollectionIterator) Response() StreamingLocatorCollection {
 11545  	return iter.page.Response()
 11546  }
 11547  
 11548  // Value returns the current value or a zero-initialized value if the
 11549  // iterator has advanced beyond the end of the collection.
 11550  func (iter StreamingLocatorCollectionIterator) Value() StreamingLocator {
 11551  	if !iter.page.NotDone() {
 11552  		return StreamingLocator{}
 11553  	}
 11554  	return iter.page.Values()[iter.i]
 11555  }
 11556  
 11557  // Creates a new instance of the StreamingLocatorCollectionIterator type.
 11558  func NewStreamingLocatorCollectionIterator(page StreamingLocatorCollectionPage) StreamingLocatorCollectionIterator {
 11559  	return StreamingLocatorCollectionIterator{page: page}
 11560  }
 11561  
 11562  // IsEmpty returns true if the ListResult contains no values.
 11563  func (slc StreamingLocatorCollection) IsEmpty() bool {
 11564  	return slc.Value == nil || len(*slc.Value) == 0
 11565  }
 11566  
 11567  // hasNextLink returns true if the NextLink is not empty.
 11568  func (slc StreamingLocatorCollection) hasNextLink() bool {
 11569  	return slc.OdataNextLink != nil && len(*slc.OdataNextLink) != 0
 11570  }
 11571  
 11572  // streamingLocatorCollectionPreparer prepares a request to retrieve the next set of results.
 11573  // It returns nil if no more results exist.
 11574  func (slc StreamingLocatorCollection) streamingLocatorCollectionPreparer(ctx context.Context) (*http.Request, error) {
 11575  	if !slc.hasNextLink() {
 11576  		return nil, nil
 11577  	}
 11578  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
 11579  		autorest.AsJSON(),
 11580  		autorest.AsGet(),
 11581  		autorest.WithBaseURL(to.String(slc.OdataNextLink)))
 11582  }
 11583  
 11584  // StreamingLocatorCollectionPage contains a page of StreamingLocator values.
 11585  type StreamingLocatorCollectionPage struct {
 11586  	fn  func(context.Context, StreamingLocatorCollection) (StreamingLocatorCollection, error)
 11587  	slc StreamingLocatorCollection
 11588  }
 11589  
 11590  // NextWithContext advances to the next page of values.  If there was an error making
 11591  // the request the page does not advance and the error is returned.
 11592  func (page *StreamingLocatorCollectionPage) NextWithContext(ctx context.Context) (err error) {
 11593  	if tracing.IsEnabled() {
 11594  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorCollectionPage.NextWithContext")
 11595  		defer func() {
 11596  			sc := -1
 11597  			if page.Response().Response.Response != nil {
 11598  				sc = page.Response().Response.Response.StatusCode
 11599  			}
 11600  			tracing.EndSpan(ctx, sc, err)
 11601  		}()
 11602  	}
 11603  	for {
 11604  		next, err := page.fn(ctx, page.slc)
 11605  		if err != nil {
 11606  			return err
 11607  		}
 11608  		page.slc = next
 11609  		if !next.hasNextLink() || !next.IsEmpty() {
 11610  			break
 11611  		}
 11612  	}
 11613  	return nil
 11614  }
 11615  
 11616  // Next advances to the next page of values.  If there was an error making
 11617  // the request the page does not advance and the error is returned.
 11618  // Deprecated: Use NextWithContext() instead.
 11619  func (page *StreamingLocatorCollectionPage) Next() error {
 11620  	return page.NextWithContext(context.Background())
 11621  }
 11622  
 11623  // NotDone returns true if the page enumeration should be started or is not yet complete.
 11624  func (page StreamingLocatorCollectionPage) NotDone() bool {
 11625  	return !page.slc.IsEmpty()
 11626  }
 11627  
 11628  // Response returns the raw server response from the last page request.
 11629  func (page StreamingLocatorCollectionPage) Response() StreamingLocatorCollection {
 11630  	return page.slc
 11631  }
 11632  
 11633  // Values returns the slice of values for the current page or nil if there are no values.
 11634  func (page StreamingLocatorCollectionPage) Values() []StreamingLocator {
 11635  	if page.slc.IsEmpty() {
 11636  		return nil
 11637  	}
 11638  	return *page.slc.Value
 11639  }
 11640  
 11641  // Creates a new instance of the StreamingLocatorCollectionPage type.
 11642  func NewStreamingLocatorCollectionPage(cur StreamingLocatorCollection, getNextPage func(context.Context, StreamingLocatorCollection) (StreamingLocatorCollection, error)) StreamingLocatorCollectionPage {
 11643  	return StreamingLocatorCollectionPage{
 11644  		fn:  getNextPage,
 11645  		slc: cur,
 11646  	}
 11647  }
 11648  
 11649  // StreamingLocatorContentKey class for content key in Streaming Locator
 11650  type StreamingLocatorContentKey struct {
 11651  	// ID - ID of Content Key
 11652  	ID *uuid.UUID `json:"id,omitempty"`
 11653  	// Type - READ-ONLY; Encryption type of Content Key. Possible values include: 'StreamingLocatorContentKeyTypeCommonEncryptionCenc', 'StreamingLocatorContentKeyTypeCommonEncryptionCbcs', 'StreamingLocatorContentKeyTypeEnvelopeEncryption'
 11654  	Type StreamingLocatorContentKeyType `json:"type,omitempty"`
 11655  	// LabelReferenceInStreamingPolicy - Label of Content Key as specified in the Streaming Policy
 11656  	LabelReferenceInStreamingPolicy *string `json:"labelReferenceInStreamingPolicy,omitempty"`
 11657  	// Value - Value of Content Key
 11658  	Value *string `json:"value,omitempty"`
 11659  	// PolicyName - READ-ONLY; ContentKeyPolicy used by Content Key
 11660  	PolicyName *string `json:"policyName,omitempty"`
 11661  	// Tracks - READ-ONLY; Tracks which use this Content Key
 11662  	Tracks *[]TrackSelection `json:"tracks,omitempty"`
 11663  }
 11664  
 11665  // MarshalJSON is the custom marshaler for StreamingLocatorContentKey.
 11666  func (slck StreamingLocatorContentKey) MarshalJSON() ([]byte, error) {
 11667  	objectMap := make(map[string]interface{})
 11668  	if slck.ID != nil {
 11669  		objectMap["id"] = slck.ID
 11670  	}
 11671  	if slck.LabelReferenceInStreamingPolicy != nil {
 11672  		objectMap["labelReferenceInStreamingPolicy"] = slck.LabelReferenceInStreamingPolicy
 11673  	}
 11674  	if slck.Value != nil {
 11675  		objectMap["value"] = slck.Value
 11676  	}
 11677  	return json.Marshal(objectMap)
 11678  }
 11679  
 11680  // StreamingLocatorProperties properties of the Streaming Locator.
 11681  type StreamingLocatorProperties struct {
 11682  	// AssetName - Asset Name
 11683  	AssetName *string `json:"assetName,omitempty"`
 11684  	// Created - READ-ONLY; The creation time of the Streaming Locator.
 11685  	Created *date.Time `json:"created,omitempty"`
 11686  	// StartTime - The start time of the Streaming Locator.
 11687  	StartTime *date.Time `json:"startTime,omitempty"`
 11688  	// EndTime - The end time of the Streaming Locator.
 11689  	EndTime *date.Time `json:"endTime,omitempty"`
 11690  	// StreamingLocatorID - The StreamingLocatorId of the Streaming Locator.
 11691  	StreamingLocatorID *uuid.UUID `json:"streamingLocatorId,omitempty"`
 11692  	// 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'
 11693  	StreamingPolicyName *string `json:"streamingPolicyName,omitempty"`
 11694  	// DefaultContentKeyPolicyName - Name of the default ContentKeyPolicy used by this Streaming Locator.
 11695  	DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"`
 11696  	// ContentKeys - The ContentKeys used by this Streaming Locator.
 11697  	ContentKeys *[]StreamingLocatorContentKey `json:"contentKeys,omitempty"`
 11698  	// AlternativeMediaID - Alternative Media ID of this Streaming Locator
 11699  	AlternativeMediaID *string `json:"alternativeMediaId,omitempty"`
 11700  	// Filters - A list of asset or account filters which apply to this streaming locator
 11701  	Filters *[]string `json:"filters,omitempty"`
 11702  }
 11703  
 11704  // MarshalJSON is the custom marshaler for StreamingLocatorProperties.
 11705  func (slp StreamingLocatorProperties) MarshalJSON() ([]byte, error) {
 11706  	objectMap := make(map[string]interface{})
 11707  	if slp.AssetName != nil {
 11708  		objectMap["assetName"] = slp.AssetName
 11709  	}
 11710  	if slp.StartTime != nil {
 11711  		objectMap["startTime"] = slp.StartTime
 11712  	}
 11713  	if slp.EndTime != nil {
 11714  		objectMap["endTime"] = slp.EndTime
 11715  	}
 11716  	if slp.StreamingLocatorID != nil {
 11717  		objectMap["streamingLocatorId"] = slp.StreamingLocatorID
 11718  	}
 11719  	if slp.StreamingPolicyName != nil {
 11720  		objectMap["streamingPolicyName"] = slp.StreamingPolicyName
 11721  	}
 11722  	if slp.DefaultContentKeyPolicyName != nil {
 11723  		objectMap["defaultContentKeyPolicyName"] = slp.DefaultContentKeyPolicyName
 11724  	}
 11725  	if slp.ContentKeys != nil {
 11726  		objectMap["contentKeys"] = slp.ContentKeys
 11727  	}
 11728  	if slp.AlternativeMediaID != nil {
 11729  		objectMap["alternativeMediaId"] = slp.AlternativeMediaID
 11730  	}
 11731  	if slp.Filters != nil {
 11732  		objectMap["filters"] = slp.Filters
 11733  	}
 11734  	return json.Marshal(objectMap)
 11735  }
 11736  
 11737  // StreamingPath class of paths for streaming
 11738  type StreamingPath struct {
 11739  	// StreamingProtocol - Streaming protocol. Possible values include: 'StreamingPolicyStreamingProtocolHls', 'StreamingPolicyStreamingProtocolDash', 'StreamingPolicyStreamingProtocolSmoothStreaming', 'StreamingPolicyStreamingProtocolDownload'
 11740  	StreamingProtocol StreamingPolicyStreamingProtocol `json:"streamingProtocol,omitempty"`
 11741  	// EncryptionScheme - Encryption scheme. Possible values include: 'EncryptionSchemeNoEncryption', 'EncryptionSchemeEnvelopeEncryption', 'EncryptionSchemeCommonEncryptionCenc', 'EncryptionSchemeCommonEncryptionCbcs'
 11742  	EncryptionScheme EncryptionScheme `json:"encryptionScheme,omitempty"`
 11743  	// Paths - Streaming paths for each protocol and encryptionScheme pair
 11744  	Paths *[]string `json:"paths,omitempty"`
 11745  }
 11746  
 11747  // StreamingPolicy a Streaming Policy resource
 11748  type StreamingPolicy struct {
 11749  	autorest.Response          `json:"-"`
 11750  	*StreamingPolicyProperties `json:"properties,omitempty"`
 11751  	// SystemData - READ-ONLY; The system metadata relating to this resource.
 11752  	SystemData *SystemData `json:"systemData,omitempty"`
 11753  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 11754  	ID *string `json:"id,omitempty"`
 11755  	// Name - READ-ONLY; The name of the resource
 11756  	Name *string `json:"name,omitempty"`
 11757  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 11758  	Type *string `json:"type,omitempty"`
 11759  }
 11760  
 11761  // MarshalJSON is the custom marshaler for StreamingPolicy.
 11762  func (sp StreamingPolicy) MarshalJSON() ([]byte, error) {
 11763  	objectMap := make(map[string]interface{})
 11764  	if sp.StreamingPolicyProperties != nil {
 11765  		objectMap["properties"] = sp.StreamingPolicyProperties
 11766  	}
 11767  	return json.Marshal(objectMap)
 11768  }
 11769  
 11770  // UnmarshalJSON is the custom unmarshaler for StreamingPolicy struct.
 11771  func (sp *StreamingPolicy) UnmarshalJSON(body []byte) error {
 11772  	var m map[string]*json.RawMessage
 11773  	err := json.Unmarshal(body, &m)
 11774  	if err != nil {
 11775  		return err
 11776  	}
 11777  	for k, v := range m {
 11778  		switch k {
 11779  		case "properties":
 11780  			if v != nil {
 11781  				var streamingPolicyProperties StreamingPolicyProperties
 11782  				err = json.Unmarshal(*v, &streamingPolicyProperties)
 11783  				if err != nil {
 11784  					return err
 11785  				}
 11786  				sp.StreamingPolicyProperties = &streamingPolicyProperties
 11787  			}
 11788  		case "systemData":
 11789  			if v != nil {
 11790  				var systemData SystemData
 11791  				err = json.Unmarshal(*v, &systemData)
 11792  				if err != nil {
 11793  					return err
 11794  				}
 11795  				sp.SystemData = &systemData
 11796  			}
 11797  		case "id":
 11798  			if v != nil {
 11799  				var ID string
 11800  				err = json.Unmarshal(*v, &ID)
 11801  				if err != nil {
 11802  					return err
 11803  				}
 11804  				sp.ID = &ID
 11805  			}
 11806  		case "name":
 11807  			if v != nil {
 11808  				var name string
 11809  				err = json.Unmarshal(*v, &name)
 11810  				if err != nil {
 11811  					return err
 11812  				}
 11813  				sp.Name = &name
 11814  			}
 11815  		case "type":
 11816  			if v != nil {
 11817  				var typeVar string
 11818  				err = json.Unmarshal(*v, &typeVar)
 11819  				if err != nil {
 11820  					return err
 11821  				}
 11822  				sp.Type = &typeVar
 11823  			}
 11824  		}
 11825  	}
 11826  
 11827  	return nil
 11828  }
 11829  
 11830  // StreamingPolicyCollection a collection of StreamingPolicy items.
 11831  type StreamingPolicyCollection struct {
 11832  	autorest.Response `json:"-"`
 11833  	// Value - A collection of StreamingPolicy items.
 11834  	Value *[]StreamingPolicy `json:"value,omitempty"`
 11835  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
 11836  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
 11837  }
 11838  
 11839  // StreamingPolicyCollectionIterator provides access to a complete listing of StreamingPolicy values.
 11840  type StreamingPolicyCollectionIterator struct {
 11841  	i    int
 11842  	page StreamingPolicyCollectionPage
 11843  }
 11844  
 11845  // NextWithContext advances to the next value.  If there was an error making
 11846  // the request the iterator does not advance and the error is returned.
 11847  func (iter *StreamingPolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) {
 11848  	if tracing.IsEnabled() {
 11849  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingPolicyCollectionIterator.NextWithContext")
 11850  		defer func() {
 11851  			sc := -1
 11852  			if iter.Response().Response.Response != nil {
 11853  				sc = iter.Response().Response.Response.StatusCode
 11854  			}
 11855  			tracing.EndSpan(ctx, sc, err)
 11856  		}()
 11857  	}
 11858  	iter.i++
 11859  	if iter.i < len(iter.page.Values()) {
 11860  		return nil
 11861  	}
 11862  	err = iter.page.NextWithContext(ctx)
 11863  	if err != nil {
 11864  		iter.i--
 11865  		return err
 11866  	}
 11867  	iter.i = 0
 11868  	return nil
 11869  }
 11870  
 11871  // Next advances to the next value.  If there was an error making
 11872  // the request the iterator does not advance and the error is returned.
 11873  // Deprecated: Use NextWithContext() instead.
 11874  func (iter *StreamingPolicyCollectionIterator) Next() error {
 11875  	return iter.NextWithContext(context.Background())
 11876  }
 11877  
 11878  // NotDone returns true if the enumeration should be started or is not yet complete.
 11879  func (iter StreamingPolicyCollectionIterator) NotDone() bool {
 11880  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
 11881  }
 11882  
 11883  // Response returns the raw server response from the last page request.
 11884  func (iter StreamingPolicyCollectionIterator) Response() StreamingPolicyCollection {
 11885  	return iter.page.Response()
 11886  }
 11887  
 11888  // Value returns the current value or a zero-initialized value if the
 11889  // iterator has advanced beyond the end of the collection.
 11890  func (iter StreamingPolicyCollectionIterator) Value() StreamingPolicy {
 11891  	if !iter.page.NotDone() {
 11892  		return StreamingPolicy{}
 11893  	}
 11894  	return iter.page.Values()[iter.i]
 11895  }
 11896  
 11897  // Creates a new instance of the StreamingPolicyCollectionIterator type.
 11898  func NewStreamingPolicyCollectionIterator(page StreamingPolicyCollectionPage) StreamingPolicyCollectionIterator {
 11899  	return StreamingPolicyCollectionIterator{page: page}
 11900  }
 11901  
 11902  // IsEmpty returns true if the ListResult contains no values.
 11903  func (spc StreamingPolicyCollection) IsEmpty() bool {
 11904  	return spc.Value == nil || len(*spc.Value) == 0
 11905  }
 11906  
 11907  // hasNextLink returns true if the NextLink is not empty.
 11908  func (spc StreamingPolicyCollection) hasNextLink() bool {
 11909  	return spc.OdataNextLink != nil && len(*spc.OdataNextLink) != 0
 11910  }
 11911  
 11912  // streamingPolicyCollectionPreparer prepares a request to retrieve the next set of results.
 11913  // It returns nil if no more results exist.
 11914  func (spc StreamingPolicyCollection) streamingPolicyCollectionPreparer(ctx context.Context) (*http.Request, error) {
 11915  	if !spc.hasNextLink() {
 11916  		return nil, nil
 11917  	}
 11918  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
 11919  		autorest.AsJSON(),
 11920  		autorest.AsGet(),
 11921  		autorest.WithBaseURL(to.String(spc.OdataNextLink)))
 11922  }
 11923  
 11924  // StreamingPolicyCollectionPage contains a page of StreamingPolicy values.
 11925  type StreamingPolicyCollectionPage struct {
 11926  	fn  func(context.Context, StreamingPolicyCollection) (StreamingPolicyCollection, error)
 11927  	spc StreamingPolicyCollection
 11928  }
 11929  
 11930  // NextWithContext advances to the next page of values.  If there was an error making
 11931  // the request the page does not advance and the error is returned.
 11932  func (page *StreamingPolicyCollectionPage) NextWithContext(ctx context.Context) (err error) {
 11933  	if tracing.IsEnabled() {
 11934  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingPolicyCollectionPage.NextWithContext")
 11935  		defer func() {
 11936  			sc := -1
 11937  			if page.Response().Response.Response != nil {
 11938  				sc = page.Response().Response.Response.StatusCode
 11939  			}
 11940  			tracing.EndSpan(ctx, sc, err)
 11941  		}()
 11942  	}
 11943  	for {
 11944  		next, err := page.fn(ctx, page.spc)
 11945  		if err != nil {
 11946  			return err
 11947  		}
 11948  		page.spc = next
 11949  		if !next.hasNextLink() || !next.IsEmpty() {
 11950  			break
 11951  		}
 11952  	}
 11953  	return nil
 11954  }
 11955  
 11956  // Next advances to the next page of values.  If there was an error making
 11957  // the request the page does not advance and the error is returned.
 11958  // Deprecated: Use NextWithContext() instead.
 11959  func (page *StreamingPolicyCollectionPage) Next() error {
 11960  	return page.NextWithContext(context.Background())
 11961  }
 11962  
 11963  // NotDone returns true if the page enumeration should be started or is not yet complete.
 11964  func (page StreamingPolicyCollectionPage) NotDone() bool {
 11965  	return !page.spc.IsEmpty()
 11966  }
 11967  
 11968  // Response returns the raw server response from the last page request.
 11969  func (page StreamingPolicyCollectionPage) Response() StreamingPolicyCollection {
 11970  	return page.spc
 11971  }
 11972  
 11973  // Values returns the slice of values for the current page or nil if there are no values.
 11974  func (page StreamingPolicyCollectionPage) Values() []StreamingPolicy {
 11975  	if page.spc.IsEmpty() {
 11976  		return nil
 11977  	}
 11978  	return *page.spc.Value
 11979  }
 11980  
 11981  // Creates a new instance of the StreamingPolicyCollectionPage type.
 11982  func NewStreamingPolicyCollectionPage(cur StreamingPolicyCollection, getNextPage func(context.Context, StreamingPolicyCollection) (StreamingPolicyCollection, error)) StreamingPolicyCollectionPage {
 11983  	return StreamingPolicyCollectionPage{
 11984  		fn:  getNextPage,
 11985  		spc: cur,
 11986  	}
 11987  }
 11988  
 11989  // StreamingPolicyContentKey class to specify properties of content key
 11990  type StreamingPolicyContentKey struct {
 11991  	// Label - Label can be used to specify Content Key when creating a Streaming Locator
 11992  	Label *string `json:"label,omitempty"`
 11993  	// PolicyName - Policy used by Content Key
 11994  	PolicyName *string `json:"policyName,omitempty"`
 11995  	// Tracks - Tracks which use this content key
 11996  	Tracks *[]TrackSelection `json:"tracks,omitempty"`
 11997  }
 11998  
 11999  // StreamingPolicyContentKeys class to specify properties of all content keys in Streaming Policy
 12000  type StreamingPolicyContentKeys struct {
 12001  	// DefaultKey - Default content key for an encryption scheme
 12002  	DefaultKey *DefaultKey `json:"defaultKey,omitempty"`
 12003  	// KeyToTrackMappings - Representing tracks needs separate content key
 12004  	KeyToTrackMappings *[]StreamingPolicyContentKey `json:"keyToTrackMappings,omitempty"`
 12005  }
 12006  
 12007  // StreamingPolicyFairPlayConfiguration class to specify configurations of FairPlay in Streaming Policy
 12008  type StreamingPolicyFairPlayConfiguration struct {
 12009  	// 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.
 12010  	CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"`
 12011  	// AllowPersistentLicense - All license to be persistent or not
 12012  	AllowPersistentLicense *bool `json:"allowPersistentLicense,omitempty"`
 12013  }
 12014  
 12015  // StreamingPolicyPlayReadyConfiguration class to specify configurations of PlayReady in Streaming Policy
 12016  type StreamingPolicyPlayReadyConfiguration struct {
 12017  	// 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.
 12018  	CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"`
 12019  	// PlayReadyCustomAttributes - Custom attributes for PlayReady
 12020  	PlayReadyCustomAttributes *string `json:"playReadyCustomAttributes,omitempty"`
 12021  }
 12022  
 12023  // StreamingPolicyProperties class to specify properties of Streaming Policy
 12024  type StreamingPolicyProperties struct {
 12025  	// Created - READ-ONLY; Creation time of Streaming Policy
 12026  	Created *date.Time `json:"created,omitempty"`
 12027  	// DefaultContentKeyPolicyName - Default ContentKey used by current Streaming Policy
 12028  	DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"`
 12029  	// EnvelopeEncryption - Configuration of EnvelopeEncryption
 12030  	EnvelopeEncryption *EnvelopeEncryption `json:"envelopeEncryption,omitempty"`
 12031  	// CommonEncryptionCenc - Configuration of CommonEncryptionCenc
 12032  	CommonEncryptionCenc *CommonEncryptionCenc `json:"commonEncryptionCenc,omitempty"`
 12033  	// CommonEncryptionCbcs - Configuration of CommonEncryptionCbcs
 12034  	CommonEncryptionCbcs *CommonEncryptionCbcs `json:"commonEncryptionCbcs,omitempty"`
 12035  	// NoEncryption - Configurations of NoEncryption
 12036  	NoEncryption *NoEncryption `json:"noEncryption,omitempty"`
 12037  }
 12038  
 12039  // MarshalJSON is the custom marshaler for StreamingPolicyProperties.
 12040  func (spp StreamingPolicyProperties) MarshalJSON() ([]byte, error) {
 12041  	objectMap := make(map[string]interface{})
 12042  	if spp.DefaultContentKeyPolicyName != nil {
 12043  		objectMap["defaultContentKeyPolicyName"] = spp.DefaultContentKeyPolicyName
 12044  	}
 12045  	if spp.EnvelopeEncryption != nil {
 12046  		objectMap["envelopeEncryption"] = spp.EnvelopeEncryption
 12047  	}
 12048  	if spp.CommonEncryptionCenc != nil {
 12049  		objectMap["commonEncryptionCenc"] = spp.CommonEncryptionCenc
 12050  	}
 12051  	if spp.CommonEncryptionCbcs != nil {
 12052  		objectMap["commonEncryptionCbcs"] = spp.CommonEncryptionCbcs
 12053  	}
 12054  	if spp.NoEncryption != nil {
 12055  		objectMap["noEncryption"] = spp.NoEncryption
 12056  	}
 12057  	return json.Marshal(objectMap)
 12058  }
 12059  
 12060  // StreamingPolicyWidevineConfiguration class to specify configurations of Widevine in Streaming Policy
 12061  type StreamingPolicyWidevineConfiguration struct {
 12062  	// 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.
 12063  	CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"`
 12064  }
 12065  
 12066  // SyncStorageKeysInput the input to the sync storage keys request.
 12067  type SyncStorageKeysInput struct {
 12068  	// ID - The ID of the storage account resource.
 12069  	ID *string `json:"id,omitempty"`
 12070  }
 12071  
 12072  // SystemData metadata pertaining to creation and last modification of the resource.
 12073  type SystemData struct {
 12074  	// CreatedBy - The identity that created the resource.
 12075  	CreatedBy *string `json:"createdBy,omitempty"`
 12076  	// CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
 12077  	CreatedByType CreatedByType `json:"createdByType,omitempty"`
 12078  	// CreatedAt - The timestamp of resource creation (UTC).
 12079  	CreatedAt *date.Time `json:"createdAt,omitempty"`
 12080  	// LastModifiedBy - The identity that last modified the resource.
 12081  	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
 12082  	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
 12083  	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
 12084  	// LastModifiedAt - The timestamp of resource last modification (UTC)
 12085  	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
 12086  }
 12087  
 12088  // BasicTrackDescriptor base type for all TrackDescriptor types, which define the metadata and selection for tracks
 12089  // that should be processed by a Job
 12090  type BasicTrackDescriptor interface {
 12091  	AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool)
 12092  	AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool)
 12093  	AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool)
 12094  	AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool)
 12095  	AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool)
 12096  	AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool)
 12097  	AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool)
 12098  	AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool)
 12099  	AsTrackDescriptor() (*TrackDescriptor, bool)
 12100  }
 12101  
 12102  // TrackDescriptor base type for all TrackDescriptor types, which define the metadata and selection for tracks
 12103  // that should be processed by a Job
 12104  type TrackDescriptor struct {
 12105  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
 12106  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
 12107  }
 12108  
 12109  func unmarshalBasicTrackDescriptor(body []byte) (BasicTrackDescriptor, error) {
 12110  	var m map[string]interface{}
 12111  	err := json.Unmarshal(body, &m)
 12112  	if err != nil {
 12113  		return nil, err
 12114  	}
 12115  
 12116  	switch m["@odata.type"] {
 12117  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor):
 12118  		var atd AudioTrackDescriptor
 12119  		err := json.Unmarshal(body, &atd)
 12120  		return atd, err
 12121  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute):
 12122  		var satba SelectAudioTrackByAttribute
 12123  		err := json.Unmarshal(body, &satba)
 12124  		return satba, err
 12125  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID):
 12126  		var satbi SelectAudioTrackByID
 12127  		err := json.Unmarshal(body, &satbi)
 12128  		return satbi, err
 12129  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor):
 12130  		var vtd VideoTrackDescriptor
 12131  		err := json.Unmarshal(body, &vtd)
 12132  		return vtd, err
 12133  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute):
 12134  		var svtba SelectVideoTrackByAttribute
 12135  		err := json.Unmarshal(body, &svtba)
 12136  		return svtba, err
 12137  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID):
 12138  		var svtbi SelectVideoTrackByID
 12139  		err := json.Unmarshal(body, &svtbi)
 12140  		return svtbi, err
 12141  	default:
 12142  		var td TrackDescriptor
 12143  		err := json.Unmarshal(body, &td)
 12144  		return td, err
 12145  	}
 12146  }
 12147  func unmarshalBasicTrackDescriptorArray(body []byte) ([]BasicTrackDescriptor, error) {
 12148  	var rawMessages []*json.RawMessage
 12149  	err := json.Unmarshal(body, &rawMessages)
 12150  	if err != nil {
 12151  		return nil, err
 12152  	}
 12153  
 12154  	tdArray := make([]BasicTrackDescriptor, len(rawMessages))
 12155  
 12156  	for index, rawMessage := range rawMessages {
 12157  		td, err := unmarshalBasicTrackDescriptor(*rawMessage)
 12158  		if err != nil {
 12159  			return nil, err
 12160  		}
 12161  		tdArray[index] = td
 12162  	}
 12163  	return tdArray, nil
 12164  }
 12165  
 12166  // MarshalJSON is the custom marshaler for TrackDescriptor.
 12167  func (td TrackDescriptor) MarshalJSON() ([]byte, error) {
 12168  	td.OdataType = OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor
 12169  	objectMap := make(map[string]interface{})
 12170  	if td.OdataType != "" {
 12171  		objectMap["@odata.type"] = td.OdataType
 12172  	}
 12173  	return json.Marshal(objectMap)
 12174  }
 12175  
 12176  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12177  func (td TrackDescriptor) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
 12178  	return nil, false
 12179  }
 12180  
 12181  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12182  func (td TrackDescriptor) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
 12183  	return nil, false
 12184  }
 12185  
 12186  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for TrackDescriptor.
 12187  func (td TrackDescriptor) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
 12188  	return nil, false
 12189  }
 12190  
 12191  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for TrackDescriptor.
 12192  func (td TrackDescriptor) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
 12193  	return nil, false
 12194  }
 12195  
 12196  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12197  func (td TrackDescriptor) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
 12198  	return nil, false
 12199  }
 12200  
 12201  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12202  func (td TrackDescriptor) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
 12203  	return nil, false
 12204  }
 12205  
 12206  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for TrackDescriptor.
 12207  func (td TrackDescriptor) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
 12208  	return nil, false
 12209  }
 12210  
 12211  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for TrackDescriptor.
 12212  func (td TrackDescriptor) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
 12213  	return nil, false
 12214  }
 12215  
 12216  // AsTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12217  func (td TrackDescriptor) AsTrackDescriptor() (*TrackDescriptor, bool) {
 12218  	return &td, true
 12219  }
 12220  
 12221  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12222  func (td TrackDescriptor) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
 12223  	return &td, true
 12224  }
 12225  
 12226  // TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource
 12227  // which has 'tags' and a 'location'
 12228  type TrackedResource struct {
 12229  	// Tags - Resource tags.
 12230  	Tags map[string]*string `json:"tags"`
 12231  	// Location - The geo-location where the resource lives
 12232  	Location *string `json:"location,omitempty"`
 12233  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 12234  	ID *string `json:"id,omitempty"`
 12235  	// Name - READ-ONLY; The name of the resource
 12236  	Name *string `json:"name,omitempty"`
 12237  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 12238  	Type *string `json:"type,omitempty"`
 12239  }
 12240  
 12241  // MarshalJSON is the custom marshaler for TrackedResource.
 12242  func (tr TrackedResource) MarshalJSON() ([]byte, error) {
 12243  	objectMap := make(map[string]interface{})
 12244  	if tr.Tags != nil {
 12245  		objectMap["tags"] = tr.Tags
 12246  	}
 12247  	if tr.Location != nil {
 12248  		objectMap["location"] = tr.Location
 12249  	}
 12250  	return json.Marshal(objectMap)
 12251  }
 12252  
 12253  // TrackPropertyCondition class to specify one track property condition
 12254  type TrackPropertyCondition struct {
 12255  	// Property - Track property type. Possible values include: 'TrackPropertyTypeUnknown', 'TrackPropertyTypeFourCC'
 12256  	Property TrackPropertyType `json:"property,omitempty"`
 12257  	// Operation - Track property condition operation. Possible values include: 'TrackPropertyCompareOperationUnknown', 'TrackPropertyCompareOperationEqual'
 12258  	Operation TrackPropertyCompareOperation `json:"operation,omitempty"`
 12259  	// Value - Track property value
 12260  	Value *string `json:"value,omitempty"`
 12261  }
 12262  
 12263  // TrackSelection class to select a track
 12264  type TrackSelection struct {
 12265  	// TrackSelections - TrackSelections is a track property condition list which can specify track(s)
 12266  	TrackSelections *[]TrackPropertyCondition `json:"trackSelections,omitempty"`
 12267  }
 12268  
 12269  // Transform a Transform encapsulates the rules or instructions for generating desired outputs from input
 12270  // media, such as by transcoding or by extracting insights. After the Transform is created, it can be
 12271  // applied to input media by creating Jobs.
 12272  type Transform struct {
 12273  	autorest.Response `json:"-"`
 12274  	// TransformProperties - The resource properties.
 12275  	*TransformProperties `json:"properties,omitempty"`
 12276  	// SystemData - READ-ONLY; The system metadata relating to this resource.
 12277  	SystemData *SystemData `json:"systemData,omitempty"`
 12278  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 12279  	ID *string `json:"id,omitempty"`
 12280  	// Name - READ-ONLY; The name of the resource
 12281  	Name *string `json:"name,omitempty"`
 12282  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 12283  	Type *string `json:"type,omitempty"`
 12284  }
 12285  
 12286  // MarshalJSON is the custom marshaler for Transform.
 12287  func (t Transform) MarshalJSON() ([]byte, error) {
 12288  	objectMap := make(map[string]interface{})
 12289  	if t.TransformProperties != nil {
 12290  		objectMap["properties"] = t.TransformProperties
 12291  	}
 12292  	return json.Marshal(objectMap)
 12293  }
 12294  
 12295  // UnmarshalJSON is the custom unmarshaler for Transform struct.
 12296  func (t *Transform) UnmarshalJSON(body []byte) error {
 12297  	var m map[string]*json.RawMessage
 12298  	err := json.Unmarshal(body, &m)
 12299  	if err != nil {
 12300  		return err
 12301  	}
 12302  	for k, v := range m {
 12303  		switch k {
 12304  		case "properties":
 12305  			if v != nil {
 12306  				var transformProperties TransformProperties
 12307  				err = json.Unmarshal(*v, &transformProperties)
 12308  				if err != nil {
 12309  					return err
 12310  				}
 12311  				t.TransformProperties = &transformProperties
 12312  			}
 12313  		case "systemData":
 12314  			if v != nil {
 12315  				var systemData SystemData
 12316  				err = json.Unmarshal(*v, &systemData)
 12317  				if err != nil {
 12318  					return err
 12319  				}
 12320  				t.SystemData = &systemData
 12321  			}
 12322  		case "id":
 12323  			if v != nil {
 12324  				var ID string
 12325  				err = json.Unmarshal(*v, &ID)
 12326  				if err != nil {
 12327  					return err
 12328  				}
 12329  				t.ID = &ID
 12330  			}
 12331  		case "name":
 12332  			if v != nil {
 12333  				var name string
 12334  				err = json.Unmarshal(*v, &name)
 12335  				if err != nil {
 12336  					return err
 12337  				}
 12338  				t.Name = &name
 12339  			}
 12340  		case "type":
 12341  			if v != nil {
 12342  				var typeVar string
 12343  				err = json.Unmarshal(*v, &typeVar)
 12344  				if err != nil {
 12345  					return err
 12346  				}
 12347  				t.Type = &typeVar
 12348  			}
 12349  		}
 12350  	}
 12351  
 12352  	return nil
 12353  }
 12354  
 12355  // TransformCollection a collection of Transform items.
 12356  type TransformCollection struct {
 12357  	autorest.Response `json:"-"`
 12358  	// Value - A collection of Transform items.
 12359  	Value *[]Transform `json:"value,omitempty"`
 12360  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
 12361  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
 12362  }
 12363  
 12364  // TransformCollectionIterator provides access to a complete listing of Transform values.
 12365  type TransformCollectionIterator struct {
 12366  	i    int
 12367  	page TransformCollectionPage
 12368  }
 12369  
 12370  // NextWithContext advances to the next value.  If there was an error making
 12371  // the request the iterator does not advance and the error is returned.
 12372  func (iter *TransformCollectionIterator) NextWithContext(ctx context.Context) (err error) {
 12373  	if tracing.IsEnabled() {
 12374  		ctx = tracing.StartSpan(ctx, fqdn+"/TransformCollectionIterator.NextWithContext")
 12375  		defer func() {
 12376  			sc := -1
 12377  			if iter.Response().Response.Response != nil {
 12378  				sc = iter.Response().Response.Response.StatusCode
 12379  			}
 12380  			tracing.EndSpan(ctx, sc, err)
 12381  		}()
 12382  	}
 12383  	iter.i++
 12384  	if iter.i < len(iter.page.Values()) {
 12385  		return nil
 12386  	}
 12387  	err = iter.page.NextWithContext(ctx)
 12388  	if err != nil {
 12389  		iter.i--
 12390  		return err
 12391  	}
 12392  	iter.i = 0
 12393  	return nil
 12394  }
 12395  
 12396  // Next advances to the next value.  If there was an error making
 12397  // the request the iterator does not advance and the error is returned.
 12398  // Deprecated: Use NextWithContext() instead.
 12399  func (iter *TransformCollectionIterator) Next() error {
 12400  	return iter.NextWithContext(context.Background())
 12401  }
 12402  
 12403  // NotDone returns true if the enumeration should be started or is not yet complete.
 12404  func (iter TransformCollectionIterator) NotDone() bool {
 12405  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
 12406  }
 12407  
 12408  // Response returns the raw server response from the last page request.
 12409  func (iter TransformCollectionIterator) Response() TransformCollection {
 12410  	return iter.page.Response()
 12411  }
 12412  
 12413  // Value returns the current value or a zero-initialized value if the
 12414  // iterator has advanced beyond the end of the collection.
 12415  func (iter TransformCollectionIterator) Value() Transform {
 12416  	if !iter.page.NotDone() {
 12417  		return Transform{}
 12418  	}
 12419  	return iter.page.Values()[iter.i]
 12420  }
 12421  
 12422  // Creates a new instance of the TransformCollectionIterator type.
 12423  func NewTransformCollectionIterator(page TransformCollectionPage) TransformCollectionIterator {
 12424  	return TransformCollectionIterator{page: page}
 12425  }
 12426  
 12427  // IsEmpty returns true if the ListResult contains no values.
 12428  func (tc TransformCollection) IsEmpty() bool {
 12429  	return tc.Value == nil || len(*tc.Value) == 0
 12430  }
 12431  
 12432  // hasNextLink returns true if the NextLink is not empty.
 12433  func (tc TransformCollection) hasNextLink() bool {
 12434  	return tc.OdataNextLink != nil && len(*tc.OdataNextLink) != 0
 12435  }
 12436  
 12437  // transformCollectionPreparer prepares a request to retrieve the next set of results.
 12438  // It returns nil if no more results exist.
 12439  func (tc TransformCollection) transformCollectionPreparer(ctx context.Context) (*http.Request, error) {
 12440  	if !tc.hasNextLink() {
 12441  		return nil, nil
 12442  	}
 12443  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
 12444  		autorest.AsJSON(),
 12445  		autorest.AsGet(),
 12446  		autorest.WithBaseURL(to.String(tc.OdataNextLink)))
 12447  }
 12448  
 12449  // TransformCollectionPage contains a page of Transform values.
 12450  type TransformCollectionPage struct {
 12451  	fn func(context.Context, TransformCollection) (TransformCollection, error)
 12452  	tc TransformCollection
 12453  }
 12454  
 12455  // NextWithContext advances to the next page of values.  If there was an error making
 12456  // the request the page does not advance and the error is returned.
 12457  func (page *TransformCollectionPage) NextWithContext(ctx context.Context) (err error) {
 12458  	if tracing.IsEnabled() {
 12459  		ctx = tracing.StartSpan(ctx, fqdn+"/TransformCollectionPage.NextWithContext")
 12460  		defer func() {
 12461  			sc := -1
 12462  			if page.Response().Response.Response != nil {
 12463  				sc = page.Response().Response.Response.StatusCode
 12464  			}
 12465  			tracing.EndSpan(ctx, sc, err)
 12466  		}()
 12467  	}
 12468  	for {
 12469  		next, err := page.fn(ctx, page.tc)
 12470  		if err != nil {
 12471  			return err
 12472  		}
 12473  		page.tc = next
 12474  		if !next.hasNextLink() || !next.IsEmpty() {
 12475  			break
 12476  		}
 12477  	}
 12478  	return nil
 12479  }
 12480  
 12481  // Next advances to the next page of values.  If there was an error making
 12482  // the request the page does not advance and the error is returned.
 12483  // Deprecated: Use NextWithContext() instead.
 12484  func (page *TransformCollectionPage) Next() error {
 12485  	return page.NextWithContext(context.Background())
 12486  }
 12487  
 12488  // NotDone returns true if the page enumeration should be started or is not yet complete.
 12489  func (page TransformCollectionPage) NotDone() bool {
 12490  	return !page.tc.IsEmpty()
 12491  }
 12492  
 12493  // Response returns the raw server response from the last page request.
 12494  func (page TransformCollectionPage) Response() TransformCollection {
 12495  	return page.tc
 12496  }
 12497  
 12498  // Values returns the slice of values for the current page or nil if there are no values.
 12499  func (page TransformCollectionPage) Values() []Transform {
 12500  	if page.tc.IsEmpty() {
 12501  		return nil
 12502  	}
 12503  	return *page.tc.Value
 12504  }
 12505  
 12506  // Creates a new instance of the TransformCollectionPage type.
 12507  func NewTransformCollectionPage(cur TransformCollection, getNextPage func(context.Context, TransformCollection) (TransformCollection, error)) TransformCollectionPage {
 12508  	return TransformCollectionPage{
 12509  		fn: getNextPage,
 12510  		tc: cur,
 12511  	}
 12512  }
 12513  
 12514  // TransformOutput describes the properties of a TransformOutput, which are the rules to be applied while
 12515  // generating the desired output.
 12516  type TransformOutput struct {
 12517  	// 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'
 12518  	OnError OnErrorType `json:"onError,omitempty"`
 12519  	// 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'
 12520  	RelativePriority Priority `json:"relativePriority,omitempty"`
 12521  	// Preset - Preset that describes the operations that will be used to modify, transcode, or extract insights from the source file to generate the output.
 12522  	Preset BasicPreset `json:"preset,omitempty"`
 12523  }
 12524  
 12525  // UnmarshalJSON is the custom unmarshaler for TransformOutput struct.
 12526  func (toVar *TransformOutput) UnmarshalJSON(body []byte) error {
 12527  	var m map[string]*json.RawMessage
 12528  	err := json.Unmarshal(body, &m)
 12529  	if err != nil {
 12530  		return err
 12531  	}
 12532  	for k, v := range m {
 12533  		switch k {
 12534  		case "onError":
 12535  			if v != nil {
 12536  				var onError OnErrorType
 12537  				err = json.Unmarshal(*v, &onError)
 12538  				if err != nil {
 12539  					return err
 12540  				}
 12541  				toVar.OnError = onError
 12542  			}
 12543  		case "relativePriority":
 12544  			if v != nil {
 12545  				var relativePriority Priority
 12546  				err = json.Unmarshal(*v, &relativePriority)
 12547  				if err != nil {
 12548  					return err
 12549  				}
 12550  				toVar.RelativePriority = relativePriority
 12551  			}
 12552  		case "preset":
 12553  			if v != nil {
 12554  				preset, err := unmarshalBasicPreset(*v)
 12555  				if err != nil {
 12556  					return err
 12557  				}
 12558  				toVar.Preset = preset
 12559  			}
 12560  		}
 12561  	}
 12562  
 12563  	return nil
 12564  }
 12565  
 12566  // TransformProperties a Transform.
 12567  type TransformProperties struct {
 12568  	// Created - READ-ONLY; The UTC date and time when the Transform was created, in 'YYYY-MM-DDThh:mm:ssZ' format.
 12569  	Created *date.Time `json:"created,omitempty"`
 12570  	// Description - An optional verbose description of the Transform.
 12571  	Description *string `json:"description,omitempty"`
 12572  	// LastModified - READ-ONLY; The UTC date and time when the Transform was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format.
 12573  	LastModified *date.Time `json:"lastModified,omitempty"`
 12574  	// Outputs - An array of one or more TransformOutputs that the Transform should generate.
 12575  	Outputs *[]TransformOutput `json:"outputs,omitempty"`
 12576  }
 12577  
 12578  // MarshalJSON is the custom marshaler for TransformProperties.
 12579  func (tp TransformProperties) MarshalJSON() ([]byte, error) {
 12580  	objectMap := make(map[string]interface{})
 12581  	if tp.Description != nil {
 12582  		objectMap["description"] = tp.Description
 12583  	}
 12584  	if tp.Outputs != nil {
 12585  		objectMap["outputs"] = tp.Outputs
 12586  	}
 12587  	return json.Marshal(objectMap)
 12588  }
 12589  
 12590  // TransportStreamFormat describes the properties for generating an MPEG-2 Transport Stream (ISO/IEC
 12591  // 13818-1) output video file(s).
 12592  type TransportStreamFormat struct {
 12593  	// 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 .
 12594  	OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
 12595  	// 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.
 12596  	FilenamePattern *string `json:"filenamePattern,omitempty"`
 12597  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
 12598  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
 12599  }
 12600  
 12601  // MarshalJSON is the custom marshaler for TransportStreamFormat.
 12602  func (tsf TransportStreamFormat) MarshalJSON() ([]byte, error) {
 12603  	tsf.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat
 12604  	objectMap := make(map[string]interface{})
 12605  	if tsf.OutputFiles != nil {
 12606  		objectMap["outputFiles"] = tsf.OutputFiles
 12607  	}
 12608  	if tsf.FilenamePattern != nil {
 12609  		objectMap["filenamePattern"] = tsf.FilenamePattern
 12610  	}
 12611  	if tsf.OdataType != "" {
 12612  		objectMap["@odata.type"] = tsf.OdataType
 12613  	}
 12614  	return json.Marshal(objectMap)
 12615  }
 12616  
 12617  // AsImageFormat is the BasicFormat implementation for TransportStreamFormat.
 12618  func (tsf TransportStreamFormat) AsImageFormat() (*ImageFormat, bool) {
 12619  	return nil, false
 12620  }
 12621  
 12622  // AsBasicImageFormat is the BasicFormat implementation for TransportStreamFormat.
 12623  func (tsf TransportStreamFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
 12624  	return nil, false
 12625  }
 12626  
 12627  // AsJpgFormat is the BasicFormat implementation for TransportStreamFormat.
 12628  func (tsf TransportStreamFormat) AsJpgFormat() (*JpgFormat, bool) {
 12629  	return nil, false
 12630  }
 12631  
 12632  // AsPngFormat is the BasicFormat implementation for TransportStreamFormat.
 12633  func (tsf TransportStreamFormat) AsPngFormat() (*PngFormat, bool) {
 12634  	return nil, false
 12635  }
 12636  
 12637  // AsMultiBitrateFormat is the BasicFormat implementation for TransportStreamFormat.
 12638  func (tsf TransportStreamFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
 12639  	return nil, false
 12640  }
 12641  
 12642  // AsBasicMultiBitrateFormat is the BasicFormat implementation for TransportStreamFormat.
 12643  func (tsf TransportStreamFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
 12644  	return &tsf, true
 12645  }
 12646  
 12647  // AsMp4Format is the BasicFormat implementation for TransportStreamFormat.
 12648  func (tsf TransportStreamFormat) AsMp4Format() (*Mp4Format, bool) {
 12649  	return nil, false
 12650  }
 12651  
 12652  // AsTransportStreamFormat is the BasicFormat implementation for TransportStreamFormat.
 12653  func (tsf TransportStreamFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
 12654  	return &tsf, true
 12655  }
 12656  
 12657  // AsFormat is the BasicFormat implementation for TransportStreamFormat.
 12658  func (tsf TransportStreamFormat) AsFormat() (*Format, bool) {
 12659  	return nil, false
 12660  }
 12661  
 12662  // AsBasicFormat is the BasicFormat implementation for TransportStreamFormat.
 12663  func (tsf TransportStreamFormat) AsBasicFormat() (BasicFormat, bool) {
 12664  	return &tsf, true
 12665  }
 12666  
 12667  // UserAssignedManagedIdentity ...
 12668  type UserAssignedManagedIdentity struct {
 12669  	// ClientID - READ-ONLY; The client ID.
 12670  	ClientID *uuid.UUID `json:"clientId,omitempty"`
 12671  	// PrincipalID - READ-ONLY; The principal ID.
 12672  	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
 12673  }
 12674  
 12675  // MarshalJSON is the custom marshaler for UserAssignedManagedIdentity.
 12676  func (uami UserAssignedManagedIdentity) MarshalJSON() ([]byte, error) {
 12677  	objectMap := make(map[string]interface{})
 12678  	return json.Marshal(objectMap)
 12679  }
 12680  
 12681  // UtcClipTime specifies the clip time as a Utc time position in the media file.  The Utc time can point to
 12682  // a different position depending on whether the media file starts from a timestamp of zero or not.
 12683  type UtcClipTime struct {
 12684  	// Time - The time position on the timeline of the input media based on Utc time.
 12685  	Time *date.Time `json:"time,omitempty"`
 12686  	// OdataType - Possible values include: 'OdataTypeBasicClipTimeOdataTypeClipTime', 'OdataTypeBasicClipTimeOdataTypeMicrosoftMediaAbsoluteClipTime', 'OdataTypeBasicClipTimeOdataTypeMicrosoftMediaUtcClipTime'
 12687  	OdataType OdataTypeBasicClipTime `json:"@odata.type,omitempty"`
 12688  }
 12689  
 12690  // MarshalJSON is the custom marshaler for UtcClipTime.
 12691  func (uct UtcClipTime) MarshalJSON() ([]byte, error) {
 12692  	uct.OdataType = OdataTypeBasicClipTimeOdataTypeMicrosoftMediaUtcClipTime
 12693  	objectMap := make(map[string]interface{})
 12694  	if uct.Time != nil {
 12695  		objectMap["time"] = uct.Time
 12696  	}
 12697  	if uct.OdataType != "" {
 12698  		objectMap["@odata.type"] = uct.OdataType
 12699  	}
 12700  	return json.Marshal(objectMap)
 12701  }
 12702  
 12703  // AsAbsoluteClipTime is the BasicClipTime implementation for UtcClipTime.
 12704  func (uct UtcClipTime) AsAbsoluteClipTime() (*AbsoluteClipTime, bool) {
 12705  	return nil, false
 12706  }
 12707  
 12708  // AsUtcClipTime is the BasicClipTime implementation for UtcClipTime.
 12709  func (uct UtcClipTime) AsUtcClipTime() (*UtcClipTime, bool) {
 12710  	return &uct, true
 12711  }
 12712  
 12713  // AsClipTime is the BasicClipTime implementation for UtcClipTime.
 12714  func (uct UtcClipTime) AsClipTime() (*ClipTime, bool) {
 12715  	return nil, false
 12716  }
 12717  
 12718  // AsBasicClipTime is the BasicClipTime implementation for UtcClipTime.
 12719  func (uct UtcClipTime) AsBasicClipTime() (BasicClipTime, bool) {
 12720  	return &uct, true
 12721  }
 12722  
 12723  // BasicVideo describes the basic properties for encoding the input video.
 12724  type BasicVideo interface {
 12725  	AsH265Video() (*H265Video, bool)
 12726  	AsImage() (*Image, bool)
 12727  	AsBasicImage() (BasicImage, bool)
 12728  	AsH264Video() (*H264Video, bool)
 12729  	AsJpgImage() (*JpgImage, bool)
 12730  	AsPngImage() (*PngImage, bool)
 12731  	AsVideo() (*Video, bool)
 12732  }
 12733  
 12734  // Video describes the basic properties for encoding the input video.
 12735  type Video struct {
 12736  	// 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.
 12737  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
 12738  	// 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'
 12739  	StretchMode StretchMode `json:"stretchMode,omitempty"`
 12740  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
 12741  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
 12742  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
 12743  	Label *string `json:"label,omitempty"`
 12744  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
 12745  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
 12746  }
 12747  
 12748  func unmarshalBasicVideo(body []byte) (BasicVideo, error) {
 12749  	var m map[string]interface{}
 12750  	err := json.Unmarshal(body, &m)
 12751  	if err != nil {
 12752  		return nil, err
 12753  	}
 12754  
 12755  	switch m["@odata.type"] {
 12756  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video):
 12757  		var hv H265Video
 12758  		err := json.Unmarshal(body, &hv)
 12759  		return hv, err
 12760  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaImage):
 12761  		var i Image
 12762  		err := json.Unmarshal(body, &i)
 12763  		return i, err
 12764  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video):
 12765  		var hv H264Video
 12766  		err := json.Unmarshal(body, &hv)
 12767  		return hv, err
 12768  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage):
 12769  		var ji JpgImage
 12770  		err := json.Unmarshal(body, &ji)
 12771  		return ji, err
 12772  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage):
 12773  		var pi PngImage
 12774  		err := json.Unmarshal(body, &pi)
 12775  		return pi, err
 12776  	default:
 12777  		var vVar Video
 12778  		err := json.Unmarshal(body, &vVar)
 12779  		return vVar, err
 12780  	}
 12781  }
 12782  func unmarshalBasicVideoArray(body []byte) ([]BasicVideo, error) {
 12783  	var rawMessages []*json.RawMessage
 12784  	err := json.Unmarshal(body, &rawMessages)
 12785  	if err != nil {
 12786  		return nil, err
 12787  	}
 12788  
 12789  	vVarArray := make([]BasicVideo, len(rawMessages))
 12790  
 12791  	for index, rawMessage := range rawMessages {
 12792  		vVar, err := unmarshalBasicVideo(*rawMessage)
 12793  		if err != nil {
 12794  			return nil, err
 12795  		}
 12796  		vVarArray[index] = vVar
 12797  	}
 12798  	return vVarArray, nil
 12799  }
 12800  
 12801  // MarshalJSON is the custom marshaler for Video.
 12802  func (vVar Video) MarshalJSON() ([]byte, error) {
 12803  	vVar.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo
 12804  	objectMap := make(map[string]interface{})
 12805  	if vVar.KeyFrameInterval != nil {
 12806  		objectMap["keyFrameInterval"] = vVar.KeyFrameInterval
 12807  	}
 12808  	if vVar.StretchMode != "" {
 12809  		objectMap["stretchMode"] = vVar.StretchMode
 12810  	}
 12811  	if vVar.SyncMode != "" {
 12812  		objectMap["syncMode"] = vVar.SyncMode
 12813  	}
 12814  	if vVar.Label != nil {
 12815  		objectMap["label"] = vVar.Label
 12816  	}
 12817  	if vVar.OdataType != "" {
 12818  		objectMap["@odata.type"] = vVar.OdataType
 12819  	}
 12820  	return json.Marshal(objectMap)
 12821  }
 12822  
 12823  // AsAudio is the BasicCodec implementation for Video.
 12824  func (vVar Video) AsAudio() (*Audio, bool) {
 12825  	return nil, false
 12826  }
 12827  
 12828  // AsBasicAudio is the BasicCodec implementation for Video.
 12829  func (vVar Video) AsBasicAudio() (BasicAudio, bool) {
 12830  	return nil, false
 12831  }
 12832  
 12833  // AsAacAudio is the BasicCodec implementation for Video.
 12834  func (vVar Video) AsAacAudio() (*AacAudio, bool) {
 12835  	return nil, false
 12836  }
 12837  
 12838  // AsVideo is the BasicCodec implementation for Video.
 12839  func (vVar Video) AsVideo() (*Video, bool) {
 12840  	return &vVar, true
 12841  }
 12842  
 12843  // AsBasicVideo is the BasicCodec implementation for Video.
 12844  func (vVar Video) AsBasicVideo() (BasicVideo, bool) {
 12845  	return &vVar, true
 12846  }
 12847  
 12848  // AsH265Video is the BasicCodec implementation for Video.
 12849  func (vVar Video) AsH265Video() (*H265Video, bool) {
 12850  	return nil, false
 12851  }
 12852  
 12853  // AsCopyVideo is the BasicCodec implementation for Video.
 12854  func (vVar Video) AsCopyVideo() (*CopyVideo, bool) {
 12855  	return nil, false
 12856  }
 12857  
 12858  // AsImage is the BasicCodec implementation for Video.
 12859  func (vVar Video) AsImage() (*Image, bool) {
 12860  	return nil, false
 12861  }
 12862  
 12863  // AsBasicImage is the BasicCodec implementation for Video.
 12864  func (vVar Video) AsBasicImage() (BasicImage, bool) {
 12865  	return nil, false
 12866  }
 12867  
 12868  // AsCopyAudio is the BasicCodec implementation for Video.
 12869  func (vVar Video) AsCopyAudio() (*CopyAudio, bool) {
 12870  	return nil, false
 12871  }
 12872  
 12873  // AsH264Video is the BasicCodec implementation for Video.
 12874  func (vVar Video) AsH264Video() (*H264Video, bool) {
 12875  	return nil, false
 12876  }
 12877  
 12878  // AsJpgImage is the BasicCodec implementation for Video.
 12879  func (vVar Video) AsJpgImage() (*JpgImage, bool) {
 12880  	return nil, false
 12881  }
 12882  
 12883  // AsPngImage is the BasicCodec implementation for Video.
 12884  func (vVar Video) AsPngImage() (*PngImage, bool) {
 12885  	return nil, false
 12886  }
 12887  
 12888  // AsCodec is the BasicCodec implementation for Video.
 12889  func (vVar Video) AsCodec() (*Codec, bool) {
 12890  	return nil, false
 12891  }
 12892  
 12893  // AsBasicCodec is the BasicCodec implementation for Video.
 12894  func (vVar Video) AsBasicCodec() (BasicCodec, bool) {
 12895  	return &vVar, true
 12896  }
 12897  
 12898  // VideoAnalyzerPreset a video analyzer preset that extracts insights (rich metadata) from both audio and
 12899  // video, and outputs a JSON format file.
 12900  type VideoAnalyzerPreset struct {
 12901  	// 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'
 12902  	InsightsToExtract InsightsType `json:"insightsToExtract,omitempty"`
 12903  	// 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
 12904  	AudioLanguage *string `json:"audioLanguage,omitempty"`
 12905  	// Mode - Determines the set of audio analysis operations to be performed. If unspecified, the Standard AudioAnalysisMode would be chosen. Possible values include: 'AudioAnalysisModeStandard', 'AudioAnalysisModeBasic'
 12906  	Mode AudioAnalysisMode `json:"mode,omitempty"`
 12907  	// ExperimentalOptions - Dictionary containing key value pairs for parameters not exposed in the preset itself
 12908  	ExperimentalOptions map[string]*string `json:"experimentalOptions"`
 12909  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
 12910  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
 12911  }
 12912  
 12913  // MarshalJSON is the custom marshaler for VideoAnalyzerPreset.
 12914  func (vap VideoAnalyzerPreset) MarshalJSON() ([]byte, error) {
 12915  	vap.OdataType = OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset
 12916  	objectMap := make(map[string]interface{})
 12917  	if vap.InsightsToExtract != "" {
 12918  		objectMap["insightsToExtract"] = vap.InsightsToExtract
 12919  	}
 12920  	if vap.AudioLanguage != nil {
 12921  		objectMap["audioLanguage"] = vap.AudioLanguage
 12922  	}
 12923  	if vap.Mode != "" {
 12924  		objectMap["mode"] = vap.Mode
 12925  	}
 12926  	if vap.ExperimentalOptions != nil {
 12927  		objectMap["experimentalOptions"] = vap.ExperimentalOptions
 12928  	}
 12929  	if vap.OdataType != "" {
 12930  		objectMap["@odata.type"] = vap.OdataType
 12931  	}
 12932  	return json.Marshal(objectMap)
 12933  }
 12934  
 12935  // AsFaceDetectorPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12936  func (vap VideoAnalyzerPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
 12937  	return nil, false
 12938  }
 12939  
 12940  // AsAudioAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12941  func (vap VideoAnalyzerPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
 12942  	return nil, false
 12943  }
 12944  
 12945  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12946  func (vap VideoAnalyzerPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
 12947  	return &vap, true
 12948  }
 12949  
 12950  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12951  func (vap VideoAnalyzerPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
 12952  	return nil, false
 12953  }
 12954  
 12955  // AsStandardEncoderPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12956  func (vap VideoAnalyzerPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
 12957  	return nil, false
 12958  }
 12959  
 12960  // AsVideoAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12961  func (vap VideoAnalyzerPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
 12962  	return &vap, true
 12963  }
 12964  
 12965  // AsPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12966  func (vap VideoAnalyzerPreset) AsPreset() (*Preset, bool) {
 12967  	return nil, false
 12968  }
 12969  
 12970  // AsBasicPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12971  func (vap VideoAnalyzerPreset) AsBasicPreset() (BasicPreset, bool) {
 12972  	return &vap, true
 12973  }
 12974  
 12975  // BasicVideoLayer describes the settings to be used when encoding the input video into a desired output bitrate layer.
 12976  type BasicVideoLayer interface {
 12977  	AsH264Layer() (*H264Layer, bool)
 12978  	AsVideoLayer() (*VideoLayer, bool)
 12979  }
 12980  
 12981  // VideoLayer describes the settings to be used when encoding the input video into a desired output bitrate
 12982  // layer.
 12983  type VideoLayer struct {
 12984  	// Bitrate - The average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field.
 12985  	Bitrate *int32 `json:"bitrate,omitempty"`
 12986  	// 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.
 12987  	MaxBitrate *int32 `json:"maxBitrate,omitempty"`
 12988  	// 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.
 12989  	BFrames *int32 `json:"bFrames,omitempty"`
 12990  	// 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.
 12991  	FrameRate *string `json:"frameRate,omitempty"`
 12992  	// 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.
 12993  	Slices *int32 `json:"slices,omitempty"`
 12994  	// 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.
 12995  	AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
 12996  	// 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.
 12997  	Width *string `json:"width,omitempty"`
 12998  	// 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.
 12999  	Height *string `json:"height,omitempty"`
 13000  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
 13001  	Label *string `json:"label,omitempty"`
 13002  	// OdataType - Possible values include: 'OdataTypeBasicLayerOdataTypeLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer'
 13003  	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
 13004  }
 13005  
 13006  func unmarshalBasicVideoLayer(body []byte) (BasicVideoLayer, error) {
 13007  	var m map[string]interface{}
 13008  	err := json.Unmarshal(body, &m)
 13009  	if err != nil {
 13010  		return nil, err
 13011  	}
 13012  
 13013  	switch m["@odata.type"] {
 13014  	case string(OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer):
 13015  		var hl H264Layer
 13016  		err := json.Unmarshal(body, &hl)
 13017  		return hl, err
 13018  	default:
 13019  		var vl VideoLayer
 13020  		err := json.Unmarshal(body, &vl)
 13021  		return vl, err
 13022  	}
 13023  }
 13024  func unmarshalBasicVideoLayerArray(body []byte) ([]BasicVideoLayer, error) {
 13025  	var rawMessages []*json.RawMessage
 13026  	err := json.Unmarshal(body, &rawMessages)
 13027  	if err != nil {
 13028  		return nil, err
 13029  	}
 13030  
 13031  	vlArray := make([]BasicVideoLayer, len(rawMessages))
 13032  
 13033  	for index, rawMessage := range rawMessages {
 13034  		vl, err := unmarshalBasicVideoLayer(*rawMessage)
 13035  		if err != nil {
 13036  			return nil, err
 13037  		}
 13038  		vlArray[index] = vl
 13039  	}
 13040  	return vlArray, nil
 13041  }
 13042  
 13043  // MarshalJSON is the custom marshaler for VideoLayer.
 13044  func (vl VideoLayer) MarshalJSON() ([]byte, error) {
 13045  	vl.OdataType = OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer
 13046  	objectMap := make(map[string]interface{})
 13047  	if vl.Bitrate != nil {
 13048  		objectMap["bitrate"] = vl.Bitrate
 13049  	}
 13050  	if vl.MaxBitrate != nil {
 13051  		objectMap["maxBitrate"] = vl.MaxBitrate
 13052  	}
 13053  	if vl.BFrames != nil {
 13054  		objectMap["bFrames"] = vl.BFrames
 13055  	}
 13056  	if vl.FrameRate != nil {
 13057  		objectMap["frameRate"] = vl.FrameRate
 13058  	}
 13059  	if vl.Slices != nil {
 13060  		objectMap["slices"] = vl.Slices
 13061  	}
 13062  	if vl.AdaptiveBFrame != nil {
 13063  		objectMap["adaptiveBFrame"] = vl.AdaptiveBFrame
 13064  	}
 13065  	if vl.Width != nil {
 13066  		objectMap["width"] = vl.Width
 13067  	}
 13068  	if vl.Height != nil {
 13069  		objectMap["height"] = vl.Height
 13070  	}
 13071  	if vl.Label != nil {
 13072  		objectMap["label"] = vl.Label
 13073  	}
 13074  	if vl.OdataType != "" {
 13075  		objectMap["@odata.type"] = vl.OdataType
 13076  	}
 13077  	return json.Marshal(objectMap)
 13078  }
 13079  
 13080  // AsH265VideoLayer is the BasicLayer implementation for VideoLayer.
 13081  func (vl VideoLayer) AsH265VideoLayer() (*H265VideoLayer, bool) {
 13082  	return nil, false
 13083  }
 13084  
 13085  // AsBasicH265VideoLayer is the BasicLayer implementation for VideoLayer.
 13086  func (vl VideoLayer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
 13087  	return nil, false
 13088  }
 13089  
 13090  // AsH265Layer is the BasicLayer implementation for VideoLayer.
 13091  func (vl VideoLayer) AsH265Layer() (*H265Layer, bool) {
 13092  	return nil, false
 13093  }
 13094  
 13095  // AsVideoLayer is the BasicLayer implementation for VideoLayer.
 13096  func (vl VideoLayer) AsVideoLayer() (*VideoLayer, bool) {
 13097  	return &vl, true
 13098  }
 13099  
 13100  // AsBasicVideoLayer is the BasicLayer implementation for VideoLayer.
 13101  func (vl VideoLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
 13102  	return &vl, true
 13103  }
 13104  
 13105  // AsH264Layer is the BasicLayer implementation for VideoLayer.
 13106  func (vl VideoLayer) AsH264Layer() (*H264Layer, bool) {
 13107  	return nil, false
 13108  }
 13109  
 13110  // AsJpgLayer is the BasicLayer implementation for VideoLayer.
 13111  func (vl VideoLayer) AsJpgLayer() (*JpgLayer, bool) {
 13112  	return nil, false
 13113  }
 13114  
 13115  // AsPngLayer is the BasicLayer implementation for VideoLayer.
 13116  func (vl VideoLayer) AsPngLayer() (*PngLayer, bool) {
 13117  	return nil, false
 13118  }
 13119  
 13120  // AsLayer is the BasicLayer implementation for VideoLayer.
 13121  func (vl VideoLayer) AsLayer() (*Layer, bool) {
 13122  	return nil, false
 13123  }
 13124  
 13125  // AsBasicLayer is the BasicLayer implementation for VideoLayer.
 13126  func (vl VideoLayer) AsBasicLayer() (BasicLayer, bool) {
 13127  	return &vl, true
 13128  }
 13129  
 13130  // VideoOverlay describes the properties of a video overlay.
 13131  type VideoOverlay struct {
 13132  	// Position - The location in the input video where the overlay is applied.
 13133  	Position *Rectangle `json:"position,omitempty"`
 13134  	// 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.
 13135  	Opacity *float64 `json:"opacity,omitempty"`
 13136  	// CropRectangle - An optional rectangular window used to crop the overlay image or video.
 13137  	CropRectangle *Rectangle `json:"cropRectangle,omitempty"`
 13138  	// 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.
 13139  	InputLabel *string `json:"inputLabel,omitempty"`
 13140  	// 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.
 13141  	Start *string `json:"start,omitempty"`
 13142  	// 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.
 13143  	End *string `json:"end,omitempty"`
 13144  	// 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).
 13145  	FadeInDuration *string `json:"fadeInDuration,omitempty"`
 13146  	// 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).
 13147  	FadeOutDuration *string `json:"fadeOutDuration,omitempty"`
 13148  	// AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0.
 13149  	AudioGainLevel *float64 `json:"audioGainLevel,omitempty"`
 13150  	// OdataType - Possible values include: 'OdataTypeBasicOverlayOdataTypeOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaVideoOverlay'
 13151  	OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"`
 13152  }
 13153  
 13154  // MarshalJSON is the custom marshaler for VideoOverlay.
 13155  func (vo VideoOverlay) MarshalJSON() ([]byte, error) {
 13156  	vo.OdataType = OdataTypeBasicOverlayOdataTypeMicrosoftMediaVideoOverlay
 13157  	objectMap := make(map[string]interface{})
 13158  	if vo.Position != nil {
 13159  		objectMap["position"] = vo.Position
 13160  	}
 13161  	if vo.Opacity != nil {
 13162  		objectMap["opacity"] = vo.Opacity
 13163  	}
 13164  	if vo.CropRectangle != nil {
 13165  		objectMap["cropRectangle"] = vo.CropRectangle
 13166  	}
 13167  	if vo.InputLabel != nil {
 13168  		objectMap["inputLabel"] = vo.InputLabel
 13169  	}
 13170  	if vo.Start != nil {
 13171  		objectMap["start"] = vo.Start
 13172  	}
 13173  	if vo.End != nil {
 13174  		objectMap["end"] = vo.End
 13175  	}
 13176  	if vo.FadeInDuration != nil {
 13177  		objectMap["fadeInDuration"] = vo.FadeInDuration
 13178  	}
 13179  	if vo.FadeOutDuration != nil {
 13180  		objectMap["fadeOutDuration"] = vo.FadeOutDuration
 13181  	}
 13182  	if vo.AudioGainLevel != nil {
 13183  		objectMap["audioGainLevel"] = vo.AudioGainLevel
 13184  	}
 13185  	if vo.OdataType != "" {
 13186  		objectMap["@odata.type"] = vo.OdataType
 13187  	}
 13188  	return json.Marshal(objectMap)
 13189  }
 13190  
 13191  // AsAudioOverlay is the BasicOverlay implementation for VideoOverlay.
 13192  func (vo VideoOverlay) AsAudioOverlay() (*AudioOverlay, bool) {
 13193  	return nil, false
 13194  }
 13195  
 13196  // AsVideoOverlay is the BasicOverlay implementation for VideoOverlay.
 13197  func (vo VideoOverlay) AsVideoOverlay() (*VideoOverlay, bool) {
 13198  	return &vo, true
 13199  }
 13200  
 13201  // AsOverlay is the BasicOverlay implementation for VideoOverlay.
 13202  func (vo VideoOverlay) AsOverlay() (*Overlay, bool) {
 13203  	return nil, false
 13204  }
 13205  
 13206  // AsBasicOverlay is the BasicOverlay implementation for VideoOverlay.
 13207  func (vo VideoOverlay) AsBasicOverlay() (BasicOverlay, bool) {
 13208  	return &vo, true
 13209  }
 13210  
 13211  // BasicVideoTrackDescriptor a TrackSelection to select video tracks.
 13212  type BasicVideoTrackDescriptor interface {
 13213  	AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool)
 13214  	AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool)
 13215  	AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool)
 13216  }
 13217  
 13218  // VideoTrackDescriptor a TrackSelection to select video tracks.
 13219  type VideoTrackDescriptor struct {
 13220  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
 13221  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
 13222  }
 13223  
 13224  func unmarshalBasicVideoTrackDescriptor(body []byte) (BasicVideoTrackDescriptor, error) {
 13225  	var m map[string]interface{}
 13226  	err := json.Unmarshal(body, &m)
 13227  	if err != nil {
 13228  		return nil, err
 13229  	}
 13230  
 13231  	switch m["@odata.type"] {
 13232  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute):
 13233  		var svtba SelectVideoTrackByAttribute
 13234  		err := json.Unmarshal(body, &svtba)
 13235  		return svtba, err
 13236  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID):
 13237  		var svtbi SelectVideoTrackByID
 13238  		err := json.Unmarshal(body, &svtbi)
 13239  		return svtbi, err
 13240  	default:
 13241  		var vtd VideoTrackDescriptor
 13242  		err := json.Unmarshal(body, &vtd)
 13243  		return vtd, err
 13244  	}
 13245  }
 13246  func unmarshalBasicVideoTrackDescriptorArray(body []byte) ([]BasicVideoTrackDescriptor, error) {
 13247  	var rawMessages []*json.RawMessage
 13248  	err := json.Unmarshal(body, &rawMessages)
 13249  	if err != nil {
 13250  		return nil, err
 13251  	}
 13252  
 13253  	vtdArray := make([]BasicVideoTrackDescriptor, len(rawMessages))
 13254  
 13255  	for index, rawMessage := range rawMessages {
 13256  		vtd, err := unmarshalBasicVideoTrackDescriptor(*rawMessage)
 13257  		if err != nil {
 13258  			return nil, err
 13259  		}
 13260  		vtdArray[index] = vtd
 13261  	}
 13262  	return vtdArray, nil
 13263  }
 13264  
 13265  // MarshalJSON is the custom marshaler for VideoTrackDescriptor.
 13266  func (vtd VideoTrackDescriptor) MarshalJSON() ([]byte, error) {
 13267  	vtd.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor
 13268  	objectMap := make(map[string]interface{})
 13269  	if vtd.OdataType != "" {
 13270  		objectMap["@odata.type"] = vtd.OdataType
 13271  	}
 13272  	return json.Marshal(objectMap)
 13273  }
 13274  
 13275  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13276  func (vtd VideoTrackDescriptor) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
 13277  	return nil, false
 13278  }
 13279  
 13280  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13281  func (vtd VideoTrackDescriptor) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
 13282  	return nil, false
 13283  }
 13284  
 13285  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13286  func (vtd VideoTrackDescriptor) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
 13287  	return nil, false
 13288  }
 13289  
 13290  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13291  func (vtd VideoTrackDescriptor) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
 13292  	return nil, false
 13293  }
 13294  
 13295  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13296  func (vtd VideoTrackDescriptor) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
 13297  	return &vtd, true
 13298  }
 13299  
 13300  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13301  func (vtd VideoTrackDescriptor) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
 13302  	return &vtd, true
 13303  }
 13304  
 13305  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13306  func (vtd VideoTrackDescriptor) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
 13307  	return nil, false
 13308  }
 13309  
 13310  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13311  func (vtd VideoTrackDescriptor) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
 13312  	return nil, false
 13313  }
 13314  
 13315  // AsTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13316  func (vtd VideoTrackDescriptor) AsTrackDescriptor() (*TrackDescriptor, bool) {
 13317  	return nil, false
 13318  }
 13319  
 13320  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13321  func (vtd VideoTrackDescriptor) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
 13322  	return &vtd, true
 13323  }
 13324  

View as plain text