...

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

Documentation: github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-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-05-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  }
   198  
   199  // AccountFilter an Account Filter.
   200  type AccountFilter struct {
   201  	autorest.Response `json:"-"`
   202  	*FilterProperties `json:"properties,omitempty"`
   203  	// SystemData - READ-ONLY; The system metadata relating to this resource.
   204  	SystemData *SystemData `json:"systemData,omitempty"`
   205  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
   206  	ID *string `json:"id,omitempty"`
   207  	// Name - READ-ONLY; The name of the resource
   208  	Name *string `json:"name,omitempty"`
   209  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
   210  	Type *string `json:"type,omitempty"`
   211  }
   212  
   213  // MarshalJSON is the custom marshaler for AccountFilter.
   214  func (af AccountFilter) MarshalJSON() ([]byte, error) {
   215  	objectMap := make(map[string]interface{})
   216  	if af.FilterProperties != nil {
   217  		objectMap["properties"] = af.FilterProperties
   218  	}
   219  	return json.Marshal(objectMap)
   220  }
   221  
   222  // UnmarshalJSON is the custom unmarshaler for AccountFilter struct.
   223  func (af *AccountFilter) UnmarshalJSON(body []byte) error {
   224  	var m map[string]*json.RawMessage
   225  	err := json.Unmarshal(body, &m)
   226  	if err != nil {
   227  		return err
   228  	}
   229  	for k, v := range m {
   230  		switch k {
   231  		case "properties":
   232  			if v != nil {
   233  				var filterProperties FilterProperties
   234  				err = json.Unmarshal(*v, &filterProperties)
   235  				if err != nil {
   236  					return err
   237  				}
   238  				af.FilterProperties = &filterProperties
   239  			}
   240  		case "systemData":
   241  			if v != nil {
   242  				var systemData SystemData
   243  				err = json.Unmarshal(*v, &systemData)
   244  				if err != nil {
   245  					return err
   246  				}
   247  				af.SystemData = &systemData
   248  			}
   249  		case "id":
   250  			if v != nil {
   251  				var ID string
   252  				err = json.Unmarshal(*v, &ID)
   253  				if err != nil {
   254  					return err
   255  				}
   256  				af.ID = &ID
   257  			}
   258  		case "name":
   259  			if v != nil {
   260  				var name string
   261  				err = json.Unmarshal(*v, &name)
   262  				if err != nil {
   263  					return err
   264  				}
   265  				af.Name = &name
   266  			}
   267  		case "type":
   268  			if v != nil {
   269  				var typeVar string
   270  				err = json.Unmarshal(*v, &typeVar)
   271  				if err != nil {
   272  					return err
   273  				}
   274  				af.Type = &typeVar
   275  			}
   276  		}
   277  	}
   278  
   279  	return nil
   280  }
   281  
   282  // AccountFilterCollection a collection of AccountFilter items.
   283  type AccountFilterCollection struct {
   284  	autorest.Response `json:"-"`
   285  	// Value - A collection of AccountFilter items.
   286  	Value *[]AccountFilter `json:"value,omitempty"`
   287  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
   288  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
   289  }
   290  
   291  // AccountFilterCollectionIterator provides access to a complete listing of AccountFilter values.
   292  type AccountFilterCollectionIterator struct {
   293  	i    int
   294  	page AccountFilterCollectionPage
   295  }
   296  
   297  // NextWithContext advances to the next value.  If there was an error making
   298  // the request the iterator does not advance and the error is returned.
   299  func (iter *AccountFilterCollectionIterator) NextWithContext(ctx context.Context) (err error) {
   300  	if tracing.IsEnabled() {
   301  		ctx = tracing.StartSpan(ctx, fqdn+"/AccountFilterCollectionIterator.NextWithContext")
   302  		defer func() {
   303  			sc := -1
   304  			if iter.Response().Response.Response != nil {
   305  				sc = iter.Response().Response.Response.StatusCode
   306  			}
   307  			tracing.EndSpan(ctx, sc, err)
   308  		}()
   309  	}
   310  	iter.i++
   311  	if iter.i < len(iter.page.Values()) {
   312  		return nil
   313  	}
   314  	err = iter.page.NextWithContext(ctx)
   315  	if err != nil {
   316  		iter.i--
   317  		return err
   318  	}
   319  	iter.i = 0
   320  	return nil
   321  }
   322  
   323  // Next advances to the next value.  If there was an error making
   324  // the request the iterator does not advance and the error is returned.
   325  // Deprecated: Use NextWithContext() instead.
   326  func (iter *AccountFilterCollectionIterator) Next() error {
   327  	return iter.NextWithContext(context.Background())
   328  }
   329  
   330  // NotDone returns true if the enumeration should be started or is not yet complete.
   331  func (iter AccountFilterCollectionIterator) NotDone() bool {
   332  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   333  }
   334  
   335  // Response returns the raw server response from the last page request.
   336  func (iter AccountFilterCollectionIterator) Response() AccountFilterCollection {
   337  	return iter.page.Response()
   338  }
   339  
   340  // Value returns the current value or a zero-initialized value if the
   341  // iterator has advanced beyond the end of the collection.
   342  func (iter AccountFilterCollectionIterator) Value() AccountFilter {
   343  	if !iter.page.NotDone() {
   344  		return AccountFilter{}
   345  	}
   346  	return iter.page.Values()[iter.i]
   347  }
   348  
   349  // Creates a new instance of the AccountFilterCollectionIterator type.
   350  func NewAccountFilterCollectionIterator(page AccountFilterCollectionPage) AccountFilterCollectionIterator {
   351  	return AccountFilterCollectionIterator{page: page}
   352  }
   353  
   354  // IsEmpty returns true if the ListResult contains no values.
   355  func (afc AccountFilterCollection) IsEmpty() bool {
   356  	return afc.Value == nil || len(*afc.Value) == 0
   357  }
   358  
   359  // hasNextLink returns true if the NextLink is not empty.
   360  func (afc AccountFilterCollection) hasNextLink() bool {
   361  	return afc.OdataNextLink != nil && len(*afc.OdataNextLink) != 0
   362  }
   363  
   364  // accountFilterCollectionPreparer prepares a request to retrieve the next set of results.
   365  // It returns nil if no more results exist.
   366  func (afc AccountFilterCollection) accountFilterCollectionPreparer(ctx context.Context) (*http.Request, error) {
   367  	if !afc.hasNextLink() {
   368  		return nil, nil
   369  	}
   370  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   371  		autorest.AsJSON(),
   372  		autorest.AsGet(),
   373  		autorest.WithBaseURL(to.String(afc.OdataNextLink)))
   374  }
   375  
   376  // AccountFilterCollectionPage contains a page of AccountFilter values.
   377  type AccountFilterCollectionPage struct {
   378  	fn  func(context.Context, AccountFilterCollection) (AccountFilterCollection, error)
   379  	afc AccountFilterCollection
   380  }
   381  
   382  // NextWithContext advances to the next page of values.  If there was an error making
   383  // the request the page does not advance and the error is returned.
   384  func (page *AccountFilterCollectionPage) NextWithContext(ctx context.Context) (err error) {
   385  	if tracing.IsEnabled() {
   386  		ctx = tracing.StartSpan(ctx, fqdn+"/AccountFilterCollectionPage.NextWithContext")
   387  		defer func() {
   388  			sc := -1
   389  			if page.Response().Response.Response != nil {
   390  				sc = page.Response().Response.Response.StatusCode
   391  			}
   392  			tracing.EndSpan(ctx, sc, err)
   393  		}()
   394  	}
   395  	for {
   396  		next, err := page.fn(ctx, page.afc)
   397  		if err != nil {
   398  			return err
   399  		}
   400  		page.afc = next
   401  		if !next.hasNextLink() || !next.IsEmpty() {
   402  			break
   403  		}
   404  	}
   405  	return nil
   406  }
   407  
   408  // Next advances to the next page of values.  If there was an error making
   409  // the request the page does not advance and the error is returned.
   410  // Deprecated: Use NextWithContext() instead.
   411  func (page *AccountFilterCollectionPage) Next() error {
   412  	return page.NextWithContext(context.Background())
   413  }
   414  
   415  // NotDone returns true if the page enumeration should be started or is not yet complete.
   416  func (page AccountFilterCollectionPage) NotDone() bool {
   417  	return !page.afc.IsEmpty()
   418  }
   419  
   420  // Response returns the raw server response from the last page request.
   421  func (page AccountFilterCollectionPage) Response() AccountFilterCollection {
   422  	return page.afc
   423  }
   424  
   425  // Values returns the slice of values for the current page or nil if there are no values.
   426  func (page AccountFilterCollectionPage) Values() []AccountFilter {
   427  	if page.afc.IsEmpty() {
   428  		return nil
   429  	}
   430  	return *page.afc.Value
   431  }
   432  
   433  // Creates a new instance of the AccountFilterCollectionPage type.
   434  func NewAccountFilterCollectionPage(cur AccountFilterCollection, getNextPage func(context.Context, AccountFilterCollection) (AccountFilterCollection, error)) AccountFilterCollectionPage {
   435  	return AccountFilterCollectionPage{
   436  		fn:  getNextPage,
   437  		afc: cur,
   438  	}
   439  }
   440  
   441  // AkamaiAccessControl akamai access control
   442  type AkamaiAccessControl struct {
   443  	// AkamaiSignatureHeaderAuthenticationKeyList - authentication key list
   444  	AkamaiSignatureHeaderAuthenticationKeyList *[]AkamaiSignatureHeaderAuthenticationKey `json:"akamaiSignatureHeaderAuthenticationKeyList,omitempty"`
   445  }
   446  
   447  // AkamaiSignatureHeaderAuthenticationKey akamai Signature Header authentication key.
   448  type AkamaiSignatureHeaderAuthenticationKey struct {
   449  	// Identifier - identifier of the key
   450  	Identifier *string `json:"identifier,omitempty"`
   451  	// Base64Key - authentication key
   452  	Base64Key *string `json:"base64Key,omitempty"`
   453  	// Expiration - The expiration time of the authentication key.
   454  	Expiration *date.Time `json:"expiration,omitempty"`
   455  }
   456  
   457  // APIError the API error.
   458  type APIError struct {
   459  	// Error - The error properties.
   460  	Error *ODataError `json:"error,omitempty"`
   461  }
   462  
   463  // Asset an Asset.
   464  type Asset struct {
   465  	autorest.Response `json:"-"`
   466  	// AssetProperties - The resource properties.
   467  	*AssetProperties `json:"properties,omitempty"`
   468  	// SystemData - READ-ONLY; The system metadata relating to this resource.
   469  	SystemData *SystemData `json:"systemData,omitempty"`
   470  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
   471  	ID *string `json:"id,omitempty"`
   472  	// Name - READ-ONLY; The name of the resource
   473  	Name *string `json:"name,omitempty"`
   474  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
   475  	Type *string `json:"type,omitempty"`
   476  }
   477  
   478  // MarshalJSON is the custom marshaler for Asset.
   479  func (a Asset) MarshalJSON() ([]byte, error) {
   480  	objectMap := make(map[string]interface{})
   481  	if a.AssetProperties != nil {
   482  		objectMap["properties"] = a.AssetProperties
   483  	}
   484  	return json.Marshal(objectMap)
   485  }
   486  
   487  // UnmarshalJSON is the custom unmarshaler for Asset struct.
   488  func (a *Asset) UnmarshalJSON(body []byte) error {
   489  	var m map[string]*json.RawMessage
   490  	err := json.Unmarshal(body, &m)
   491  	if err != nil {
   492  		return err
   493  	}
   494  	for k, v := range m {
   495  		switch k {
   496  		case "properties":
   497  			if v != nil {
   498  				var assetProperties AssetProperties
   499  				err = json.Unmarshal(*v, &assetProperties)
   500  				if err != nil {
   501  					return err
   502  				}
   503  				a.AssetProperties = &assetProperties
   504  			}
   505  		case "systemData":
   506  			if v != nil {
   507  				var systemData SystemData
   508  				err = json.Unmarshal(*v, &systemData)
   509  				if err != nil {
   510  					return err
   511  				}
   512  				a.SystemData = &systemData
   513  			}
   514  		case "id":
   515  			if v != nil {
   516  				var ID string
   517  				err = json.Unmarshal(*v, &ID)
   518  				if err != nil {
   519  					return err
   520  				}
   521  				a.ID = &ID
   522  			}
   523  		case "name":
   524  			if v != nil {
   525  				var name string
   526  				err = json.Unmarshal(*v, &name)
   527  				if err != nil {
   528  					return err
   529  				}
   530  				a.Name = &name
   531  			}
   532  		case "type":
   533  			if v != nil {
   534  				var typeVar string
   535  				err = json.Unmarshal(*v, &typeVar)
   536  				if err != nil {
   537  					return err
   538  				}
   539  				a.Type = &typeVar
   540  			}
   541  		}
   542  	}
   543  
   544  	return nil
   545  }
   546  
   547  // AssetCollection a collection of Asset items.
   548  type AssetCollection struct {
   549  	autorest.Response `json:"-"`
   550  	// Value - A collection of Asset items.
   551  	Value *[]Asset `json:"value,omitempty"`
   552  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
   553  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
   554  }
   555  
   556  // AssetCollectionIterator provides access to a complete listing of Asset values.
   557  type AssetCollectionIterator struct {
   558  	i    int
   559  	page AssetCollectionPage
   560  }
   561  
   562  // NextWithContext advances to the next value.  If there was an error making
   563  // the request the iterator does not advance and the error is returned.
   564  func (iter *AssetCollectionIterator) NextWithContext(ctx context.Context) (err error) {
   565  	if tracing.IsEnabled() {
   566  		ctx = tracing.StartSpan(ctx, fqdn+"/AssetCollectionIterator.NextWithContext")
   567  		defer func() {
   568  			sc := -1
   569  			if iter.Response().Response.Response != nil {
   570  				sc = iter.Response().Response.Response.StatusCode
   571  			}
   572  			tracing.EndSpan(ctx, sc, err)
   573  		}()
   574  	}
   575  	iter.i++
   576  	if iter.i < len(iter.page.Values()) {
   577  		return nil
   578  	}
   579  	err = iter.page.NextWithContext(ctx)
   580  	if err != nil {
   581  		iter.i--
   582  		return err
   583  	}
   584  	iter.i = 0
   585  	return nil
   586  }
   587  
   588  // Next advances to the next value.  If there was an error making
   589  // the request the iterator does not advance and the error is returned.
   590  // Deprecated: Use NextWithContext() instead.
   591  func (iter *AssetCollectionIterator) Next() error {
   592  	return iter.NextWithContext(context.Background())
   593  }
   594  
   595  // NotDone returns true if the enumeration should be started or is not yet complete.
   596  func (iter AssetCollectionIterator) NotDone() bool {
   597  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   598  }
   599  
   600  // Response returns the raw server response from the last page request.
   601  func (iter AssetCollectionIterator) Response() AssetCollection {
   602  	return iter.page.Response()
   603  }
   604  
   605  // Value returns the current value or a zero-initialized value if the
   606  // iterator has advanced beyond the end of the collection.
   607  func (iter AssetCollectionIterator) Value() Asset {
   608  	if !iter.page.NotDone() {
   609  		return Asset{}
   610  	}
   611  	return iter.page.Values()[iter.i]
   612  }
   613  
   614  // Creates a new instance of the AssetCollectionIterator type.
   615  func NewAssetCollectionIterator(page AssetCollectionPage) AssetCollectionIterator {
   616  	return AssetCollectionIterator{page: page}
   617  }
   618  
   619  // IsEmpty returns true if the ListResult contains no values.
   620  func (ac AssetCollection) IsEmpty() bool {
   621  	return ac.Value == nil || len(*ac.Value) == 0
   622  }
   623  
   624  // hasNextLink returns true if the NextLink is not empty.
   625  func (ac AssetCollection) hasNextLink() bool {
   626  	return ac.OdataNextLink != nil && len(*ac.OdataNextLink) != 0
   627  }
   628  
   629  // assetCollectionPreparer prepares a request to retrieve the next set of results.
   630  // It returns nil if no more results exist.
   631  func (ac AssetCollection) assetCollectionPreparer(ctx context.Context) (*http.Request, error) {
   632  	if !ac.hasNextLink() {
   633  		return nil, nil
   634  	}
   635  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   636  		autorest.AsJSON(),
   637  		autorest.AsGet(),
   638  		autorest.WithBaseURL(to.String(ac.OdataNextLink)))
   639  }
   640  
   641  // AssetCollectionPage contains a page of Asset values.
   642  type AssetCollectionPage struct {
   643  	fn func(context.Context, AssetCollection) (AssetCollection, error)
   644  	ac AssetCollection
   645  }
   646  
   647  // NextWithContext advances to the next page of values.  If there was an error making
   648  // the request the page does not advance and the error is returned.
   649  func (page *AssetCollectionPage) NextWithContext(ctx context.Context) (err error) {
   650  	if tracing.IsEnabled() {
   651  		ctx = tracing.StartSpan(ctx, fqdn+"/AssetCollectionPage.NextWithContext")
   652  		defer func() {
   653  			sc := -1
   654  			if page.Response().Response.Response != nil {
   655  				sc = page.Response().Response.Response.StatusCode
   656  			}
   657  			tracing.EndSpan(ctx, sc, err)
   658  		}()
   659  	}
   660  	for {
   661  		next, err := page.fn(ctx, page.ac)
   662  		if err != nil {
   663  			return err
   664  		}
   665  		page.ac = next
   666  		if !next.hasNextLink() || !next.IsEmpty() {
   667  			break
   668  		}
   669  	}
   670  	return nil
   671  }
   672  
   673  // Next advances to the next page of values.  If there was an error making
   674  // the request the page does not advance and the error is returned.
   675  // Deprecated: Use NextWithContext() instead.
   676  func (page *AssetCollectionPage) Next() error {
   677  	return page.NextWithContext(context.Background())
   678  }
   679  
   680  // NotDone returns true if the page enumeration should be started or is not yet complete.
   681  func (page AssetCollectionPage) NotDone() bool {
   682  	return !page.ac.IsEmpty()
   683  }
   684  
   685  // Response returns the raw server response from the last page request.
   686  func (page AssetCollectionPage) Response() AssetCollection {
   687  	return page.ac
   688  }
   689  
   690  // Values returns the slice of values for the current page or nil if there are no values.
   691  func (page AssetCollectionPage) Values() []Asset {
   692  	if page.ac.IsEmpty() {
   693  		return nil
   694  	}
   695  	return *page.ac.Value
   696  }
   697  
   698  // Creates a new instance of the AssetCollectionPage type.
   699  func NewAssetCollectionPage(cur AssetCollection, getNextPage func(context.Context, AssetCollection) (AssetCollection, error)) AssetCollectionPage {
   700  	return AssetCollectionPage{
   701  		fn: getNextPage,
   702  		ac: cur,
   703  	}
   704  }
   705  
   706  // AssetContainerSas the Asset Storage container SAS URLs.
   707  type AssetContainerSas struct {
   708  	autorest.Response `json:"-"`
   709  	// AssetContainerSasUrls - The list of Asset container SAS URLs.
   710  	AssetContainerSasUrls *[]string `json:"assetContainerSasUrls,omitempty"`
   711  }
   712  
   713  // AssetFileEncryptionMetadata the Asset File Storage encryption metadata.
   714  type AssetFileEncryptionMetadata struct {
   715  	// InitializationVector - The Asset File initialization vector.
   716  	InitializationVector *string `json:"initializationVector,omitempty"`
   717  	// AssetFileName - The Asset File name.
   718  	AssetFileName *string `json:"assetFileName,omitempty"`
   719  	// AssetFileID - The Asset File Id.
   720  	AssetFileID *uuid.UUID `json:"assetFileId,omitempty"`
   721  }
   722  
   723  // AssetFilter an Asset Filter.
   724  type AssetFilter struct {
   725  	autorest.Response `json:"-"`
   726  	*FilterProperties `json:"properties,omitempty"`
   727  	// SystemData - READ-ONLY; The system metadata relating to this resource.
   728  	SystemData *SystemData `json:"systemData,omitempty"`
   729  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
   730  	ID *string `json:"id,omitempty"`
   731  	// Name - READ-ONLY; The name of the resource
   732  	Name *string `json:"name,omitempty"`
   733  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
   734  	Type *string `json:"type,omitempty"`
   735  }
   736  
   737  // MarshalJSON is the custom marshaler for AssetFilter.
   738  func (af AssetFilter) MarshalJSON() ([]byte, error) {
   739  	objectMap := make(map[string]interface{})
   740  	if af.FilterProperties != nil {
   741  		objectMap["properties"] = af.FilterProperties
   742  	}
   743  	return json.Marshal(objectMap)
   744  }
   745  
   746  // UnmarshalJSON is the custom unmarshaler for AssetFilter struct.
   747  func (af *AssetFilter) UnmarshalJSON(body []byte) error {
   748  	var m map[string]*json.RawMessage
   749  	err := json.Unmarshal(body, &m)
   750  	if err != nil {
   751  		return err
   752  	}
   753  	for k, v := range m {
   754  		switch k {
   755  		case "properties":
   756  			if v != nil {
   757  				var filterProperties FilterProperties
   758  				err = json.Unmarshal(*v, &filterProperties)
   759  				if err != nil {
   760  					return err
   761  				}
   762  				af.FilterProperties = &filterProperties
   763  			}
   764  		case "systemData":
   765  			if v != nil {
   766  				var systemData SystemData
   767  				err = json.Unmarshal(*v, &systemData)
   768  				if err != nil {
   769  					return err
   770  				}
   771  				af.SystemData = &systemData
   772  			}
   773  		case "id":
   774  			if v != nil {
   775  				var ID string
   776  				err = json.Unmarshal(*v, &ID)
   777  				if err != nil {
   778  					return err
   779  				}
   780  				af.ID = &ID
   781  			}
   782  		case "name":
   783  			if v != nil {
   784  				var name string
   785  				err = json.Unmarshal(*v, &name)
   786  				if err != nil {
   787  					return err
   788  				}
   789  				af.Name = &name
   790  			}
   791  		case "type":
   792  			if v != nil {
   793  				var typeVar string
   794  				err = json.Unmarshal(*v, &typeVar)
   795  				if err != nil {
   796  					return err
   797  				}
   798  				af.Type = &typeVar
   799  			}
   800  		}
   801  	}
   802  
   803  	return nil
   804  }
   805  
   806  // AssetFilterCollection a collection of AssetFilter items.
   807  type AssetFilterCollection struct {
   808  	autorest.Response `json:"-"`
   809  	// Value - A collection of AssetFilter items.
   810  	Value *[]AssetFilter `json:"value,omitempty"`
   811  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
   812  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
   813  }
   814  
   815  // AssetFilterCollectionIterator provides access to a complete listing of AssetFilter values.
   816  type AssetFilterCollectionIterator struct {
   817  	i    int
   818  	page AssetFilterCollectionPage
   819  }
   820  
   821  // NextWithContext advances to the next value.  If there was an error making
   822  // the request the iterator does not advance and the error is returned.
   823  func (iter *AssetFilterCollectionIterator) NextWithContext(ctx context.Context) (err error) {
   824  	if tracing.IsEnabled() {
   825  		ctx = tracing.StartSpan(ctx, fqdn+"/AssetFilterCollectionIterator.NextWithContext")
   826  		defer func() {
   827  			sc := -1
   828  			if iter.Response().Response.Response != nil {
   829  				sc = iter.Response().Response.Response.StatusCode
   830  			}
   831  			tracing.EndSpan(ctx, sc, err)
   832  		}()
   833  	}
   834  	iter.i++
   835  	if iter.i < len(iter.page.Values()) {
   836  		return nil
   837  	}
   838  	err = iter.page.NextWithContext(ctx)
   839  	if err != nil {
   840  		iter.i--
   841  		return err
   842  	}
   843  	iter.i = 0
   844  	return nil
   845  }
   846  
   847  // Next advances to the next value.  If there was an error making
   848  // the request the iterator does not advance and the error is returned.
   849  // Deprecated: Use NextWithContext() instead.
   850  func (iter *AssetFilterCollectionIterator) Next() error {
   851  	return iter.NextWithContext(context.Background())
   852  }
   853  
   854  // NotDone returns true if the enumeration should be started or is not yet complete.
   855  func (iter AssetFilterCollectionIterator) NotDone() bool {
   856  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   857  }
   858  
   859  // Response returns the raw server response from the last page request.
   860  func (iter AssetFilterCollectionIterator) Response() AssetFilterCollection {
   861  	return iter.page.Response()
   862  }
   863  
   864  // Value returns the current value or a zero-initialized value if the
   865  // iterator has advanced beyond the end of the collection.
   866  func (iter AssetFilterCollectionIterator) Value() AssetFilter {
   867  	if !iter.page.NotDone() {
   868  		return AssetFilter{}
   869  	}
   870  	return iter.page.Values()[iter.i]
   871  }
   872  
   873  // Creates a new instance of the AssetFilterCollectionIterator type.
   874  func NewAssetFilterCollectionIterator(page AssetFilterCollectionPage) AssetFilterCollectionIterator {
   875  	return AssetFilterCollectionIterator{page: page}
   876  }
   877  
   878  // IsEmpty returns true if the ListResult contains no values.
   879  func (afc AssetFilterCollection) IsEmpty() bool {
   880  	return afc.Value == nil || len(*afc.Value) == 0
   881  }
   882  
   883  // hasNextLink returns true if the NextLink is not empty.
   884  func (afc AssetFilterCollection) hasNextLink() bool {
   885  	return afc.OdataNextLink != nil && len(*afc.OdataNextLink) != 0
   886  }
   887  
   888  // assetFilterCollectionPreparer prepares a request to retrieve the next set of results.
   889  // It returns nil if no more results exist.
   890  func (afc AssetFilterCollection) assetFilterCollectionPreparer(ctx context.Context) (*http.Request, error) {
   891  	if !afc.hasNextLink() {
   892  		return nil, nil
   893  	}
   894  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   895  		autorest.AsJSON(),
   896  		autorest.AsGet(),
   897  		autorest.WithBaseURL(to.String(afc.OdataNextLink)))
   898  }
   899  
   900  // AssetFilterCollectionPage contains a page of AssetFilter values.
   901  type AssetFilterCollectionPage struct {
   902  	fn  func(context.Context, AssetFilterCollection) (AssetFilterCollection, error)
   903  	afc AssetFilterCollection
   904  }
   905  
   906  // NextWithContext advances to the next page of values.  If there was an error making
   907  // the request the page does not advance and the error is returned.
   908  func (page *AssetFilterCollectionPage) NextWithContext(ctx context.Context) (err error) {
   909  	if tracing.IsEnabled() {
   910  		ctx = tracing.StartSpan(ctx, fqdn+"/AssetFilterCollectionPage.NextWithContext")
   911  		defer func() {
   912  			sc := -1
   913  			if page.Response().Response.Response != nil {
   914  				sc = page.Response().Response.Response.StatusCode
   915  			}
   916  			tracing.EndSpan(ctx, sc, err)
   917  		}()
   918  	}
   919  	for {
   920  		next, err := page.fn(ctx, page.afc)
   921  		if err != nil {
   922  			return err
   923  		}
   924  		page.afc = next
   925  		if !next.hasNextLink() || !next.IsEmpty() {
   926  			break
   927  		}
   928  	}
   929  	return nil
   930  }
   931  
   932  // Next advances to the next page of values.  If there was an error making
   933  // the request the page does not advance and the error is returned.
   934  // Deprecated: Use NextWithContext() instead.
   935  func (page *AssetFilterCollectionPage) Next() error {
   936  	return page.NextWithContext(context.Background())
   937  }
   938  
   939  // NotDone returns true if the page enumeration should be started or is not yet complete.
   940  func (page AssetFilterCollectionPage) NotDone() bool {
   941  	return !page.afc.IsEmpty()
   942  }
   943  
   944  // Response returns the raw server response from the last page request.
   945  func (page AssetFilterCollectionPage) Response() AssetFilterCollection {
   946  	return page.afc
   947  }
   948  
   949  // Values returns the slice of values for the current page or nil if there are no values.
   950  func (page AssetFilterCollectionPage) Values() []AssetFilter {
   951  	if page.afc.IsEmpty() {
   952  		return nil
   953  	}
   954  	return *page.afc.Value
   955  }
   956  
   957  // Creates a new instance of the AssetFilterCollectionPage type.
   958  func NewAssetFilterCollectionPage(cur AssetFilterCollection, getNextPage func(context.Context, AssetFilterCollection) (AssetFilterCollection, error)) AssetFilterCollectionPage {
   959  	return AssetFilterCollectionPage{
   960  		fn:  getNextPage,
   961  		afc: cur,
   962  	}
   963  }
   964  
   965  // AssetProperties the Asset properties.
   966  type AssetProperties struct {
   967  	// AssetID - READ-ONLY; The Asset ID.
   968  	AssetID *uuid.UUID `json:"assetId,omitempty"`
   969  	// Created - READ-ONLY; The creation date of the Asset.
   970  	Created *date.Time `json:"created,omitempty"`
   971  	// LastModified - READ-ONLY; The last modified date of the Asset.
   972  	LastModified *date.Time `json:"lastModified,omitempty"`
   973  	// AlternateID - The alternate ID of the Asset.
   974  	AlternateID *string `json:"alternateId,omitempty"`
   975  	// Description - The Asset description.
   976  	Description *string `json:"description,omitempty"`
   977  	// Container - The name of the asset blob container.
   978  	Container *string `json:"container,omitempty"`
   979  	// StorageAccountName - The name of the storage account.
   980  	StorageAccountName *string `json:"storageAccountName,omitempty"`
   981  	// StorageEncryptionFormat - READ-ONLY; The Asset encryption format. One of None or MediaStorageEncryption. Possible values include: 'AssetStorageEncryptionFormatNone', 'AssetStorageEncryptionFormatMediaStorageClientEncryption'
   982  	StorageEncryptionFormat AssetStorageEncryptionFormat `json:"storageEncryptionFormat,omitempty"`
   983  }
   984  
   985  // MarshalJSON is the custom marshaler for AssetProperties.
   986  func (ap AssetProperties) MarshalJSON() ([]byte, error) {
   987  	objectMap := make(map[string]interface{})
   988  	if ap.AlternateID != nil {
   989  		objectMap["alternateId"] = ap.AlternateID
   990  	}
   991  	if ap.Description != nil {
   992  		objectMap["description"] = ap.Description
   993  	}
   994  	if ap.Container != nil {
   995  		objectMap["container"] = ap.Container
   996  	}
   997  	if ap.StorageAccountName != nil {
   998  		objectMap["storageAccountName"] = ap.StorageAccountName
   999  	}
  1000  	return json.Marshal(objectMap)
  1001  }
  1002  
  1003  // AssetStreamingLocator properties of the Streaming Locator.
  1004  type AssetStreamingLocator struct {
  1005  	// Name - READ-ONLY; Streaming Locator name.
  1006  	Name *string `json:"name,omitempty"`
  1007  	// AssetName - READ-ONLY; Asset Name.
  1008  	AssetName *string `json:"assetName,omitempty"`
  1009  	// Created - READ-ONLY; The creation time of the Streaming Locator.
  1010  	Created *date.Time `json:"created,omitempty"`
  1011  	// StartTime - READ-ONLY; The start time of the Streaming Locator.
  1012  	StartTime *date.Time `json:"startTime,omitempty"`
  1013  	// EndTime - READ-ONLY; The end time of the Streaming Locator.
  1014  	EndTime *date.Time `json:"endTime,omitempty"`
  1015  	// StreamingLocatorID - READ-ONLY; StreamingLocatorId of the Streaming Locator.
  1016  	StreamingLocatorID *uuid.UUID `json:"streamingLocatorId,omitempty"`
  1017  	// StreamingPolicyName - READ-ONLY; Name of the Streaming Policy used by this Streaming Locator.
  1018  	StreamingPolicyName *string `json:"streamingPolicyName,omitempty"`
  1019  	// DefaultContentKeyPolicyName - READ-ONLY; Name of the default ContentKeyPolicy used by this Streaming Locator.
  1020  	DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"`
  1021  }
  1022  
  1023  // MarshalJSON is the custom marshaler for AssetStreamingLocator.
  1024  func (asl AssetStreamingLocator) MarshalJSON() ([]byte, error) {
  1025  	objectMap := make(map[string]interface{})
  1026  	return json.Marshal(objectMap)
  1027  }
  1028  
  1029  // BasicAudio defines the common properties for all audio codecs.
  1030  type BasicAudio interface {
  1031  	AsAacAudio() (*AacAudio, bool)
  1032  	AsAudio() (*Audio, bool)
  1033  }
  1034  
  1035  // Audio defines the common properties for all audio codecs.
  1036  type Audio struct {
  1037  	// Channels - The number of channels in the audio.
  1038  	Channels *int32 `json:"channels,omitempty"`
  1039  	// SamplingRate - The sampling rate to use for encoding in hertz.
  1040  	SamplingRate *int32 `json:"samplingRate,omitempty"`
  1041  	// Bitrate - The bitrate, in bits per second, of the output encoded audio.
  1042  	Bitrate *int32 `json:"bitrate,omitempty"`
  1043  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  1044  	Label *string `json:"label,omitempty"`
  1045  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  1046  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  1047  }
  1048  
  1049  func unmarshalBasicAudio(body []byte) (BasicAudio, error) {
  1050  	var m map[string]interface{}
  1051  	err := json.Unmarshal(body, &m)
  1052  	if err != nil {
  1053  		return nil, err
  1054  	}
  1055  
  1056  	switch m["@odata.type"] {
  1057  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio):
  1058  		var aa AacAudio
  1059  		err := json.Unmarshal(body, &aa)
  1060  		return aa, err
  1061  	default:
  1062  		var a Audio
  1063  		err := json.Unmarshal(body, &a)
  1064  		return a, err
  1065  	}
  1066  }
  1067  func unmarshalBasicAudioArray(body []byte) ([]BasicAudio, error) {
  1068  	var rawMessages []*json.RawMessage
  1069  	err := json.Unmarshal(body, &rawMessages)
  1070  	if err != nil {
  1071  		return nil, err
  1072  	}
  1073  
  1074  	aArray := make([]BasicAudio, len(rawMessages))
  1075  
  1076  	for index, rawMessage := range rawMessages {
  1077  		a, err := unmarshalBasicAudio(*rawMessage)
  1078  		if err != nil {
  1079  			return nil, err
  1080  		}
  1081  		aArray[index] = a
  1082  	}
  1083  	return aArray, nil
  1084  }
  1085  
  1086  // MarshalJSON is the custom marshaler for Audio.
  1087  func (a Audio) MarshalJSON() ([]byte, error) {
  1088  	a.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio
  1089  	objectMap := make(map[string]interface{})
  1090  	if a.Channels != nil {
  1091  		objectMap["channels"] = a.Channels
  1092  	}
  1093  	if a.SamplingRate != nil {
  1094  		objectMap["samplingRate"] = a.SamplingRate
  1095  	}
  1096  	if a.Bitrate != nil {
  1097  		objectMap["bitrate"] = a.Bitrate
  1098  	}
  1099  	if a.Label != nil {
  1100  		objectMap["label"] = a.Label
  1101  	}
  1102  	if a.OdataType != "" {
  1103  		objectMap["@odata.type"] = a.OdataType
  1104  	}
  1105  	return json.Marshal(objectMap)
  1106  }
  1107  
  1108  // AsAudio is the BasicCodec implementation for Audio.
  1109  func (a Audio) AsAudio() (*Audio, bool) {
  1110  	return &a, true
  1111  }
  1112  
  1113  // AsBasicAudio is the BasicCodec implementation for Audio.
  1114  func (a Audio) AsBasicAudio() (BasicAudio, bool) {
  1115  	return &a, true
  1116  }
  1117  
  1118  // AsAacAudio is the BasicCodec implementation for Audio.
  1119  func (a Audio) AsAacAudio() (*AacAudio, bool) {
  1120  	return nil, false
  1121  }
  1122  
  1123  // AsVideo is the BasicCodec implementation for Audio.
  1124  func (a Audio) AsVideo() (*Video, bool) {
  1125  	return nil, false
  1126  }
  1127  
  1128  // AsBasicVideo is the BasicCodec implementation for Audio.
  1129  func (a Audio) AsBasicVideo() (BasicVideo, bool) {
  1130  	return nil, false
  1131  }
  1132  
  1133  // AsH265Video is the BasicCodec implementation for Audio.
  1134  func (a Audio) AsH265Video() (*H265Video, bool) {
  1135  	return nil, false
  1136  }
  1137  
  1138  // AsCopyVideo is the BasicCodec implementation for Audio.
  1139  func (a Audio) AsCopyVideo() (*CopyVideo, bool) {
  1140  	return nil, false
  1141  }
  1142  
  1143  // AsImage is the BasicCodec implementation for Audio.
  1144  func (a Audio) AsImage() (*Image, bool) {
  1145  	return nil, false
  1146  }
  1147  
  1148  // AsBasicImage is the BasicCodec implementation for Audio.
  1149  func (a Audio) AsBasicImage() (BasicImage, bool) {
  1150  	return nil, false
  1151  }
  1152  
  1153  // AsCopyAudio is the BasicCodec implementation for Audio.
  1154  func (a Audio) AsCopyAudio() (*CopyAudio, bool) {
  1155  	return nil, false
  1156  }
  1157  
  1158  // AsH264Video is the BasicCodec implementation for Audio.
  1159  func (a Audio) AsH264Video() (*H264Video, bool) {
  1160  	return nil, false
  1161  }
  1162  
  1163  // AsJpgImage is the BasicCodec implementation for Audio.
  1164  func (a Audio) AsJpgImage() (*JpgImage, bool) {
  1165  	return nil, false
  1166  }
  1167  
  1168  // AsPngImage is the BasicCodec implementation for Audio.
  1169  func (a Audio) AsPngImage() (*PngImage, bool) {
  1170  	return nil, false
  1171  }
  1172  
  1173  // AsCodec is the BasicCodec implementation for Audio.
  1174  func (a Audio) AsCodec() (*Codec, bool) {
  1175  	return nil, false
  1176  }
  1177  
  1178  // AsBasicCodec is the BasicCodec implementation for Audio.
  1179  func (a Audio) AsBasicCodec() (BasicCodec, bool) {
  1180  	return &a, true
  1181  }
  1182  
  1183  // BasicAudioAnalyzerPreset the Audio Analyzer preset applies a pre-defined set of AI-based analysis operations,
  1184  // including speech transcription. Currently, the preset supports processing of content with a single audio track.
  1185  type BasicAudioAnalyzerPreset interface {
  1186  	AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool)
  1187  	AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool)
  1188  }
  1189  
  1190  // AudioAnalyzerPreset the Audio Analyzer preset applies a pre-defined set of AI-based analysis operations,
  1191  // including speech transcription. Currently, the preset supports processing of content with a single audio
  1192  // track.
  1193  type AudioAnalyzerPreset struct {
  1194  	// 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
  1195  	AudioLanguage *string `json:"audioLanguage,omitempty"`
  1196  	// Mode - Determines the set of audio analysis operations to be performed. If unspecified, the Standard AudioAnalysisMode would be chosen. Possible values include: 'AudioAnalysisModeStandard', 'AudioAnalysisModeBasic'
  1197  	Mode AudioAnalysisMode `json:"mode,omitempty"`
  1198  	// ExperimentalOptions - Dictionary containing key value pairs for parameters not exposed in the preset itself
  1199  	ExperimentalOptions map[string]*string `json:"experimentalOptions"`
  1200  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
  1201  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
  1202  }
  1203  
  1204  func unmarshalBasicAudioAnalyzerPreset(body []byte) (BasicAudioAnalyzerPreset, error) {
  1205  	var m map[string]interface{}
  1206  	err := json.Unmarshal(body, &m)
  1207  	if err != nil {
  1208  		return nil, err
  1209  	}
  1210  
  1211  	switch m["@odata.type"] {
  1212  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset):
  1213  		var vap VideoAnalyzerPreset
  1214  		err := json.Unmarshal(body, &vap)
  1215  		return vap, err
  1216  	default:
  1217  		var aap AudioAnalyzerPreset
  1218  		err := json.Unmarshal(body, &aap)
  1219  		return aap, err
  1220  	}
  1221  }
  1222  func unmarshalBasicAudioAnalyzerPresetArray(body []byte) ([]BasicAudioAnalyzerPreset, error) {
  1223  	var rawMessages []*json.RawMessage
  1224  	err := json.Unmarshal(body, &rawMessages)
  1225  	if err != nil {
  1226  		return nil, err
  1227  	}
  1228  
  1229  	aapArray := make([]BasicAudioAnalyzerPreset, len(rawMessages))
  1230  
  1231  	for index, rawMessage := range rawMessages {
  1232  		aap, err := unmarshalBasicAudioAnalyzerPreset(*rawMessage)
  1233  		if err != nil {
  1234  			return nil, err
  1235  		}
  1236  		aapArray[index] = aap
  1237  	}
  1238  	return aapArray, nil
  1239  }
  1240  
  1241  // MarshalJSON is the custom marshaler for AudioAnalyzerPreset.
  1242  func (aap AudioAnalyzerPreset) MarshalJSON() ([]byte, error) {
  1243  	aap.OdataType = OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset
  1244  	objectMap := make(map[string]interface{})
  1245  	if aap.AudioLanguage != nil {
  1246  		objectMap["audioLanguage"] = aap.AudioLanguage
  1247  	}
  1248  	if aap.Mode != "" {
  1249  		objectMap["mode"] = aap.Mode
  1250  	}
  1251  	if aap.ExperimentalOptions != nil {
  1252  		objectMap["experimentalOptions"] = aap.ExperimentalOptions
  1253  	}
  1254  	if aap.OdataType != "" {
  1255  		objectMap["@odata.type"] = aap.OdataType
  1256  	}
  1257  	return json.Marshal(objectMap)
  1258  }
  1259  
  1260  // AsFaceDetectorPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1261  func (aap AudioAnalyzerPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
  1262  	return nil, false
  1263  }
  1264  
  1265  // AsAudioAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1266  func (aap AudioAnalyzerPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
  1267  	return &aap, true
  1268  }
  1269  
  1270  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1271  func (aap AudioAnalyzerPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
  1272  	return &aap, true
  1273  }
  1274  
  1275  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1276  func (aap AudioAnalyzerPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
  1277  	return nil, false
  1278  }
  1279  
  1280  // AsStandardEncoderPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1281  func (aap AudioAnalyzerPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
  1282  	return nil, false
  1283  }
  1284  
  1285  // AsVideoAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1286  func (aap AudioAnalyzerPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
  1287  	return nil, false
  1288  }
  1289  
  1290  // AsPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1291  func (aap AudioAnalyzerPreset) AsPreset() (*Preset, bool) {
  1292  	return nil, false
  1293  }
  1294  
  1295  // AsBasicPreset is the BasicPreset implementation for AudioAnalyzerPreset.
  1296  func (aap AudioAnalyzerPreset) AsBasicPreset() (BasicPreset, bool) {
  1297  	return &aap, true
  1298  }
  1299  
  1300  // AudioOverlay describes the properties of an audio overlay.
  1301  type AudioOverlay struct {
  1302  	// 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.
  1303  	InputLabel *string `json:"inputLabel,omitempty"`
  1304  	// 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.
  1305  	Start *string `json:"start,omitempty"`
  1306  	// 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.
  1307  	End *string `json:"end,omitempty"`
  1308  	// 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).
  1309  	FadeInDuration *string `json:"fadeInDuration,omitempty"`
  1310  	// 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).
  1311  	FadeOutDuration *string `json:"fadeOutDuration,omitempty"`
  1312  	// AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0.
  1313  	AudioGainLevel *float64 `json:"audioGainLevel,omitempty"`
  1314  	// OdataType - Possible values include: 'OdataTypeBasicOverlayOdataTypeOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaVideoOverlay'
  1315  	OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"`
  1316  }
  1317  
  1318  // MarshalJSON is the custom marshaler for AudioOverlay.
  1319  func (ao AudioOverlay) MarshalJSON() ([]byte, error) {
  1320  	ao.OdataType = OdataTypeBasicOverlayOdataTypeMicrosoftMediaAudioOverlay
  1321  	objectMap := make(map[string]interface{})
  1322  	if ao.InputLabel != nil {
  1323  		objectMap["inputLabel"] = ao.InputLabel
  1324  	}
  1325  	if ao.Start != nil {
  1326  		objectMap["start"] = ao.Start
  1327  	}
  1328  	if ao.End != nil {
  1329  		objectMap["end"] = ao.End
  1330  	}
  1331  	if ao.FadeInDuration != nil {
  1332  		objectMap["fadeInDuration"] = ao.FadeInDuration
  1333  	}
  1334  	if ao.FadeOutDuration != nil {
  1335  		objectMap["fadeOutDuration"] = ao.FadeOutDuration
  1336  	}
  1337  	if ao.AudioGainLevel != nil {
  1338  		objectMap["audioGainLevel"] = ao.AudioGainLevel
  1339  	}
  1340  	if ao.OdataType != "" {
  1341  		objectMap["@odata.type"] = ao.OdataType
  1342  	}
  1343  	return json.Marshal(objectMap)
  1344  }
  1345  
  1346  // AsAudioOverlay is the BasicOverlay implementation for AudioOverlay.
  1347  func (ao AudioOverlay) AsAudioOverlay() (*AudioOverlay, bool) {
  1348  	return &ao, true
  1349  }
  1350  
  1351  // AsVideoOverlay is the BasicOverlay implementation for AudioOverlay.
  1352  func (ao AudioOverlay) AsVideoOverlay() (*VideoOverlay, bool) {
  1353  	return nil, false
  1354  }
  1355  
  1356  // AsOverlay is the BasicOverlay implementation for AudioOverlay.
  1357  func (ao AudioOverlay) AsOverlay() (*Overlay, bool) {
  1358  	return nil, false
  1359  }
  1360  
  1361  // AsBasicOverlay is the BasicOverlay implementation for AudioOverlay.
  1362  func (ao AudioOverlay) AsBasicOverlay() (BasicOverlay, bool) {
  1363  	return &ao, true
  1364  }
  1365  
  1366  // BasicAudioTrackDescriptor a TrackSelection to select audio tracks.
  1367  type BasicAudioTrackDescriptor interface {
  1368  	AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool)
  1369  	AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool)
  1370  	AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool)
  1371  }
  1372  
  1373  // AudioTrackDescriptor a TrackSelection to select audio tracks.
  1374  type AudioTrackDescriptor struct {
  1375  	// 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'
  1376  	ChannelMapping ChannelMapping `json:"channelMapping,omitempty"`
  1377  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
  1378  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
  1379  }
  1380  
  1381  func unmarshalBasicAudioTrackDescriptor(body []byte) (BasicAudioTrackDescriptor, error) {
  1382  	var m map[string]interface{}
  1383  	err := json.Unmarshal(body, &m)
  1384  	if err != nil {
  1385  		return nil, err
  1386  	}
  1387  
  1388  	switch m["@odata.type"] {
  1389  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute):
  1390  		var satba SelectAudioTrackByAttribute
  1391  		err := json.Unmarshal(body, &satba)
  1392  		return satba, err
  1393  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID):
  1394  		var satbi SelectAudioTrackByID
  1395  		err := json.Unmarshal(body, &satbi)
  1396  		return satbi, err
  1397  	default:
  1398  		var atd AudioTrackDescriptor
  1399  		err := json.Unmarshal(body, &atd)
  1400  		return atd, err
  1401  	}
  1402  }
  1403  func unmarshalBasicAudioTrackDescriptorArray(body []byte) ([]BasicAudioTrackDescriptor, error) {
  1404  	var rawMessages []*json.RawMessage
  1405  	err := json.Unmarshal(body, &rawMessages)
  1406  	if err != nil {
  1407  		return nil, err
  1408  	}
  1409  
  1410  	atdArray := make([]BasicAudioTrackDescriptor, len(rawMessages))
  1411  
  1412  	for index, rawMessage := range rawMessages {
  1413  		atd, err := unmarshalBasicAudioTrackDescriptor(*rawMessage)
  1414  		if err != nil {
  1415  			return nil, err
  1416  		}
  1417  		atdArray[index] = atd
  1418  	}
  1419  	return atdArray, nil
  1420  }
  1421  
  1422  // MarshalJSON is the custom marshaler for AudioTrackDescriptor.
  1423  func (atd AudioTrackDescriptor) MarshalJSON() ([]byte, error) {
  1424  	atd.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor
  1425  	objectMap := make(map[string]interface{})
  1426  	if atd.ChannelMapping != "" {
  1427  		objectMap["channelMapping"] = atd.ChannelMapping
  1428  	}
  1429  	if atd.OdataType != "" {
  1430  		objectMap["@odata.type"] = atd.OdataType
  1431  	}
  1432  	return json.Marshal(objectMap)
  1433  }
  1434  
  1435  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1436  func (atd AudioTrackDescriptor) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
  1437  	return &atd, true
  1438  }
  1439  
  1440  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1441  func (atd AudioTrackDescriptor) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
  1442  	return &atd, true
  1443  }
  1444  
  1445  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1446  func (atd AudioTrackDescriptor) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
  1447  	return nil, false
  1448  }
  1449  
  1450  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1451  func (atd AudioTrackDescriptor) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
  1452  	return nil, false
  1453  }
  1454  
  1455  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1456  func (atd AudioTrackDescriptor) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
  1457  	return nil, false
  1458  }
  1459  
  1460  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1461  func (atd AudioTrackDescriptor) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
  1462  	return nil, false
  1463  }
  1464  
  1465  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1466  func (atd AudioTrackDescriptor) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
  1467  	return nil, false
  1468  }
  1469  
  1470  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1471  func (atd AudioTrackDescriptor) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
  1472  	return nil, false
  1473  }
  1474  
  1475  // AsTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1476  func (atd AudioTrackDescriptor) AsTrackDescriptor() (*TrackDescriptor, bool) {
  1477  	return nil, false
  1478  }
  1479  
  1480  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for AudioTrackDescriptor.
  1481  func (atd AudioTrackDescriptor) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
  1482  	return &atd, true
  1483  }
  1484  
  1485  // AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
  1486  type AzureEntityResource struct {
  1487  	// Etag - READ-ONLY; Resource Etag.
  1488  	Etag *string `json:"etag,omitempty"`
  1489  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  1490  	ID *string `json:"id,omitempty"`
  1491  	// Name - READ-ONLY; The name of the resource
  1492  	Name *string `json:"name,omitempty"`
  1493  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  1494  	Type *string `json:"type,omitempty"`
  1495  }
  1496  
  1497  // MarshalJSON is the custom marshaler for AzureEntityResource.
  1498  func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
  1499  	objectMap := make(map[string]interface{})
  1500  	return json.Marshal(objectMap)
  1501  }
  1502  
  1503  // BuiltInStandardEncoderPreset describes a built-in preset for encoding the input video with the Standard
  1504  // Encoder.
  1505  type BuiltInStandardEncoderPreset struct {
  1506  	// 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'
  1507  	PresetName EncoderNamedPreset `json:"presetName,omitempty"`
  1508  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
  1509  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
  1510  }
  1511  
  1512  // MarshalJSON is the custom marshaler for BuiltInStandardEncoderPreset.
  1513  func (bisep BuiltInStandardEncoderPreset) MarshalJSON() ([]byte, error) {
  1514  	bisep.OdataType = OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset
  1515  	objectMap := make(map[string]interface{})
  1516  	if bisep.PresetName != "" {
  1517  		objectMap["presetName"] = bisep.PresetName
  1518  	}
  1519  	if bisep.OdataType != "" {
  1520  		objectMap["@odata.type"] = bisep.OdataType
  1521  	}
  1522  	return json.Marshal(objectMap)
  1523  }
  1524  
  1525  // AsFaceDetectorPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1526  func (bisep BuiltInStandardEncoderPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
  1527  	return nil, false
  1528  }
  1529  
  1530  // AsAudioAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1531  func (bisep BuiltInStandardEncoderPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
  1532  	return nil, false
  1533  }
  1534  
  1535  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1536  func (bisep BuiltInStandardEncoderPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
  1537  	return nil, false
  1538  }
  1539  
  1540  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1541  func (bisep BuiltInStandardEncoderPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
  1542  	return &bisep, true
  1543  }
  1544  
  1545  // AsStandardEncoderPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1546  func (bisep BuiltInStandardEncoderPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
  1547  	return nil, false
  1548  }
  1549  
  1550  // AsVideoAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1551  func (bisep BuiltInStandardEncoderPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
  1552  	return nil, false
  1553  }
  1554  
  1555  // AsPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1556  func (bisep BuiltInStandardEncoderPreset) AsPreset() (*Preset, bool) {
  1557  	return nil, false
  1558  }
  1559  
  1560  // AsBasicPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset.
  1561  func (bisep BuiltInStandardEncoderPreset) AsBasicPreset() (BasicPreset, bool) {
  1562  	return &bisep, true
  1563  }
  1564  
  1565  // CbcsDrmConfiguration class to specify DRM configurations of CommonEncryptionCbcs scheme in Streaming
  1566  // Policy
  1567  type CbcsDrmConfiguration struct {
  1568  	// FairPlay - FairPlay configurations
  1569  	FairPlay *StreamingPolicyFairPlayConfiguration `json:"fairPlay,omitempty"`
  1570  	// PlayReady - PlayReady configurations
  1571  	PlayReady *StreamingPolicyPlayReadyConfiguration `json:"playReady,omitempty"`
  1572  	// Widevine - Widevine configurations
  1573  	Widevine *StreamingPolicyWidevineConfiguration `json:"widevine,omitempty"`
  1574  }
  1575  
  1576  // CencDrmConfiguration class to specify DRM configurations of CommonEncryptionCenc scheme in Streaming
  1577  // Policy
  1578  type CencDrmConfiguration struct {
  1579  	// PlayReady - PlayReady configurations
  1580  	PlayReady *StreamingPolicyPlayReadyConfiguration `json:"playReady,omitempty"`
  1581  	// Widevine - Widevine configurations
  1582  	Widevine *StreamingPolicyWidevineConfiguration `json:"widevine,omitempty"`
  1583  }
  1584  
  1585  // CheckNameAvailabilityInput the input to the check name availability request.
  1586  type CheckNameAvailabilityInput struct {
  1587  	// Name - The account name.
  1588  	Name *string `json:"name,omitempty"`
  1589  	// Type - The account type. For a Media Services account, this should be 'MediaServices'.
  1590  	Type *string `json:"type,omitempty"`
  1591  }
  1592  
  1593  // BasicClipTime base class for specifying a clip time. Use sub classes of this class to specify the time position in
  1594  // the media.
  1595  type BasicClipTime interface {
  1596  	AsAbsoluteClipTime() (*AbsoluteClipTime, bool)
  1597  	AsUtcClipTime() (*UtcClipTime, bool)
  1598  	AsClipTime() (*ClipTime, bool)
  1599  }
  1600  
  1601  // ClipTime base class for specifying a clip time. Use sub classes of this class to specify the time position
  1602  // in the media.
  1603  type ClipTime struct {
  1604  	// OdataType - Possible values include: 'OdataTypeBasicClipTimeOdataTypeClipTime', 'OdataTypeBasicClipTimeOdataTypeMicrosoftMediaAbsoluteClipTime', 'OdataTypeBasicClipTimeOdataTypeMicrosoftMediaUtcClipTime'
  1605  	OdataType OdataTypeBasicClipTime `json:"@odata.type,omitempty"`
  1606  }
  1607  
  1608  func unmarshalBasicClipTime(body []byte) (BasicClipTime, error) {
  1609  	var m map[string]interface{}
  1610  	err := json.Unmarshal(body, &m)
  1611  	if err != nil {
  1612  		return nil, err
  1613  	}
  1614  
  1615  	switch m["@odata.type"] {
  1616  	case string(OdataTypeBasicClipTimeOdataTypeMicrosoftMediaAbsoluteClipTime):
  1617  		var act AbsoluteClipTime
  1618  		err := json.Unmarshal(body, &act)
  1619  		return act, err
  1620  	case string(OdataTypeBasicClipTimeOdataTypeMicrosoftMediaUtcClipTime):
  1621  		var uct UtcClipTime
  1622  		err := json.Unmarshal(body, &uct)
  1623  		return uct, err
  1624  	default:
  1625  		var ct ClipTime
  1626  		err := json.Unmarshal(body, &ct)
  1627  		return ct, err
  1628  	}
  1629  }
  1630  func unmarshalBasicClipTimeArray(body []byte) ([]BasicClipTime, error) {
  1631  	var rawMessages []*json.RawMessage
  1632  	err := json.Unmarshal(body, &rawMessages)
  1633  	if err != nil {
  1634  		return nil, err
  1635  	}
  1636  
  1637  	ctArray := make([]BasicClipTime, len(rawMessages))
  1638  
  1639  	for index, rawMessage := range rawMessages {
  1640  		ct, err := unmarshalBasicClipTime(*rawMessage)
  1641  		if err != nil {
  1642  			return nil, err
  1643  		}
  1644  		ctArray[index] = ct
  1645  	}
  1646  	return ctArray, nil
  1647  }
  1648  
  1649  // MarshalJSON is the custom marshaler for ClipTime.
  1650  func (ct ClipTime) MarshalJSON() ([]byte, error) {
  1651  	ct.OdataType = OdataTypeBasicClipTimeOdataTypeClipTime
  1652  	objectMap := make(map[string]interface{})
  1653  	if ct.OdataType != "" {
  1654  		objectMap["@odata.type"] = ct.OdataType
  1655  	}
  1656  	return json.Marshal(objectMap)
  1657  }
  1658  
  1659  // AsAbsoluteClipTime is the BasicClipTime implementation for ClipTime.
  1660  func (ct ClipTime) AsAbsoluteClipTime() (*AbsoluteClipTime, bool) {
  1661  	return nil, false
  1662  }
  1663  
  1664  // AsUtcClipTime is the BasicClipTime implementation for ClipTime.
  1665  func (ct ClipTime) AsUtcClipTime() (*UtcClipTime, bool) {
  1666  	return nil, false
  1667  }
  1668  
  1669  // AsClipTime is the BasicClipTime implementation for ClipTime.
  1670  func (ct ClipTime) AsClipTime() (*ClipTime, bool) {
  1671  	return &ct, true
  1672  }
  1673  
  1674  // AsBasicClipTime is the BasicClipTime implementation for ClipTime.
  1675  func (ct ClipTime) AsBasicClipTime() (BasicClipTime, bool) {
  1676  	return &ct, true
  1677  }
  1678  
  1679  // BasicCodec describes the basic properties of all codecs.
  1680  type BasicCodec interface {
  1681  	AsAudio() (*Audio, bool)
  1682  	AsBasicAudio() (BasicAudio, bool)
  1683  	AsAacAudio() (*AacAudio, bool)
  1684  	AsVideo() (*Video, bool)
  1685  	AsBasicVideo() (BasicVideo, bool)
  1686  	AsH265Video() (*H265Video, bool)
  1687  	AsCopyVideo() (*CopyVideo, bool)
  1688  	AsImage() (*Image, bool)
  1689  	AsBasicImage() (BasicImage, bool)
  1690  	AsCopyAudio() (*CopyAudio, bool)
  1691  	AsH264Video() (*H264Video, bool)
  1692  	AsJpgImage() (*JpgImage, bool)
  1693  	AsPngImage() (*PngImage, bool)
  1694  	AsCodec() (*Codec, bool)
  1695  }
  1696  
  1697  // Codec describes the basic properties of all codecs.
  1698  type Codec struct {
  1699  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  1700  	Label *string `json:"label,omitempty"`
  1701  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  1702  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  1703  }
  1704  
  1705  func unmarshalBasicCodec(body []byte) (BasicCodec, error) {
  1706  	var m map[string]interface{}
  1707  	err := json.Unmarshal(body, &m)
  1708  	if err != nil {
  1709  		return nil, err
  1710  	}
  1711  
  1712  	switch m["@odata.type"] {
  1713  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio):
  1714  		var a Audio
  1715  		err := json.Unmarshal(body, &a)
  1716  		return a, err
  1717  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio):
  1718  		var aa AacAudio
  1719  		err := json.Unmarshal(body, &aa)
  1720  		return aa, err
  1721  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo):
  1722  		var vVar Video
  1723  		err := json.Unmarshal(body, &vVar)
  1724  		return vVar, err
  1725  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video):
  1726  		var hv H265Video
  1727  		err := json.Unmarshal(body, &hv)
  1728  		return hv, err
  1729  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo):
  1730  		var cv CopyVideo
  1731  		err := json.Unmarshal(body, &cv)
  1732  		return cv, err
  1733  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaImage):
  1734  		var i Image
  1735  		err := json.Unmarshal(body, &i)
  1736  		return i, err
  1737  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio):
  1738  		var ca CopyAudio
  1739  		err := json.Unmarshal(body, &ca)
  1740  		return ca, err
  1741  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video):
  1742  		var hv H264Video
  1743  		err := json.Unmarshal(body, &hv)
  1744  		return hv, err
  1745  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage):
  1746  		var ji JpgImage
  1747  		err := json.Unmarshal(body, &ji)
  1748  		return ji, err
  1749  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage):
  1750  		var pi PngImage
  1751  		err := json.Unmarshal(body, &pi)
  1752  		return pi, err
  1753  	default:
  1754  		var c Codec
  1755  		err := json.Unmarshal(body, &c)
  1756  		return c, err
  1757  	}
  1758  }
  1759  func unmarshalBasicCodecArray(body []byte) ([]BasicCodec, error) {
  1760  	var rawMessages []*json.RawMessage
  1761  	err := json.Unmarshal(body, &rawMessages)
  1762  	if err != nil {
  1763  		return nil, err
  1764  	}
  1765  
  1766  	cArray := make([]BasicCodec, len(rawMessages))
  1767  
  1768  	for index, rawMessage := range rawMessages {
  1769  		c, err := unmarshalBasicCodec(*rawMessage)
  1770  		if err != nil {
  1771  			return nil, err
  1772  		}
  1773  		cArray[index] = c
  1774  	}
  1775  	return cArray, nil
  1776  }
  1777  
  1778  // MarshalJSON is the custom marshaler for Codec.
  1779  func (c Codec) MarshalJSON() ([]byte, error) {
  1780  	c.OdataType = OdataTypeBasicCodecOdataTypeCodec
  1781  	objectMap := make(map[string]interface{})
  1782  	if c.Label != nil {
  1783  		objectMap["label"] = c.Label
  1784  	}
  1785  	if c.OdataType != "" {
  1786  		objectMap["@odata.type"] = c.OdataType
  1787  	}
  1788  	return json.Marshal(objectMap)
  1789  }
  1790  
  1791  // AsAudio is the BasicCodec implementation for Codec.
  1792  func (c Codec) AsAudio() (*Audio, bool) {
  1793  	return nil, false
  1794  }
  1795  
  1796  // AsBasicAudio is the BasicCodec implementation for Codec.
  1797  func (c Codec) AsBasicAudio() (BasicAudio, bool) {
  1798  	return nil, false
  1799  }
  1800  
  1801  // AsAacAudio is the BasicCodec implementation for Codec.
  1802  func (c Codec) AsAacAudio() (*AacAudio, bool) {
  1803  	return nil, false
  1804  }
  1805  
  1806  // AsVideo is the BasicCodec implementation for Codec.
  1807  func (c Codec) AsVideo() (*Video, bool) {
  1808  	return nil, false
  1809  }
  1810  
  1811  // AsBasicVideo is the BasicCodec implementation for Codec.
  1812  func (c Codec) AsBasicVideo() (BasicVideo, bool) {
  1813  	return nil, false
  1814  }
  1815  
  1816  // AsH265Video is the BasicCodec implementation for Codec.
  1817  func (c Codec) AsH265Video() (*H265Video, bool) {
  1818  	return nil, false
  1819  }
  1820  
  1821  // AsCopyVideo is the BasicCodec implementation for Codec.
  1822  func (c Codec) AsCopyVideo() (*CopyVideo, bool) {
  1823  	return nil, false
  1824  }
  1825  
  1826  // AsImage is the BasicCodec implementation for Codec.
  1827  func (c Codec) AsImage() (*Image, bool) {
  1828  	return nil, false
  1829  }
  1830  
  1831  // AsBasicImage is the BasicCodec implementation for Codec.
  1832  func (c Codec) AsBasicImage() (BasicImage, bool) {
  1833  	return nil, false
  1834  }
  1835  
  1836  // AsCopyAudio is the BasicCodec implementation for Codec.
  1837  func (c Codec) AsCopyAudio() (*CopyAudio, bool) {
  1838  	return nil, false
  1839  }
  1840  
  1841  // AsH264Video is the BasicCodec implementation for Codec.
  1842  func (c Codec) AsH264Video() (*H264Video, bool) {
  1843  	return nil, false
  1844  }
  1845  
  1846  // AsJpgImage is the BasicCodec implementation for Codec.
  1847  func (c Codec) AsJpgImage() (*JpgImage, bool) {
  1848  	return nil, false
  1849  }
  1850  
  1851  // AsPngImage is the BasicCodec implementation for Codec.
  1852  func (c Codec) AsPngImage() (*PngImage, bool) {
  1853  	return nil, false
  1854  }
  1855  
  1856  // AsCodec is the BasicCodec implementation for Codec.
  1857  func (c Codec) AsCodec() (*Codec, bool) {
  1858  	return &c, true
  1859  }
  1860  
  1861  // AsBasicCodec is the BasicCodec implementation for Codec.
  1862  func (c Codec) AsBasicCodec() (BasicCodec, bool) {
  1863  	return &c, true
  1864  }
  1865  
  1866  // CommonEncryptionCbcs class for CommonEncryptionCbcs encryption scheme
  1867  type CommonEncryptionCbcs struct {
  1868  	// EnabledProtocols - Representing supported protocols
  1869  	EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
  1870  	// ClearTracks - Representing which tracks should not be encrypted
  1871  	ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"`
  1872  	// ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks
  1873  	ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"`
  1874  	// Drm - Configuration of DRMs for current encryption scheme
  1875  	Drm *CbcsDrmConfiguration `json:"drm,omitempty"`
  1876  }
  1877  
  1878  // CommonEncryptionCenc class for envelope encryption scheme
  1879  type CommonEncryptionCenc struct {
  1880  	// EnabledProtocols - Representing supported protocols
  1881  	EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
  1882  	// ClearTracks - Representing which tracks should not be encrypted
  1883  	ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"`
  1884  	// ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks
  1885  	ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"`
  1886  	// Drm - Configuration of DRMs for CommonEncryptionCenc encryption scheme
  1887  	Drm *CencDrmConfiguration `json:"drm,omitempty"`
  1888  }
  1889  
  1890  // ContentKeyPolicy a Content Key Policy resource.
  1891  type ContentKeyPolicy struct {
  1892  	autorest.Response           `json:"-"`
  1893  	*ContentKeyPolicyProperties `json:"properties,omitempty"`
  1894  	// SystemData - READ-ONLY; The system metadata relating to this resource.
  1895  	SystemData *SystemData `json:"systemData,omitempty"`
  1896  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  1897  	ID *string `json:"id,omitempty"`
  1898  	// Name - READ-ONLY; The name of the resource
  1899  	Name *string `json:"name,omitempty"`
  1900  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  1901  	Type *string `json:"type,omitempty"`
  1902  }
  1903  
  1904  // MarshalJSON is the custom marshaler for ContentKeyPolicy.
  1905  func (ckp ContentKeyPolicy) MarshalJSON() ([]byte, error) {
  1906  	objectMap := make(map[string]interface{})
  1907  	if ckp.ContentKeyPolicyProperties != nil {
  1908  		objectMap["properties"] = ckp.ContentKeyPolicyProperties
  1909  	}
  1910  	return json.Marshal(objectMap)
  1911  }
  1912  
  1913  // UnmarshalJSON is the custom unmarshaler for ContentKeyPolicy struct.
  1914  func (ckp *ContentKeyPolicy) UnmarshalJSON(body []byte) error {
  1915  	var m map[string]*json.RawMessage
  1916  	err := json.Unmarshal(body, &m)
  1917  	if err != nil {
  1918  		return err
  1919  	}
  1920  	for k, v := range m {
  1921  		switch k {
  1922  		case "properties":
  1923  			if v != nil {
  1924  				var contentKeyPolicyProperties ContentKeyPolicyProperties
  1925  				err = json.Unmarshal(*v, &contentKeyPolicyProperties)
  1926  				if err != nil {
  1927  					return err
  1928  				}
  1929  				ckp.ContentKeyPolicyProperties = &contentKeyPolicyProperties
  1930  			}
  1931  		case "systemData":
  1932  			if v != nil {
  1933  				var systemData SystemData
  1934  				err = json.Unmarshal(*v, &systemData)
  1935  				if err != nil {
  1936  					return err
  1937  				}
  1938  				ckp.SystemData = &systemData
  1939  			}
  1940  		case "id":
  1941  			if v != nil {
  1942  				var ID string
  1943  				err = json.Unmarshal(*v, &ID)
  1944  				if err != nil {
  1945  					return err
  1946  				}
  1947  				ckp.ID = &ID
  1948  			}
  1949  		case "name":
  1950  			if v != nil {
  1951  				var name string
  1952  				err = json.Unmarshal(*v, &name)
  1953  				if err != nil {
  1954  					return err
  1955  				}
  1956  				ckp.Name = &name
  1957  			}
  1958  		case "type":
  1959  			if v != nil {
  1960  				var typeVar string
  1961  				err = json.Unmarshal(*v, &typeVar)
  1962  				if err != nil {
  1963  					return err
  1964  				}
  1965  				ckp.Type = &typeVar
  1966  			}
  1967  		}
  1968  	}
  1969  
  1970  	return nil
  1971  }
  1972  
  1973  // ContentKeyPolicyClearKeyConfiguration represents a configuration for non-DRM keys.
  1974  type ContentKeyPolicyClearKeyConfiguration struct {
  1975  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  1976  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  1977  }
  1978  
  1979  // MarshalJSON is the custom marshaler for ContentKeyPolicyClearKeyConfiguration.
  1980  func (ckpckc ContentKeyPolicyClearKeyConfiguration) MarshalJSON() ([]byte, error) {
  1981  	ckpckc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration
  1982  	objectMap := make(map[string]interface{})
  1983  	if ckpckc.OdataType != "" {
  1984  		objectMap["@odata.type"] = ckpckc.OdataType
  1985  	}
  1986  	return json.Marshal(objectMap)
  1987  }
  1988  
  1989  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  1990  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  1991  	return &ckpckc, true
  1992  }
  1993  
  1994  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  1995  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  1996  	return nil, false
  1997  }
  1998  
  1999  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2000  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  2001  	return nil, false
  2002  }
  2003  
  2004  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2005  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  2006  	return nil, false
  2007  }
  2008  
  2009  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2010  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  2011  	return nil, false
  2012  }
  2013  
  2014  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2015  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  2016  	return nil, false
  2017  }
  2018  
  2019  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration.
  2020  func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  2021  	return &ckpckc, true
  2022  }
  2023  
  2024  // ContentKeyPolicyCollection a collection of ContentKeyPolicy items.
  2025  type ContentKeyPolicyCollection struct {
  2026  	autorest.Response `json:"-"`
  2027  	// Value - A collection of ContentKeyPolicy items.
  2028  	Value *[]ContentKeyPolicy `json:"value,omitempty"`
  2029  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
  2030  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
  2031  }
  2032  
  2033  // ContentKeyPolicyCollectionIterator provides access to a complete listing of ContentKeyPolicy values.
  2034  type ContentKeyPolicyCollectionIterator struct {
  2035  	i    int
  2036  	page ContentKeyPolicyCollectionPage
  2037  }
  2038  
  2039  // NextWithContext advances to the next value.  If there was an error making
  2040  // the request the iterator does not advance and the error is returned.
  2041  func (iter *ContentKeyPolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) {
  2042  	if tracing.IsEnabled() {
  2043  		ctx = tracing.StartSpan(ctx, fqdn+"/ContentKeyPolicyCollectionIterator.NextWithContext")
  2044  		defer func() {
  2045  			sc := -1
  2046  			if iter.Response().Response.Response != nil {
  2047  				sc = iter.Response().Response.Response.StatusCode
  2048  			}
  2049  			tracing.EndSpan(ctx, sc, err)
  2050  		}()
  2051  	}
  2052  	iter.i++
  2053  	if iter.i < len(iter.page.Values()) {
  2054  		return nil
  2055  	}
  2056  	err = iter.page.NextWithContext(ctx)
  2057  	if err != nil {
  2058  		iter.i--
  2059  		return err
  2060  	}
  2061  	iter.i = 0
  2062  	return nil
  2063  }
  2064  
  2065  // Next advances to the next value.  If there was an error making
  2066  // the request the iterator does not advance and the error is returned.
  2067  // Deprecated: Use NextWithContext() instead.
  2068  func (iter *ContentKeyPolicyCollectionIterator) Next() error {
  2069  	return iter.NextWithContext(context.Background())
  2070  }
  2071  
  2072  // NotDone returns true if the enumeration should be started or is not yet complete.
  2073  func (iter ContentKeyPolicyCollectionIterator) NotDone() bool {
  2074  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  2075  }
  2076  
  2077  // Response returns the raw server response from the last page request.
  2078  func (iter ContentKeyPolicyCollectionIterator) Response() ContentKeyPolicyCollection {
  2079  	return iter.page.Response()
  2080  }
  2081  
  2082  // Value returns the current value or a zero-initialized value if the
  2083  // iterator has advanced beyond the end of the collection.
  2084  func (iter ContentKeyPolicyCollectionIterator) Value() ContentKeyPolicy {
  2085  	if !iter.page.NotDone() {
  2086  		return ContentKeyPolicy{}
  2087  	}
  2088  	return iter.page.Values()[iter.i]
  2089  }
  2090  
  2091  // Creates a new instance of the ContentKeyPolicyCollectionIterator type.
  2092  func NewContentKeyPolicyCollectionIterator(page ContentKeyPolicyCollectionPage) ContentKeyPolicyCollectionIterator {
  2093  	return ContentKeyPolicyCollectionIterator{page: page}
  2094  }
  2095  
  2096  // IsEmpty returns true if the ListResult contains no values.
  2097  func (ckpc ContentKeyPolicyCollection) IsEmpty() bool {
  2098  	return ckpc.Value == nil || len(*ckpc.Value) == 0
  2099  }
  2100  
  2101  // hasNextLink returns true if the NextLink is not empty.
  2102  func (ckpc ContentKeyPolicyCollection) hasNextLink() bool {
  2103  	return ckpc.OdataNextLink != nil && len(*ckpc.OdataNextLink) != 0
  2104  }
  2105  
  2106  // contentKeyPolicyCollectionPreparer prepares a request to retrieve the next set of results.
  2107  // It returns nil if no more results exist.
  2108  func (ckpc ContentKeyPolicyCollection) contentKeyPolicyCollectionPreparer(ctx context.Context) (*http.Request, error) {
  2109  	if !ckpc.hasNextLink() {
  2110  		return nil, nil
  2111  	}
  2112  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  2113  		autorest.AsJSON(),
  2114  		autorest.AsGet(),
  2115  		autorest.WithBaseURL(to.String(ckpc.OdataNextLink)))
  2116  }
  2117  
  2118  // ContentKeyPolicyCollectionPage contains a page of ContentKeyPolicy values.
  2119  type ContentKeyPolicyCollectionPage struct {
  2120  	fn   func(context.Context, ContentKeyPolicyCollection) (ContentKeyPolicyCollection, error)
  2121  	ckpc ContentKeyPolicyCollection
  2122  }
  2123  
  2124  // NextWithContext advances to the next page of values.  If there was an error making
  2125  // the request the page does not advance and the error is returned.
  2126  func (page *ContentKeyPolicyCollectionPage) NextWithContext(ctx context.Context) (err error) {
  2127  	if tracing.IsEnabled() {
  2128  		ctx = tracing.StartSpan(ctx, fqdn+"/ContentKeyPolicyCollectionPage.NextWithContext")
  2129  		defer func() {
  2130  			sc := -1
  2131  			if page.Response().Response.Response != nil {
  2132  				sc = page.Response().Response.Response.StatusCode
  2133  			}
  2134  			tracing.EndSpan(ctx, sc, err)
  2135  		}()
  2136  	}
  2137  	for {
  2138  		next, err := page.fn(ctx, page.ckpc)
  2139  		if err != nil {
  2140  			return err
  2141  		}
  2142  		page.ckpc = next
  2143  		if !next.hasNextLink() || !next.IsEmpty() {
  2144  			break
  2145  		}
  2146  	}
  2147  	return nil
  2148  }
  2149  
  2150  // Next advances to the next page of values.  If there was an error making
  2151  // the request the page does not advance and the error is returned.
  2152  // Deprecated: Use NextWithContext() instead.
  2153  func (page *ContentKeyPolicyCollectionPage) Next() error {
  2154  	return page.NextWithContext(context.Background())
  2155  }
  2156  
  2157  // NotDone returns true if the page enumeration should be started or is not yet complete.
  2158  func (page ContentKeyPolicyCollectionPage) NotDone() bool {
  2159  	return !page.ckpc.IsEmpty()
  2160  }
  2161  
  2162  // Response returns the raw server response from the last page request.
  2163  func (page ContentKeyPolicyCollectionPage) Response() ContentKeyPolicyCollection {
  2164  	return page.ckpc
  2165  }
  2166  
  2167  // Values returns the slice of values for the current page or nil if there are no values.
  2168  func (page ContentKeyPolicyCollectionPage) Values() []ContentKeyPolicy {
  2169  	if page.ckpc.IsEmpty() {
  2170  		return nil
  2171  	}
  2172  	return *page.ckpc.Value
  2173  }
  2174  
  2175  // Creates a new instance of the ContentKeyPolicyCollectionPage type.
  2176  func NewContentKeyPolicyCollectionPage(cur ContentKeyPolicyCollection, getNextPage func(context.Context, ContentKeyPolicyCollection) (ContentKeyPolicyCollection, error)) ContentKeyPolicyCollectionPage {
  2177  	return ContentKeyPolicyCollectionPage{
  2178  		fn:   getNextPage,
  2179  		ckpc: cur,
  2180  	}
  2181  }
  2182  
  2183  // BasicContentKeyPolicyConfiguration base class for Content Key Policy configuration. A derived class must be used to
  2184  // create a configuration.
  2185  type BasicContentKeyPolicyConfiguration interface {
  2186  	AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool)
  2187  	AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool)
  2188  	AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool)
  2189  	AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool)
  2190  	AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool)
  2191  	AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool)
  2192  }
  2193  
  2194  // ContentKeyPolicyConfiguration base class for Content Key Policy configuration. A derived class must be used
  2195  // to create a configuration.
  2196  type ContentKeyPolicyConfiguration struct {
  2197  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  2198  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  2199  }
  2200  
  2201  func unmarshalBasicContentKeyPolicyConfiguration(body []byte) (BasicContentKeyPolicyConfiguration, error) {
  2202  	var m map[string]interface{}
  2203  	err := json.Unmarshal(body, &m)
  2204  	if err != nil {
  2205  		return nil, err
  2206  	}
  2207  
  2208  	switch m["@odata.type"] {
  2209  	case string(OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration):
  2210  		var ckpckc ContentKeyPolicyClearKeyConfiguration
  2211  		err := json.Unmarshal(body, &ckpckc)
  2212  		return ckpckc, err
  2213  	case string(OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration):
  2214  		var ckpuc ContentKeyPolicyUnknownConfiguration
  2215  		err := json.Unmarshal(body, &ckpuc)
  2216  		return ckpuc, err
  2217  	case string(OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration):
  2218  		var ckpwc ContentKeyPolicyWidevineConfiguration
  2219  		err := json.Unmarshal(body, &ckpwc)
  2220  		return ckpwc, err
  2221  	case string(OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration):
  2222  		var ckpprc ContentKeyPolicyPlayReadyConfiguration
  2223  		err := json.Unmarshal(body, &ckpprc)
  2224  		return ckpprc, err
  2225  	case string(OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration):
  2226  		var ckpfpc ContentKeyPolicyFairPlayConfiguration
  2227  		err := json.Unmarshal(body, &ckpfpc)
  2228  		return ckpfpc, err
  2229  	default:
  2230  		var ckpc ContentKeyPolicyConfiguration
  2231  		err := json.Unmarshal(body, &ckpc)
  2232  		return ckpc, err
  2233  	}
  2234  }
  2235  func unmarshalBasicContentKeyPolicyConfigurationArray(body []byte) ([]BasicContentKeyPolicyConfiguration, error) {
  2236  	var rawMessages []*json.RawMessage
  2237  	err := json.Unmarshal(body, &rawMessages)
  2238  	if err != nil {
  2239  		return nil, err
  2240  	}
  2241  
  2242  	ckpcArray := make([]BasicContentKeyPolicyConfiguration, len(rawMessages))
  2243  
  2244  	for index, rawMessage := range rawMessages {
  2245  		ckpc, err := unmarshalBasicContentKeyPolicyConfiguration(*rawMessage)
  2246  		if err != nil {
  2247  			return nil, err
  2248  		}
  2249  		ckpcArray[index] = ckpc
  2250  	}
  2251  	return ckpcArray, nil
  2252  }
  2253  
  2254  // MarshalJSON is the custom marshaler for ContentKeyPolicyConfiguration.
  2255  func (ckpc ContentKeyPolicyConfiguration) MarshalJSON() ([]byte, error) {
  2256  	ckpc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration
  2257  	objectMap := make(map[string]interface{})
  2258  	if ckpc.OdataType != "" {
  2259  		objectMap["@odata.type"] = ckpc.OdataType
  2260  	}
  2261  	return json.Marshal(objectMap)
  2262  }
  2263  
  2264  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2265  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  2266  	return nil, false
  2267  }
  2268  
  2269  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2270  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  2271  	return nil, false
  2272  }
  2273  
  2274  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2275  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  2276  	return nil, false
  2277  }
  2278  
  2279  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2280  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  2281  	return nil, false
  2282  }
  2283  
  2284  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2285  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  2286  	return nil, false
  2287  }
  2288  
  2289  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2290  func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  2291  	return &ckpc, true
  2292  }
  2293  
  2294  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration.
  2295  func (ckpc ContentKeyPolicyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  2296  	return &ckpc, true
  2297  }
  2298  
  2299  // ContentKeyPolicyFairPlayConfiguration specifies a configuration for FairPlay licenses.
  2300  type ContentKeyPolicyFairPlayConfiguration struct {
  2301  	// Ask - The key that must be used as FairPlay Application Secret key.
  2302  	Ask *[]byte `json:"ask,omitempty"`
  2303  	// FairPlayPfxPassword - The password encrypting FairPlay certificate in PKCS 12 (pfx) format.
  2304  	FairPlayPfxPassword *string `json:"fairPlayPfxPassword,omitempty"`
  2305  	// FairPlayPfx - The Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key).
  2306  	FairPlayPfx *string `json:"fairPlayPfx,omitempty"`
  2307  	// RentalAndLeaseKeyType - The rental and lease key type. Possible values include: 'ContentKeyPolicyFairPlayRentalAndLeaseKeyTypeUnknown', 'ContentKeyPolicyFairPlayRentalAndLeaseKeyTypeUndefined', 'ContentKeyPolicyFairPlayRentalAndLeaseKeyTypeDualExpiry', 'ContentKeyPolicyFairPlayRentalAndLeaseKeyTypePersistentUnlimited', 'ContentKeyPolicyFairPlayRentalAndLeaseKeyTypePersistentLimited'
  2308  	RentalAndLeaseKeyType ContentKeyPolicyFairPlayRentalAndLeaseKeyType `json:"rentalAndLeaseKeyType,omitempty"`
  2309  	// RentalDuration - The rental duration. Must be greater than or equal to 0.
  2310  	RentalDuration *int64 `json:"rentalDuration,omitempty"`
  2311  	// OfflineRentalConfiguration - Offline rental policy
  2312  	OfflineRentalConfiguration *ContentKeyPolicyFairPlayOfflineRentalConfiguration `json:"offlineRentalConfiguration,omitempty"`
  2313  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  2314  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  2315  }
  2316  
  2317  // MarshalJSON is the custom marshaler for ContentKeyPolicyFairPlayConfiguration.
  2318  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) MarshalJSON() ([]byte, error) {
  2319  	ckpfpc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration
  2320  	objectMap := make(map[string]interface{})
  2321  	if ckpfpc.Ask != nil {
  2322  		objectMap["ask"] = ckpfpc.Ask
  2323  	}
  2324  	if ckpfpc.FairPlayPfxPassword != nil {
  2325  		objectMap["fairPlayPfxPassword"] = ckpfpc.FairPlayPfxPassword
  2326  	}
  2327  	if ckpfpc.FairPlayPfx != nil {
  2328  		objectMap["fairPlayPfx"] = ckpfpc.FairPlayPfx
  2329  	}
  2330  	if ckpfpc.RentalAndLeaseKeyType != "" {
  2331  		objectMap["rentalAndLeaseKeyType"] = ckpfpc.RentalAndLeaseKeyType
  2332  	}
  2333  	if ckpfpc.RentalDuration != nil {
  2334  		objectMap["rentalDuration"] = ckpfpc.RentalDuration
  2335  	}
  2336  	if ckpfpc.OfflineRentalConfiguration != nil {
  2337  		objectMap["offlineRentalConfiguration"] = ckpfpc.OfflineRentalConfiguration
  2338  	}
  2339  	if ckpfpc.OdataType != "" {
  2340  		objectMap["@odata.type"] = ckpfpc.OdataType
  2341  	}
  2342  	return json.Marshal(objectMap)
  2343  }
  2344  
  2345  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2346  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  2347  	return nil, false
  2348  }
  2349  
  2350  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2351  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  2352  	return nil, false
  2353  }
  2354  
  2355  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2356  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  2357  	return nil, false
  2358  }
  2359  
  2360  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2361  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  2362  	return nil, false
  2363  }
  2364  
  2365  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2366  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  2367  	return &ckpfpc, true
  2368  }
  2369  
  2370  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2371  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  2372  	return nil, false
  2373  }
  2374  
  2375  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration.
  2376  func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  2377  	return &ckpfpc, true
  2378  }
  2379  
  2380  // ContentKeyPolicyFairPlayOfflineRentalConfiguration ...
  2381  type ContentKeyPolicyFairPlayOfflineRentalConfiguration struct {
  2382  	// PlaybackDurationSeconds - Playback duration
  2383  	PlaybackDurationSeconds *int64 `json:"playbackDurationSeconds,omitempty"`
  2384  	// StorageDurationSeconds - Storage duration
  2385  	StorageDurationSeconds *int64 `json:"storageDurationSeconds,omitempty"`
  2386  }
  2387  
  2388  // ContentKeyPolicyOpenRestriction represents an open restriction. License or key will be delivered on
  2389  // every request.
  2390  type ContentKeyPolicyOpenRestriction struct {
  2391  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeContentKeyPolicyRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction'
  2392  	OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
  2393  }
  2394  
  2395  // MarshalJSON is the custom marshaler for ContentKeyPolicyOpenRestriction.
  2396  func (ckpor ContentKeyPolicyOpenRestriction) MarshalJSON() ([]byte, error) {
  2397  	ckpor.OdataType = OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction
  2398  	objectMap := make(map[string]interface{})
  2399  	if ckpor.OdataType != "" {
  2400  		objectMap["@odata.type"] = ckpor.OdataType
  2401  	}
  2402  	return json.Marshal(objectMap)
  2403  }
  2404  
  2405  // AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
  2406  func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
  2407  	return &ckpor, true
  2408  }
  2409  
  2410  // AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
  2411  func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
  2412  	return nil, false
  2413  }
  2414  
  2415  // AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
  2416  func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
  2417  	return nil, false
  2418  }
  2419  
  2420  // AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
  2421  func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
  2422  	return nil, false
  2423  }
  2424  
  2425  // AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction.
  2426  func (ckpor ContentKeyPolicyOpenRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
  2427  	return &ckpor, true
  2428  }
  2429  
  2430  // ContentKeyPolicyOption represents a policy option.
  2431  type ContentKeyPolicyOption struct {
  2432  	// PolicyOptionID - READ-ONLY; The legacy Policy Option ID.
  2433  	PolicyOptionID *uuid.UUID `json:"policyOptionId,omitempty"`
  2434  	// Name - The Policy Option description.
  2435  	Name *string `json:"name,omitempty"`
  2436  	// Configuration - The key delivery configuration.
  2437  	Configuration BasicContentKeyPolicyConfiguration `json:"configuration,omitempty"`
  2438  	// Restriction - The requirements that must be met to deliver keys with this configuration
  2439  	Restriction BasicContentKeyPolicyRestriction `json:"restriction,omitempty"`
  2440  }
  2441  
  2442  // MarshalJSON is the custom marshaler for ContentKeyPolicyOption.
  2443  func (ckpo ContentKeyPolicyOption) MarshalJSON() ([]byte, error) {
  2444  	objectMap := make(map[string]interface{})
  2445  	if ckpo.Name != nil {
  2446  		objectMap["name"] = ckpo.Name
  2447  	}
  2448  	objectMap["configuration"] = ckpo.Configuration
  2449  	objectMap["restriction"] = ckpo.Restriction
  2450  	return json.Marshal(objectMap)
  2451  }
  2452  
  2453  // UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyOption struct.
  2454  func (ckpo *ContentKeyPolicyOption) UnmarshalJSON(body []byte) error {
  2455  	var m map[string]*json.RawMessage
  2456  	err := json.Unmarshal(body, &m)
  2457  	if err != nil {
  2458  		return err
  2459  	}
  2460  	for k, v := range m {
  2461  		switch k {
  2462  		case "policyOptionId":
  2463  			if v != nil {
  2464  				var policyOptionID uuid.UUID
  2465  				err = json.Unmarshal(*v, &policyOptionID)
  2466  				if err != nil {
  2467  					return err
  2468  				}
  2469  				ckpo.PolicyOptionID = &policyOptionID
  2470  			}
  2471  		case "name":
  2472  			if v != nil {
  2473  				var name string
  2474  				err = json.Unmarshal(*v, &name)
  2475  				if err != nil {
  2476  					return err
  2477  				}
  2478  				ckpo.Name = &name
  2479  			}
  2480  		case "configuration":
  2481  			if v != nil {
  2482  				configuration, err := unmarshalBasicContentKeyPolicyConfiguration(*v)
  2483  				if err != nil {
  2484  					return err
  2485  				}
  2486  				ckpo.Configuration = configuration
  2487  			}
  2488  		case "restriction":
  2489  			if v != nil {
  2490  				restriction, err := unmarshalBasicContentKeyPolicyRestriction(*v)
  2491  				if err != nil {
  2492  					return err
  2493  				}
  2494  				ckpo.Restriction = restriction
  2495  			}
  2496  		}
  2497  	}
  2498  
  2499  	return nil
  2500  }
  2501  
  2502  // ContentKeyPolicyPlayReadyConfiguration specifies a configuration for PlayReady licenses.
  2503  type ContentKeyPolicyPlayReadyConfiguration struct {
  2504  	// Licenses - The PlayReady licenses.
  2505  	Licenses *[]ContentKeyPolicyPlayReadyLicense `json:"licenses,omitempty"`
  2506  	// ResponseCustomData - The custom response data.
  2507  	ResponseCustomData *string `json:"responseCustomData,omitempty"`
  2508  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  2509  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  2510  }
  2511  
  2512  // MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyConfiguration.
  2513  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) MarshalJSON() ([]byte, error) {
  2514  	ckpprc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration
  2515  	objectMap := make(map[string]interface{})
  2516  	if ckpprc.Licenses != nil {
  2517  		objectMap["licenses"] = ckpprc.Licenses
  2518  	}
  2519  	if ckpprc.ResponseCustomData != nil {
  2520  		objectMap["responseCustomData"] = ckpprc.ResponseCustomData
  2521  	}
  2522  	if ckpprc.OdataType != "" {
  2523  		objectMap["@odata.type"] = ckpprc.OdataType
  2524  	}
  2525  	return json.Marshal(objectMap)
  2526  }
  2527  
  2528  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2529  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  2530  	return nil, false
  2531  }
  2532  
  2533  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2534  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  2535  	return nil, false
  2536  }
  2537  
  2538  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2539  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  2540  	return nil, false
  2541  }
  2542  
  2543  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2544  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  2545  	return &ckpprc, true
  2546  }
  2547  
  2548  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2549  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  2550  	return nil, false
  2551  }
  2552  
  2553  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2554  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  2555  	return nil, false
  2556  }
  2557  
  2558  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration.
  2559  func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  2560  	return &ckpprc, true
  2561  }
  2562  
  2563  // ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader specifies that the content key ID is in the
  2564  // PlayReady header.
  2565  type ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader struct {
  2566  	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier'
  2567  	OdataType OdataType `json:"@odata.type,omitempty"`
  2568  }
  2569  
  2570  // MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
  2571  func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) MarshalJSON() ([]byte, error) {
  2572  	ckpprcekfh.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader
  2573  	objectMap := make(map[string]interface{})
  2574  	if ckpprcekfh.OdataType != "" {
  2575  		objectMap["@odata.type"] = ckpprcekfh.OdataType
  2576  	}
  2577  	return json.Marshal(objectMap)
  2578  }
  2579  
  2580  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
  2581  func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) {
  2582  	return &ckpprcekfh, true
  2583  }
  2584  
  2585  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
  2586  func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) {
  2587  	return nil, false
  2588  }
  2589  
  2590  // AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
  2591  func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2592  	return nil, false
  2593  }
  2594  
  2595  // AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.
  2596  func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2597  	return &ckpprcekfh, true
  2598  }
  2599  
  2600  // ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier specifies that the content key ID is
  2601  // specified in the PlayReady configuration.
  2602  type ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier struct {
  2603  	// KeyID - The content key ID.
  2604  	KeyID *uuid.UUID `json:"keyId,omitempty"`
  2605  	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier'
  2606  	OdataType OdataType `json:"@odata.type,omitempty"`
  2607  }
  2608  
  2609  // MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
  2610  func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) MarshalJSON() ([]byte, error) {
  2611  	ckpprcekfki.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier
  2612  	objectMap := make(map[string]interface{})
  2613  	if ckpprcekfki.KeyID != nil {
  2614  		objectMap["keyId"] = ckpprcekfki.KeyID
  2615  	}
  2616  	if ckpprcekfki.OdataType != "" {
  2617  		objectMap["@odata.type"] = ckpprcekfki.OdataType
  2618  	}
  2619  	return json.Marshal(objectMap)
  2620  }
  2621  
  2622  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
  2623  func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) {
  2624  	return nil, false
  2625  }
  2626  
  2627  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
  2628  func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) {
  2629  	return &ckpprcekfki, true
  2630  }
  2631  
  2632  // AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
  2633  func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2634  	return nil, false
  2635  }
  2636  
  2637  // AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.
  2638  func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2639  	return &ckpprcekfki, true
  2640  }
  2641  
  2642  // BasicContentKeyPolicyPlayReadyContentKeyLocation base class for content key ID location. A derived class must be
  2643  // used to represent the location.
  2644  type BasicContentKeyPolicyPlayReadyContentKeyLocation interface {
  2645  	AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool)
  2646  	AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool)
  2647  	AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool)
  2648  }
  2649  
  2650  // ContentKeyPolicyPlayReadyContentKeyLocation base class for content key ID location. A derived class must be
  2651  // used to represent the location.
  2652  type ContentKeyPolicyPlayReadyContentKeyLocation struct {
  2653  	// OdataType - Possible values include: 'OdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier'
  2654  	OdataType OdataType `json:"@odata.type,omitempty"`
  2655  }
  2656  
  2657  func unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(body []byte) (BasicContentKeyPolicyPlayReadyContentKeyLocation, error) {
  2658  	var m map[string]interface{}
  2659  	err := json.Unmarshal(body, &m)
  2660  	if err != nil {
  2661  		return nil, err
  2662  	}
  2663  
  2664  	switch m["@odata.type"] {
  2665  	case string(OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader):
  2666  		var ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader
  2667  		err := json.Unmarshal(body, &ckpprcekfh)
  2668  		return ckpprcekfh, err
  2669  	case string(OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier):
  2670  		var ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier
  2671  		err := json.Unmarshal(body, &ckpprcekfki)
  2672  		return ckpprcekfki, err
  2673  	default:
  2674  		var ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation
  2675  		err := json.Unmarshal(body, &ckpprckl)
  2676  		return ckpprckl, err
  2677  	}
  2678  }
  2679  func unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocationArray(body []byte) ([]BasicContentKeyPolicyPlayReadyContentKeyLocation, error) {
  2680  	var rawMessages []*json.RawMessage
  2681  	err := json.Unmarshal(body, &rawMessages)
  2682  	if err != nil {
  2683  		return nil, err
  2684  	}
  2685  
  2686  	ckpprcklArray := make([]BasicContentKeyPolicyPlayReadyContentKeyLocation, len(rawMessages))
  2687  
  2688  	for index, rawMessage := range rawMessages {
  2689  		ckpprckl, err := unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(*rawMessage)
  2690  		if err != nil {
  2691  			return nil, err
  2692  		}
  2693  		ckpprcklArray[index] = ckpprckl
  2694  	}
  2695  	return ckpprcklArray, nil
  2696  }
  2697  
  2698  // MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentKeyLocation.
  2699  func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) MarshalJSON() ([]byte, error) {
  2700  	ckpprckl.OdataType = OdataTypeContentKeyPolicyPlayReadyContentKeyLocation
  2701  	objectMap := make(map[string]interface{})
  2702  	if ckpprckl.OdataType != "" {
  2703  		objectMap["@odata.type"] = ckpprckl.OdataType
  2704  	}
  2705  	return json.Marshal(objectMap)
  2706  }
  2707  
  2708  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation.
  2709  func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) {
  2710  	return nil, false
  2711  }
  2712  
  2713  // AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation.
  2714  func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) {
  2715  	return nil, false
  2716  }
  2717  
  2718  // AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation.
  2719  func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2720  	return &ckpprckl, true
  2721  }
  2722  
  2723  // AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation.
  2724  func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) {
  2725  	return &ckpprckl, true
  2726  }
  2727  
  2728  // ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction configures the Explicit Analog Television
  2729  // Output Restriction control bits. For further details see the PlayReady Compliance Rules.
  2730  type ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction struct {
  2731  	// BestEffort - Indicates whether this restriction is enforced on a Best Effort basis.
  2732  	BestEffort *bool `json:"bestEffort,omitempty"`
  2733  	// ConfigurationData - Configures the restriction control bits. Must be between 0 and 3 inclusive.
  2734  	ConfigurationData *int32 `json:"configurationData,omitempty"`
  2735  }
  2736  
  2737  // ContentKeyPolicyPlayReadyLicense the PlayReady license
  2738  type ContentKeyPolicyPlayReadyLicense struct {
  2739  	// AllowTestDevices - A flag indicating whether test devices can use the license.
  2740  	AllowTestDevices *bool `json:"allowTestDevices,omitempty"`
  2741  	// BeginDate - The begin date of license
  2742  	BeginDate *date.Time `json:"beginDate,omitempty"`
  2743  	// ExpirationDate - The expiration date of license.
  2744  	ExpirationDate *date.Time `json:"expirationDate,omitempty"`
  2745  	// RelativeBeginDate - The relative begin date of license.
  2746  	RelativeBeginDate *string `json:"relativeBeginDate,omitempty"`
  2747  	// RelativeExpirationDate - The relative expiration date of license.
  2748  	RelativeExpirationDate *string `json:"relativeExpirationDate,omitempty"`
  2749  	// GracePeriod - The grace period of license.
  2750  	GracePeriod *string `json:"gracePeriod,omitempty"`
  2751  	// PlayRight - The license PlayRight
  2752  	PlayRight *ContentKeyPolicyPlayReadyPlayRight `json:"playRight,omitempty"`
  2753  	// LicenseType - The license type. Possible values include: 'ContentKeyPolicyPlayReadyLicenseTypeUnknown', 'ContentKeyPolicyPlayReadyLicenseTypeNonPersistent', 'ContentKeyPolicyPlayReadyLicenseTypePersistent'
  2754  	LicenseType ContentKeyPolicyPlayReadyLicenseType `json:"licenseType,omitempty"`
  2755  	// ContentKeyLocation - The content key location.
  2756  	ContentKeyLocation BasicContentKeyPolicyPlayReadyContentKeyLocation `json:"contentKeyLocation,omitempty"`
  2757  	// ContentType - The PlayReady content type. Possible values include: 'ContentKeyPolicyPlayReadyContentTypeUnknown', 'ContentKeyPolicyPlayReadyContentTypeUnspecified', 'ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload', 'ContentKeyPolicyPlayReadyContentTypeUltraVioletStreaming'
  2758  	ContentType ContentKeyPolicyPlayReadyContentType `json:"contentType,omitempty"`
  2759  }
  2760  
  2761  // UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyPlayReadyLicense struct.
  2762  func (ckpprl *ContentKeyPolicyPlayReadyLicense) UnmarshalJSON(body []byte) error {
  2763  	var m map[string]*json.RawMessage
  2764  	err := json.Unmarshal(body, &m)
  2765  	if err != nil {
  2766  		return err
  2767  	}
  2768  	for k, v := range m {
  2769  		switch k {
  2770  		case "allowTestDevices":
  2771  			if v != nil {
  2772  				var allowTestDevices bool
  2773  				err = json.Unmarshal(*v, &allowTestDevices)
  2774  				if err != nil {
  2775  					return err
  2776  				}
  2777  				ckpprl.AllowTestDevices = &allowTestDevices
  2778  			}
  2779  		case "beginDate":
  2780  			if v != nil {
  2781  				var beginDate date.Time
  2782  				err = json.Unmarshal(*v, &beginDate)
  2783  				if err != nil {
  2784  					return err
  2785  				}
  2786  				ckpprl.BeginDate = &beginDate
  2787  			}
  2788  		case "expirationDate":
  2789  			if v != nil {
  2790  				var expirationDate date.Time
  2791  				err = json.Unmarshal(*v, &expirationDate)
  2792  				if err != nil {
  2793  					return err
  2794  				}
  2795  				ckpprl.ExpirationDate = &expirationDate
  2796  			}
  2797  		case "relativeBeginDate":
  2798  			if v != nil {
  2799  				var relativeBeginDate string
  2800  				err = json.Unmarshal(*v, &relativeBeginDate)
  2801  				if err != nil {
  2802  					return err
  2803  				}
  2804  				ckpprl.RelativeBeginDate = &relativeBeginDate
  2805  			}
  2806  		case "relativeExpirationDate":
  2807  			if v != nil {
  2808  				var relativeExpirationDate string
  2809  				err = json.Unmarshal(*v, &relativeExpirationDate)
  2810  				if err != nil {
  2811  					return err
  2812  				}
  2813  				ckpprl.RelativeExpirationDate = &relativeExpirationDate
  2814  			}
  2815  		case "gracePeriod":
  2816  			if v != nil {
  2817  				var gracePeriod string
  2818  				err = json.Unmarshal(*v, &gracePeriod)
  2819  				if err != nil {
  2820  					return err
  2821  				}
  2822  				ckpprl.GracePeriod = &gracePeriod
  2823  			}
  2824  		case "playRight":
  2825  			if v != nil {
  2826  				var playRight ContentKeyPolicyPlayReadyPlayRight
  2827  				err = json.Unmarshal(*v, &playRight)
  2828  				if err != nil {
  2829  					return err
  2830  				}
  2831  				ckpprl.PlayRight = &playRight
  2832  			}
  2833  		case "licenseType":
  2834  			if v != nil {
  2835  				var licenseType ContentKeyPolicyPlayReadyLicenseType
  2836  				err = json.Unmarshal(*v, &licenseType)
  2837  				if err != nil {
  2838  					return err
  2839  				}
  2840  				ckpprl.LicenseType = licenseType
  2841  			}
  2842  		case "contentKeyLocation":
  2843  			if v != nil {
  2844  				contentKeyLocation, err := unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(*v)
  2845  				if err != nil {
  2846  					return err
  2847  				}
  2848  				ckpprl.ContentKeyLocation = contentKeyLocation
  2849  			}
  2850  		case "contentType":
  2851  			if v != nil {
  2852  				var contentType ContentKeyPolicyPlayReadyContentType
  2853  				err = json.Unmarshal(*v, &contentType)
  2854  				if err != nil {
  2855  					return err
  2856  				}
  2857  				ckpprl.ContentType = contentType
  2858  			}
  2859  		}
  2860  	}
  2861  
  2862  	return nil
  2863  }
  2864  
  2865  // ContentKeyPolicyPlayReadyPlayRight configures the Play Right in the PlayReady license.
  2866  type ContentKeyPolicyPlayReadyPlayRight struct {
  2867  	// FirstPlayExpiration - The amount of time that the license is valid after the license is first used to play content.
  2868  	FirstPlayExpiration *string `json:"firstPlayExpiration,omitempty"`
  2869  	// ScmsRestriction - Configures the Serial Copy Management System (SCMS) in the license. Must be between 0 and 3 inclusive.
  2870  	ScmsRestriction *int32 `json:"scmsRestriction,omitempty"`
  2871  	// AgcAndColorStripeRestriction - Configures Automatic Gain Control (AGC) and Color Stripe in the license. Must be between 0 and 3 inclusive.
  2872  	AgcAndColorStripeRestriction *int32 `json:"agcAndColorStripeRestriction,omitempty"`
  2873  	// ExplicitAnalogTelevisionOutputRestriction - Configures the Explicit Analog Television Output Restriction in the license. Configuration data must be between 0 and 3 inclusive.
  2874  	ExplicitAnalogTelevisionOutputRestriction *ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction `json:"explicitAnalogTelevisionOutputRestriction,omitempty"`
  2875  	// DigitalVideoOnlyContentRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license.
  2876  	DigitalVideoOnlyContentRestriction *bool `json:"digitalVideoOnlyContentRestriction,omitempty"`
  2877  	// ImageConstraintForAnalogComponentVideoRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license.
  2878  	ImageConstraintForAnalogComponentVideoRestriction *bool `json:"imageConstraintForAnalogComponentVideoRestriction,omitempty"`
  2879  	// ImageConstraintForAnalogComputerMonitorRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license.
  2880  	ImageConstraintForAnalogComputerMonitorRestriction *bool `json:"imageConstraintForAnalogComputerMonitorRestriction,omitempty"`
  2881  	// AllowPassingVideoContentToUnknownOutput - Configures Unknown output handling settings of the license. Possible values include: 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionUnknown', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowed', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowedWithVideoConstriction'
  2882  	AllowPassingVideoContentToUnknownOutput ContentKeyPolicyPlayReadyUnknownOutputPassingOption `json:"allowPassingVideoContentToUnknownOutput,omitempty"`
  2883  	// UncompressedDigitalVideoOpl - Specifies the output protection level for uncompressed digital video.
  2884  	UncompressedDigitalVideoOpl *int32 `json:"uncompressedDigitalVideoOpl,omitempty"`
  2885  	// CompressedDigitalVideoOpl - Specifies the output protection level for compressed digital video.
  2886  	CompressedDigitalVideoOpl *int32 `json:"compressedDigitalVideoOpl,omitempty"`
  2887  	// AnalogVideoOpl - Specifies the output protection level for compressed digital audio.
  2888  	AnalogVideoOpl *int32 `json:"analogVideoOpl,omitempty"`
  2889  	// CompressedDigitalAudioOpl - Specifies the output protection level for compressed digital audio.
  2890  	CompressedDigitalAudioOpl *int32 `json:"compressedDigitalAudioOpl,omitempty"`
  2891  	// UncompressedDigitalAudioOpl - Specifies the output protection level for uncompressed digital audio.
  2892  	UncompressedDigitalAudioOpl *int32 `json:"uncompressedDigitalAudioOpl,omitempty"`
  2893  }
  2894  
  2895  // ContentKeyPolicyProperties the properties of the Content Key Policy.
  2896  type ContentKeyPolicyProperties struct {
  2897  	autorest.Response `json:"-"`
  2898  	// PolicyID - READ-ONLY; The legacy Policy ID.
  2899  	PolicyID *uuid.UUID `json:"policyId,omitempty"`
  2900  	// Created - READ-ONLY; The creation date of the Policy
  2901  	Created *date.Time `json:"created,omitempty"`
  2902  	// LastModified - READ-ONLY; The last modified date of the Policy
  2903  	LastModified *date.Time `json:"lastModified,omitempty"`
  2904  	// Description - A description for the Policy.
  2905  	Description *string `json:"description,omitempty"`
  2906  	// Options - The Key Policy options.
  2907  	Options *[]ContentKeyPolicyOption `json:"options,omitempty"`
  2908  }
  2909  
  2910  // MarshalJSON is the custom marshaler for ContentKeyPolicyProperties.
  2911  func (ckpp ContentKeyPolicyProperties) MarshalJSON() ([]byte, error) {
  2912  	objectMap := make(map[string]interface{})
  2913  	if ckpp.Description != nil {
  2914  		objectMap["description"] = ckpp.Description
  2915  	}
  2916  	if ckpp.Options != nil {
  2917  		objectMap["options"] = ckpp.Options
  2918  	}
  2919  	return json.Marshal(objectMap)
  2920  }
  2921  
  2922  // BasicContentKeyPolicyRestriction base class for Content Key Policy restrictions. A derived class must be used to
  2923  // create a restriction.
  2924  type BasicContentKeyPolicyRestriction interface {
  2925  	AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool)
  2926  	AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool)
  2927  	AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool)
  2928  	AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool)
  2929  }
  2930  
  2931  // ContentKeyPolicyRestriction base class for Content Key Policy restrictions. A derived class must be used to
  2932  // create a restriction.
  2933  type ContentKeyPolicyRestriction struct {
  2934  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeContentKeyPolicyRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction'
  2935  	OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
  2936  }
  2937  
  2938  func unmarshalBasicContentKeyPolicyRestriction(body []byte) (BasicContentKeyPolicyRestriction, error) {
  2939  	var m map[string]interface{}
  2940  	err := json.Unmarshal(body, &m)
  2941  	if err != nil {
  2942  		return nil, err
  2943  	}
  2944  
  2945  	switch m["@odata.type"] {
  2946  	case string(OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction):
  2947  		var ckpor ContentKeyPolicyOpenRestriction
  2948  		err := json.Unmarshal(body, &ckpor)
  2949  		return ckpor, err
  2950  	case string(OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction):
  2951  		var ckpur ContentKeyPolicyUnknownRestriction
  2952  		err := json.Unmarshal(body, &ckpur)
  2953  		return ckpur, err
  2954  	case string(OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction):
  2955  		var ckptr ContentKeyPolicyTokenRestriction
  2956  		err := json.Unmarshal(body, &ckptr)
  2957  		return ckptr, err
  2958  	default:
  2959  		var ckpr ContentKeyPolicyRestriction
  2960  		err := json.Unmarshal(body, &ckpr)
  2961  		return ckpr, err
  2962  	}
  2963  }
  2964  func unmarshalBasicContentKeyPolicyRestrictionArray(body []byte) ([]BasicContentKeyPolicyRestriction, error) {
  2965  	var rawMessages []*json.RawMessage
  2966  	err := json.Unmarshal(body, &rawMessages)
  2967  	if err != nil {
  2968  		return nil, err
  2969  	}
  2970  
  2971  	ckprArray := make([]BasicContentKeyPolicyRestriction, len(rawMessages))
  2972  
  2973  	for index, rawMessage := range rawMessages {
  2974  		ckpr, err := unmarshalBasicContentKeyPolicyRestriction(*rawMessage)
  2975  		if err != nil {
  2976  			return nil, err
  2977  		}
  2978  		ckprArray[index] = ckpr
  2979  	}
  2980  	return ckprArray, nil
  2981  }
  2982  
  2983  // MarshalJSON is the custom marshaler for ContentKeyPolicyRestriction.
  2984  func (ckpr ContentKeyPolicyRestriction) MarshalJSON() ([]byte, error) {
  2985  	ckpr.OdataType = OdataTypeBasicContentKeyPolicyRestrictionOdataTypeContentKeyPolicyRestriction
  2986  	objectMap := make(map[string]interface{})
  2987  	if ckpr.OdataType != "" {
  2988  		objectMap["@odata.type"] = ckpr.OdataType
  2989  	}
  2990  	return json.Marshal(objectMap)
  2991  }
  2992  
  2993  // AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
  2994  func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
  2995  	return nil, false
  2996  }
  2997  
  2998  // AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
  2999  func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
  3000  	return nil, false
  3001  }
  3002  
  3003  // AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
  3004  func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
  3005  	return nil, false
  3006  }
  3007  
  3008  // AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
  3009  func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
  3010  	return &ckpr, true
  3011  }
  3012  
  3013  // AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction.
  3014  func (ckpr ContentKeyPolicyRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
  3015  	return &ckpr, true
  3016  }
  3017  
  3018  // BasicContentKeyPolicyRestrictionTokenKey base class for Content Key Policy key for token validation. A derived class
  3019  // must be used to create a token key.
  3020  type BasicContentKeyPolicyRestrictionTokenKey interface {
  3021  	AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool)
  3022  	AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool)
  3023  	AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool)
  3024  	AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool)
  3025  }
  3026  
  3027  // ContentKeyPolicyRestrictionTokenKey base class for Content Key Policy key for token validation. A derived
  3028  // class must be used to create a token key.
  3029  type ContentKeyPolicyRestrictionTokenKey struct {
  3030  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey'
  3031  	OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
  3032  }
  3033  
  3034  func unmarshalBasicContentKeyPolicyRestrictionTokenKey(body []byte) (BasicContentKeyPolicyRestrictionTokenKey, error) {
  3035  	var m map[string]interface{}
  3036  	err := json.Unmarshal(body, &m)
  3037  	if err != nil {
  3038  		return nil, err
  3039  	}
  3040  
  3041  	switch m["@odata.type"] {
  3042  	case string(OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey):
  3043  		var ckpstk ContentKeyPolicySymmetricTokenKey
  3044  		err := json.Unmarshal(body, &ckpstk)
  3045  		return ckpstk, err
  3046  	case string(OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey):
  3047  		var ckprtk ContentKeyPolicyRsaTokenKey
  3048  		err := json.Unmarshal(body, &ckprtk)
  3049  		return ckprtk, err
  3050  	case string(OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey):
  3051  		var ckpxctk ContentKeyPolicyX509CertificateTokenKey
  3052  		err := json.Unmarshal(body, &ckpxctk)
  3053  		return ckpxctk, err
  3054  	default:
  3055  		var ckprtk ContentKeyPolicyRestrictionTokenKey
  3056  		err := json.Unmarshal(body, &ckprtk)
  3057  		return ckprtk, err
  3058  	}
  3059  }
  3060  func unmarshalBasicContentKeyPolicyRestrictionTokenKeyArray(body []byte) ([]BasicContentKeyPolicyRestrictionTokenKey, error) {
  3061  	var rawMessages []*json.RawMessage
  3062  	err := json.Unmarshal(body, &rawMessages)
  3063  	if err != nil {
  3064  		return nil, err
  3065  	}
  3066  
  3067  	ckprtkArray := make([]BasicContentKeyPolicyRestrictionTokenKey, len(rawMessages))
  3068  
  3069  	for index, rawMessage := range rawMessages {
  3070  		ckprtk, err := unmarshalBasicContentKeyPolicyRestrictionTokenKey(*rawMessage)
  3071  		if err != nil {
  3072  			return nil, err
  3073  		}
  3074  		ckprtkArray[index] = ckprtk
  3075  	}
  3076  	return ckprtkArray, nil
  3077  }
  3078  
  3079  // MarshalJSON is the custom marshaler for ContentKeyPolicyRestrictionTokenKey.
  3080  func (ckprtk ContentKeyPolicyRestrictionTokenKey) MarshalJSON() ([]byte, error) {
  3081  	ckprtk.OdataType = OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeContentKeyPolicyRestrictionTokenKey
  3082  	objectMap := make(map[string]interface{})
  3083  	if ckprtk.OdataType != "" {
  3084  		objectMap["@odata.type"] = ckprtk.OdataType
  3085  	}
  3086  	return json.Marshal(objectMap)
  3087  }
  3088  
  3089  // AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
  3090  func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
  3091  	return nil, false
  3092  }
  3093  
  3094  // AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
  3095  func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
  3096  	return nil, false
  3097  }
  3098  
  3099  // AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
  3100  func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
  3101  	return nil, false
  3102  }
  3103  
  3104  // AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
  3105  func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
  3106  	return &ckprtk, true
  3107  }
  3108  
  3109  // AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey.
  3110  func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
  3111  	return &ckprtk, true
  3112  }
  3113  
  3114  // ContentKeyPolicyRsaTokenKey specifies a RSA key for token validation
  3115  type ContentKeyPolicyRsaTokenKey struct {
  3116  	// Exponent - The RSA Parameter exponent
  3117  	Exponent *[]byte `json:"exponent,omitempty"`
  3118  	// Modulus - The RSA Parameter modulus
  3119  	Modulus *[]byte `json:"modulus,omitempty"`
  3120  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey'
  3121  	OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
  3122  }
  3123  
  3124  // MarshalJSON is the custom marshaler for ContentKeyPolicyRsaTokenKey.
  3125  func (ckprtk ContentKeyPolicyRsaTokenKey) MarshalJSON() ([]byte, error) {
  3126  	ckprtk.OdataType = OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey
  3127  	objectMap := make(map[string]interface{})
  3128  	if ckprtk.Exponent != nil {
  3129  		objectMap["exponent"] = ckprtk.Exponent
  3130  	}
  3131  	if ckprtk.Modulus != nil {
  3132  		objectMap["modulus"] = ckprtk.Modulus
  3133  	}
  3134  	if ckprtk.OdataType != "" {
  3135  		objectMap["@odata.type"] = ckprtk.OdataType
  3136  	}
  3137  	return json.Marshal(objectMap)
  3138  }
  3139  
  3140  // AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
  3141  func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
  3142  	return nil, false
  3143  }
  3144  
  3145  // AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
  3146  func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
  3147  	return &ckprtk, true
  3148  }
  3149  
  3150  // AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
  3151  func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
  3152  	return nil, false
  3153  }
  3154  
  3155  // AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
  3156  func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
  3157  	return nil, false
  3158  }
  3159  
  3160  // AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey.
  3161  func (ckprtk ContentKeyPolicyRsaTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
  3162  	return &ckprtk, true
  3163  }
  3164  
  3165  // ContentKeyPolicySymmetricTokenKey specifies a symmetric key for token validation.
  3166  type ContentKeyPolicySymmetricTokenKey struct {
  3167  	// KeyValue - The key value of the key
  3168  	KeyValue *[]byte `json:"keyValue,omitempty"`
  3169  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey'
  3170  	OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
  3171  }
  3172  
  3173  // MarshalJSON is the custom marshaler for ContentKeyPolicySymmetricTokenKey.
  3174  func (ckpstk ContentKeyPolicySymmetricTokenKey) MarshalJSON() ([]byte, error) {
  3175  	ckpstk.OdataType = OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey
  3176  	objectMap := make(map[string]interface{})
  3177  	if ckpstk.KeyValue != nil {
  3178  		objectMap["keyValue"] = ckpstk.KeyValue
  3179  	}
  3180  	if ckpstk.OdataType != "" {
  3181  		objectMap["@odata.type"] = ckpstk.OdataType
  3182  	}
  3183  	return json.Marshal(objectMap)
  3184  }
  3185  
  3186  // AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
  3187  func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
  3188  	return &ckpstk, true
  3189  }
  3190  
  3191  // AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
  3192  func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
  3193  	return nil, false
  3194  }
  3195  
  3196  // AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
  3197  func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
  3198  	return nil, false
  3199  }
  3200  
  3201  // AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
  3202  func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
  3203  	return nil, false
  3204  }
  3205  
  3206  // AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey.
  3207  func (ckpstk ContentKeyPolicySymmetricTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
  3208  	return &ckpstk, true
  3209  }
  3210  
  3211  // ContentKeyPolicyTokenClaim represents a token claim.
  3212  type ContentKeyPolicyTokenClaim struct {
  3213  	// ClaimType - Token claim type.
  3214  	ClaimType *string `json:"claimType,omitempty"`
  3215  	// ClaimValue - Token claim value.
  3216  	ClaimValue *string `json:"claimValue,omitempty"`
  3217  }
  3218  
  3219  // ContentKeyPolicyTokenRestriction represents a token restriction. Provided token must match these
  3220  // requirements for successful license or key delivery.
  3221  type ContentKeyPolicyTokenRestriction struct {
  3222  	// Issuer - The token issuer.
  3223  	Issuer *string `json:"issuer,omitempty"`
  3224  	// Audience - The audience for the token.
  3225  	Audience *string `json:"audience,omitempty"`
  3226  	// PrimaryVerificationKey - The primary verification key.
  3227  	PrimaryVerificationKey BasicContentKeyPolicyRestrictionTokenKey `json:"primaryVerificationKey,omitempty"`
  3228  	// AlternateVerificationKeys - A list of alternative verification keys.
  3229  	AlternateVerificationKeys *[]BasicContentKeyPolicyRestrictionTokenKey `json:"alternateVerificationKeys,omitempty"`
  3230  	// RequiredClaims - A list of required token claims.
  3231  	RequiredClaims *[]ContentKeyPolicyTokenClaim `json:"requiredClaims,omitempty"`
  3232  	// RestrictionTokenType - The type of token. Possible values include: 'ContentKeyPolicyRestrictionTokenTypeUnknown', 'ContentKeyPolicyRestrictionTokenTypeSwt', 'ContentKeyPolicyRestrictionTokenTypeJwt'
  3233  	RestrictionTokenType ContentKeyPolicyRestrictionTokenType `json:"restrictionTokenType,omitempty"`
  3234  	// OpenIDConnectDiscoveryDocument - The OpenID connect discovery document.
  3235  	OpenIDConnectDiscoveryDocument *string `json:"openIdConnectDiscoveryDocument,omitempty"`
  3236  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeContentKeyPolicyRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction'
  3237  	OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
  3238  }
  3239  
  3240  // MarshalJSON is the custom marshaler for ContentKeyPolicyTokenRestriction.
  3241  func (ckptr ContentKeyPolicyTokenRestriction) MarshalJSON() ([]byte, error) {
  3242  	ckptr.OdataType = OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction
  3243  	objectMap := make(map[string]interface{})
  3244  	if ckptr.Issuer != nil {
  3245  		objectMap["issuer"] = ckptr.Issuer
  3246  	}
  3247  	if ckptr.Audience != nil {
  3248  		objectMap["audience"] = ckptr.Audience
  3249  	}
  3250  	objectMap["primaryVerificationKey"] = ckptr.PrimaryVerificationKey
  3251  	if ckptr.AlternateVerificationKeys != nil {
  3252  		objectMap["alternateVerificationKeys"] = ckptr.AlternateVerificationKeys
  3253  	}
  3254  	if ckptr.RequiredClaims != nil {
  3255  		objectMap["requiredClaims"] = ckptr.RequiredClaims
  3256  	}
  3257  	if ckptr.RestrictionTokenType != "" {
  3258  		objectMap["restrictionTokenType"] = ckptr.RestrictionTokenType
  3259  	}
  3260  	if ckptr.OpenIDConnectDiscoveryDocument != nil {
  3261  		objectMap["openIdConnectDiscoveryDocument"] = ckptr.OpenIDConnectDiscoveryDocument
  3262  	}
  3263  	if ckptr.OdataType != "" {
  3264  		objectMap["@odata.type"] = ckptr.OdataType
  3265  	}
  3266  	return json.Marshal(objectMap)
  3267  }
  3268  
  3269  // AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
  3270  func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
  3271  	return nil, false
  3272  }
  3273  
  3274  // AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
  3275  func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
  3276  	return nil, false
  3277  }
  3278  
  3279  // AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
  3280  func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
  3281  	return &ckptr, true
  3282  }
  3283  
  3284  // AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
  3285  func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
  3286  	return nil, false
  3287  }
  3288  
  3289  // AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction.
  3290  func (ckptr ContentKeyPolicyTokenRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
  3291  	return &ckptr, true
  3292  }
  3293  
  3294  // UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyTokenRestriction struct.
  3295  func (ckptr *ContentKeyPolicyTokenRestriction) UnmarshalJSON(body []byte) error {
  3296  	var m map[string]*json.RawMessage
  3297  	err := json.Unmarshal(body, &m)
  3298  	if err != nil {
  3299  		return err
  3300  	}
  3301  	for k, v := range m {
  3302  		switch k {
  3303  		case "issuer":
  3304  			if v != nil {
  3305  				var issuer string
  3306  				err = json.Unmarshal(*v, &issuer)
  3307  				if err != nil {
  3308  					return err
  3309  				}
  3310  				ckptr.Issuer = &issuer
  3311  			}
  3312  		case "audience":
  3313  			if v != nil {
  3314  				var audience string
  3315  				err = json.Unmarshal(*v, &audience)
  3316  				if err != nil {
  3317  					return err
  3318  				}
  3319  				ckptr.Audience = &audience
  3320  			}
  3321  		case "primaryVerificationKey":
  3322  			if v != nil {
  3323  				primaryVerificationKey, err := unmarshalBasicContentKeyPolicyRestrictionTokenKey(*v)
  3324  				if err != nil {
  3325  					return err
  3326  				}
  3327  				ckptr.PrimaryVerificationKey = primaryVerificationKey
  3328  			}
  3329  		case "alternateVerificationKeys":
  3330  			if v != nil {
  3331  				alternateVerificationKeys, err := unmarshalBasicContentKeyPolicyRestrictionTokenKeyArray(*v)
  3332  				if err != nil {
  3333  					return err
  3334  				}
  3335  				ckptr.AlternateVerificationKeys = &alternateVerificationKeys
  3336  			}
  3337  		case "requiredClaims":
  3338  			if v != nil {
  3339  				var requiredClaims []ContentKeyPolicyTokenClaim
  3340  				err = json.Unmarshal(*v, &requiredClaims)
  3341  				if err != nil {
  3342  					return err
  3343  				}
  3344  				ckptr.RequiredClaims = &requiredClaims
  3345  			}
  3346  		case "restrictionTokenType":
  3347  			if v != nil {
  3348  				var restrictionTokenType ContentKeyPolicyRestrictionTokenType
  3349  				err = json.Unmarshal(*v, &restrictionTokenType)
  3350  				if err != nil {
  3351  					return err
  3352  				}
  3353  				ckptr.RestrictionTokenType = restrictionTokenType
  3354  			}
  3355  		case "openIdConnectDiscoveryDocument":
  3356  			if v != nil {
  3357  				var openIDConnectDiscoveryDocument string
  3358  				err = json.Unmarshal(*v, &openIDConnectDiscoveryDocument)
  3359  				if err != nil {
  3360  					return err
  3361  				}
  3362  				ckptr.OpenIDConnectDiscoveryDocument = &openIDConnectDiscoveryDocument
  3363  			}
  3364  		case "@odata.type":
  3365  			if v != nil {
  3366  				var odataType OdataTypeBasicContentKeyPolicyRestriction
  3367  				err = json.Unmarshal(*v, &odataType)
  3368  				if err != nil {
  3369  					return err
  3370  				}
  3371  				ckptr.OdataType = odataType
  3372  			}
  3373  		}
  3374  	}
  3375  
  3376  	return nil
  3377  }
  3378  
  3379  // ContentKeyPolicyUnknownConfiguration represents a ContentKeyPolicyConfiguration that is unavailable in
  3380  // the current API version.
  3381  type ContentKeyPolicyUnknownConfiguration struct {
  3382  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  3383  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  3384  }
  3385  
  3386  // MarshalJSON is the custom marshaler for ContentKeyPolicyUnknownConfiguration.
  3387  func (ckpuc ContentKeyPolicyUnknownConfiguration) MarshalJSON() ([]byte, error) {
  3388  	ckpuc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration
  3389  	objectMap := make(map[string]interface{})
  3390  	if ckpuc.OdataType != "" {
  3391  		objectMap["@odata.type"] = ckpuc.OdataType
  3392  	}
  3393  	return json.Marshal(objectMap)
  3394  }
  3395  
  3396  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3397  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  3398  	return nil, false
  3399  }
  3400  
  3401  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3402  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  3403  	return &ckpuc, true
  3404  }
  3405  
  3406  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3407  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  3408  	return nil, false
  3409  }
  3410  
  3411  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3412  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  3413  	return nil, false
  3414  }
  3415  
  3416  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3417  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  3418  	return nil, false
  3419  }
  3420  
  3421  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3422  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  3423  	return nil, false
  3424  }
  3425  
  3426  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration.
  3427  func (ckpuc ContentKeyPolicyUnknownConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  3428  	return &ckpuc, true
  3429  }
  3430  
  3431  // ContentKeyPolicyUnknownRestriction represents a ContentKeyPolicyRestriction that is unavailable in the
  3432  // current API version.
  3433  type ContentKeyPolicyUnknownRestriction struct {
  3434  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeContentKeyPolicyRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction'
  3435  	OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"`
  3436  }
  3437  
  3438  // MarshalJSON is the custom marshaler for ContentKeyPolicyUnknownRestriction.
  3439  func (ckpur ContentKeyPolicyUnknownRestriction) MarshalJSON() ([]byte, error) {
  3440  	ckpur.OdataType = OdataTypeBasicContentKeyPolicyRestrictionOdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction
  3441  	objectMap := make(map[string]interface{})
  3442  	if ckpur.OdataType != "" {
  3443  		objectMap["@odata.type"] = ckpur.OdataType
  3444  	}
  3445  	return json.Marshal(objectMap)
  3446  }
  3447  
  3448  // AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
  3449  func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) {
  3450  	return nil, false
  3451  }
  3452  
  3453  // AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
  3454  func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) {
  3455  	return &ckpur, true
  3456  }
  3457  
  3458  // AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
  3459  func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) {
  3460  	return nil, false
  3461  }
  3462  
  3463  // AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
  3464  func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) {
  3465  	return nil, false
  3466  }
  3467  
  3468  // AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction.
  3469  func (ckpur ContentKeyPolicyUnknownRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) {
  3470  	return &ckpur, true
  3471  }
  3472  
  3473  // ContentKeyPolicyWidevineConfiguration specifies a configuration for Widevine licenses.
  3474  type ContentKeyPolicyWidevineConfiguration struct {
  3475  	// WidevineTemplate - The Widevine template.
  3476  	WidevineTemplate *string `json:"widevineTemplate,omitempty"`
  3477  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeContentKeyPolicyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration'
  3478  	OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"`
  3479  }
  3480  
  3481  // MarshalJSON is the custom marshaler for ContentKeyPolicyWidevineConfiguration.
  3482  func (ckpwc ContentKeyPolicyWidevineConfiguration) MarshalJSON() ([]byte, error) {
  3483  	ckpwc.OdataType = OdataTypeBasicContentKeyPolicyConfigurationOdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration
  3484  	objectMap := make(map[string]interface{})
  3485  	if ckpwc.WidevineTemplate != nil {
  3486  		objectMap["widevineTemplate"] = ckpwc.WidevineTemplate
  3487  	}
  3488  	if ckpwc.OdataType != "" {
  3489  		objectMap["@odata.type"] = ckpwc.OdataType
  3490  	}
  3491  	return json.Marshal(objectMap)
  3492  }
  3493  
  3494  // AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3495  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) {
  3496  	return nil, false
  3497  }
  3498  
  3499  // AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3500  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) {
  3501  	return nil, false
  3502  }
  3503  
  3504  // AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3505  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) {
  3506  	return &ckpwc, true
  3507  }
  3508  
  3509  // AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3510  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) {
  3511  	return nil, false
  3512  }
  3513  
  3514  // AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3515  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) {
  3516  	return nil, false
  3517  }
  3518  
  3519  // AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3520  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) {
  3521  	return nil, false
  3522  }
  3523  
  3524  // AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration.
  3525  func (ckpwc ContentKeyPolicyWidevineConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) {
  3526  	return &ckpwc, true
  3527  }
  3528  
  3529  // ContentKeyPolicyX509CertificateTokenKey specifies a certificate for token validation.
  3530  type ContentKeyPolicyX509CertificateTokenKey struct {
  3531  	// RawBody - The raw data field of a certificate in PKCS 12 format (X509Certificate2 in .NET)
  3532  	RawBody *[]byte `json:"rawBody,omitempty"`
  3533  	// OdataType - Possible values include: 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey'
  3534  	OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"`
  3535  }
  3536  
  3537  // MarshalJSON is the custom marshaler for ContentKeyPolicyX509CertificateTokenKey.
  3538  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) MarshalJSON() ([]byte, error) {
  3539  	ckpxctk.OdataType = OdataTypeBasicContentKeyPolicyRestrictionTokenKeyOdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey
  3540  	objectMap := make(map[string]interface{})
  3541  	if ckpxctk.RawBody != nil {
  3542  		objectMap["rawBody"] = ckpxctk.RawBody
  3543  	}
  3544  	if ckpxctk.OdataType != "" {
  3545  		objectMap["@odata.type"] = ckpxctk.OdataType
  3546  	}
  3547  	return json.Marshal(objectMap)
  3548  }
  3549  
  3550  // AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
  3551  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) {
  3552  	return nil, false
  3553  }
  3554  
  3555  // AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
  3556  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) {
  3557  	return nil, false
  3558  }
  3559  
  3560  // AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
  3561  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) {
  3562  	return &ckpxctk, true
  3563  }
  3564  
  3565  // AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
  3566  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) {
  3567  	return nil, false
  3568  }
  3569  
  3570  // AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey.
  3571  func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) {
  3572  	return &ckpxctk, true
  3573  }
  3574  
  3575  // CopyAudio a codec flag, which tells the encoder to copy the input audio bitstream.
  3576  type CopyAudio struct {
  3577  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  3578  	Label *string `json:"label,omitempty"`
  3579  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  3580  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  3581  }
  3582  
  3583  // MarshalJSON is the custom marshaler for CopyAudio.
  3584  func (ca CopyAudio) MarshalJSON() ([]byte, error) {
  3585  	ca.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio
  3586  	objectMap := make(map[string]interface{})
  3587  	if ca.Label != nil {
  3588  		objectMap["label"] = ca.Label
  3589  	}
  3590  	if ca.OdataType != "" {
  3591  		objectMap["@odata.type"] = ca.OdataType
  3592  	}
  3593  	return json.Marshal(objectMap)
  3594  }
  3595  
  3596  // AsAudio is the BasicCodec implementation for CopyAudio.
  3597  func (ca CopyAudio) AsAudio() (*Audio, bool) {
  3598  	return nil, false
  3599  }
  3600  
  3601  // AsBasicAudio is the BasicCodec implementation for CopyAudio.
  3602  func (ca CopyAudio) AsBasicAudio() (BasicAudio, bool) {
  3603  	return nil, false
  3604  }
  3605  
  3606  // AsAacAudio is the BasicCodec implementation for CopyAudio.
  3607  func (ca CopyAudio) AsAacAudio() (*AacAudio, bool) {
  3608  	return nil, false
  3609  }
  3610  
  3611  // AsVideo is the BasicCodec implementation for CopyAudio.
  3612  func (ca CopyAudio) AsVideo() (*Video, bool) {
  3613  	return nil, false
  3614  }
  3615  
  3616  // AsBasicVideo is the BasicCodec implementation for CopyAudio.
  3617  func (ca CopyAudio) AsBasicVideo() (BasicVideo, bool) {
  3618  	return nil, false
  3619  }
  3620  
  3621  // AsH265Video is the BasicCodec implementation for CopyAudio.
  3622  func (ca CopyAudio) AsH265Video() (*H265Video, bool) {
  3623  	return nil, false
  3624  }
  3625  
  3626  // AsCopyVideo is the BasicCodec implementation for CopyAudio.
  3627  func (ca CopyAudio) AsCopyVideo() (*CopyVideo, bool) {
  3628  	return nil, false
  3629  }
  3630  
  3631  // AsImage is the BasicCodec implementation for CopyAudio.
  3632  func (ca CopyAudio) AsImage() (*Image, bool) {
  3633  	return nil, false
  3634  }
  3635  
  3636  // AsBasicImage is the BasicCodec implementation for CopyAudio.
  3637  func (ca CopyAudio) AsBasicImage() (BasicImage, bool) {
  3638  	return nil, false
  3639  }
  3640  
  3641  // AsCopyAudio is the BasicCodec implementation for CopyAudio.
  3642  func (ca CopyAudio) AsCopyAudio() (*CopyAudio, bool) {
  3643  	return &ca, true
  3644  }
  3645  
  3646  // AsH264Video is the BasicCodec implementation for CopyAudio.
  3647  func (ca CopyAudio) AsH264Video() (*H264Video, bool) {
  3648  	return nil, false
  3649  }
  3650  
  3651  // AsJpgImage is the BasicCodec implementation for CopyAudio.
  3652  func (ca CopyAudio) AsJpgImage() (*JpgImage, bool) {
  3653  	return nil, false
  3654  }
  3655  
  3656  // AsPngImage is the BasicCodec implementation for CopyAudio.
  3657  func (ca CopyAudio) AsPngImage() (*PngImage, bool) {
  3658  	return nil, false
  3659  }
  3660  
  3661  // AsCodec is the BasicCodec implementation for CopyAudio.
  3662  func (ca CopyAudio) AsCodec() (*Codec, bool) {
  3663  	return nil, false
  3664  }
  3665  
  3666  // AsBasicCodec is the BasicCodec implementation for CopyAudio.
  3667  func (ca CopyAudio) AsBasicCodec() (BasicCodec, bool) {
  3668  	return &ca, true
  3669  }
  3670  
  3671  // CopyVideo a codec flag, which tells the encoder to copy the input video bitstream without re-encoding.
  3672  type CopyVideo struct {
  3673  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  3674  	Label *string `json:"label,omitempty"`
  3675  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  3676  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  3677  }
  3678  
  3679  // MarshalJSON is the custom marshaler for CopyVideo.
  3680  func (cv CopyVideo) MarshalJSON() ([]byte, error) {
  3681  	cv.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo
  3682  	objectMap := make(map[string]interface{})
  3683  	if cv.Label != nil {
  3684  		objectMap["label"] = cv.Label
  3685  	}
  3686  	if cv.OdataType != "" {
  3687  		objectMap["@odata.type"] = cv.OdataType
  3688  	}
  3689  	return json.Marshal(objectMap)
  3690  }
  3691  
  3692  // AsAudio is the BasicCodec implementation for CopyVideo.
  3693  func (cv CopyVideo) AsAudio() (*Audio, bool) {
  3694  	return nil, false
  3695  }
  3696  
  3697  // AsBasicAudio is the BasicCodec implementation for CopyVideo.
  3698  func (cv CopyVideo) AsBasicAudio() (BasicAudio, bool) {
  3699  	return nil, false
  3700  }
  3701  
  3702  // AsAacAudio is the BasicCodec implementation for CopyVideo.
  3703  func (cv CopyVideo) AsAacAudio() (*AacAudio, bool) {
  3704  	return nil, false
  3705  }
  3706  
  3707  // AsVideo is the BasicCodec implementation for CopyVideo.
  3708  func (cv CopyVideo) AsVideo() (*Video, bool) {
  3709  	return nil, false
  3710  }
  3711  
  3712  // AsBasicVideo is the BasicCodec implementation for CopyVideo.
  3713  func (cv CopyVideo) AsBasicVideo() (BasicVideo, bool) {
  3714  	return nil, false
  3715  }
  3716  
  3717  // AsH265Video is the BasicCodec implementation for CopyVideo.
  3718  func (cv CopyVideo) AsH265Video() (*H265Video, bool) {
  3719  	return nil, false
  3720  }
  3721  
  3722  // AsCopyVideo is the BasicCodec implementation for CopyVideo.
  3723  func (cv CopyVideo) AsCopyVideo() (*CopyVideo, bool) {
  3724  	return &cv, true
  3725  }
  3726  
  3727  // AsImage is the BasicCodec implementation for CopyVideo.
  3728  func (cv CopyVideo) AsImage() (*Image, bool) {
  3729  	return nil, false
  3730  }
  3731  
  3732  // AsBasicImage is the BasicCodec implementation for CopyVideo.
  3733  func (cv CopyVideo) AsBasicImage() (BasicImage, bool) {
  3734  	return nil, false
  3735  }
  3736  
  3737  // AsCopyAudio is the BasicCodec implementation for CopyVideo.
  3738  func (cv CopyVideo) AsCopyAudio() (*CopyAudio, bool) {
  3739  	return nil, false
  3740  }
  3741  
  3742  // AsH264Video is the BasicCodec implementation for CopyVideo.
  3743  func (cv CopyVideo) AsH264Video() (*H264Video, bool) {
  3744  	return nil, false
  3745  }
  3746  
  3747  // AsJpgImage is the BasicCodec implementation for CopyVideo.
  3748  func (cv CopyVideo) AsJpgImage() (*JpgImage, bool) {
  3749  	return nil, false
  3750  }
  3751  
  3752  // AsPngImage is the BasicCodec implementation for CopyVideo.
  3753  func (cv CopyVideo) AsPngImage() (*PngImage, bool) {
  3754  	return nil, false
  3755  }
  3756  
  3757  // AsCodec is the BasicCodec implementation for CopyVideo.
  3758  func (cv CopyVideo) AsCodec() (*Codec, bool) {
  3759  	return nil, false
  3760  }
  3761  
  3762  // AsBasicCodec is the BasicCodec implementation for CopyVideo.
  3763  func (cv CopyVideo) AsBasicCodec() (BasicCodec, bool) {
  3764  	return &cv, true
  3765  }
  3766  
  3767  // CrossSiteAccessPolicies the client access policy.
  3768  type CrossSiteAccessPolicies struct {
  3769  	// ClientAccessPolicy - The content of clientaccesspolicy.xml used by Silverlight.
  3770  	ClientAccessPolicy *string `json:"clientAccessPolicy,omitempty"`
  3771  	// CrossDomainPolicy - The content of crossdomain.xml used by Silverlight.
  3772  	CrossDomainPolicy *string `json:"crossDomainPolicy,omitempty"`
  3773  }
  3774  
  3775  // DefaultKey class to specify properties of default content key for each encryption scheme
  3776  type DefaultKey struct {
  3777  	// Label - Label can be used to specify Content Key when creating a Streaming Locator
  3778  	Label *string `json:"label,omitempty"`
  3779  	// PolicyName - Policy used by Default Key
  3780  	PolicyName *string `json:"policyName,omitempty"`
  3781  }
  3782  
  3783  // Deinterlace describes the de-interlacing settings.
  3784  type Deinterlace struct {
  3785  	// Parity - The field parity for de-interlacing, defaults to Auto. Possible values include: 'DeinterlaceParityAuto', 'DeinterlaceParityTopFieldFirst', 'DeinterlaceParityBottomFieldFirst'
  3786  	Parity DeinterlaceParity `json:"parity,omitempty"`
  3787  	// Mode - The deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values include: 'DeinterlaceModeOff', 'DeinterlaceModeAutoPixelAdaptive'
  3788  	Mode DeinterlaceMode `json:"mode,omitempty"`
  3789  }
  3790  
  3791  // EdgePolicies ...
  3792  type EdgePolicies struct {
  3793  	autorest.Response         `json:"-"`
  3794  	UsageDataCollectionPolicy *EdgeUsageDataCollectionPolicy `json:"usageDataCollectionPolicy,omitempty"`
  3795  }
  3796  
  3797  // EdgeUsageDataCollectionPolicy ...
  3798  type EdgeUsageDataCollectionPolicy struct {
  3799  	// DataCollectionFrequency - Usage data collection frequency in ISO 8601 duration format e.g. PT10M , PT5H.
  3800  	DataCollectionFrequency *string `json:"dataCollectionFrequency,omitempty"`
  3801  	// DataReportingFrequency - Usage data reporting frequency in ISO 8601 duration format e.g. PT10M , PT5H.
  3802  	DataReportingFrequency *string `json:"dataReportingFrequency,omitempty"`
  3803  	// MaxAllowedUnreportedUsageDuration - Maximum time for which the functionality of the device will not be hampered for not reporting the usage data.
  3804  	MaxAllowedUnreportedUsageDuration *string `json:"maxAllowedUnreportedUsageDuration,omitempty"`
  3805  	// EventHubDetails - Details of Event Hub where the usage will be reported.
  3806  	EventHubDetails *EdgeUsageDataEventHub `json:"eventHubDetails,omitempty"`
  3807  }
  3808  
  3809  // EdgeUsageDataEventHub ...
  3810  type EdgeUsageDataEventHub struct {
  3811  	// Name - Name of the Event Hub where usage will be reported.
  3812  	Name *string `json:"name,omitempty"`
  3813  	// Namespace - Namespace of the Event Hub where usage will be reported.
  3814  	Namespace *string `json:"namespace,omitempty"`
  3815  	// Token - SAS token needed to interact with Event Hub.
  3816  	Token *string `json:"token,omitempty"`
  3817  }
  3818  
  3819  // EnabledProtocols class to specify which protocols are enabled
  3820  type EnabledProtocols struct {
  3821  	// Download - Enable Download protocol or not
  3822  	Download *bool `json:"download,omitempty"`
  3823  	// Dash - Enable DASH protocol or not
  3824  	Dash *bool `json:"dash,omitempty"`
  3825  	// Hls - Enable HLS protocol or not
  3826  	Hls *bool `json:"hls,omitempty"`
  3827  	// SmoothStreaming - Enable SmoothStreaming protocol or not
  3828  	SmoothStreaming *bool `json:"smoothStreaming,omitempty"`
  3829  }
  3830  
  3831  // EntityNameAvailabilityCheckOutput the response from the check name availability request.
  3832  type EntityNameAvailabilityCheckOutput struct {
  3833  	autorest.Response `json:"-"`
  3834  	// NameAvailable - Specifies if the name is available.
  3835  	NameAvailable *bool `json:"nameAvailable,omitempty"`
  3836  	// Reason - Specifies the reason if the name is not available.
  3837  	Reason *string `json:"reason,omitempty"`
  3838  	// Message - Specifies the detailed reason if the name is not available.
  3839  	Message *string `json:"message,omitempty"`
  3840  }
  3841  
  3842  // EnvelopeEncryption class for EnvelopeEncryption encryption scheme
  3843  type EnvelopeEncryption struct {
  3844  	// EnabledProtocols - Representing supported protocols
  3845  	EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
  3846  	// ClearTracks - Representing which tracks should not be encrypted
  3847  	ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"`
  3848  	// ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks
  3849  	ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"`
  3850  	// 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.
  3851  	CustomKeyAcquisitionURLTemplate *string `json:"customKeyAcquisitionUrlTemplate,omitempty"`
  3852  }
  3853  
  3854  // FaceDetectorPreset describes all the settings to be used when analyzing a video in order to detect (and
  3855  // optionally redact) all the faces present.
  3856  type FaceDetectorPreset struct {
  3857  	// 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'
  3858  	Resolution AnalysisResolution `json:"resolution,omitempty"`
  3859  	// 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'
  3860  	Mode FaceRedactorMode `json:"mode,omitempty"`
  3861  	// BlurType - Blur type. Possible values include: 'BlurTypeBox', 'BlurTypeLow', 'BlurTypeMed', 'BlurTypeHigh', 'BlurTypeBlack'
  3862  	BlurType BlurType `json:"blurType,omitempty"`
  3863  	// ExperimentalOptions - Dictionary containing key value pairs for parameters not exposed in the preset itself
  3864  	ExperimentalOptions map[string]*string `json:"experimentalOptions"`
  3865  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
  3866  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
  3867  }
  3868  
  3869  // MarshalJSON is the custom marshaler for FaceDetectorPreset.
  3870  func (fdp FaceDetectorPreset) MarshalJSON() ([]byte, error) {
  3871  	fdp.OdataType = OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset
  3872  	objectMap := make(map[string]interface{})
  3873  	if fdp.Resolution != "" {
  3874  		objectMap["resolution"] = fdp.Resolution
  3875  	}
  3876  	if fdp.Mode != "" {
  3877  		objectMap["mode"] = fdp.Mode
  3878  	}
  3879  	if fdp.BlurType != "" {
  3880  		objectMap["blurType"] = fdp.BlurType
  3881  	}
  3882  	if fdp.ExperimentalOptions != nil {
  3883  		objectMap["experimentalOptions"] = fdp.ExperimentalOptions
  3884  	}
  3885  	if fdp.OdataType != "" {
  3886  		objectMap["@odata.type"] = fdp.OdataType
  3887  	}
  3888  	return json.Marshal(objectMap)
  3889  }
  3890  
  3891  // AsFaceDetectorPreset is the BasicPreset implementation for FaceDetectorPreset.
  3892  func (fdp FaceDetectorPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
  3893  	return &fdp, true
  3894  }
  3895  
  3896  // AsAudioAnalyzerPreset is the BasicPreset implementation for FaceDetectorPreset.
  3897  func (fdp FaceDetectorPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
  3898  	return nil, false
  3899  }
  3900  
  3901  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for FaceDetectorPreset.
  3902  func (fdp FaceDetectorPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
  3903  	return nil, false
  3904  }
  3905  
  3906  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for FaceDetectorPreset.
  3907  func (fdp FaceDetectorPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
  3908  	return nil, false
  3909  }
  3910  
  3911  // AsStandardEncoderPreset is the BasicPreset implementation for FaceDetectorPreset.
  3912  func (fdp FaceDetectorPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
  3913  	return nil, false
  3914  }
  3915  
  3916  // AsVideoAnalyzerPreset is the BasicPreset implementation for FaceDetectorPreset.
  3917  func (fdp FaceDetectorPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
  3918  	return nil, false
  3919  }
  3920  
  3921  // AsPreset is the BasicPreset implementation for FaceDetectorPreset.
  3922  func (fdp FaceDetectorPreset) AsPreset() (*Preset, bool) {
  3923  	return nil, false
  3924  }
  3925  
  3926  // AsBasicPreset is the BasicPreset implementation for FaceDetectorPreset.
  3927  func (fdp FaceDetectorPreset) AsBasicPreset() (BasicPreset, bool) {
  3928  	return &fdp, true
  3929  }
  3930  
  3931  // FilterProperties the Media Filter properties.
  3932  type FilterProperties struct {
  3933  	// PresentationTimeRange - The presentation time range.
  3934  	PresentationTimeRange *PresentationTimeRange `json:"presentationTimeRange,omitempty"`
  3935  	// FirstQuality - The first quality.
  3936  	FirstQuality *FirstQuality `json:"firstQuality,omitempty"`
  3937  	// Tracks - The tracks selection conditions.
  3938  	Tracks *[]FilterTrackSelection `json:"tracks,omitempty"`
  3939  }
  3940  
  3941  // Filters describes all the filtering operations, such as de-interlacing, rotation etc. that are to be
  3942  // applied to the input media before encoding.
  3943  type Filters struct {
  3944  	// Deinterlace - The de-interlacing settings.
  3945  	Deinterlace *Deinterlace `json:"deinterlace,omitempty"`
  3946  	// 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'
  3947  	Rotation Rotation `json:"rotation,omitempty"`
  3948  	// Crop - The parameters for the rectangular window with which to crop the input video.
  3949  	Crop *Rectangle `json:"crop,omitempty"`
  3950  	// Overlays - The properties of overlays to be applied to the input video. These could be audio, image or video overlays.
  3951  	Overlays *[]BasicOverlay `json:"overlays,omitempty"`
  3952  }
  3953  
  3954  // UnmarshalJSON is the custom unmarshaler for Filters struct.
  3955  func (f *Filters) UnmarshalJSON(body []byte) error {
  3956  	var m map[string]*json.RawMessage
  3957  	err := json.Unmarshal(body, &m)
  3958  	if err != nil {
  3959  		return err
  3960  	}
  3961  	for k, v := range m {
  3962  		switch k {
  3963  		case "deinterlace":
  3964  			if v != nil {
  3965  				var deinterlace Deinterlace
  3966  				err = json.Unmarshal(*v, &deinterlace)
  3967  				if err != nil {
  3968  					return err
  3969  				}
  3970  				f.Deinterlace = &deinterlace
  3971  			}
  3972  		case "rotation":
  3973  			if v != nil {
  3974  				var rotation Rotation
  3975  				err = json.Unmarshal(*v, &rotation)
  3976  				if err != nil {
  3977  					return err
  3978  				}
  3979  				f.Rotation = rotation
  3980  			}
  3981  		case "crop":
  3982  			if v != nil {
  3983  				var crop Rectangle
  3984  				err = json.Unmarshal(*v, &crop)
  3985  				if err != nil {
  3986  					return err
  3987  				}
  3988  				f.Crop = &crop
  3989  			}
  3990  		case "overlays":
  3991  			if v != nil {
  3992  				overlays, err := unmarshalBasicOverlayArray(*v)
  3993  				if err != nil {
  3994  					return err
  3995  				}
  3996  				f.Overlays = &overlays
  3997  			}
  3998  		}
  3999  	}
  4000  
  4001  	return nil
  4002  }
  4003  
  4004  // FilterTrackPropertyCondition the class to specify one track property condition.
  4005  type FilterTrackPropertyCondition struct {
  4006  	// Property - The track property type. Possible values include: 'FilterTrackPropertyTypeUnknown', 'FilterTrackPropertyTypeType', 'FilterTrackPropertyTypeName', 'FilterTrackPropertyTypeLanguage', 'FilterTrackPropertyTypeFourCC', 'FilterTrackPropertyTypeBitrate'
  4007  	Property FilterTrackPropertyType `json:"property,omitempty"`
  4008  	// Value - The track property value.
  4009  	Value *string `json:"value,omitempty"`
  4010  	// Operation - The track property condition operation. Possible values include: 'FilterTrackPropertyCompareOperationEqual', 'FilterTrackPropertyCompareOperationNotEqual'
  4011  	Operation FilterTrackPropertyCompareOperation `json:"operation,omitempty"`
  4012  }
  4013  
  4014  // FilterTrackSelection representing a list of FilterTrackPropertyConditions to select a track.  The
  4015  // filters are combined using a logical AND operation.
  4016  type FilterTrackSelection struct {
  4017  	// TrackSelections - The track selections.
  4018  	TrackSelections *[]FilterTrackPropertyCondition `json:"trackSelections,omitempty"`
  4019  }
  4020  
  4021  // FirstQuality filter First Quality
  4022  type FirstQuality struct {
  4023  	// Bitrate - The first quality bitrate.
  4024  	Bitrate *int32 `json:"bitrate,omitempty"`
  4025  }
  4026  
  4027  // BasicFormat base class for output.
  4028  type BasicFormat interface {
  4029  	AsImageFormat() (*ImageFormat, bool)
  4030  	AsBasicImageFormat() (BasicImageFormat, bool)
  4031  	AsJpgFormat() (*JpgFormat, bool)
  4032  	AsPngFormat() (*PngFormat, bool)
  4033  	AsMultiBitrateFormat() (*MultiBitrateFormat, bool)
  4034  	AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool)
  4035  	AsMp4Format() (*Mp4Format, bool)
  4036  	AsTransportStreamFormat() (*TransportStreamFormat, bool)
  4037  	AsFormat() (*Format, bool)
  4038  }
  4039  
  4040  // Format base class for output.
  4041  type Format struct {
  4042  	// 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.
  4043  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  4044  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  4045  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  4046  }
  4047  
  4048  func unmarshalBasicFormat(body []byte) (BasicFormat, error) {
  4049  	var m map[string]interface{}
  4050  	err := json.Unmarshal(body, &m)
  4051  	if err != nil {
  4052  		return nil, err
  4053  	}
  4054  
  4055  	switch m["@odata.type"] {
  4056  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat):
  4057  		var ifVar ImageFormat
  4058  		err := json.Unmarshal(body, &ifVar)
  4059  		return ifVar, err
  4060  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat):
  4061  		var jf JpgFormat
  4062  		err := json.Unmarshal(body, &jf)
  4063  		return jf, err
  4064  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat):
  4065  		var pf PngFormat
  4066  		err := json.Unmarshal(body, &pf)
  4067  		return pf, err
  4068  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat):
  4069  		var mbf MultiBitrateFormat
  4070  		err := json.Unmarshal(body, &mbf)
  4071  		return mbf, err
  4072  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format):
  4073  		var m4f Mp4Format
  4074  		err := json.Unmarshal(body, &m4f)
  4075  		return m4f, err
  4076  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat):
  4077  		var tsf TransportStreamFormat
  4078  		err := json.Unmarshal(body, &tsf)
  4079  		return tsf, err
  4080  	default:
  4081  		var f Format
  4082  		err := json.Unmarshal(body, &f)
  4083  		return f, err
  4084  	}
  4085  }
  4086  func unmarshalBasicFormatArray(body []byte) ([]BasicFormat, error) {
  4087  	var rawMessages []*json.RawMessage
  4088  	err := json.Unmarshal(body, &rawMessages)
  4089  	if err != nil {
  4090  		return nil, err
  4091  	}
  4092  
  4093  	fArray := make([]BasicFormat, len(rawMessages))
  4094  
  4095  	for index, rawMessage := range rawMessages {
  4096  		f, err := unmarshalBasicFormat(*rawMessage)
  4097  		if err != nil {
  4098  			return nil, err
  4099  		}
  4100  		fArray[index] = f
  4101  	}
  4102  	return fArray, nil
  4103  }
  4104  
  4105  // MarshalJSON is the custom marshaler for Format.
  4106  func (f Format) MarshalJSON() ([]byte, error) {
  4107  	f.OdataType = OdataTypeBasicFormatOdataTypeFormat
  4108  	objectMap := make(map[string]interface{})
  4109  	if f.FilenamePattern != nil {
  4110  		objectMap["filenamePattern"] = f.FilenamePattern
  4111  	}
  4112  	if f.OdataType != "" {
  4113  		objectMap["@odata.type"] = f.OdataType
  4114  	}
  4115  	return json.Marshal(objectMap)
  4116  }
  4117  
  4118  // AsImageFormat is the BasicFormat implementation for Format.
  4119  func (f Format) AsImageFormat() (*ImageFormat, bool) {
  4120  	return nil, false
  4121  }
  4122  
  4123  // AsBasicImageFormat is the BasicFormat implementation for Format.
  4124  func (f Format) AsBasicImageFormat() (BasicImageFormat, bool) {
  4125  	return nil, false
  4126  }
  4127  
  4128  // AsJpgFormat is the BasicFormat implementation for Format.
  4129  func (f Format) AsJpgFormat() (*JpgFormat, bool) {
  4130  	return nil, false
  4131  }
  4132  
  4133  // AsPngFormat is the BasicFormat implementation for Format.
  4134  func (f Format) AsPngFormat() (*PngFormat, bool) {
  4135  	return nil, false
  4136  }
  4137  
  4138  // AsMultiBitrateFormat is the BasicFormat implementation for Format.
  4139  func (f Format) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  4140  	return nil, false
  4141  }
  4142  
  4143  // AsBasicMultiBitrateFormat is the BasicFormat implementation for Format.
  4144  func (f Format) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  4145  	return nil, false
  4146  }
  4147  
  4148  // AsMp4Format is the BasicFormat implementation for Format.
  4149  func (f Format) AsMp4Format() (*Mp4Format, bool) {
  4150  	return nil, false
  4151  }
  4152  
  4153  // AsTransportStreamFormat is the BasicFormat implementation for Format.
  4154  func (f Format) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  4155  	return nil, false
  4156  }
  4157  
  4158  // AsFormat is the BasicFormat implementation for Format.
  4159  func (f Format) AsFormat() (*Format, bool) {
  4160  	return &f, true
  4161  }
  4162  
  4163  // AsBasicFormat is the BasicFormat implementation for Format.
  4164  func (f Format) AsBasicFormat() (BasicFormat, bool) {
  4165  	return &f, true
  4166  }
  4167  
  4168  // FromAllInputFile an InputDefinition that looks across all of the files provided to select tracks
  4169  // specified by the IncludedTracks property. Generally used with the AudioTrackByAttribute and
  4170  // VideoTrackByAttribute to allow selection of a single track across a set of input files.
  4171  type FromAllInputFile struct {
  4172  	// IncludedTracks - The list of TrackDescriptors which define the metadata and selection of tracks in the input.
  4173  	IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
  4174  	// OdataType - Possible values include: 'OdataTypeBasicInputDefinitionOdataTypeInputDefinition', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile'
  4175  	OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
  4176  }
  4177  
  4178  // MarshalJSON is the custom marshaler for FromAllInputFile.
  4179  func (faif FromAllInputFile) MarshalJSON() ([]byte, error) {
  4180  	faif.OdataType = OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile
  4181  	objectMap := make(map[string]interface{})
  4182  	if faif.IncludedTracks != nil {
  4183  		objectMap["includedTracks"] = faif.IncludedTracks
  4184  	}
  4185  	if faif.OdataType != "" {
  4186  		objectMap["@odata.type"] = faif.OdataType
  4187  	}
  4188  	return json.Marshal(objectMap)
  4189  }
  4190  
  4191  // AsFromAllInputFile is the BasicInputDefinition implementation for FromAllInputFile.
  4192  func (faif FromAllInputFile) AsFromAllInputFile() (*FromAllInputFile, bool) {
  4193  	return &faif, true
  4194  }
  4195  
  4196  // AsFromEachInputFile is the BasicInputDefinition implementation for FromAllInputFile.
  4197  func (faif FromAllInputFile) AsFromEachInputFile() (*FromEachInputFile, bool) {
  4198  	return nil, false
  4199  }
  4200  
  4201  // AsInputFile is the BasicInputDefinition implementation for FromAllInputFile.
  4202  func (faif FromAllInputFile) AsInputFile() (*InputFile, bool) {
  4203  	return nil, false
  4204  }
  4205  
  4206  // AsInputDefinition is the BasicInputDefinition implementation for FromAllInputFile.
  4207  func (faif FromAllInputFile) AsInputDefinition() (*InputDefinition, bool) {
  4208  	return nil, false
  4209  }
  4210  
  4211  // AsBasicInputDefinition is the BasicInputDefinition implementation for FromAllInputFile.
  4212  func (faif FromAllInputFile) AsBasicInputDefinition() (BasicInputDefinition, bool) {
  4213  	return &faif, true
  4214  }
  4215  
  4216  // UnmarshalJSON is the custom unmarshaler for FromAllInputFile struct.
  4217  func (faif *FromAllInputFile) UnmarshalJSON(body []byte) error {
  4218  	var m map[string]*json.RawMessage
  4219  	err := json.Unmarshal(body, &m)
  4220  	if err != nil {
  4221  		return err
  4222  	}
  4223  	for k, v := range m {
  4224  		switch k {
  4225  		case "includedTracks":
  4226  			if v != nil {
  4227  				includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
  4228  				if err != nil {
  4229  					return err
  4230  				}
  4231  				faif.IncludedTracks = &includedTracks
  4232  			}
  4233  		case "@odata.type":
  4234  			if v != nil {
  4235  				var odataType OdataTypeBasicInputDefinition
  4236  				err = json.Unmarshal(*v, &odataType)
  4237  				if err != nil {
  4238  					return err
  4239  				}
  4240  				faif.OdataType = odataType
  4241  			}
  4242  		}
  4243  	}
  4244  
  4245  	return nil
  4246  }
  4247  
  4248  // FromEachInputFile an InputDefinition that looks at each input file provided to select tracks specified
  4249  // by the IncludedTracks property. Generally used with the AudioTrackByAttribute and VideoTrackByAttribute
  4250  // to select tracks from each file given.
  4251  type FromEachInputFile struct {
  4252  	// IncludedTracks - The list of TrackDescriptors which define the metadata and selection of tracks in the input.
  4253  	IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
  4254  	// OdataType - Possible values include: 'OdataTypeBasicInputDefinitionOdataTypeInputDefinition', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile'
  4255  	OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
  4256  }
  4257  
  4258  // MarshalJSON is the custom marshaler for FromEachInputFile.
  4259  func (feif FromEachInputFile) MarshalJSON() ([]byte, error) {
  4260  	feif.OdataType = OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile
  4261  	objectMap := make(map[string]interface{})
  4262  	if feif.IncludedTracks != nil {
  4263  		objectMap["includedTracks"] = feif.IncludedTracks
  4264  	}
  4265  	if feif.OdataType != "" {
  4266  		objectMap["@odata.type"] = feif.OdataType
  4267  	}
  4268  	return json.Marshal(objectMap)
  4269  }
  4270  
  4271  // AsFromAllInputFile is the BasicInputDefinition implementation for FromEachInputFile.
  4272  func (feif FromEachInputFile) AsFromAllInputFile() (*FromAllInputFile, bool) {
  4273  	return nil, false
  4274  }
  4275  
  4276  // AsFromEachInputFile is the BasicInputDefinition implementation for FromEachInputFile.
  4277  func (feif FromEachInputFile) AsFromEachInputFile() (*FromEachInputFile, bool) {
  4278  	return &feif, true
  4279  }
  4280  
  4281  // AsInputFile is the BasicInputDefinition implementation for FromEachInputFile.
  4282  func (feif FromEachInputFile) AsInputFile() (*InputFile, bool) {
  4283  	return nil, false
  4284  }
  4285  
  4286  // AsInputDefinition is the BasicInputDefinition implementation for FromEachInputFile.
  4287  func (feif FromEachInputFile) AsInputDefinition() (*InputDefinition, bool) {
  4288  	return nil, false
  4289  }
  4290  
  4291  // AsBasicInputDefinition is the BasicInputDefinition implementation for FromEachInputFile.
  4292  func (feif FromEachInputFile) AsBasicInputDefinition() (BasicInputDefinition, bool) {
  4293  	return &feif, true
  4294  }
  4295  
  4296  // UnmarshalJSON is the custom unmarshaler for FromEachInputFile struct.
  4297  func (feif *FromEachInputFile) UnmarshalJSON(body []byte) error {
  4298  	var m map[string]*json.RawMessage
  4299  	err := json.Unmarshal(body, &m)
  4300  	if err != nil {
  4301  		return err
  4302  	}
  4303  	for k, v := range m {
  4304  		switch k {
  4305  		case "includedTracks":
  4306  			if v != nil {
  4307  				includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
  4308  				if err != nil {
  4309  					return err
  4310  				}
  4311  				feif.IncludedTracks = &includedTracks
  4312  			}
  4313  		case "@odata.type":
  4314  			if v != nil {
  4315  				var odataType OdataTypeBasicInputDefinition
  4316  				err = json.Unmarshal(*v, &odataType)
  4317  				if err != nil {
  4318  					return err
  4319  				}
  4320  				feif.OdataType = odataType
  4321  			}
  4322  		}
  4323  	}
  4324  
  4325  	return nil
  4326  }
  4327  
  4328  // H264Layer describes the settings to be used when encoding the input video into a desired output bitrate
  4329  // layer with the H.264 video codec.
  4330  type H264Layer struct {
  4331  	// Profile - We currently support Baseline, Main, High, High422, High444. Default is Auto. Possible values include: 'H264VideoProfileAuto', 'H264VideoProfileBaseline', 'H264VideoProfileMain', 'H264VideoProfileHigh', 'H264VideoProfileHigh422', 'H264VideoProfileHigh444'
  4332  	Profile H264VideoProfile `json:"profile,omitempty"`
  4333  	// 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.
  4334  	Level *string `json:"level,omitempty"`
  4335  	// 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).
  4336  	BufferWindow *string `json:"bufferWindow,omitempty"`
  4337  	// 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.
  4338  	ReferenceFrames *int32 `json:"referenceFrames,omitempty"`
  4339  	// 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'
  4340  	EntropyMode EntropyMode `json:"entropyMode,omitempty"`
  4341  	// Bitrate - The average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field.
  4342  	Bitrate *int32 `json:"bitrate,omitempty"`
  4343  	// 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.
  4344  	MaxBitrate *int32 `json:"maxBitrate,omitempty"`
  4345  	// 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.
  4346  	BFrames *int32 `json:"bFrames,omitempty"`
  4347  	// 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.
  4348  	FrameRate *string `json:"frameRate,omitempty"`
  4349  	// 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.
  4350  	Slices *int32 `json:"slices,omitempty"`
  4351  	// 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.
  4352  	AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
  4353  	// 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.
  4354  	Width *string `json:"width,omitempty"`
  4355  	// 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.
  4356  	Height *string `json:"height,omitempty"`
  4357  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  4358  	Label *string `json:"label,omitempty"`
  4359  	// OdataType - Possible values include: 'OdataTypeBasicLayerOdataTypeLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer'
  4360  	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
  4361  }
  4362  
  4363  // MarshalJSON is the custom marshaler for H264Layer.
  4364  func (hl H264Layer) MarshalJSON() ([]byte, error) {
  4365  	hl.OdataType = OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer
  4366  	objectMap := make(map[string]interface{})
  4367  	if hl.Profile != "" {
  4368  		objectMap["profile"] = hl.Profile
  4369  	}
  4370  	if hl.Level != nil {
  4371  		objectMap["level"] = hl.Level
  4372  	}
  4373  	if hl.BufferWindow != nil {
  4374  		objectMap["bufferWindow"] = hl.BufferWindow
  4375  	}
  4376  	if hl.ReferenceFrames != nil {
  4377  		objectMap["referenceFrames"] = hl.ReferenceFrames
  4378  	}
  4379  	if hl.EntropyMode != "" {
  4380  		objectMap["entropyMode"] = hl.EntropyMode
  4381  	}
  4382  	if hl.Bitrate != nil {
  4383  		objectMap["bitrate"] = hl.Bitrate
  4384  	}
  4385  	if hl.MaxBitrate != nil {
  4386  		objectMap["maxBitrate"] = hl.MaxBitrate
  4387  	}
  4388  	if hl.BFrames != nil {
  4389  		objectMap["bFrames"] = hl.BFrames
  4390  	}
  4391  	if hl.FrameRate != nil {
  4392  		objectMap["frameRate"] = hl.FrameRate
  4393  	}
  4394  	if hl.Slices != nil {
  4395  		objectMap["slices"] = hl.Slices
  4396  	}
  4397  	if hl.AdaptiveBFrame != nil {
  4398  		objectMap["adaptiveBFrame"] = hl.AdaptiveBFrame
  4399  	}
  4400  	if hl.Width != nil {
  4401  		objectMap["width"] = hl.Width
  4402  	}
  4403  	if hl.Height != nil {
  4404  		objectMap["height"] = hl.Height
  4405  	}
  4406  	if hl.Label != nil {
  4407  		objectMap["label"] = hl.Label
  4408  	}
  4409  	if hl.OdataType != "" {
  4410  		objectMap["@odata.type"] = hl.OdataType
  4411  	}
  4412  	return json.Marshal(objectMap)
  4413  }
  4414  
  4415  // AsH265VideoLayer is the BasicLayer implementation for H264Layer.
  4416  func (hl H264Layer) AsH265VideoLayer() (*H265VideoLayer, bool) {
  4417  	return nil, false
  4418  }
  4419  
  4420  // AsBasicH265VideoLayer is the BasicLayer implementation for H264Layer.
  4421  func (hl H264Layer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
  4422  	return nil, false
  4423  }
  4424  
  4425  // AsH265Layer is the BasicLayer implementation for H264Layer.
  4426  func (hl H264Layer) AsH265Layer() (*H265Layer, bool) {
  4427  	return nil, false
  4428  }
  4429  
  4430  // AsVideoLayer is the BasicLayer implementation for H264Layer.
  4431  func (hl H264Layer) AsVideoLayer() (*VideoLayer, bool) {
  4432  	return nil, false
  4433  }
  4434  
  4435  // AsBasicVideoLayer is the BasicLayer implementation for H264Layer.
  4436  func (hl H264Layer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
  4437  	return &hl, true
  4438  }
  4439  
  4440  // AsH264Layer is the BasicLayer implementation for H264Layer.
  4441  func (hl H264Layer) AsH264Layer() (*H264Layer, bool) {
  4442  	return &hl, true
  4443  }
  4444  
  4445  // AsJpgLayer is the BasicLayer implementation for H264Layer.
  4446  func (hl H264Layer) AsJpgLayer() (*JpgLayer, bool) {
  4447  	return nil, false
  4448  }
  4449  
  4450  // AsPngLayer is the BasicLayer implementation for H264Layer.
  4451  func (hl H264Layer) AsPngLayer() (*PngLayer, bool) {
  4452  	return nil, false
  4453  }
  4454  
  4455  // AsLayer is the BasicLayer implementation for H264Layer.
  4456  func (hl H264Layer) AsLayer() (*Layer, bool) {
  4457  	return nil, false
  4458  }
  4459  
  4460  // AsBasicLayer is the BasicLayer implementation for H264Layer.
  4461  func (hl H264Layer) AsBasicLayer() (BasicLayer, bool) {
  4462  	return &hl, true
  4463  }
  4464  
  4465  // H264Video describes all the properties for encoding a video with the H.264 codec.
  4466  type H264Video struct {
  4467  	// 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.
  4468  	SceneChangeDetection *bool `json:"sceneChangeDetection,omitempty"`
  4469  	// Complexity - Tells the encoder how to choose its encoding settings. The default value is Balanced. Possible values include: 'H264ComplexitySpeed', 'H264ComplexityBalanced', 'H264ComplexityQuality'
  4470  	Complexity H264Complexity `json:"complexity,omitempty"`
  4471  	// Layers - The collection of output H.264 layers to be produced by the encoder.
  4472  	Layers *[]H264Layer `json:"layers,omitempty"`
  4473  	// 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.
  4474  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  4475  	// 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'
  4476  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  4477  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
  4478  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
  4479  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  4480  	Label *string `json:"label,omitempty"`
  4481  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  4482  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  4483  }
  4484  
  4485  // MarshalJSON is the custom marshaler for H264Video.
  4486  func (hv H264Video) MarshalJSON() ([]byte, error) {
  4487  	hv.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video
  4488  	objectMap := make(map[string]interface{})
  4489  	if hv.SceneChangeDetection != nil {
  4490  		objectMap["sceneChangeDetection"] = hv.SceneChangeDetection
  4491  	}
  4492  	if hv.Complexity != "" {
  4493  		objectMap["complexity"] = hv.Complexity
  4494  	}
  4495  	if hv.Layers != nil {
  4496  		objectMap["layers"] = hv.Layers
  4497  	}
  4498  	if hv.KeyFrameInterval != nil {
  4499  		objectMap["keyFrameInterval"] = hv.KeyFrameInterval
  4500  	}
  4501  	if hv.StretchMode != "" {
  4502  		objectMap["stretchMode"] = hv.StretchMode
  4503  	}
  4504  	if hv.SyncMode != "" {
  4505  		objectMap["syncMode"] = hv.SyncMode
  4506  	}
  4507  	if hv.Label != nil {
  4508  		objectMap["label"] = hv.Label
  4509  	}
  4510  	if hv.OdataType != "" {
  4511  		objectMap["@odata.type"] = hv.OdataType
  4512  	}
  4513  	return json.Marshal(objectMap)
  4514  }
  4515  
  4516  // AsAudio is the BasicCodec implementation for H264Video.
  4517  func (hv H264Video) AsAudio() (*Audio, bool) {
  4518  	return nil, false
  4519  }
  4520  
  4521  // AsBasicAudio is the BasicCodec implementation for H264Video.
  4522  func (hv H264Video) AsBasicAudio() (BasicAudio, bool) {
  4523  	return nil, false
  4524  }
  4525  
  4526  // AsAacAudio is the BasicCodec implementation for H264Video.
  4527  func (hv H264Video) AsAacAudio() (*AacAudio, bool) {
  4528  	return nil, false
  4529  }
  4530  
  4531  // AsVideo is the BasicCodec implementation for H264Video.
  4532  func (hv H264Video) AsVideo() (*Video, bool) {
  4533  	return nil, false
  4534  }
  4535  
  4536  // AsBasicVideo is the BasicCodec implementation for H264Video.
  4537  func (hv H264Video) AsBasicVideo() (BasicVideo, bool) {
  4538  	return &hv, true
  4539  }
  4540  
  4541  // AsH265Video is the BasicCodec implementation for H264Video.
  4542  func (hv H264Video) AsH265Video() (*H265Video, bool) {
  4543  	return nil, false
  4544  }
  4545  
  4546  // AsCopyVideo is the BasicCodec implementation for H264Video.
  4547  func (hv H264Video) AsCopyVideo() (*CopyVideo, bool) {
  4548  	return nil, false
  4549  }
  4550  
  4551  // AsImage is the BasicCodec implementation for H264Video.
  4552  func (hv H264Video) AsImage() (*Image, bool) {
  4553  	return nil, false
  4554  }
  4555  
  4556  // AsBasicImage is the BasicCodec implementation for H264Video.
  4557  func (hv H264Video) AsBasicImage() (BasicImage, bool) {
  4558  	return nil, false
  4559  }
  4560  
  4561  // AsCopyAudio is the BasicCodec implementation for H264Video.
  4562  func (hv H264Video) AsCopyAudio() (*CopyAudio, bool) {
  4563  	return nil, false
  4564  }
  4565  
  4566  // AsH264Video is the BasicCodec implementation for H264Video.
  4567  func (hv H264Video) AsH264Video() (*H264Video, bool) {
  4568  	return &hv, true
  4569  }
  4570  
  4571  // AsJpgImage is the BasicCodec implementation for H264Video.
  4572  func (hv H264Video) AsJpgImage() (*JpgImage, bool) {
  4573  	return nil, false
  4574  }
  4575  
  4576  // AsPngImage is the BasicCodec implementation for H264Video.
  4577  func (hv H264Video) AsPngImage() (*PngImage, bool) {
  4578  	return nil, false
  4579  }
  4580  
  4581  // AsCodec is the BasicCodec implementation for H264Video.
  4582  func (hv H264Video) AsCodec() (*Codec, bool) {
  4583  	return nil, false
  4584  }
  4585  
  4586  // AsBasicCodec is the BasicCodec implementation for H264Video.
  4587  func (hv H264Video) AsBasicCodec() (BasicCodec, bool) {
  4588  	return &hv, true
  4589  }
  4590  
  4591  // H265Layer describes the settings to be used when encoding the input video into a desired output bitrate
  4592  // layer with the H.265 video codec.
  4593  type H265Layer struct {
  4594  	// Profile - We currently support Main. Default is Auto. Possible values include: 'H265VideoProfileAuto', 'H265VideoProfileMain'
  4595  	Profile H265VideoProfile `json:"profile,omitempty"`
  4596  	// 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.
  4597  	Level *string `json:"level,omitempty"`
  4598  	// 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).
  4599  	BufferWindow *string `json:"bufferWindow,omitempty"`
  4600  	// 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.
  4601  	ReferenceFrames *int32 `json:"referenceFrames,omitempty"`
  4602  	// 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.
  4603  	Bitrate *int32 `json:"bitrate,omitempty"`
  4604  	// 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.
  4605  	MaxBitrate *int32 `json:"maxBitrate,omitempty"`
  4606  	// 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.
  4607  	BFrames *int32 `json:"bFrames,omitempty"`
  4608  	// 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.
  4609  	FrameRate *string `json:"frameRate,omitempty"`
  4610  	// 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.
  4611  	Slices *int32 `json:"slices,omitempty"`
  4612  	// 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.
  4613  	AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
  4614  	// 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.
  4615  	Width *string `json:"width,omitempty"`
  4616  	// 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.
  4617  	Height *string `json:"height,omitempty"`
  4618  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  4619  	Label *string `json:"label,omitempty"`
  4620  	// OdataType - Possible values include: 'OdataTypeBasicLayerOdataTypeLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer'
  4621  	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
  4622  }
  4623  
  4624  // MarshalJSON is the custom marshaler for H265Layer.
  4625  func (hl H265Layer) MarshalJSON() ([]byte, error) {
  4626  	hl.OdataType = OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer
  4627  	objectMap := make(map[string]interface{})
  4628  	if hl.Profile != "" {
  4629  		objectMap["profile"] = hl.Profile
  4630  	}
  4631  	if hl.Level != nil {
  4632  		objectMap["level"] = hl.Level
  4633  	}
  4634  	if hl.BufferWindow != nil {
  4635  		objectMap["bufferWindow"] = hl.BufferWindow
  4636  	}
  4637  	if hl.ReferenceFrames != nil {
  4638  		objectMap["referenceFrames"] = hl.ReferenceFrames
  4639  	}
  4640  	if hl.Bitrate != nil {
  4641  		objectMap["bitrate"] = hl.Bitrate
  4642  	}
  4643  	if hl.MaxBitrate != nil {
  4644  		objectMap["maxBitrate"] = hl.MaxBitrate
  4645  	}
  4646  	if hl.BFrames != nil {
  4647  		objectMap["bFrames"] = hl.BFrames
  4648  	}
  4649  	if hl.FrameRate != nil {
  4650  		objectMap["frameRate"] = hl.FrameRate
  4651  	}
  4652  	if hl.Slices != nil {
  4653  		objectMap["slices"] = hl.Slices
  4654  	}
  4655  	if hl.AdaptiveBFrame != nil {
  4656  		objectMap["adaptiveBFrame"] = hl.AdaptiveBFrame
  4657  	}
  4658  	if hl.Width != nil {
  4659  		objectMap["width"] = hl.Width
  4660  	}
  4661  	if hl.Height != nil {
  4662  		objectMap["height"] = hl.Height
  4663  	}
  4664  	if hl.Label != nil {
  4665  		objectMap["label"] = hl.Label
  4666  	}
  4667  	if hl.OdataType != "" {
  4668  		objectMap["@odata.type"] = hl.OdataType
  4669  	}
  4670  	return json.Marshal(objectMap)
  4671  }
  4672  
  4673  // AsH265VideoLayer is the BasicLayer implementation for H265Layer.
  4674  func (hl H265Layer) AsH265VideoLayer() (*H265VideoLayer, bool) {
  4675  	return nil, false
  4676  }
  4677  
  4678  // AsBasicH265VideoLayer is the BasicLayer implementation for H265Layer.
  4679  func (hl H265Layer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
  4680  	return &hl, true
  4681  }
  4682  
  4683  // AsH265Layer is the BasicLayer implementation for H265Layer.
  4684  func (hl H265Layer) AsH265Layer() (*H265Layer, bool) {
  4685  	return &hl, true
  4686  }
  4687  
  4688  // AsVideoLayer is the BasicLayer implementation for H265Layer.
  4689  func (hl H265Layer) AsVideoLayer() (*VideoLayer, bool) {
  4690  	return nil, false
  4691  }
  4692  
  4693  // AsBasicVideoLayer is the BasicLayer implementation for H265Layer.
  4694  func (hl H265Layer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
  4695  	return nil, false
  4696  }
  4697  
  4698  // AsH264Layer is the BasicLayer implementation for H265Layer.
  4699  func (hl H265Layer) AsH264Layer() (*H264Layer, bool) {
  4700  	return nil, false
  4701  }
  4702  
  4703  // AsJpgLayer is the BasicLayer implementation for H265Layer.
  4704  func (hl H265Layer) AsJpgLayer() (*JpgLayer, bool) {
  4705  	return nil, false
  4706  }
  4707  
  4708  // AsPngLayer is the BasicLayer implementation for H265Layer.
  4709  func (hl H265Layer) AsPngLayer() (*PngLayer, bool) {
  4710  	return nil, false
  4711  }
  4712  
  4713  // AsLayer is the BasicLayer implementation for H265Layer.
  4714  func (hl H265Layer) AsLayer() (*Layer, bool) {
  4715  	return nil, false
  4716  }
  4717  
  4718  // AsBasicLayer is the BasicLayer implementation for H265Layer.
  4719  func (hl H265Layer) AsBasicLayer() (BasicLayer, bool) {
  4720  	return &hl, true
  4721  }
  4722  
  4723  // H265Video describes all the properties for encoding a video with the H.265 codec.
  4724  type H265Video struct {
  4725  	// 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.
  4726  	SceneChangeDetection *bool `json:"sceneChangeDetection,omitempty"`
  4727  	// 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'
  4728  	Complexity H265Complexity `json:"complexity,omitempty"`
  4729  	// Layers - The collection of output H.265 layers to be produced by the encoder.
  4730  	Layers *[]H265Layer `json:"layers,omitempty"`
  4731  	// 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.
  4732  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  4733  	// 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'
  4734  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  4735  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
  4736  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
  4737  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  4738  	Label *string `json:"label,omitempty"`
  4739  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  4740  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  4741  }
  4742  
  4743  // MarshalJSON is the custom marshaler for H265Video.
  4744  func (hv H265Video) MarshalJSON() ([]byte, error) {
  4745  	hv.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video
  4746  	objectMap := make(map[string]interface{})
  4747  	if hv.SceneChangeDetection != nil {
  4748  		objectMap["sceneChangeDetection"] = hv.SceneChangeDetection
  4749  	}
  4750  	if hv.Complexity != "" {
  4751  		objectMap["complexity"] = hv.Complexity
  4752  	}
  4753  	if hv.Layers != nil {
  4754  		objectMap["layers"] = hv.Layers
  4755  	}
  4756  	if hv.KeyFrameInterval != nil {
  4757  		objectMap["keyFrameInterval"] = hv.KeyFrameInterval
  4758  	}
  4759  	if hv.StretchMode != "" {
  4760  		objectMap["stretchMode"] = hv.StretchMode
  4761  	}
  4762  	if hv.SyncMode != "" {
  4763  		objectMap["syncMode"] = hv.SyncMode
  4764  	}
  4765  	if hv.Label != nil {
  4766  		objectMap["label"] = hv.Label
  4767  	}
  4768  	if hv.OdataType != "" {
  4769  		objectMap["@odata.type"] = hv.OdataType
  4770  	}
  4771  	return json.Marshal(objectMap)
  4772  }
  4773  
  4774  // AsAudio is the BasicCodec implementation for H265Video.
  4775  func (hv H265Video) AsAudio() (*Audio, bool) {
  4776  	return nil, false
  4777  }
  4778  
  4779  // AsBasicAudio is the BasicCodec implementation for H265Video.
  4780  func (hv H265Video) AsBasicAudio() (BasicAudio, bool) {
  4781  	return nil, false
  4782  }
  4783  
  4784  // AsAacAudio is the BasicCodec implementation for H265Video.
  4785  func (hv H265Video) AsAacAudio() (*AacAudio, bool) {
  4786  	return nil, false
  4787  }
  4788  
  4789  // AsVideo is the BasicCodec implementation for H265Video.
  4790  func (hv H265Video) AsVideo() (*Video, bool) {
  4791  	return nil, false
  4792  }
  4793  
  4794  // AsBasicVideo is the BasicCodec implementation for H265Video.
  4795  func (hv H265Video) AsBasicVideo() (BasicVideo, bool) {
  4796  	return &hv, true
  4797  }
  4798  
  4799  // AsH265Video is the BasicCodec implementation for H265Video.
  4800  func (hv H265Video) AsH265Video() (*H265Video, bool) {
  4801  	return &hv, true
  4802  }
  4803  
  4804  // AsCopyVideo is the BasicCodec implementation for H265Video.
  4805  func (hv H265Video) AsCopyVideo() (*CopyVideo, bool) {
  4806  	return nil, false
  4807  }
  4808  
  4809  // AsImage is the BasicCodec implementation for H265Video.
  4810  func (hv H265Video) AsImage() (*Image, bool) {
  4811  	return nil, false
  4812  }
  4813  
  4814  // AsBasicImage is the BasicCodec implementation for H265Video.
  4815  func (hv H265Video) AsBasicImage() (BasicImage, bool) {
  4816  	return nil, false
  4817  }
  4818  
  4819  // AsCopyAudio is the BasicCodec implementation for H265Video.
  4820  func (hv H265Video) AsCopyAudio() (*CopyAudio, bool) {
  4821  	return nil, false
  4822  }
  4823  
  4824  // AsH264Video is the BasicCodec implementation for H265Video.
  4825  func (hv H265Video) AsH264Video() (*H264Video, bool) {
  4826  	return nil, false
  4827  }
  4828  
  4829  // AsJpgImage is the BasicCodec implementation for H265Video.
  4830  func (hv H265Video) AsJpgImage() (*JpgImage, bool) {
  4831  	return nil, false
  4832  }
  4833  
  4834  // AsPngImage is the BasicCodec implementation for H265Video.
  4835  func (hv H265Video) AsPngImage() (*PngImage, bool) {
  4836  	return nil, false
  4837  }
  4838  
  4839  // AsCodec is the BasicCodec implementation for H265Video.
  4840  func (hv H265Video) AsCodec() (*Codec, bool) {
  4841  	return nil, false
  4842  }
  4843  
  4844  // AsBasicCodec is the BasicCodec implementation for H265Video.
  4845  func (hv H265Video) AsBasicCodec() (BasicCodec, bool) {
  4846  	return &hv, true
  4847  }
  4848  
  4849  // BasicH265VideoLayer describes the settings to be used when encoding the input video into a desired output bitrate
  4850  // layer.
  4851  type BasicH265VideoLayer interface {
  4852  	AsH265Layer() (*H265Layer, bool)
  4853  	AsH265VideoLayer() (*H265VideoLayer, bool)
  4854  }
  4855  
  4856  // H265VideoLayer describes the settings to be used when encoding the input video into a desired output bitrate
  4857  // layer.
  4858  type H265VideoLayer struct {
  4859  	// 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.
  4860  	Bitrate *int32 `json:"bitrate,omitempty"`
  4861  	// 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.
  4862  	MaxBitrate *int32 `json:"maxBitrate,omitempty"`
  4863  	// 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.
  4864  	BFrames *int32 `json:"bFrames,omitempty"`
  4865  	// 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.
  4866  	FrameRate *string `json:"frameRate,omitempty"`
  4867  	// 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.
  4868  	Slices *int32 `json:"slices,omitempty"`
  4869  	// 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.
  4870  	AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
  4871  	// 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.
  4872  	Width *string `json:"width,omitempty"`
  4873  	// 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.
  4874  	Height *string `json:"height,omitempty"`
  4875  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  4876  	Label *string `json:"label,omitempty"`
  4877  	// OdataType - Possible values include: 'OdataTypeBasicLayerOdataTypeLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer'
  4878  	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
  4879  }
  4880  
  4881  func unmarshalBasicH265VideoLayer(body []byte) (BasicH265VideoLayer, error) {
  4882  	var m map[string]interface{}
  4883  	err := json.Unmarshal(body, &m)
  4884  	if err != nil {
  4885  		return nil, err
  4886  	}
  4887  
  4888  	switch m["@odata.type"] {
  4889  	case string(OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer):
  4890  		var hl H265Layer
  4891  		err := json.Unmarshal(body, &hl)
  4892  		return hl, err
  4893  	default:
  4894  		var hvl H265VideoLayer
  4895  		err := json.Unmarshal(body, &hvl)
  4896  		return hvl, err
  4897  	}
  4898  }
  4899  func unmarshalBasicH265VideoLayerArray(body []byte) ([]BasicH265VideoLayer, error) {
  4900  	var rawMessages []*json.RawMessage
  4901  	err := json.Unmarshal(body, &rawMessages)
  4902  	if err != nil {
  4903  		return nil, err
  4904  	}
  4905  
  4906  	hvlArray := make([]BasicH265VideoLayer, len(rawMessages))
  4907  
  4908  	for index, rawMessage := range rawMessages {
  4909  		hvl, err := unmarshalBasicH265VideoLayer(*rawMessage)
  4910  		if err != nil {
  4911  			return nil, err
  4912  		}
  4913  		hvlArray[index] = hvl
  4914  	}
  4915  	return hvlArray, nil
  4916  }
  4917  
  4918  // MarshalJSON is the custom marshaler for H265VideoLayer.
  4919  func (hvl H265VideoLayer) MarshalJSON() ([]byte, error) {
  4920  	hvl.OdataType = OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer
  4921  	objectMap := make(map[string]interface{})
  4922  	if hvl.Bitrate != nil {
  4923  		objectMap["bitrate"] = hvl.Bitrate
  4924  	}
  4925  	if hvl.MaxBitrate != nil {
  4926  		objectMap["maxBitrate"] = hvl.MaxBitrate
  4927  	}
  4928  	if hvl.BFrames != nil {
  4929  		objectMap["bFrames"] = hvl.BFrames
  4930  	}
  4931  	if hvl.FrameRate != nil {
  4932  		objectMap["frameRate"] = hvl.FrameRate
  4933  	}
  4934  	if hvl.Slices != nil {
  4935  		objectMap["slices"] = hvl.Slices
  4936  	}
  4937  	if hvl.AdaptiveBFrame != nil {
  4938  		objectMap["adaptiveBFrame"] = hvl.AdaptiveBFrame
  4939  	}
  4940  	if hvl.Width != nil {
  4941  		objectMap["width"] = hvl.Width
  4942  	}
  4943  	if hvl.Height != nil {
  4944  		objectMap["height"] = hvl.Height
  4945  	}
  4946  	if hvl.Label != nil {
  4947  		objectMap["label"] = hvl.Label
  4948  	}
  4949  	if hvl.OdataType != "" {
  4950  		objectMap["@odata.type"] = hvl.OdataType
  4951  	}
  4952  	return json.Marshal(objectMap)
  4953  }
  4954  
  4955  // AsH265VideoLayer is the BasicLayer implementation for H265VideoLayer.
  4956  func (hvl H265VideoLayer) AsH265VideoLayer() (*H265VideoLayer, bool) {
  4957  	return &hvl, true
  4958  }
  4959  
  4960  // AsBasicH265VideoLayer is the BasicLayer implementation for H265VideoLayer.
  4961  func (hvl H265VideoLayer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
  4962  	return &hvl, true
  4963  }
  4964  
  4965  // AsH265Layer is the BasicLayer implementation for H265VideoLayer.
  4966  func (hvl H265VideoLayer) AsH265Layer() (*H265Layer, bool) {
  4967  	return nil, false
  4968  }
  4969  
  4970  // AsVideoLayer is the BasicLayer implementation for H265VideoLayer.
  4971  func (hvl H265VideoLayer) AsVideoLayer() (*VideoLayer, bool) {
  4972  	return nil, false
  4973  }
  4974  
  4975  // AsBasicVideoLayer is the BasicLayer implementation for H265VideoLayer.
  4976  func (hvl H265VideoLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
  4977  	return nil, false
  4978  }
  4979  
  4980  // AsH264Layer is the BasicLayer implementation for H265VideoLayer.
  4981  func (hvl H265VideoLayer) AsH264Layer() (*H264Layer, bool) {
  4982  	return nil, false
  4983  }
  4984  
  4985  // AsJpgLayer is the BasicLayer implementation for H265VideoLayer.
  4986  func (hvl H265VideoLayer) AsJpgLayer() (*JpgLayer, bool) {
  4987  	return nil, false
  4988  }
  4989  
  4990  // AsPngLayer is the BasicLayer implementation for H265VideoLayer.
  4991  func (hvl H265VideoLayer) AsPngLayer() (*PngLayer, bool) {
  4992  	return nil, false
  4993  }
  4994  
  4995  // AsLayer is the BasicLayer implementation for H265VideoLayer.
  4996  func (hvl H265VideoLayer) AsLayer() (*Layer, bool) {
  4997  	return nil, false
  4998  }
  4999  
  5000  // AsBasicLayer is the BasicLayer implementation for H265VideoLayer.
  5001  func (hvl H265VideoLayer) AsBasicLayer() (BasicLayer, bool) {
  5002  	return &hvl, true
  5003  }
  5004  
  5005  // Hls HTTP Live Streaming (HLS) packing setting for the live output.
  5006  type Hls struct {
  5007  	// 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.
  5008  	FragmentsPerTsSegment *int32 `json:"fragmentsPerTsSegment,omitempty"`
  5009  }
  5010  
  5011  // BasicImage describes the basic properties for generating thumbnails from the input video
  5012  type BasicImage interface {
  5013  	AsJpgImage() (*JpgImage, bool)
  5014  	AsPngImage() (*PngImage, bool)
  5015  	AsImage() (*Image, bool)
  5016  }
  5017  
  5018  // Image describes the basic properties for generating thumbnails from the input video
  5019  type Image struct {
  5020  	// 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}.
  5021  	Start *string `json:"start,omitempty"`
  5022  	// 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.
  5023  	Step *string `json:"step,omitempty"`
  5024  	// 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.
  5025  	Range *string `json:"range,omitempty"`
  5026  	// 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.
  5027  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  5028  	// 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'
  5029  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  5030  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
  5031  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
  5032  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  5033  	Label *string `json:"label,omitempty"`
  5034  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  5035  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  5036  }
  5037  
  5038  func unmarshalBasicImage(body []byte) (BasicImage, error) {
  5039  	var m map[string]interface{}
  5040  	err := json.Unmarshal(body, &m)
  5041  	if err != nil {
  5042  		return nil, err
  5043  	}
  5044  
  5045  	switch m["@odata.type"] {
  5046  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage):
  5047  		var ji JpgImage
  5048  		err := json.Unmarshal(body, &ji)
  5049  		return ji, err
  5050  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage):
  5051  		var pi PngImage
  5052  		err := json.Unmarshal(body, &pi)
  5053  		return pi, err
  5054  	default:
  5055  		var i Image
  5056  		err := json.Unmarshal(body, &i)
  5057  		return i, err
  5058  	}
  5059  }
  5060  func unmarshalBasicImageArray(body []byte) ([]BasicImage, error) {
  5061  	var rawMessages []*json.RawMessage
  5062  	err := json.Unmarshal(body, &rawMessages)
  5063  	if err != nil {
  5064  		return nil, err
  5065  	}
  5066  
  5067  	iArray := make([]BasicImage, len(rawMessages))
  5068  
  5069  	for index, rawMessage := range rawMessages {
  5070  		i, err := unmarshalBasicImage(*rawMessage)
  5071  		if err != nil {
  5072  			return nil, err
  5073  		}
  5074  		iArray[index] = i
  5075  	}
  5076  	return iArray, nil
  5077  }
  5078  
  5079  // MarshalJSON is the custom marshaler for Image.
  5080  func (i Image) MarshalJSON() ([]byte, error) {
  5081  	i.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaImage
  5082  	objectMap := make(map[string]interface{})
  5083  	if i.Start != nil {
  5084  		objectMap["start"] = i.Start
  5085  	}
  5086  	if i.Step != nil {
  5087  		objectMap["step"] = i.Step
  5088  	}
  5089  	if i.Range != nil {
  5090  		objectMap["range"] = i.Range
  5091  	}
  5092  	if i.KeyFrameInterval != nil {
  5093  		objectMap["keyFrameInterval"] = i.KeyFrameInterval
  5094  	}
  5095  	if i.StretchMode != "" {
  5096  		objectMap["stretchMode"] = i.StretchMode
  5097  	}
  5098  	if i.SyncMode != "" {
  5099  		objectMap["syncMode"] = i.SyncMode
  5100  	}
  5101  	if i.Label != nil {
  5102  		objectMap["label"] = i.Label
  5103  	}
  5104  	if i.OdataType != "" {
  5105  		objectMap["@odata.type"] = i.OdataType
  5106  	}
  5107  	return json.Marshal(objectMap)
  5108  }
  5109  
  5110  // AsAudio is the BasicCodec implementation for Image.
  5111  func (i Image) AsAudio() (*Audio, bool) {
  5112  	return nil, false
  5113  }
  5114  
  5115  // AsBasicAudio is the BasicCodec implementation for Image.
  5116  func (i Image) AsBasicAudio() (BasicAudio, bool) {
  5117  	return nil, false
  5118  }
  5119  
  5120  // AsAacAudio is the BasicCodec implementation for Image.
  5121  func (i Image) AsAacAudio() (*AacAudio, bool) {
  5122  	return nil, false
  5123  }
  5124  
  5125  // AsVideo is the BasicCodec implementation for Image.
  5126  func (i Image) AsVideo() (*Video, bool) {
  5127  	return nil, false
  5128  }
  5129  
  5130  // AsBasicVideo is the BasicCodec implementation for Image.
  5131  func (i Image) AsBasicVideo() (BasicVideo, bool) {
  5132  	return &i, true
  5133  }
  5134  
  5135  // AsH265Video is the BasicCodec implementation for Image.
  5136  func (i Image) AsH265Video() (*H265Video, bool) {
  5137  	return nil, false
  5138  }
  5139  
  5140  // AsCopyVideo is the BasicCodec implementation for Image.
  5141  func (i Image) AsCopyVideo() (*CopyVideo, bool) {
  5142  	return nil, false
  5143  }
  5144  
  5145  // AsImage is the BasicCodec implementation for Image.
  5146  func (i Image) AsImage() (*Image, bool) {
  5147  	return &i, true
  5148  }
  5149  
  5150  // AsBasicImage is the BasicCodec implementation for Image.
  5151  func (i Image) AsBasicImage() (BasicImage, bool) {
  5152  	return &i, true
  5153  }
  5154  
  5155  // AsCopyAudio is the BasicCodec implementation for Image.
  5156  func (i Image) AsCopyAudio() (*CopyAudio, bool) {
  5157  	return nil, false
  5158  }
  5159  
  5160  // AsH264Video is the BasicCodec implementation for Image.
  5161  func (i Image) AsH264Video() (*H264Video, bool) {
  5162  	return nil, false
  5163  }
  5164  
  5165  // AsJpgImage is the BasicCodec implementation for Image.
  5166  func (i Image) AsJpgImage() (*JpgImage, bool) {
  5167  	return nil, false
  5168  }
  5169  
  5170  // AsPngImage is the BasicCodec implementation for Image.
  5171  func (i Image) AsPngImage() (*PngImage, bool) {
  5172  	return nil, false
  5173  }
  5174  
  5175  // AsCodec is the BasicCodec implementation for Image.
  5176  func (i Image) AsCodec() (*Codec, bool) {
  5177  	return nil, false
  5178  }
  5179  
  5180  // AsBasicCodec is the BasicCodec implementation for Image.
  5181  func (i Image) AsBasicCodec() (BasicCodec, bool) {
  5182  	return &i, true
  5183  }
  5184  
  5185  // BasicImageFormat describes the properties for an output image file.
  5186  type BasicImageFormat interface {
  5187  	AsJpgFormat() (*JpgFormat, bool)
  5188  	AsPngFormat() (*PngFormat, bool)
  5189  	AsImageFormat() (*ImageFormat, bool)
  5190  }
  5191  
  5192  // ImageFormat describes the properties for an output image file.
  5193  type ImageFormat struct {
  5194  	// 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.
  5195  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  5196  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  5197  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  5198  }
  5199  
  5200  func unmarshalBasicImageFormat(body []byte) (BasicImageFormat, error) {
  5201  	var m map[string]interface{}
  5202  	err := json.Unmarshal(body, &m)
  5203  	if err != nil {
  5204  		return nil, err
  5205  	}
  5206  
  5207  	switch m["@odata.type"] {
  5208  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat):
  5209  		var jf JpgFormat
  5210  		err := json.Unmarshal(body, &jf)
  5211  		return jf, err
  5212  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat):
  5213  		var pf PngFormat
  5214  		err := json.Unmarshal(body, &pf)
  5215  		return pf, err
  5216  	default:
  5217  		var ifVar ImageFormat
  5218  		err := json.Unmarshal(body, &ifVar)
  5219  		return ifVar, err
  5220  	}
  5221  }
  5222  func unmarshalBasicImageFormatArray(body []byte) ([]BasicImageFormat, error) {
  5223  	var rawMessages []*json.RawMessage
  5224  	err := json.Unmarshal(body, &rawMessages)
  5225  	if err != nil {
  5226  		return nil, err
  5227  	}
  5228  
  5229  	ifVarArray := make([]BasicImageFormat, len(rawMessages))
  5230  
  5231  	for index, rawMessage := range rawMessages {
  5232  		ifVar, err := unmarshalBasicImageFormat(*rawMessage)
  5233  		if err != nil {
  5234  			return nil, err
  5235  		}
  5236  		ifVarArray[index] = ifVar
  5237  	}
  5238  	return ifVarArray, nil
  5239  }
  5240  
  5241  // MarshalJSON is the custom marshaler for ImageFormat.
  5242  func (ifVar ImageFormat) MarshalJSON() ([]byte, error) {
  5243  	ifVar.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat
  5244  	objectMap := make(map[string]interface{})
  5245  	if ifVar.FilenamePattern != nil {
  5246  		objectMap["filenamePattern"] = ifVar.FilenamePattern
  5247  	}
  5248  	if ifVar.OdataType != "" {
  5249  		objectMap["@odata.type"] = ifVar.OdataType
  5250  	}
  5251  	return json.Marshal(objectMap)
  5252  }
  5253  
  5254  // AsImageFormat is the BasicFormat implementation for ImageFormat.
  5255  func (ifVar ImageFormat) AsImageFormat() (*ImageFormat, bool) {
  5256  	return &ifVar, true
  5257  }
  5258  
  5259  // AsBasicImageFormat is the BasicFormat implementation for ImageFormat.
  5260  func (ifVar ImageFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
  5261  	return &ifVar, true
  5262  }
  5263  
  5264  // AsJpgFormat is the BasicFormat implementation for ImageFormat.
  5265  func (ifVar ImageFormat) AsJpgFormat() (*JpgFormat, bool) {
  5266  	return nil, false
  5267  }
  5268  
  5269  // AsPngFormat is the BasicFormat implementation for ImageFormat.
  5270  func (ifVar ImageFormat) AsPngFormat() (*PngFormat, bool) {
  5271  	return nil, false
  5272  }
  5273  
  5274  // AsMultiBitrateFormat is the BasicFormat implementation for ImageFormat.
  5275  func (ifVar ImageFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  5276  	return nil, false
  5277  }
  5278  
  5279  // AsBasicMultiBitrateFormat is the BasicFormat implementation for ImageFormat.
  5280  func (ifVar ImageFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  5281  	return nil, false
  5282  }
  5283  
  5284  // AsMp4Format is the BasicFormat implementation for ImageFormat.
  5285  func (ifVar ImageFormat) AsMp4Format() (*Mp4Format, bool) {
  5286  	return nil, false
  5287  }
  5288  
  5289  // AsTransportStreamFormat is the BasicFormat implementation for ImageFormat.
  5290  func (ifVar ImageFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  5291  	return nil, false
  5292  }
  5293  
  5294  // AsFormat is the BasicFormat implementation for ImageFormat.
  5295  func (ifVar ImageFormat) AsFormat() (*Format, bool) {
  5296  	return nil, false
  5297  }
  5298  
  5299  // AsBasicFormat is the BasicFormat implementation for ImageFormat.
  5300  func (ifVar ImageFormat) AsBasicFormat() (BasicFormat, bool) {
  5301  	return &ifVar, true
  5302  }
  5303  
  5304  // BasicInputDefinition base class for defining an input. Use sub classes of this class to specify tracks selections
  5305  // and related metadata.
  5306  type BasicInputDefinition interface {
  5307  	AsFromAllInputFile() (*FromAllInputFile, bool)
  5308  	AsFromEachInputFile() (*FromEachInputFile, bool)
  5309  	AsInputFile() (*InputFile, bool)
  5310  	AsInputDefinition() (*InputDefinition, bool)
  5311  }
  5312  
  5313  // InputDefinition base class for defining an input. Use sub classes of this class to specify tracks selections
  5314  // and related metadata.
  5315  type InputDefinition struct {
  5316  	// IncludedTracks - The list of TrackDescriptors which define the metadata and selection of tracks in the input.
  5317  	IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
  5318  	// OdataType - Possible values include: 'OdataTypeBasicInputDefinitionOdataTypeInputDefinition', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile'
  5319  	OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
  5320  }
  5321  
  5322  func unmarshalBasicInputDefinition(body []byte) (BasicInputDefinition, error) {
  5323  	var m map[string]interface{}
  5324  	err := json.Unmarshal(body, &m)
  5325  	if err != nil {
  5326  		return nil, err
  5327  	}
  5328  
  5329  	switch m["@odata.type"] {
  5330  	case string(OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile):
  5331  		var faif FromAllInputFile
  5332  		err := json.Unmarshal(body, &faif)
  5333  		return faif, err
  5334  	case string(OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile):
  5335  		var feif FromEachInputFile
  5336  		err := json.Unmarshal(body, &feif)
  5337  		return feif, err
  5338  	case string(OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile):
  5339  		var ifVar InputFile
  5340  		err := json.Unmarshal(body, &ifVar)
  5341  		return ifVar, err
  5342  	default:
  5343  		var ID InputDefinition
  5344  		err := json.Unmarshal(body, &ID)
  5345  		return ID, err
  5346  	}
  5347  }
  5348  func unmarshalBasicInputDefinitionArray(body []byte) ([]BasicInputDefinition, error) {
  5349  	var rawMessages []*json.RawMessage
  5350  	err := json.Unmarshal(body, &rawMessages)
  5351  	if err != nil {
  5352  		return nil, err
  5353  	}
  5354  
  5355  	IDArray := make([]BasicInputDefinition, len(rawMessages))
  5356  
  5357  	for index, rawMessage := range rawMessages {
  5358  		ID, err := unmarshalBasicInputDefinition(*rawMessage)
  5359  		if err != nil {
  5360  			return nil, err
  5361  		}
  5362  		IDArray[index] = ID
  5363  	}
  5364  	return IDArray, nil
  5365  }
  5366  
  5367  // MarshalJSON is the custom marshaler for InputDefinition.
  5368  func (ID InputDefinition) MarshalJSON() ([]byte, error) {
  5369  	ID.OdataType = OdataTypeBasicInputDefinitionOdataTypeInputDefinition
  5370  	objectMap := make(map[string]interface{})
  5371  	if ID.IncludedTracks != nil {
  5372  		objectMap["includedTracks"] = ID.IncludedTracks
  5373  	}
  5374  	if ID.OdataType != "" {
  5375  		objectMap["@odata.type"] = ID.OdataType
  5376  	}
  5377  	return json.Marshal(objectMap)
  5378  }
  5379  
  5380  // AsFromAllInputFile is the BasicInputDefinition implementation for InputDefinition.
  5381  func (ID InputDefinition) AsFromAllInputFile() (*FromAllInputFile, bool) {
  5382  	return nil, false
  5383  }
  5384  
  5385  // AsFromEachInputFile is the BasicInputDefinition implementation for InputDefinition.
  5386  func (ID InputDefinition) AsFromEachInputFile() (*FromEachInputFile, bool) {
  5387  	return nil, false
  5388  }
  5389  
  5390  // AsInputFile is the BasicInputDefinition implementation for InputDefinition.
  5391  func (ID InputDefinition) AsInputFile() (*InputFile, bool) {
  5392  	return nil, false
  5393  }
  5394  
  5395  // AsInputDefinition is the BasicInputDefinition implementation for InputDefinition.
  5396  func (ID InputDefinition) AsInputDefinition() (*InputDefinition, bool) {
  5397  	return &ID, true
  5398  }
  5399  
  5400  // AsBasicInputDefinition is the BasicInputDefinition implementation for InputDefinition.
  5401  func (ID InputDefinition) AsBasicInputDefinition() (BasicInputDefinition, bool) {
  5402  	return &ID, true
  5403  }
  5404  
  5405  // UnmarshalJSON is the custom unmarshaler for InputDefinition struct.
  5406  func (ID *InputDefinition) UnmarshalJSON(body []byte) error {
  5407  	var m map[string]*json.RawMessage
  5408  	err := json.Unmarshal(body, &m)
  5409  	if err != nil {
  5410  		return err
  5411  	}
  5412  	for k, v := range m {
  5413  		switch k {
  5414  		case "includedTracks":
  5415  			if v != nil {
  5416  				includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
  5417  				if err != nil {
  5418  					return err
  5419  				}
  5420  				ID.IncludedTracks = &includedTracks
  5421  			}
  5422  		case "@odata.type":
  5423  			if v != nil {
  5424  				var odataType OdataTypeBasicInputDefinition
  5425  				err = json.Unmarshal(*v, &odataType)
  5426  				if err != nil {
  5427  					return err
  5428  				}
  5429  				ID.OdataType = odataType
  5430  			}
  5431  		}
  5432  	}
  5433  
  5434  	return nil
  5435  }
  5436  
  5437  // InputFile an InputDefinition for a single file.  TrackSelections are scoped to the file specified.
  5438  type InputFile struct {
  5439  	// Filename - Name of the file that this input definition applies to.
  5440  	Filename *string `json:"filename,omitempty"`
  5441  	// IncludedTracks - The list of TrackDescriptors which define the metadata and selection of tracks in the input.
  5442  	IncludedTracks *[]BasicTrackDescriptor `json:"includedTracks,omitempty"`
  5443  	// OdataType - Possible values include: 'OdataTypeBasicInputDefinitionOdataTypeInputDefinition', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromAllInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaFromEachInputFile', 'OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile'
  5444  	OdataType OdataTypeBasicInputDefinition `json:"@odata.type,omitempty"`
  5445  }
  5446  
  5447  // MarshalJSON is the custom marshaler for InputFile.
  5448  func (ifVar InputFile) MarshalJSON() ([]byte, error) {
  5449  	ifVar.OdataType = OdataTypeBasicInputDefinitionOdataTypeMicrosoftMediaInputFile
  5450  	objectMap := make(map[string]interface{})
  5451  	if ifVar.Filename != nil {
  5452  		objectMap["filename"] = ifVar.Filename
  5453  	}
  5454  	if ifVar.IncludedTracks != nil {
  5455  		objectMap["includedTracks"] = ifVar.IncludedTracks
  5456  	}
  5457  	if ifVar.OdataType != "" {
  5458  		objectMap["@odata.type"] = ifVar.OdataType
  5459  	}
  5460  	return json.Marshal(objectMap)
  5461  }
  5462  
  5463  // AsFromAllInputFile is the BasicInputDefinition implementation for InputFile.
  5464  func (ifVar InputFile) AsFromAllInputFile() (*FromAllInputFile, bool) {
  5465  	return nil, false
  5466  }
  5467  
  5468  // AsFromEachInputFile is the BasicInputDefinition implementation for InputFile.
  5469  func (ifVar InputFile) AsFromEachInputFile() (*FromEachInputFile, bool) {
  5470  	return nil, false
  5471  }
  5472  
  5473  // AsInputFile is the BasicInputDefinition implementation for InputFile.
  5474  func (ifVar InputFile) AsInputFile() (*InputFile, bool) {
  5475  	return &ifVar, true
  5476  }
  5477  
  5478  // AsInputDefinition is the BasicInputDefinition implementation for InputFile.
  5479  func (ifVar InputFile) AsInputDefinition() (*InputDefinition, bool) {
  5480  	return nil, false
  5481  }
  5482  
  5483  // AsBasicInputDefinition is the BasicInputDefinition implementation for InputFile.
  5484  func (ifVar InputFile) AsBasicInputDefinition() (BasicInputDefinition, bool) {
  5485  	return &ifVar, true
  5486  }
  5487  
  5488  // UnmarshalJSON is the custom unmarshaler for InputFile struct.
  5489  func (ifVar *InputFile) UnmarshalJSON(body []byte) error {
  5490  	var m map[string]*json.RawMessage
  5491  	err := json.Unmarshal(body, &m)
  5492  	if err != nil {
  5493  		return err
  5494  	}
  5495  	for k, v := range m {
  5496  		switch k {
  5497  		case "filename":
  5498  			if v != nil {
  5499  				var filename string
  5500  				err = json.Unmarshal(*v, &filename)
  5501  				if err != nil {
  5502  					return err
  5503  				}
  5504  				ifVar.Filename = &filename
  5505  			}
  5506  		case "includedTracks":
  5507  			if v != nil {
  5508  				includedTracks, err := unmarshalBasicTrackDescriptorArray(*v)
  5509  				if err != nil {
  5510  					return err
  5511  				}
  5512  				ifVar.IncludedTracks = &includedTracks
  5513  			}
  5514  		case "@odata.type":
  5515  			if v != nil {
  5516  				var odataType OdataTypeBasicInputDefinition
  5517  				err = json.Unmarshal(*v, &odataType)
  5518  				if err != nil {
  5519  					return err
  5520  				}
  5521  				ifVar.OdataType = odataType
  5522  			}
  5523  		}
  5524  	}
  5525  
  5526  	return nil
  5527  }
  5528  
  5529  // IPAccessControl the IP access control.
  5530  type IPAccessControl struct {
  5531  	// Allow - The IP allow list.
  5532  	Allow *[]IPRange `json:"allow,omitempty"`
  5533  }
  5534  
  5535  // IPRange the IP address range in the CIDR scheme.
  5536  type IPRange struct {
  5537  	// Name - The friendly name for the IP address range.
  5538  	Name *string `json:"name,omitempty"`
  5539  	// Address - The IP address.
  5540  	Address *string `json:"address,omitempty"`
  5541  	// SubnetPrefixLength - The subnet mask prefix length (see CIDR notation).
  5542  	SubnetPrefixLength *int32 `json:"subnetPrefixLength,omitempty"`
  5543  }
  5544  
  5545  // Job a Job resource type. The progress and state can be obtained by polling a Job or subscribing to
  5546  // events using EventGrid.
  5547  type Job struct {
  5548  	autorest.Response `json:"-"`
  5549  	// JobProperties - The resource properties.
  5550  	*JobProperties `json:"properties,omitempty"`
  5551  	// SystemData - READ-ONLY; The system metadata relating to this resource.
  5552  	SystemData *SystemData `json:"systemData,omitempty"`
  5553  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  5554  	ID *string `json:"id,omitempty"`
  5555  	// Name - READ-ONLY; The name of the resource
  5556  	Name *string `json:"name,omitempty"`
  5557  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  5558  	Type *string `json:"type,omitempty"`
  5559  }
  5560  
  5561  // MarshalJSON is the custom marshaler for Job.
  5562  func (j Job) MarshalJSON() ([]byte, error) {
  5563  	objectMap := make(map[string]interface{})
  5564  	if j.JobProperties != nil {
  5565  		objectMap["properties"] = j.JobProperties
  5566  	}
  5567  	return json.Marshal(objectMap)
  5568  }
  5569  
  5570  // UnmarshalJSON is the custom unmarshaler for Job struct.
  5571  func (j *Job) UnmarshalJSON(body []byte) error {
  5572  	var m map[string]*json.RawMessage
  5573  	err := json.Unmarshal(body, &m)
  5574  	if err != nil {
  5575  		return err
  5576  	}
  5577  	for k, v := range m {
  5578  		switch k {
  5579  		case "properties":
  5580  			if v != nil {
  5581  				var jobProperties JobProperties
  5582  				err = json.Unmarshal(*v, &jobProperties)
  5583  				if err != nil {
  5584  					return err
  5585  				}
  5586  				j.JobProperties = &jobProperties
  5587  			}
  5588  		case "systemData":
  5589  			if v != nil {
  5590  				var systemData SystemData
  5591  				err = json.Unmarshal(*v, &systemData)
  5592  				if err != nil {
  5593  					return err
  5594  				}
  5595  				j.SystemData = &systemData
  5596  			}
  5597  		case "id":
  5598  			if v != nil {
  5599  				var ID string
  5600  				err = json.Unmarshal(*v, &ID)
  5601  				if err != nil {
  5602  					return err
  5603  				}
  5604  				j.ID = &ID
  5605  			}
  5606  		case "name":
  5607  			if v != nil {
  5608  				var name string
  5609  				err = json.Unmarshal(*v, &name)
  5610  				if err != nil {
  5611  					return err
  5612  				}
  5613  				j.Name = &name
  5614  			}
  5615  		case "type":
  5616  			if v != nil {
  5617  				var typeVar string
  5618  				err = json.Unmarshal(*v, &typeVar)
  5619  				if err != nil {
  5620  					return err
  5621  				}
  5622  				j.Type = &typeVar
  5623  			}
  5624  		}
  5625  	}
  5626  
  5627  	return nil
  5628  }
  5629  
  5630  // JobCollection a collection of Job items.
  5631  type JobCollection struct {
  5632  	autorest.Response `json:"-"`
  5633  	// Value - A collection of Job items.
  5634  	Value *[]Job `json:"value,omitempty"`
  5635  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
  5636  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
  5637  }
  5638  
  5639  // JobCollectionIterator provides access to a complete listing of Job values.
  5640  type JobCollectionIterator struct {
  5641  	i    int
  5642  	page JobCollectionPage
  5643  }
  5644  
  5645  // NextWithContext advances to the next value.  If there was an error making
  5646  // the request the iterator does not advance and the error is returned.
  5647  func (iter *JobCollectionIterator) NextWithContext(ctx context.Context) (err error) {
  5648  	if tracing.IsEnabled() {
  5649  		ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionIterator.NextWithContext")
  5650  		defer func() {
  5651  			sc := -1
  5652  			if iter.Response().Response.Response != nil {
  5653  				sc = iter.Response().Response.Response.StatusCode
  5654  			}
  5655  			tracing.EndSpan(ctx, sc, err)
  5656  		}()
  5657  	}
  5658  	iter.i++
  5659  	if iter.i < len(iter.page.Values()) {
  5660  		return nil
  5661  	}
  5662  	err = iter.page.NextWithContext(ctx)
  5663  	if err != nil {
  5664  		iter.i--
  5665  		return err
  5666  	}
  5667  	iter.i = 0
  5668  	return nil
  5669  }
  5670  
  5671  // Next advances to the next value.  If there was an error making
  5672  // the request the iterator does not advance and the error is returned.
  5673  // Deprecated: Use NextWithContext() instead.
  5674  func (iter *JobCollectionIterator) Next() error {
  5675  	return iter.NextWithContext(context.Background())
  5676  }
  5677  
  5678  // NotDone returns true if the enumeration should be started or is not yet complete.
  5679  func (iter JobCollectionIterator) NotDone() bool {
  5680  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  5681  }
  5682  
  5683  // Response returns the raw server response from the last page request.
  5684  func (iter JobCollectionIterator) Response() JobCollection {
  5685  	return iter.page.Response()
  5686  }
  5687  
  5688  // Value returns the current value or a zero-initialized value if the
  5689  // iterator has advanced beyond the end of the collection.
  5690  func (iter JobCollectionIterator) Value() Job {
  5691  	if !iter.page.NotDone() {
  5692  		return Job{}
  5693  	}
  5694  	return iter.page.Values()[iter.i]
  5695  }
  5696  
  5697  // Creates a new instance of the JobCollectionIterator type.
  5698  func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator {
  5699  	return JobCollectionIterator{page: page}
  5700  }
  5701  
  5702  // IsEmpty returns true if the ListResult contains no values.
  5703  func (jc JobCollection) IsEmpty() bool {
  5704  	return jc.Value == nil || len(*jc.Value) == 0
  5705  }
  5706  
  5707  // hasNextLink returns true if the NextLink is not empty.
  5708  func (jc JobCollection) hasNextLink() bool {
  5709  	return jc.OdataNextLink != nil && len(*jc.OdataNextLink) != 0
  5710  }
  5711  
  5712  // jobCollectionPreparer prepares a request to retrieve the next set of results.
  5713  // It returns nil if no more results exist.
  5714  func (jc JobCollection) jobCollectionPreparer(ctx context.Context) (*http.Request, error) {
  5715  	if !jc.hasNextLink() {
  5716  		return nil, nil
  5717  	}
  5718  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  5719  		autorest.AsJSON(),
  5720  		autorest.AsGet(),
  5721  		autorest.WithBaseURL(to.String(jc.OdataNextLink)))
  5722  }
  5723  
  5724  // JobCollectionPage contains a page of Job values.
  5725  type JobCollectionPage struct {
  5726  	fn func(context.Context, JobCollection) (JobCollection, error)
  5727  	jc JobCollection
  5728  }
  5729  
  5730  // NextWithContext advances to the next page of values.  If there was an error making
  5731  // the request the page does not advance and the error is returned.
  5732  func (page *JobCollectionPage) NextWithContext(ctx context.Context) (err error) {
  5733  	if tracing.IsEnabled() {
  5734  		ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionPage.NextWithContext")
  5735  		defer func() {
  5736  			sc := -1
  5737  			if page.Response().Response.Response != nil {
  5738  				sc = page.Response().Response.Response.StatusCode
  5739  			}
  5740  			tracing.EndSpan(ctx, sc, err)
  5741  		}()
  5742  	}
  5743  	for {
  5744  		next, err := page.fn(ctx, page.jc)
  5745  		if err != nil {
  5746  			return err
  5747  		}
  5748  		page.jc = next
  5749  		if !next.hasNextLink() || !next.IsEmpty() {
  5750  			break
  5751  		}
  5752  	}
  5753  	return nil
  5754  }
  5755  
  5756  // Next advances to the next page of values.  If there was an error making
  5757  // the request the page does not advance and the error is returned.
  5758  // Deprecated: Use NextWithContext() instead.
  5759  func (page *JobCollectionPage) Next() error {
  5760  	return page.NextWithContext(context.Background())
  5761  }
  5762  
  5763  // NotDone returns true if the page enumeration should be started or is not yet complete.
  5764  func (page JobCollectionPage) NotDone() bool {
  5765  	return !page.jc.IsEmpty()
  5766  }
  5767  
  5768  // Response returns the raw server response from the last page request.
  5769  func (page JobCollectionPage) Response() JobCollection {
  5770  	return page.jc
  5771  }
  5772  
  5773  // Values returns the slice of values for the current page or nil if there are no values.
  5774  func (page JobCollectionPage) Values() []Job {
  5775  	if page.jc.IsEmpty() {
  5776  		return nil
  5777  	}
  5778  	return *page.jc.Value
  5779  }
  5780  
  5781  // Creates a new instance of the JobCollectionPage type.
  5782  func NewJobCollectionPage(cur JobCollection, getNextPage func(context.Context, JobCollection) (JobCollection, error)) JobCollectionPage {
  5783  	return JobCollectionPage{
  5784  		fn: getNextPage,
  5785  		jc: cur,
  5786  	}
  5787  }
  5788  
  5789  // JobError details of JobOutput errors.
  5790  type JobError struct {
  5791  	// Code - READ-ONLY; Error code describing the error. Possible values include: 'JobErrorCodeServiceError', 'JobErrorCodeServiceTransientError', 'JobErrorCodeDownloadNotAccessible', 'JobErrorCodeDownloadTransientError', 'JobErrorCodeUploadNotAccessible', 'JobErrorCodeUploadTransientError', 'JobErrorCodeConfigurationUnsupported', 'JobErrorCodeContentMalformed', 'JobErrorCodeContentUnsupported'
  5792  	Code JobErrorCode `json:"code,omitempty"`
  5793  	// Message - READ-ONLY; A human-readable language-dependent representation of the error.
  5794  	Message *string `json:"message,omitempty"`
  5795  	// Category - READ-ONLY; Helps with categorization of errors. Possible values include: 'JobErrorCategoryService', 'JobErrorCategoryDownload', 'JobErrorCategoryUpload', 'JobErrorCategoryConfiguration', 'JobErrorCategoryContent'
  5796  	Category JobErrorCategory `json:"category,omitempty"`
  5797  	// 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'
  5798  	Retry JobRetry `json:"retry,omitempty"`
  5799  	// Details - READ-ONLY; An array of details about specific errors that led to this reported error.
  5800  	Details *[]JobErrorDetail `json:"details,omitempty"`
  5801  }
  5802  
  5803  // MarshalJSON is the custom marshaler for JobError.
  5804  func (je JobError) MarshalJSON() ([]byte, error) {
  5805  	objectMap := make(map[string]interface{})
  5806  	return json.Marshal(objectMap)
  5807  }
  5808  
  5809  // JobErrorDetail details of JobOutput errors.
  5810  type JobErrorDetail struct {
  5811  	// Code - READ-ONLY; Code describing the error detail.
  5812  	Code *string `json:"code,omitempty"`
  5813  	// Message - READ-ONLY; A human-readable representation of the error.
  5814  	Message *string `json:"message,omitempty"`
  5815  }
  5816  
  5817  // MarshalJSON is the custom marshaler for JobErrorDetail.
  5818  func (jed JobErrorDetail) MarshalJSON() ([]byte, error) {
  5819  	objectMap := make(map[string]interface{})
  5820  	return json.Marshal(objectMap)
  5821  }
  5822  
  5823  // BasicJobInput base class for inputs to a Job.
  5824  type BasicJobInput interface {
  5825  	AsJobInputClip() (*JobInputClip, bool)
  5826  	AsBasicJobInputClip() (BasicJobInputClip, bool)
  5827  	AsJobInputs() (*JobInputs, bool)
  5828  	AsJobInputAsset() (*JobInputAsset, bool)
  5829  	AsJobInputHTTP() (*JobInputHTTP, bool)
  5830  	AsJobInputSequence() (*JobInputSequence, bool)
  5831  	AsJobInput() (*JobInput, bool)
  5832  }
  5833  
  5834  // JobInput base class for inputs to a Job.
  5835  type JobInput struct {
  5836  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  5837  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  5838  }
  5839  
  5840  func unmarshalBasicJobInput(body []byte) (BasicJobInput, error) {
  5841  	var m map[string]interface{}
  5842  	err := json.Unmarshal(body, &m)
  5843  	if err != nil {
  5844  		return nil, err
  5845  	}
  5846  
  5847  	switch m["@odata.type"] {
  5848  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip):
  5849  		var jic JobInputClip
  5850  		err := json.Unmarshal(body, &jic)
  5851  		return jic, err
  5852  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs):
  5853  		var ji JobInputs
  5854  		err := json.Unmarshal(body, &ji)
  5855  		return ji, err
  5856  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset):
  5857  		var jia JobInputAsset
  5858  		err := json.Unmarshal(body, &jia)
  5859  		return jia, err
  5860  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP):
  5861  		var jih JobInputHTTP
  5862  		err := json.Unmarshal(body, &jih)
  5863  		return jih, err
  5864  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence):
  5865  		var jis JobInputSequence
  5866  		err := json.Unmarshal(body, &jis)
  5867  		return jis, err
  5868  	default:
  5869  		var ji JobInput
  5870  		err := json.Unmarshal(body, &ji)
  5871  		return ji, err
  5872  	}
  5873  }
  5874  func unmarshalBasicJobInputArray(body []byte) ([]BasicJobInput, error) {
  5875  	var rawMessages []*json.RawMessage
  5876  	err := json.Unmarshal(body, &rawMessages)
  5877  	if err != nil {
  5878  		return nil, err
  5879  	}
  5880  
  5881  	jiArray := make([]BasicJobInput, len(rawMessages))
  5882  
  5883  	for index, rawMessage := range rawMessages {
  5884  		ji, err := unmarshalBasicJobInput(*rawMessage)
  5885  		if err != nil {
  5886  			return nil, err
  5887  		}
  5888  		jiArray[index] = ji
  5889  	}
  5890  	return jiArray, nil
  5891  }
  5892  
  5893  // MarshalJSON is the custom marshaler for JobInput.
  5894  func (ji JobInput) MarshalJSON() ([]byte, error) {
  5895  	ji.OdataType = OdataTypeBasicJobInputOdataTypeJobInput
  5896  	objectMap := make(map[string]interface{})
  5897  	if ji.OdataType != "" {
  5898  		objectMap["@odata.type"] = ji.OdataType
  5899  	}
  5900  	return json.Marshal(objectMap)
  5901  }
  5902  
  5903  // AsJobInputClip is the BasicJobInput implementation for JobInput.
  5904  func (ji JobInput) AsJobInputClip() (*JobInputClip, bool) {
  5905  	return nil, false
  5906  }
  5907  
  5908  // AsBasicJobInputClip is the BasicJobInput implementation for JobInput.
  5909  func (ji JobInput) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  5910  	return nil, false
  5911  }
  5912  
  5913  // AsJobInputs is the BasicJobInput implementation for JobInput.
  5914  func (ji JobInput) AsJobInputs() (*JobInputs, bool) {
  5915  	return nil, false
  5916  }
  5917  
  5918  // AsJobInputAsset is the BasicJobInput implementation for JobInput.
  5919  func (ji JobInput) AsJobInputAsset() (*JobInputAsset, bool) {
  5920  	return nil, false
  5921  }
  5922  
  5923  // AsJobInputHTTP is the BasicJobInput implementation for JobInput.
  5924  func (ji JobInput) AsJobInputHTTP() (*JobInputHTTP, bool) {
  5925  	return nil, false
  5926  }
  5927  
  5928  // AsJobInputSequence is the BasicJobInput implementation for JobInput.
  5929  func (ji JobInput) AsJobInputSequence() (*JobInputSequence, bool) {
  5930  	return nil, false
  5931  }
  5932  
  5933  // AsJobInput is the BasicJobInput implementation for JobInput.
  5934  func (ji JobInput) AsJobInput() (*JobInput, bool) {
  5935  	return &ji, true
  5936  }
  5937  
  5938  // AsBasicJobInput is the BasicJobInput implementation for JobInput.
  5939  func (ji JobInput) AsBasicJobInput() (BasicJobInput, bool) {
  5940  	return &ji, true
  5941  }
  5942  
  5943  // JobInputAsset represents an Asset for input into a Job.
  5944  type JobInputAsset struct {
  5945  	// AssetName - The name of the input Asset.
  5946  	AssetName *string `json:"assetName,omitempty"`
  5947  	// Files - List of files. Required for JobInputHttp. Maximum of 4000 characters each.
  5948  	Files *[]string `json:"files,omitempty"`
  5949  	// Start - Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.
  5950  	Start BasicClipTime `json:"start,omitempty"`
  5951  	// End - Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.
  5952  	End BasicClipTime `json:"end,omitempty"`
  5953  	// 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'.
  5954  	Label *string `json:"label,omitempty"`
  5955  	// InputDefinitions - Defines a list of InputDefinitions. For each InputDefinition, it defines a list of track selections and related metadata.
  5956  	InputDefinitions *[]BasicInputDefinition `json:"inputDefinitions,omitempty"`
  5957  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  5958  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  5959  }
  5960  
  5961  // MarshalJSON is the custom marshaler for JobInputAsset.
  5962  func (jia JobInputAsset) MarshalJSON() ([]byte, error) {
  5963  	jia.OdataType = OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset
  5964  	objectMap := make(map[string]interface{})
  5965  	if jia.AssetName != nil {
  5966  		objectMap["assetName"] = jia.AssetName
  5967  	}
  5968  	if jia.Files != nil {
  5969  		objectMap["files"] = jia.Files
  5970  	}
  5971  	objectMap["start"] = jia.Start
  5972  	objectMap["end"] = jia.End
  5973  	if jia.Label != nil {
  5974  		objectMap["label"] = jia.Label
  5975  	}
  5976  	if jia.InputDefinitions != nil {
  5977  		objectMap["inputDefinitions"] = jia.InputDefinitions
  5978  	}
  5979  	if jia.OdataType != "" {
  5980  		objectMap["@odata.type"] = jia.OdataType
  5981  	}
  5982  	return json.Marshal(objectMap)
  5983  }
  5984  
  5985  // AsJobInputClip is the BasicJobInput implementation for JobInputAsset.
  5986  func (jia JobInputAsset) AsJobInputClip() (*JobInputClip, bool) {
  5987  	return nil, false
  5988  }
  5989  
  5990  // AsBasicJobInputClip is the BasicJobInput implementation for JobInputAsset.
  5991  func (jia JobInputAsset) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  5992  	return &jia, true
  5993  }
  5994  
  5995  // AsJobInputs is the BasicJobInput implementation for JobInputAsset.
  5996  func (jia JobInputAsset) AsJobInputs() (*JobInputs, bool) {
  5997  	return nil, false
  5998  }
  5999  
  6000  // AsJobInputAsset is the BasicJobInput implementation for JobInputAsset.
  6001  func (jia JobInputAsset) AsJobInputAsset() (*JobInputAsset, bool) {
  6002  	return &jia, true
  6003  }
  6004  
  6005  // AsJobInputHTTP is the BasicJobInput implementation for JobInputAsset.
  6006  func (jia JobInputAsset) AsJobInputHTTP() (*JobInputHTTP, bool) {
  6007  	return nil, false
  6008  }
  6009  
  6010  // AsJobInputSequence is the BasicJobInput implementation for JobInputAsset.
  6011  func (jia JobInputAsset) AsJobInputSequence() (*JobInputSequence, bool) {
  6012  	return nil, false
  6013  }
  6014  
  6015  // AsJobInput is the BasicJobInput implementation for JobInputAsset.
  6016  func (jia JobInputAsset) AsJobInput() (*JobInput, bool) {
  6017  	return nil, false
  6018  }
  6019  
  6020  // AsBasicJobInput is the BasicJobInput implementation for JobInputAsset.
  6021  func (jia JobInputAsset) AsBasicJobInput() (BasicJobInput, bool) {
  6022  	return &jia, true
  6023  }
  6024  
  6025  // UnmarshalJSON is the custom unmarshaler for JobInputAsset struct.
  6026  func (jia *JobInputAsset) UnmarshalJSON(body []byte) error {
  6027  	var m map[string]*json.RawMessage
  6028  	err := json.Unmarshal(body, &m)
  6029  	if err != nil {
  6030  		return err
  6031  	}
  6032  	for k, v := range m {
  6033  		switch k {
  6034  		case "assetName":
  6035  			if v != nil {
  6036  				var assetName string
  6037  				err = json.Unmarshal(*v, &assetName)
  6038  				if err != nil {
  6039  					return err
  6040  				}
  6041  				jia.AssetName = &assetName
  6042  			}
  6043  		case "files":
  6044  			if v != nil {
  6045  				var files []string
  6046  				err = json.Unmarshal(*v, &files)
  6047  				if err != nil {
  6048  					return err
  6049  				}
  6050  				jia.Files = &files
  6051  			}
  6052  		case "start":
  6053  			if v != nil {
  6054  				start, err := unmarshalBasicClipTime(*v)
  6055  				if err != nil {
  6056  					return err
  6057  				}
  6058  				jia.Start = start
  6059  			}
  6060  		case "end":
  6061  			if v != nil {
  6062  				end, err := unmarshalBasicClipTime(*v)
  6063  				if err != nil {
  6064  					return err
  6065  				}
  6066  				jia.End = end
  6067  			}
  6068  		case "label":
  6069  			if v != nil {
  6070  				var label string
  6071  				err = json.Unmarshal(*v, &label)
  6072  				if err != nil {
  6073  					return err
  6074  				}
  6075  				jia.Label = &label
  6076  			}
  6077  		case "inputDefinitions":
  6078  			if v != nil {
  6079  				inputDefinitions, err := unmarshalBasicInputDefinitionArray(*v)
  6080  				if err != nil {
  6081  					return err
  6082  				}
  6083  				jia.InputDefinitions = &inputDefinitions
  6084  			}
  6085  		case "@odata.type":
  6086  			if v != nil {
  6087  				var odataType OdataTypeBasicJobInput
  6088  				err = json.Unmarshal(*v, &odataType)
  6089  				if err != nil {
  6090  					return err
  6091  				}
  6092  				jia.OdataType = odataType
  6093  			}
  6094  		}
  6095  	}
  6096  
  6097  	return nil
  6098  }
  6099  
  6100  // BasicJobInputClip represents input files for a Job.
  6101  type BasicJobInputClip interface {
  6102  	AsJobInputAsset() (*JobInputAsset, bool)
  6103  	AsJobInputHTTP() (*JobInputHTTP, bool)
  6104  	AsJobInputClip() (*JobInputClip, bool)
  6105  }
  6106  
  6107  // JobInputClip represents input files for a Job.
  6108  type JobInputClip struct {
  6109  	// Files - List of files. Required for JobInputHttp. Maximum of 4000 characters each.
  6110  	Files *[]string `json:"files,omitempty"`
  6111  	// Start - Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.
  6112  	Start BasicClipTime `json:"start,omitempty"`
  6113  	// End - Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.
  6114  	End BasicClipTime `json:"end,omitempty"`
  6115  	// 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'.
  6116  	Label *string `json:"label,omitempty"`
  6117  	// InputDefinitions - Defines a list of InputDefinitions. For each InputDefinition, it defines a list of track selections and related metadata.
  6118  	InputDefinitions *[]BasicInputDefinition `json:"inputDefinitions,omitempty"`
  6119  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  6120  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  6121  }
  6122  
  6123  func unmarshalBasicJobInputClip(body []byte) (BasicJobInputClip, error) {
  6124  	var m map[string]interface{}
  6125  	err := json.Unmarshal(body, &m)
  6126  	if err != nil {
  6127  		return nil, err
  6128  	}
  6129  
  6130  	switch m["@odata.type"] {
  6131  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset):
  6132  		var jia JobInputAsset
  6133  		err := json.Unmarshal(body, &jia)
  6134  		return jia, err
  6135  	case string(OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP):
  6136  		var jih JobInputHTTP
  6137  		err := json.Unmarshal(body, &jih)
  6138  		return jih, err
  6139  	default:
  6140  		var jic JobInputClip
  6141  		err := json.Unmarshal(body, &jic)
  6142  		return jic, err
  6143  	}
  6144  }
  6145  func unmarshalBasicJobInputClipArray(body []byte) ([]BasicJobInputClip, error) {
  6146  	var rawMessages []*json.RawMessage
  6147  	err := json.Unmarshal(body, &rawMessages)
  6148  	if err != nil {
  6149  		return nil, err
  6150  	}
  6151  
  6152  	jicArray := make([]BasicJobInputClip, len(rawMessages))
  6153  
  6154  	for index, rawMessage := range rawMessages {
  6155  		jic, err := unmarshalBasicJobInputClip(*rawMessage)
  6156  		if err != nil {
  6157  			return nil, err
  6158  		}
  6159  		jicArray[index] = jic
  6160  	}
  6161  	return jicArray, nil
  6162  }
  6163  
  6164  // MarshalJSON is the custom marshaler for JobInputClip.
  6165  func (jic JobInputClip) MarshalJSON() ([]byte, error) {
  6166  	jic.OdataType = OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip
  6167  	objectMap := make(map[string]interface{})
  6168  	if jic.Files != nil {
  6169  		objectMap["files"] = jic.Files
  6170  	}
  6171  	objectMap["start"] = jic.Start
  6172  	objectMap["end"] = jic.End
  6173  	if jic.Label != nil {
  6174  		objectMap["label"] = jic.Label
  6175  	}
  6176  	if jic.InputDefinitions != nil {
  6177  		objectMap["inputDefinitions"] = jic.InputDefinitions
  6178  	}
  6179  	if jic.OdataType != "" {
  6180  		objectMap["@odata.type"] = jic.OdataType
  6181  	}
  6182  	return json.Marshal(objectMap)
  6183  }
  6184  
  6185  // AsJobInputClip is the BasicJobInput implementation for JobInputClip.
  6186  func (jic JobInputClip) AsJobInputClip() (*JobInputClip, bool) {
  6187  	return &jic, true
  6188  }
  6189  
  6190  // AsBasicJobInputClip is the BasicJobInput implementation for JobInputClip.
  6191  func (jic JobInputClip) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  6192  	return &jic, true
  6193  }
  6194  
  6195  // AsJobInputs is the BasicJobInput implementation for JobInputClip.
  6196  func (jic JobInputClip) AsJobInputs() (*JobInputs, bool) {
  6197  	return nil, false
  6198  }
  6199  
  6200  // AsJobInputAsset is the BasicJobInput implementation for JobInputClip.
  6201  func (jic JobInputClip) AsJobInputAsset() (*JobInputAsset, bool) {
  6202  	return nil, false
  6203  }
  6204  
  6205  // AsJobInputHTTP is the BasicJobInput implementation for JobInputClip.
  6206  func (jic JobInputClip) AsJobInputHTTP() (*JobInputHTTP, bool) {
  6207  	return nil, false
  6208  }
  6209  
  6210  // AsJobInputSequence is the BasicJobInput implementation for JobInputClip.
  6211  func (jic JobInputClip) AsJobInputSequence() (*JobInputSequence, bool) {
  6212  	return nil, false
  6213  }
  6214  
  6215  // AsJobInput is the BasicJobInput implementation for JobInputClip.
  6216  func (jic JobInputClip) AsJobInput() (*JobInput, bool) {
  6217  	return nil, false
  6218  }
  6219  
  6220  // AsBasicJobInput is the BasicJobInput implementation for JobInputClip.
  6221  func (jic JobInputClip) AsBasicJobInput() (BasicJobInput, bool) {
  6222  	return &jic, true
  6223  }
  6224  
  6225  // UnmarshalJSON is the custom unmarshaler for JobInputClip struct.
  6226  func (jic *JobInputClip) UnmarshalJSON(body []byte) error {
  6227  	var m map[string]*json.RawMessage
  6228  	err := json.Unmarshal(body, &m)
  6229  	if err != nil {
  6230  		return err
  6231  	}
  6232  	for k, v := range m {
  6233  		switch k {
  6234  		case "files":
  6235  			if v != nil {
  6236  				var files []string
  6237  				err = json.Unmarshal(*v, &files)
  6238  				if err != nil {
  6239  					return err
  6240  				}
  6241  				jic.Files = &files
  6242  			}
  6243  		case "start":
  6244  			if v != nil {
  6245  				start, err := unmarshalBasicClipTime(*v)
  6246  				if err != nil {
  6247  					return err
  6248  				}
  6249  				jic.Start = start
  6250  			}
  6251  		case "end":
  6252  			if v != nil {
  6253  				end, err := unmarshalBasicClipTime(*v)
  6254  				if err != nil {
  6255  					return err
  6256  				}
  6257  				jic.End = end
  6258  			}
  6259  		case "label":
  6260  			if v != nil {
  6261  				var label string
  6262  				err = json.Unmarshal(*v, &label)
  6263  				if err != nil {
  6264  					return err
  6265  				}
  6266  				jic.Label = &label
  6267  			}
  6268  		case "inputDefinitions":
  6269  			if v != nil {
  6270  				inputDefinitions, err := unmarshalBasicInputDefinitionArray(*v)
  6271  				if err != nil {
  6272  					return err
  6273  				}
  6274  				jic.InputDefinitions = &inputDefinitions
  6275  			}
  6276  		case "@odata.type":
  6277  			if v != nil {
  6278  				var odataType OdataTypeBasicJobInput
  6279  				err = json.Unmarshal(*v, &odataType)
  6280  				if err != nil {
  6281  					return err
  6282  				}
  6283  				jic.OdataType = odataType
  6284  			}
  6285  		}
  6286  	}
  6287  
  6288  	return nil
  6289  }
  6290  
  6291  // JobInputHTTP represents HTTPS job input.
  6292  type JobInputHTTP struct {
  6293  	// 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.
  6294  	BaseURI *string `json:"baseUri,omitempty"`
  6295  	// Files - List of files. Required for JobInputHttp. Maximum of 4000 characters each.
  6296  	Files *[]string `json:"files,omitempty"`
  6297  	// Start - Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.
  6298  	Start BasicClipTime `json:"start,omitempty"`
  6299  	// End - Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.
  6300  	End BasicClipTime `json:"end,omitempty"`
  6301  	// 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'.
  6302  	Label *string `json:"label,omitempty"`
  6303  	// InputDefinitions - Defines a list of InputDefinitions. For each InputDefinition, it defines a list of track selections and related metadata.
  6304  	InputDefinitions *[]BasicInputDefinition `json:"inputDefinitions,omitempty"`
  6305  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  6306  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  6307  }
  6308  
  6309  // MarshalJSON is the custom marshaler for JobInputHTTP.
  6310  func (jih JobInputHTTP) MarshalJSON() ([]byte, error) {
  6311  	jih.OdataType = OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP
  6312  	objectMap := make(map[string]interface{})
  6313  	if jih.BaseURI != nil {
  6314  		objectMap["baseUri"] = jih.BaseURI
  6315  	}
  6316  	if jih.Files != nil {
  6317  		objectMap["files"] = jih.Files
  6318  	}
  6319  	objectMap["start"] = jih.Start
  6320  	objectMap["end"] = jih.End
  6321  	if jih.Label != nil {
  6322  		objectMap["label"] = jih.Label
  6323  	}
  6324  	if jih.InputDefinitions != nil {
  6325  		objectMap["inputDefinitions"] = jih.InputDefinitions
  6326  	}
  6327  	if jih.OdataType != "" {
  6328  		objectMap["@odata.type"] = jih.OdataType
  6329  	}
  6330  	return json.Marshal(objectMap)
  6331  }
  6332  
  6333  // AsJobInputClip is the BasicJobInput implementation for JobInputHTTP.
  6334  func (jih JobInputHTTP) AsJobInputClip() (*JobInputClip, bool) {
  6335  	return nil, false
  6336  }
  6337  
  6338  // AsBasicJobInputClip is the BasicJobInput implementation for JobInputHTTP.
  6339  func (jih JobInputHTTP) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  6340  	return &jih, true
  6341  }
  6342  
  6343  // AsJobInputs is the BasicJobInput implementation for JobInputHTTP.
  6344  func (jih JobInputHTTP) AsJobInputs() (*JobInputs, bool) {
  6345  	return nil, false
  6346  }
  6347  
  6348  // AsJobInputAsset is the BasicJobInput implementation for JobInputHTTP.
  6349  func (jih JobInputHTTP) AsJobInputAsset() (*JobInputAsset, bool) {
  6350  	return nil, false
  6351  }
  6352  
  6353  // AsJobInputHTTP is the BasicJobInput implementation for JobInputHTTP.
  6354  func (jih JobInputHTTP) AsJobInputHTTP() (*JobInputHTTP, bool) {
  6355  	return &jih, true
  6356  }
  6357  
  6358  // AsJobInputSequence is the BasicJobInput implementation for JobInputHTTP.
  6359  func (jih JobInputHTTP) AsJobInputSequence() (*JobInputSequence, bool) {
  6360  	return nil, false
  6361  }
  6362  
  6363  // AsJobInput is the BasicJobInput implementation for JobInputHTTP.
  6364  func (jih JobInputHTTP) AsJobInput() (*JobInput, bool) {
  6365  	return nil, false
  6366  }
  6367  
  6368  // AsBasicJobInput is the BasicJobInput implementation for JobInputHTTP.
  6369  func (jih JobInputHTTP) AsBasicJobInput() (BasicJobInput, bool) {
  6370  	return &jih, true
  6371  }
  6372  
  6373  // UnmarshalJSON is the custom unmarshaler for JobInputHTTP struct.
  6374  func (jih *JobInputHTTP) UnmarshalJSON(body []byte) error {
  6375  	var m map[string]*json.RawMessage
  6376  	err := json.Unmarshal(body, &m)
  6377  	if err != nil {
  6378  		return err
  6379  	}
  6380  	for k, v := range m {
  6381  		switch k {
  6382  		case "baseUri":
  6383  			if v != nil {
  6384  				var baseURI string
  6385  				err = json.Unmarshal(*v, &baseURI)
  6386  				if err != nil {
  6387  					return err
  6388  				}
  6389  				jih.BaseURI = &baseURI
  6390  			}
  6391  		case "files":
  6392  			if v != nil {
  6393  				var files []string
  6394  				err = json.Unmarshal(*v, &files)
  6395  				if err != nil {
  6396  					return err
  6397  				}
  6398  				jih.Files = &files
  6399  			}
  6400  		case "start":
  6401  			if v != nil {
  6402  				start, err := unmarshalBasicClipTime(*v)
  6403  				if err != nil {
  6404  					return err
  6405  				}
  6406  				jih.Start = start
  6407  			}
  6408  		case "end":
  6409  			if v != nil {
  6410  				end, err := unmarshalBasicClipTime(*v)
  6411  				if err != nil {
  6412  					return err
  6413  				}
  6414  				jih.End = end
  6415  			}
  6416  		case "label":
  6417  			if v != nil {
  6418  				var label string
  6419  				err = json.Unmarshal(*v, &label)
  6420  				if err != nil {
  6421  					return err
  6422  				}
  6423  				jih.Label = &label
  6424  			}
  6425  		case "inputDefinitions":
  6426  			if v != nil {
  6427  				inputDefinitions, err := unmarshalBasicInputDefinitionArray(*v)
  6428  				if err != nil {
  6429  					return err
  6430  				}
  6431  				jih.InputDefinitions = &inputDefinitions
  6432  			}
  6433  		case "@odata.type":
  6434  			if v != nil {
  6435  				var odataType OdataTypeBasicJobInput
  6436  				err = json.Unmarshal(*v, &odataType)
  6437  				if err != nil {
  6438  					return err
  6439  				}
  6440  				jih.OdataType = odataType
  6441  			}
  6442  		}
  6443  	}
  6444  
  6445  	return nil
  6446  }
  6447  
  6448  // JobInputs describes a list of inputs to a Job.
  6449  type JobInputs struct {
  6450  	// Inputs - List of inputs to a Job.
  6451  	Inputs *[]BasicJobInput `json:"inputs,omitempty"`
  6452  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  6453  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  6454  }
  6455  
  6456  // MarshalJSON is the custom marshaler for JobInputs.
  6457  func (ji JobInputs) MarshalJSON() ([]byte, error) {
  6458  	ji.OdataType = OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs
  6459  	objectMap := make(map[string]interface{})
  6460  	if ji.Inputs != nil {
  6461  		objectMap["inputs"] = ji.Inputs
  6462  	}
  6463  	if ji.OdataType != "" {
  6464  		objectMap["@odata.type"] = ji.OdataType
  6465  	}
  6466  	return json.Marshal(objectMap)
  6467  }
  6468  
  6469  // AsJobInputClip is the BasicJobInput implementation for JobInputs.
  6470  func (ji JobInputs) AsJobInputClip() (*JobInputClip, bool) {
  6471  	return nil, false
  6472  }
  6473  
  6474  // AsBasicJobInputClip is the BasicJobInput implementation for JobInputs.
  6475  func (ji JobInputs) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  6476  	return nil, false
  6477  }
  6478  
  6479  // AsJobInputs is the BasicJobInput implementation for JobInputs.
  6480  func (ji JobInputs) AsJobInputs() (*JobInputs, bool) {
  6481  	return &ji, true
  6482  }
  6483  
  6484  // AsJobInputAsset is the BasicJobInput implementation for JobInputs.
  6485  func (ji JobInputs) AsJobInputAsset() (*JobInputAsset, bool) {
  6486  	return nil, false
  6487  }
  6488  
  6489  // AsJobInputHTTP is the BasicJobInput implementation for JobInputs.
  6490  func (ji JobInputs) AsJobInputHTTP() (*JobInputHTTP, bool) {
  6491  	return nil, false
  6492  }
  6493  
  6494  // AsJobInputSequence is the BasicJobInput implementation for JobInputs.
  6495  func (ji JobInputs) AsJobInputSequence() (*JobInputSequence, bool) {
  6496  	return nil, false
  6497  }
  6498  
  6499  // AsJobInput is the BasicJobInput implementation for JobInputs.
  6500  func (ji JobInputs) AsJobInput() (*JobInput, bool) {
  6501  	return nil, false
  6502  }
  6503  
  6504  // AsBasicJobInput is the BasicJobInput implementation for JobInputs.
  6505  func (ji JobInputs) AsBasicJobInput() (BasicJobInput, bool) {
  6506  	return &ji, true
  6507  }
  6508  
  6509  // UnmarshalJSON is the custom unmarshaler for JobInputs struct.
  6510  func (ji *JobInputs) UnmarshalJSON(body []byte) error {
  6511  	var m map[string]*json.RawMessage
  6512  	err := json.Unmarshal(body, &m)
  6513  	if err != nil {
  6514  		return err
  6515  	}
  6516  	for k, v := range m {
  6517  		switch k {
  6518  		case "inputs":
  6519  			if v != nil {
  6520  				inputs, err := unmarshalBasicJobInputArray(*v)
  6521  				if err != nil {
  6522  					return err
  6523  				}
  6524  				ji.Inputs = &inputs
  6525  			}
  6526  		case "@odata.type":
  6527  			if v != nil {
  6528  				var odataType OdataTypeBasicJobInput
  6529  				err = json.Unmarshal(*v, &odataType)
  6530  				if err != nil {
  6531  					return err
  6532  				}
  6533  				ji.OdataType = odataType
  6534  			}
  6535  		}
  6536  	}
  6537  
  6538  	return nil
  6539  }
  6540  
  6541  // JobInputSequence a Sequence contains an ordered list of Clips where each clip is a JobInput.  The
  6542  // Sequence will be treated as a single input.
  6543  type JobInputSequence struct {
  6544  	// Inputs - JobInputs that make up the timeline.
  6545  	Inputs *[]BasicJobInputClip `json:"inputs,omitempty"`
  6546  	// OdataType - Possible values include: 'OdataTypeBasicJobInputOdataTypeJobInput', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputClip', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputs', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputHTTP', 'OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence'
  6547  	OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"`
  6548  }
  6549  
  6550  // MarshalJSON is the custom marshaler for JobInputSequence.
  6551  func (jis JobInputSequence) MarshalJSON() ([]byte, error) {
  6552  	jis.OdataType = OdataTypeBasicJobInputOdataTypeMicrosoftMediaJobInputSequence
  6553  	objectMap := make(map[string]interface{})
  6554  	if jis.Inputs != nil {
  6555  		objectMap["inputs"] = jis.Inputs
  6556  	}
  6557  	if jis.OdataType != "" {
  6558  		objectMap["@odata.type"] = jis.OdataType
  6559  	}
  6560  	return json.Marshal(objectMap)
  6561  }
  6562  
  6563  // AsJobInputClip is the BasicJobInput implementation for JobInputSequence.
  6564  func (jis JobInputSequence) AsJobInputClip() (*JobInputClip, bool) {
  6565  	return nil, false
  6566  }
  6567  
  6568  // AsBasicJobInputClip is the BasicJobInput implementation for JobInputSequence.
  6569  func (jis JobInputSequence) AsBasicJobInputClip() (BasicJobInputClip, bool) {
  6570  	return nil, false
  6571  }
  6572  
  6573  // AsJobInputs is the BasicJobInput implementation for JobInputSequence.
  6574  func (jis JobInputSequence) AsJobInputs() (*JobInputs, bool) {
  6575  	return nil, false
  6576  }
  6577  
  6578  // AsJobInputAsset is the BasicJobInput implementation for JobInputSequence.
  6579  func (jis JobInputSequence) AsJobInputAsset() (*JobInputAsset, bool) {
  6580  	return nil, false
  6581  }
  6582  
  6583  // AsJobInputHTTP is the BasicJobInput implementation for JobInputSequence.
  6584  func (jis JobInputSequence) AsJobInputHTTP() (*JobInputHTTP, bool) {
  6585  	return nil, false
  6586  }
  6587  
  6588  // AsJobInputSequence is the BasicJobInput implementation for JobInputSequence.
  6589  func (jis JobInputSequence) AsJobInputSequence() (*JobInputSequence, bool) {
  6590  	return &jis, true
  6591  }
  6592  
  6593  // AsJobInput is the BasicJobInput implementation for JobInputSequence.
  6594  func (jis JobInputSequence) AsJobInput() (*JobInput, bool) {
  6595  	return nil, false
  6596  }
  6597  
  6598  // AsBasicJobInput is the BasicJobInput implementation for JobInputSequence.
  6599  func (jis JobInputSequence) AsBasicJobInput() (BasicJobInput, bool) {
  6600  	return &jis, true
  6601  }
  6602  
  6603  // UnmarshalJSON is the custom unmarshaler for JobInputSequence struct.
  6604  func (jis *JobInputSequence) UnmarshalJSON(body []byte) error {
  6605  	var m map[string]*json.RawMessage
  6606  	err := json.Unmarshal(body, &m)
  6607  	if err != nil {
  6608  		return err
  6609  	}
  6610  	for k, v := range m {
  6611  		switch k {
  6612  		case "inputs":
  6613  			if v != nil {
  6614  				inputs, err := unmarshalBasicJobInputClipArray(*v)
  6615  				if err != nil {
  6616  					return err
  6617  				}
  6618  				jis.Inputs = &inputs
  6619  			}
  6620  		case "@odata.type":
  6621  			if v != nil {
  6622  				var odataType OdataTypeBasicJobInput
  6623  				err = json.Unmarshal(*v, &odataType)
  6624  				if err != nil {
  6625  					return err
  6626  				}
  6627  				jis.OdataType = odataType
  6628  			}
  6629  		}
  6630  	}
  6631  
  6632  	return nil
  6633  }
  6634  
  6635  // BasicJobOutput describes all the properties of a JobOutput.
  6636  type BasicJobOutput interface {
  6637  	AsJobOutputAsset() (*JobOutputAsset, bool)
  6638  	AsJobOutput() (*JobOutput, bool)
  6639  }
  6640  
  6641  // JobOutput describes all the properties of a JobOutput.
  6642  type JobOutput struct {
  6643  	// Error - READ-ONLY; If the JobOutput is in the Error state, it contains the details of the error.
  6644  	Error *JobError `json:"error,omitempty"`
  6645  	// State - READ-ONLY; Describes the state of the JobOutput. Possible values include: 'JobStateCanceled', 'JobStateCanceling', 'JobStateError', 'JobStateFinished', 'JobStateProcessing', 'JobStateQueued', 'JobStateScheduled'
  6646  	State JobState `json:"state,omitempty"`
  6647  	// 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.
  6648  	Progress *int32 `json:"progress,omitempty"`
  6649  	// 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.
  6650  	Label *string `json:"label,omitempty"`
  6651  	// StartTime - READ-ONLY; The UTC date and time at which this Job Output began processing.
  6652  	StartTime *date.Time `json:"startTime,omitempty"`
  6653  	// EndTime - READ-ONLY; The UTC date and time at which this Job Output finished processing.
  6654  	EndTime *date.Time `json:"endTime,omitempty"`
  6655  	// OdataType - Possible values include: 'OdataTypeBasicJobOutputOdataTypeJobOutput', 'OdataTypeBasicJobOutputOdataTypeMicrosoftMediaJobOutputAsset'
  6656  	OdataType OdataTypeBasicJobOutput `json:"@odata.type,omitempty"`
  6657  }
  6658  
  6659  func unmarshalBasicJobOutput(body []byte) (BasicJobOutput, error) {
  6660  	var m map[string]interface{}
  6661  	err := json.Unmarshal(body, &m)
  6662  	if err != nil {
  6663  		return nil, err
  6664  	}
  6665  
  6666  	switch m["@odata.type"] {
  6667  	case string(OdataTypeBasicJobOutputOdataTypeMicrosoftMediaJobOutputAsset):
  6668  		var joa JobOutputAsset
  6669  		err := json.Unmarshal(body, &joa)
  6670  		return joa, err
  6671  	default:
  6672  		var jo JobOutput
  6673  		err := json.Unmarshal(body, &jo)
  6674  		return jo, err
  6675  	}
  6676  }
  6677  func unmarshalBasicJobOutputArray(body []byte) ([]BasicJobOutput, error) {
  6678  	var rawMessages []*json.RawMessage
  6679  	err := json.Unmarshal(body, &rawMessages)
  6680  	if err != nil {
  6681  		return nil, err
  6682  	}
  6683  
  6684  	joArray := make([]BasicJobOutput, len(rawMessages))
  6685  
  6686  	for index, rawMessage := range rawMessages {
  6687  		jo, err := unmarshalBasicJobOutput(*rawMessage)
  6688  		if err != nil {
  6689  			return nil, err
  6690  		}
  6691  		joArray[index] = jo
  6692  	}
  6693  	return joArray, nil
  6694  }
  6695  
  6696  // MarshalJSON is the custom marshaler for JobOutput.
  6697  func (jo JobOutput) MarshalJSON() ([]byte, error) {
  6698  	jo.OdataType = OdataTypeBasicJobOutputOdataTypeJobOutput
  6699  	objectMap := make(map[string]interface{})
  6700  	if jo.Label != nil {
  6701  		objectMap["label"] = jo.Label
  6702  	}
  6703  	if jo.OdataType != "" {
  6704  		objectMap["@odata.type"] = jo.OdataType
  6705  	}
  6706  	return json.Marshal(objectMap)
  6707  }
  6708  
  6709  // AsJobOutputAsset is the BasicJobOutput implementation for JobOutput.
  6710  func (jo JobOutput) AsJobOutputAsset() (*JobOutputAsset, bool) {
  6711  	return nil, false
  6712  }
  6713  
  6714  // AsJobOutput is the BasicJobOutput implementation for JobOutput.
  6715  func (jo JobOutput) AsJobOutput() (*JobOutput, bool) {
  6716  	return &jo, true
  6717  }
  6718  
  6719  // AsBasicJobOutput is the BasicJobOutput implementation for JobOutput.
  6720  func (jo JobOutput) AsBasicJobOutput() (BasicJobOutput, bool) {
  6721  	return &jo, true
  6722  }
  6723  
  6724  // JobOutputAsset represents an Asset used as a JobOutput.
  6725  type JobOutputAsset struct {
  6726  	// AssetName - The name of the output Asset.
  6727  	AssetName *string `json:"assetName,omitempty"`
  6728  	// Error - READ-ONLY; If the JobOutput is in the Error state, it contains the details of the error.
  6729  	Error *JobError `json:"error,omitempty"`
  6730  	// State - READ-ONLY; Describes the state of the JobOutput. Possible values include: 'JobStateCanceled', 'JobStateCanceling', 'JobStateError', 'JobStateFinished', 'JobStateProcessing', 'JobStateQueued', 'JobStateScheduled'
  6731  	State JobState `json:"state,omitempty"`
  6732  	// 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.
  6733  	Progress *int32 `json:"progress,omitempty"`
  6734  	// 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.
  6735  	Label *string `json:"label,omitempty"`
  6736  	// StartTime - READ-ONLY; The UTC date and time at which this Job Output began processing.
  6737  	StartTime *date.Time `json:"startTime,omitempty"`
  6738  	// EndTime - READ-ONLY; The UTC date and time at which this Job Output finished processing.
  6739  	EndTime *date.Time `json:"endTime,omitempty"`
  6740  	// OdataType - Possible values include: 'OdataTypeBasicJobOutputOdataTypeJobOutput', 'OdataTypeBasicJobOutputOdataTypeMicrosoftMediaJobOutputAsset'
  6741  	OdataType OdataTypeBasicJobOutput `json:"@odata.type,omitempty"`
  6742  }
  6743  
  6744  // MarshalJSON is the custom marshaler for JobOutputAsset.
  6745  func (joa JobOutputAsset) MarshalJSON() ([]byte, error) {
  6746  	joa.OdataType = OdataTypeBasicJobOutputOdataTypeMicrosoftMediaJobOutputAsset
  6747  	objectMap := make(map[string]interface{})
  6748  	if joa.AssetName != nil {
  6749  		objectMap["assetName"] = joa.AssetName
  6750  	}
  6751  	if joa.Label != nil {
  6752  		objectMap["label"] = joa.Label
  6753  	}
  6754  	if joa.OdataType != "" {
  6755  		objectMap["@odata.type"] = joa.OdataType
  6756  	}
  6757  	return json.Marshal(objectMap)
  6758  }
  6759  
  6760  // AsJobOutputAsset is the BasicJobOutput implementation for JobOutputAsset.
  6761  func (joa JobOutputAsset) AsJobOutputAsset() (*JobOutputAsset, bool) {
  6762  	return &joa, true
  6763  }
  6764  
  6765  // AsJobOutput is the BasicJobOutput implementation for JobOutputAsset.
  6766  func (joa JobOutputAsset) AsJobOutput() (*JobOutput, bool) {
  6767  	return nil, false
  6768  }
  6769  
  6770  // AsBasicJobOutput is the BasicJobOutput implementation for JobOutputAsset.
  6771  func (joa JobOutputAsset) AsBasicJobOutput() (BasicJobOutput, bool) {
  6772  	return &joa, true
  6773  }
  6774  
  6775  // JobProperties properties of the Job.
  6776  type JobProperties struct {
  6777  	// Created - READ-ONLY; The UTC date and time when the customer has created the Job, in 'YYYY-MM-DDThh:mm:ssZ' format.
  6778  	Created *date.Time `json:"created,omitempty"`
  6779  	// State - READ-ONLY; The current state of the job. Possible values include: 'JobStateCanceled', 'JobStateCanceling', 'JobStateError', 'JobStateFinished', 'JobStateProcessing', 'JobStateQueued', 'JobStateScheduled'
  6780  	State JobState `json:"state,omitempty"`
  6781  	// Description - Optional customer supplied description of the Job.
  6782  	Description *string `json:"description,omitempty"`
  6783  	// Input - The inputs for the Job.
  6784  	Input BasicJobInput `json:"input,omitempty"`
  6785  	// LastModified - READ-ONLY; The UTC date and time when the customer has last updated the Job, in 'YYYY-MM-DDThh:mm:ssZ' format.
  6786  	LastModified *date.Time `json:"lastModified,omitempty"`
  6787  	// Outputs - The outputs for the Job.
  6788  	Outputs *[]BasicJobOutput `json:"outputs,omitempty"`
  6789  	// 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'
  6790  	Priority Priority `json:"priority,omitempty"`
  6791  	// CorrelationData - Customer provided key, value pairs that will be returned in Job and JobOutput state events.
  6792  	CorrelationData map[string]*string `json:"correlationData"`
  6793  	// StartTime - READ-ONLY; The UTC date and time at which this Job began processing.
  6794  	StartTime *date.Time `json:"startTime,omitempty"`
  6795  	// EndTime - READ-ONLY; The UTC date and time at which this Job finished processing.
  6796  	EndTime *date.Time `json:"endTime,omitempty"`
  6797  }
  6798  
  6799  // MarshalJSON is the custom marshaler for JobProperties.
  6800  func (jp JobProperties) MarshalJSON() ([]byte, error) {
  6801  	objectMap := make(map[string]interface{})
  6802  	if jp.Description != nil {
  6803  		objectMap["description"] = jp.Description
  6804  	}
  6805  	objectMap["input"] = jp.Input
  6806  	if jp.Outputs != nil {
  6807  		objectMap["outputs"] = jp.Outputs
  6808  	}
  6809  	if jp.Priority != "" {
  6810  		objectMap["priority"] = jp.Priority
  6811  	}
  6812  	if jp.CorrelationData != nil {
  6813  		objectMap["correlationData"] = jp.CorrelationData
  6814  	}
  6815  	return json.Marshal(objectMap)
  6816  }
  6817  
  6818  // UnmarshalJSON is the custom unmarshaler for JobProperties struct.
  6819  func (jp *JobProperties) UnmarshalJSON(body []byte) error {
  6820  	var m map[string]*json.RawMessage
  6821  	err := json.Unmarshal(body, &m)
  6822  	if err != nil {
  6823  		return err
  6824  	}
  6825  	for k, v := range m {
  6826  		switch k {
  6827  		case "created":
  6828  			if v != nil {
  6829  				var created date.Time
  6830  				err = json.Unmarshal(*v, &created)
  6831  				if err != nil {
  6832  					return err
  6833  				}
  6834  				jp.Created = &created
  6835  			}
  6836  		case "state":
  6837  			if v != nil {
  6838  				var state JobState
  6839  				err = json.Unmarshal(*v, &state)
  6840  				if err != nil {
  6841  					return err
  6842  				}
  6843  				jp.State = state
  6844  			}
  6845  		case "description":
  6846  			if v != nil {
  6847  				var description string
  6848  				err = json.Unmarshal(*v, &description)
  6849  				if err != nil {
  6850  					return err
  6851  				}
  6852  				jp.Description = &description
  6853  			}
  6854  		case "input":
  6855  			if v != nil {
  6856  				input, err := unmarshalBasicJobInput(*v)
  6857  				if err != nil {
  6858  					return err
  6859  				}
  6860  				jp.Input = input
  6861  			}
  6862  		case "lastModified":
  6863  			if v != nil {
  6864  				var lastModified date.Time
  6865  				err = json.Unmarshal(*v, &lastModified)
  6866  				if err != nil {
  6867  					return err
  6868  				}
  6869  				jp.LastModified = &lastModified
  6870  			}
  6871  		case "outputs":
  6872  			if v != nil {
  6873  				outputs, err := unmarshalBasicJobOutputArray(*v)
  6874  				if err != nil {
  6875  					return err
  6876  				}
  6877  				jp.Outputs = &outputs
  6878  			}
  6879  		case "priority":
  6880  			if v != nil {
  6881  				var priority Priority
  6882  				err = json.Unmarshal(*v, &priority)
  6883  				if err != nil {
  6884  					return err
  6885  				}
  6886  				jp.Priority = priority
  6887  			}
  6888  		case "correlationData":
  6889  			if v != nil {
  6890  				var correlationData map[string]*string
  6891  				err = json.Unmarshal(*v, &correlationData)
  6892  				if err != nil {
  6893  					return err
  6894  				}
  6895  				jp.CorrelationData = correlationData
  6896  			}
  6897  		case "startTime":
  6898  			if v != nil {
  6899  				var startTime date.Time
  6900  				err = json.Unmarshal(*v, &startTime)
  6901  				if err != nil {
  6902  					return err
  6903  				}
  6904  				jp.StartTime = &startTime
  6905  			}
  6906  		case "endTime":
  6907  			if v != nil {
  6908  				var endTime date.Time
  6909  				err = json.Unmarshal(*v, &endTime)
  6910  				if err != nil {
  6911  					return err
  6912  				}
  6913  				jp.EndTime = &endTime
  6914  			}
  6915  		}
  6916  	}
  6917  
  6918  	return nil
  6919  }
  6920  
  6921  // JpgFormat describes the settings for producing JPEG thumbnails.
  6922  type JpgFormat struct {
  6923  	// 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.
  6924  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  6925  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  6926  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  6927  }
  6928  
  6929  // MarshalJSON is the custom marshaler for JpgFormat.
  6930  func (jf JpgFormat) MarshalJSON() ([]byte, error) {
  6931  	jf.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat
  6932  	objectMap := make(map[string]interface{})
  6933  	if jf.FilenamePattern != nil {
  6934  		objectMap["filenamePattern"] = jf.FilenamePattern
  6935  	}
  6936  	if jf.OdataType != "" {
  6937  		objectMap["@odata.type"] = jf.OdataType
  6938  	}
  6939  	return json.Marshal(objectMap)
  6940  }
  6941  
  6942  // AsImageFormat is the BasicFormat implementation for JpgFormat.
  6943  func (jf JpgFormat) AsImageFormat() (*ImageFormat, bool) {
  6944  	return nil, false
  6945  }
  6946  
  6947  // AsBasicImageFormat is the BasicFormat implementation for JpgFormat.
  6948  func (jf JpgFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
  6949  	return &jf, true
  6950  }
  6951  
  6952  // AsJpgFormat is the BasicFormat implementation for JpgFormat.
  6953  func (jf JpgFormat) AsJpgFormat() (*JpgFormat, bool) {
  6954  	return &jf, true
  6955  }
  6956  
  6957  // AsPngFormat is the BasicFormat implementation for JpgFormat.
  6958  func (jf JpgFormat) AsPngFormat() (*PngFormat, bool) {
  6959  	return nil, false
  6960  }
  6961  
  6962  // AsMultiBitrateFormat is the BasicFormat implementation for JpgFormat.
  6963  func (jf JpgFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  6964  	return nil, false
  6965  }
  6966  
  6967  // AsBasicMultiBitrateFormat is the BasicFormat implementation for JpgFormat.
  6968  func (jf JpgFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  6969  	return nil, false
  6970  }
  6971  
  6972  // AsMp4Format is the BasicFormat implementation for JpgFormat.
  6973  func (jf JpgFormat) AsMp4Format() (*Mp4Format, bool) {
  6974  	return nil, false
  6975  }
  6976  
  6977  // AsTransportStreamFormat is the BasicFormat implementation for JpgFormat.
  6978  func (jf JpgFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  6979  	return nil, false
  6980  }
  6981  
  6982  // AsFormat is the BasicFormat implementation for JpgFormat.
  6983  func (jf JpgFormat) AsFormat() (*Format, bool) {
  6984  	return nil, false
  6985  }
  6986  
  6987  // AsBasicFormat is the BasicFormat implementation for JpgFormat.
  6988  func (jf JpgFormat) AsBasicFormat() (BasicFormat, bool) {
  6989  	return &jf, true
  6990  }
  6991  
  6992  // JpgImage describes the properties for producing a series of JPEG images from the input video.
  6993  type JpgImage struct {
  6994  	// Layers - A collection of output JPEG image layers to be produced by the encoder.
  6995  	Layers *[]JpgLayer `json:"layers,omitempty"`
  6996  	// 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.
  6997  	SpriteColumn *int32 `json:"spriteColumn,omitempty"`
  6998  	// 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}.
  6999  	Start *string `json:"start,omitempty"`
  7000  	// 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.
  7001  	Step *string `json:"step,omitempty"`
  7002  	// 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.
  7003  	Range *string `json:"range,omitempty"`
  7004  	// 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.
  7005  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  7006  	// 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'
  7007  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  7008  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
  7009  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
  7010  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  7011  	Label *string `json:"label,omitempty"`
  7012  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  7013  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  7014  }
  7015  
  7016  // MarshalJSON is the custom marshaler for JpgImage.
  7017  func (ji JpgImage) MarshalJSON() ([]byte, error) {
  7018  	ji.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage
  7019  	objectMap := make(map[string]interface{})
  7020  	if ji.Layers != nil {
  7021  		objectMap["layers"] = ji.Layers
  7022  	}
  7023  	if ji.SpriteColumn != nil {
  7024  		objectMap["spriteColumn"] = ji.SpriteColumn
  7025  	}
  7026  	if ji.Start != nil {
  7027  		objectMap["start"] = ji.Start
  7028  	}
  7029  	if ji.Step != nil {
  7030  		objectMap["step"] = ji.Step
  7031  	}
  7032  	if ji.Range != nil {
  7033  		objectMap["range"] = ji.Range
  7034  	}
  7035  	if ji.KeyFrameInterval != nil {
  7036  		objectMap["keyFrameInterval"] = ji.KeyFrameInterval
  7037  	}
  7038  	if ji.StretchMode != "" {
  7039  		objectMap["stretchMode"] = ji.StretchMode
  7040  	}
  7041  	if ji.SyncMode != "" {
  7042  		objectMap["syncMode"] = ji.SyncMode
  7043  	}
  7044  	if ji.Label != nil {
  7045  		objectMap["label"] = ji.Label
  7046  	}
  7047  	if ji.OdataType != "" {
  7048  		objectMap["@odata.type"] = ji.OdataType
  7049  	}
  7050  	return json.Marshal(objectMap)
  7051  }
  7052  
  7053  // AsAudio is the BasicCodec implementation for JpgImage.
  7054  func (ji JpgImage) AsAudio() (*Audio, bool) {
  7055  	return nil, false
  7056  }
  7057  
  7058  // AsBasicAudio is the BasicCodec implementation for JpgImage.
  7059  func (ji JpgImage) AsBasicAudio() (BasicAudio, bool) {
  7060  	return nil, false
  7061  }
  7062  
  7063  // AsAacAudio is the BasicCodec implementation for JpgImage.
  7064  func (ji JpgImage) AsAacAudio() (*AacAudio, bool) {
  7065  	return nil, false
  7066  }
  7067  
  7068  // AsVideo is the BasicCodec implementation for JpgImage.
  7069  func (ji JpgImage) AsVideo() (*Video, bool) {
  7070  	return nil, false
  7071  }
  7072  
  7073  // AsBasicVideo is the BasicCodec implementation for JpgImage.
  7074  func (ji JpgImage) AsBasicVideo() (BasicVideo, bool) {
  7075  	return &ji, true
  7076  }
  7077  
  7078  // AsH265Video is the BasicCodec implementation for JpgImage.
  7079  func (ji JpgImage) AsH265Video() (*H265Video, bool) {
  7080  	return nil, false
  7081  }
  7082  
  7083  // AsCopyVideo is the BasicCodec implementation for JpgImage.
  7084  func (ji JpgImage) AsCopyVideo() (*CopyVideo, bool) {
  7085  	return nil, false
  7086  }
  7087  
  7088  // AsImage is the BasicCodec implementation for JpgImage.
  7089  func (ji JpgImage) AsImage() (*Image, bool) {
  7090  	return nil, false
  7091  }
  7092  
  7093  // AsBasicImage is the BasicCodec implementation for JpgImage.
  7094  func (ji JpgImage) AsBasicImage() (BasicImage, bool) {
  7095  	return &ji, true
  7096  }
  7097  
  7098  // AsCopyAudio is the BasicCodec implementation for JpgImage.
  7099  func (ji JpgImage) AsCopyAudio() (*CopyAudio, bool) {
  7100  	return nil, false
  7101  }
  7102  
  7103  // AsH264Video is the BasicCodec implementation for JpgImage.
  7104  func (ji JpgImage) AsH264Video() (*H264Video, bool) {
  7105  	return nil, false
  7106  }
  7107  
  7108  // AsJpgImage is the BasicCodec implementation for JpgImage.
  7109  func (ji JpgImage) AsJpgImage() (*JpgImage, bool) {
  7110  	return &ji, true
  7111  }
  7112  
  7113  // AsPngImage is the BasicCodec implementation for JpgImage.
  7114  func (ji JpgImage) AsPngImage() (*PngImage, bool) {
  7115  	return nil, false
  7116  }
  7117  
  7118  // AsCodec is the BasicCodec implementation for JpgImage.
  7119  func (ji JpgImage) AsCodec() (*Codec, bool) {
  7120  	return nil, false
  7121  }
  7122  
  7123  // AsBasicCodec is the BasicCodec implementation for JpgImage.
  7124  func (ji JpgImage) AsBasicCodec() (BasicCodec, bool) {
  7125  	return &ji, true
  7126  }
  7127  
  7128  // JpgLayer describes the settings to produce a JPEG image from the input video.
  7129  type JpgLayer struct {
  7130  	// Quality - The compression quality of the JPEG output. Range is from 0-100 and the default is 70.
  7131  	Quality *int32 `json:"quality,omitempty"`
  7132  	// 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.
  7133  	Width *string `json:"width,omitempty"`
  7134  	// 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.
  7135  	Height *string `json:"height,omitempty"`
  7136  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  7137  	Label *string `json:"label,omitempty"`
  7138  	// OdataType - Possible values include: 'OdataTypeBasicLayerOdataTypeLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer'
  7139  	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
  7140  }
  7141  
  7142  // MarshalJSON is the custom marshaler for JpgLayer.
  7143  func (jl JpgLayer) MarshalJSON() ([]byte, error) {
  7144  	jl.OdataType = OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer
  7145  	objectMap := make(map[string]interface{})
  7146  	if jl.Quality != nil {
  7147  		objectMap["quality"] = jl.Quality
  7148  	}
  7149  	if jl.Width != nil {
  7150  		objectMap["width"] = jl.Width
  7151  	}
  7152  	if jl.Height != nil {
  7153  		objectMap["height"] = jl.Height
  7154  	}
  7155  	if jl.Label != nil {
  7156  		objectMap["label"] = jl.Label
  7157  	}
  7158  	if jl.OdataType != "" {
  7159  		objectMap["@odata.type"] = jl.OdataType
  7160  	}
  7161  	return json.Marshal(objectMap)
  7162  }
  7163  
  7164  // AsH265VideoLayer is the BasicLayer implementation for JpgLayer.
  7165  func (jl JpgLayer) AsH265VideoLayer() (*H265VideoLayer, bool) {
  7166  	return nil, false
  7167  }
  7168  
  7169  // AsBasicH265VideoLayer is the BasicLayer implementation for JpgLayer.
  7170  func (jl JpgLayer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
  7171  	return nil, false
  7172  }
  7173  
  7174  // AsH265Layer is the BasicLayer implementation for JpgLayer.
  7175  func (jl JpgLayer) AsH265Layer() (*H265Layer, bool) {
  7176  	return nil, false
  7177  }
  7178  
  7179  // AsVideoLayer is the BasicLayer implementation for JpgLayer.
  7180  func (jl JpgLayer) AsVideoLayer() (*VideoLayer, bool) {
  7181  	return nil, false
  7182  }
  7183  
  7184  // AsBasicVideoLayer is the BasicLayer implementation for JpgLayer.
  7185  func (jl JpgLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
  7186  	return nil, false
  7187  }
  7188  
  7189  // AsH264Layer is the BasicLayer implementation for JpgLayer.
  7190  func (jl JpgLayer) AsH264Layer() (*H264Layer, bool) {
  7191  	return nil, false
  7192  }
  7193  
  7194  // AsJpgLayer is the BasicLayer implementation for JpgLayer.
  7195  func (jl JpgLayer) AsJpgLayer() (*JpgLayer, bool) {
  7196  	return &jl, true
  7197  }
  7198  
  7199  // AsPngLayer is the BasicLayer implementation for JpgLayer.
  7200  func (jl JpgLayer) AsPngLayer() (*PngLayer, bool) {
  7201  	return nil, false
  7202  }
  7203  
  7204  // AsLayer is the BasicLayer implementation for JpgLayer.
  7205  func (jl JpgLayer) AsLayer() (*Layer, bool) {
  7206  	return nil, false
  7207  }
  7208  
  7209  // AsBasicLayer is the BasicLayer implementation for JpgLayer.
  7210  func (jl JpgLayer) AsBasicLayer() (BasicLayer, bool) {
  7211  	return &jl, true
  7212  }
  7213  
  7214  // KeyDelivery ...
  7215  type KeyDelivery struct {
  7216  	// AccessControl - The access control properties for Key Delivery.
  7217  	AccessControl *AccessControl `json:"accessControl,omitempty"`
  7218  }
  7219  
  7220  // KeyVaultProperties ...
  7221  type KeyVaultProperties struct {
  7222  	// 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).
  7223  	KeyIdentifier *string `json:"keyIdentifier,omitempty"`
  7224  	// CurrentKeyIdentifier - READ-ONLY; The current key used to encrypt the Media Services account, including the key version.
  7225  	CurrentKeyIdentifier *string `json:"currentKeyIdentifier,omitempty"`
  7226  }
  7227  
  7228  // MarshalJSON is the custom marshaler for KeyVaultProperties.
  7229  func (kvp KeyVaultProperties) MarshalJSON() ([]byte, error) {
  7230  	objectMap := make(map[string]interface{})
  7231  	if kvp.KeyIdentifier != nil {
  7232  		objectMap["keyIdentifier"] = kvp.KeyIdentifier
  7233  	}
  7234  	return json.Marshal(objectMap)
  7235  }
  7236  
  7237  // BasicLayer the encoder can be configured to produce video and/or images (thumbnails) at different resolutions, by
  7238  // specifying a layer for each desired resolution. A layer represents the properties for the video or image at a
  7239  // resolution.
  7240  type BasicLayer interface {
  7241  	AsH265VideoLayer() (*H265VideoLayer, bool)
  7242  	AsBasicH265VideoLayer() (BasicH265VideoLayer, bool)
  7243  	AsH265Layer() (*H265Layer, bool)
  7244  	AsVideoLayer() (*VideoLayer, bool)
  7245  	AsBasicVideoLayer() (BasicVideoLayer, bool)
  7246  	AsH264Layer() (*H264Layer, bool)
  7247  	AsJpgLayer() (*JpgLayer, bool)
  7248  	AsPngLayer() (*PngLayer, bool)
  7249  	AsLayer() (*Layer, bool)
  7250  }
  7251  
  7252  // Layer the encoder can be configured to produce video and/or images (thumbnails) at different resolutions, by
  7253  // specifying a layer for each desired resolution. A layer represents the properties for the video or image at
  7254  // a resolution.
  7255  type Layer struct {
  7256  	// 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.
  7257  	Width *string `json:"width,omitempty"`
  7258  	// 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.
  7259  	Height *string `json:"height,omitempty"`
  7260  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  7261  	Label *string `json:"label,omitempty"`
  7262  	// OdataType - Possible values include: 'OdataTypeBasicLayerOdataTypeLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer'
  7263  	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
  7264  }
  7265  
  7266  func unmarshalBasicLayer(body []byte) (BasicLayer, error) {
  7267  	var m map[string]interface{}
  7268  	err := json.Unmarshal(body, &m)
  7269  	if err != nil {
  7270  		return nil, err
  7271  	}
  7272  
  7273  	switch m["@odata.type"] {
  7274  	case string(OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer):
  7275  		var hvl H265VideoLayer
  7276  		err := json.Unmarshal(body, &hvl)
  7277  		return hvl, err
  7278  	case string(OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer):
  7279  		var hl H265Layer
  7280  		err := json.Unmarshal(body, &hl)
  7281  		return hl, err
  7282  	case string(OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer):
  7283  		var vl VideoLayer
  7284  		err := json.Unmarshal(body, &vl)
  7285  		return vl, err
  7286  	case string(OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer):
  7287  		var hl H264Layer
  7288  		err := json.Unmarshal(body, &hl)
  7289  		return hl, err
  7290  	case string(OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer):
  7291  		var jl JpgLayer
  7292  		err := json.Unmarshal(body, &jl)
  7293  		return jl, err
  7294  	case string(OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer):
  7295  		var pl PngLayer
  7296  		err := json.Unmarshal(body, &pl)
  7297  		return pl, err
  7298  	default:
  7299  		var l Layer
  7300  		err := json.Unmarshal(body, &l)
  7301  		return l, err
  7302  	}
  7303  }
  7304  func unmarshalBasicLayerArray(body []byte) ([]BasicLayer, error) {
  7305  	var rawMessages []*json.RawMessage
  7306  	err := json.Unmarshal(body, &rawMessages)
  7307  	if err != nil {
  7308  		return nil, err
  7309  	}
  7310  
  7311  	lArray := make([]BasicLayer, len(rawMessages))
  7312  
  7313  	for index, rawMessage := range rawMessages {
  7314  		l, err := unmarshalBasicLayer(*rawMessage)
  7315  		if err != nil {
  7316  			return nil, err
  7317  		}
  7318  		lArray[index] = l
  7319  	}
  7320  	return lArray, nil
  7321  }
  7322  
  7323  // MarshalJSON is the custom marshaler for Layer.
  7324  func (l Layer) MarshalJSON() ([]byte, error) {
  7325  	l.OdataType = OdataTypeBasicLayerOdataTypeLayer
  7326  	objectMap := make(map[string]interface{})
  7327  	if l.Width != nil {
  7328  		objectMap["width"] = l.Width
  7329  	}
  7330  	if l.Height != nil {
  7331  		objectMap["height"] = l.Height
  7332  	}
  7333  	if l.Label != nil {
  7334  		objectMap["label"] = l.Label
  7335  	}
  7336  	if l.OdataType != "" {
  7337  		objectMap["@odata.type"] = l.OdataType
  7338  	}
  7339  	return json.Marshal(objectMap)
  7340  }
  7341  
  7342  // AsH265VideoLayer is the BasicLayer implementation for Layer.
  7343  func (l Layer) AsH265VideoLayer() (*H265VideoLayer, bool) {
  7344  	return nil, false
  7345  }
  7346  
  7347  // AsBasicH265VideoLayer is the BasicLayer implementation for Layer.
  7348  func (l Layer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
  7349  	return nil, false
  7350  }
  7351  
  7352  // AsH265Layer is the BasicLayer implementation for Layer.
  7353  func (l Layer) AsH265Layer() (*H265Layer, bool) {
  7354  	return nil, false
  7355  }
  7356  
  7357  // AsVideoLayer is the BasicLayer implementation for Layer.
  7358  func (l Layer) AsVideoLayer() (*VideoLayer, bool) {
  7359  	return nil, false
  7360  }
  7361  
  7362  // AsBasicVideoLayer is the BasicLayer implementation for Layer.
  7363  func (l Layer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
  7364  	return nil, false
  7365  }
  7366  
  7367  // AsH264Layer is the BasicLayer implementation for Layer.
  7368  func (l Layer) AsH264Layer() (*H264Layer, bool) {
  7369  	return nil, false
  7370  }
  7371  
  7372  // AsJpgLayer is the BasicLayer implementation for Layer.
  7373  func (l Layer) AsJpgLayer() (*JpgLayer, bool) {
  7374  	return nil, false
  7375  }
  7376  
  7377  // AsPngLayer is the BasicLayer implementation for Layer.
  7378  func (l Layer) AsPngLayer() (*PngLayer, bool) {
  7379  	return nil, false
  7380  }
  7381  
  7382  // AsLayer is the BasicLayer implementation for Layer.
  7383  func (l Layer) AsLayer() (*Layer, bool) {
  7384  	return &l, true
  7385  }
  7386  
  7387  // AsBasicLayer is the BasicLayer implementation for Layer.
  7388  func (l Layer) AsBasicLayer() (BasicLayer, bool) {
  7389  	return &l, true
  7390  }
  7391  
  7392  // ListContainerSasInput the parameters to the list SAS request.
  7393  type ListContainerSasInput struct {
  7394  	// Permissions - The permissions to set on the SAS URL. Possible values include: 'AssetContainerPermissionRead', 'AssetContainerPermissionReadWrite', 'AssetContainerPermissionReadWriteDelete'
  7395  	Permissions AssetContainerPermission `json:"permissions,omitempty"`
  7396  	// ExpiryTime - The SAS URL expiration time.  This must be less than 24 hours from the current time.
  7397  	ExpiryTime *date.Time `json:"expiryTime,omitempty"`
  7398  }
  7399  
  7400  // ListContentKeysResponse class of response for listContentKeys action
  7401  type ListContentKeysResponse struct {
  7402  	autorest.Response `json:"-"`
  7403  	// ContentKeys - ContentKeys used by current Streaming Locator
  7404  	ContentKeys *[]StreamingLocatorContentKey `json:"contentKeys,omitempty"`
  7405  }
  7406  
  7407  // ListEdgePoliciesInput ...
  7408  type ListEdgePoliciesInput struct {
  7409  	// DeviceID - Unique identifier of the edge device.
  7410  	DeviceID *string `json:"deviceId,omitempty"`
  7411  }
  7412  
  7413  // ListPathsResponse class of response for listPaths action
  7414  type ListPathsResponse struct {
  7415  	autorest.Response `json:"-"`
  7416  	// StreamingPaths - Streaming Paths supported by current Streaming Locator
  7417  	StreamingPaths *[]StreamingPath `json:"streamingPaths,omitempty"`
  7418  	// DownloadPaths - Download Paths supported by current Streaming Locator
  7419  	DownloadPaths *[]string `json:"downloadPaths,omitempty"`
  7420  }
  7421  
  7422  // ListStreamingLocatorsResponse the Streaming Locators associated with this Asset.
  7423  type ListStreamingLocatorsResponse struct {
  7424  	autorest.Response `json:"-"`
  7425  	// StreamingLocators - READ-ONLY; The list of Streaming Locators.
  7426  	StreamingLocators *[]AssetStreamingLocator `json:"streamingLocators,omitempty"`
  7427  }
  7428  
  7429  // MarshalJSON is the custom marshaler for ListStreamingLocatorsResponse.
  7430  func (lslr ListStreamingLocatorsResponse) MarshalJSON() ([]byte, error) {
  7431  	objectMap := make(map[string]interface{})
  7432  	return json.Marshal(objectMap)
  7433  }
  7434  
  7435  // LiveEvent the live event.
  7436  type LiveEvent struct {
  7437  	autorest.Response `json:"-"`
  7438  	// LiveEventProperties - The live event properties.
  7439  	*LiveEventProperties `json:"properties,omitempty"`
  7440  	// SystemData - READ-ONLY; The system metadata relating to this resource.
  7441  	SystemData *SystemData `json:"systemData,omitempty"`
  7442  	// Tags - Resource tags.
  7443  	Tags map[string]*string `json:"tags"`
  7444  	// Location - The geo-location where the resource lives
  7445  	Location *string `json:"location,omitempty"`
  7446  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  7447  	ID *string `json:"id,omitempty"`
  7448  	// Name - READ-ONLY; The name of the resource
  7449  	Name *string `json:"name,omitempty"`
  7450  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  7451  	Type *string `json:"type,omitempty"`
  7452  }
  7453  
  7454  // MarshalJSON is the custom marshaler for LiveEvent.
  7455  func (le LiveEvent) MarshalJSON() ([]byte, error) {
  7456  	objectMap := make(map[string]interface{})
  7457  	if le.LiveEventProperties != nil {
  7458  		objectMap["properties"] = le.LiveEventProperties
  7459  	}
  7460  	if le.Tags != nil {
  7461  		objectMap["tags"] = le.Tags
  7462  	}
  7463  	if le.Location != nil {
  7464  		objectMap["location"] = le.Location
  7465  	}
  7466  	return json.Marshal(objectMap)
  7467  }
  7468  
  7469  // UnmarshalJSON is the custom unmarshaler for LiveEvent struct.
  7470  func (le *LiveEvent) UnmarshalJSON(body []byte) error {
  7471  	var m map[string]*json.RawMessage
  7472  	err := json.Unmarshal(body, &m)
  7473  	if err != nil {
  7474  		return err
  7475  	}
  7476  	for k, v := range m {
  7477  		switch k {
  7478  		case "properties":
  7479  			if v != nil {
  7480  				var liveEventProperties LiveEventProperties
  7481  				err = json.Unmarshal(*v, &liveEventProperties)
  7482  				if err != nil {
  7483  					return err
  7484  				}
  7485  				le.LiveEventProperties = &liveEventProperties
  7486  			}
  7487  		case "systemData":
  7488  			if v != nil {
  7489  				var systemData SystemData
  7490  				err = json.Unmarshal(*v, &systemData)
  7491  				if err != nil {
  7492  					return err
  7493  				}
  7494  				le.SystemData = &systemData
  7495  			}
  7496  		case "tags":
  7497  			if v != nil {
  7498  				var tags map[string]*string
  7499  				err = json.Unmarshal(*v, &tags)
  7500  				if err != nil {
  7501  					return err
  7502  				}
  7503  				le.Tags = tags
  7504  			}
  7505  		case "location":
  7506  			if v != nil {
  7507  				var location string
  7508  				err = json.Unmarshal(*v, &location)
  7509  				if err != nil {
  7510  					return err
  7511  				}
  7512  				le.Location = &location
  7513  			}
  7514  		case "id":
  7515  			if v != nil {
  7516  				var ID string
  7517  				err = json.Unmarshal(*v, &ID)
  7518  				if err != nil {
  7519  					return err
  7520  				}
  7521  				le.ID = &ID
  7522  			}
  7523  		case "name":
  7524  			if v != nil {
  7525  				var name string
  7526  				err = json.Unmarshal(*v, &name)
  7527  				if err != nil {
  7528  					return err
  7529  				}
  7530  				le.Name = &name
  7531  			}
  7532  		case "type":
  7533  			if v != nil {
  7534  				var typeVar string
  7535  				err = json.Unmarshal(*v, &typeVar)
  7536  				if err != nil {
  7537  					return err
  7538  				}
  7539  				le.Type = &typeVar
  7540  			}
  7541  		}
  7542  	}
  7543  
  7544  	return nil
  7545  }
  7546  
  7547  // LiveEventActionInput the LiveEvent action input parameter definition.
  7548  type LiveEventActionInput struct {
  7549  	// 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.
  7550  	RemoveOutputsOnStop *bool `json:"removeOutputsOnStop,omitempty"`
  7551  }
  7552  
  7553  // LiveEventEncoding specifies the live event type and optional encoding settings for encoding live events.
  7554  type LiveEventEncoding struct {
  7555  	// 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'
  7556  	EncodingType LiveEventEncodingType `json:"encodingType,omitempty"`
  7557  	// 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’.
  7558  	PresetName *string `json:"presetName,omitempty"`
  7559  	// 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'
  7560  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  7561  	// 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.
  7562  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  7563  }
  7564  
  7565  // LiveEventEndpoint the live event endpoint.
  7566  type LiveEventEndpoint struct {
  7567  	// Protocol - The endpoint protocol.
  7568  	Protocol *string `json:"protocol,omitempty"`
  7569  	// URL - The endpoint URL.
  7570  	URL *string `json:"url,omitempty"`
  7571  }
  7572  
  7573  // LiveEventInput the live event input.
  7574  type LiveEventInput struct {
  7575  	// StreamingProtocol - The input protocol for the live event. This is specified at creation time and cannot be updated. Possible values include: 'LiveEventInputProtocolFragmentedMP4', 'LiveEventInputProtocolRTMP'
  7576  	StreamingProtocol LiveEventInputProtocol `json:"streamingProtocol,omitempty"`
  7577  	// AccessControl - Access control for live event input.
  7578  	AccessControl *LiveEventInputAccessControl `json:"accessControl,omitempty"`
  7579  	// 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.
  7580  	KeyFrameIntervalDuration *string `json:"keyFrameIntervalDuration,omitempty"`
  7581  	// 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.
  7582  	AccessToken *string `json:"accessToken,omitempty"`
  7583  	// Endpoints - The input endpoints for the live event.
  7584  	Endpoints *[]LiveEventEndpoint `json:"endpoints,omitempty"`
  7585  }
  7586  
  7587  // LiveEventInputAccessControl the IP access control for live event input.
  7588  type LiveEventInputAccessControl struct {
  7589  	// IP - The IP access control properties.
  7590  	IP *IPAccessControl `json:"ip,omitempty"`
  7591  }
  7592  
  7593  // LiveEventInputTrackSelection a track selection condition. This property is reserved for future use, any
  7594  // value set on this property will be ignored.
  7595  type LiveEventInputTrackSelection struct {
  7596  	// Property - Property name to select. This property is reserved for future use, any value set on this property will be ignored.
  7597  	Property *string `json:"property,omitempty"`
  7598  	// Operation - Comparing operation. This property is reserved for future use, any value set on this property will be ignored.
  7599  	Operation *string `json:"operation,omitempty"`
  7600  	// Value - Property value to select. This property is reserved for future use, any value set on this property will be ignored.
  7601  	Value *string `json:"value,omitempty"`
  7602  }
  7603  
  7604  // LiveEventListResult the LiveEvent list result.
  7605  type LiveEventListResult struct {
  7606  	autorest.Response `json:"-"`
  7607  	// Value - The result of the List Live Event operation.
  7608  	Value *[]LiveEvent `json:"value,omitempty"`
  7609  	// OdataCount - The number of result.
  7610  	OdataCount *int32 `json:"@odata.count,omitempty"`
  7611  	// OdataNextLink - The link to the next set of results. Not empty if value contains incomplete list of live outputs.
  7612  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
  7613  }
  7614  
  7615  // LiveEventListResultIterator provides access to a complete listing of LiveEvent values.
  7616  type LiveEventListResultIterator struct {
  7617  	i    int
  7618  	page LiveEventListResultPage
  7619  }
  7620  
  7621  // NextWithContext advances to the next value.  If there was an error making
  7622  // the request the iterator does not advance and the error is returned.
  7623  func (iter *LiveEventListResultIterator) NextWithContext(ctx context.Context) (err error) {
  7624  	if tracing.IsEnabled() {
  7625  		ctx = tracing.StartSpan(ctx, fqdn+"/LiveEventListResultIterator.NextWithContext")
  7626  		defer func() {
  7627  			sc := -1
  7628  			if iter.Response().Response.Response != nil {
  7629  				sc = iter.Response().Response.Response.StatusCode
  7630  			}
  7631  			tracing.EndSpan(ctx, sc, err)
  7632  		}()
  7633  	}
  7634  	iter.i++
  7635  	if iter.i < len(iter.page.Values()) {
  7636  		return nil
  7637  	}
  7638  	err = iter.page.NextWithContext(ctx)
  7639  	if err != nil {
  7640  		iter.i--
  7641  		return err
  7642  	}
  7643  	iter.i = 0
  7644  	return nil
  7645  }
  7646  
  7647  // Next advances to the next value.  If there was an error making
  7648  // the request the iterator does not advance and the error is returned.
  7649  // Deprecated: Use NextWithContext() instead.
  7650  func (iter *LiveEventListResultIterator) Next() error {
  7651  	return iter.NextWithContext(context.Background())
  7652  }
  7653  
  7654  // NotDone returns true if the enumeration should be started or is not yet complete.
  7655  func (iter LiveEventListResultIterator) NotDone() bool {
  7656  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  7657  }
  7658  
  7659  // Response returns the raw server response from the last page request.
  7660  func (iter LiveEventListResultIterator) Response() LiveEventListResult {
  7661  	return iter.page.Response()
  7662  }
  7663  
  7664  // Value returns the current value or a zero-initialized value if the
  7665  // iterator has advanced beyond the end of the collection.
  7666  func (iter LiveEventListResultIterator) Value() LiveEvent {
  7667  	if !iter.page.NotDone() {
  7668  		return LiveEvent{}
  7669  	}
  7670  	return iter.page.Values()[iter.i]
  7671  }
  7672  
  7673  // Creates a new instance of the LiveEventListResultIterator type.
  7674  func NewLiveEventListResultIterator(page LiveEventListResultPage) LiveEventListResultIterator {
  7675  	return LiveEventListResultIterator{page: page}
  7676  }
  7677  
  7678  // IsEmpty returns true if the ListResult contains no values.
  7679  func (lelr LiveEventListResult) IsEmpty() bool {
  7680  	return lelr.Value == nil || len(*lelr.Value) == 0
  7681  }
  7682  
  7683  // hasNextLink returns true if the NextLink is not empty.
  7684  func (lelr LiveEventListResult) hasNextLink() bool {
  7685  	return lelr.OdataNextLink != nil && len(*lelr.OdataNextLink) != 0
  7686  }
  7687  
  7688  // liveEventListResultPreparer prepares a request to retrieve the next set of results.
  7689  // It returns nil if no more results exist.
  7690  func (lelr LiveEventListResult) liveEventListResultPreparer(ctx context.Context) (*http.Request, error) {
  7691  	if !lelr.hasNextLink() {
  7692  		return nil, nil
  7693  	}
  7694  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  7695  		autorest.AsJSON(),
  7696  		autorest.AsGet(),
  7697  		autorest.WithBaseURL(to.String(lelr.OdataNextLink)))
  7698  }
  7699  
  7700  // LiveEventListResultPage contains a page of LiveEvent values.
  7701  type LiveEventListResultPage struct {
  7702  	fn   func(context.Context, LiveEventListResult) (LiveEventListResult, error)
  7703  	lelr LiveEventListResult
  7704  }
  7705  
  7706  // NextWithContext advances to the next page of values.  If there was an error making
  7707  // the request the page does not advance and the error is returned.
  7708  func (page *LiveEventListResultPage) NextWithContext(ctx context.Context) (err error) {
  7709  	if tracing.IsEnabled() {
  7710  		ctx = tracing.StartSpan(ctx, fqdn+"/LiveEventListResultPage.NextWithContext")
  7711  		defer func() {
  7712  			sc := -1
  7713  			if page.Response().Response.Response != nil {
  7714  				sc = page.Response().Response.Response.StatusCode
  7715  			}
  7716  			tracing.EndSpan(ctx, sc, err)
  7717  		}()
  7718  	}
  7719  	for {
  7720  		next, err := page.fn(ctx, page.lelr)
  7721  		if err != nil {
  7722  			return err
  7723  		}
  7724  		page.lelr = next
  7725  		if !next.hasNextLink() || !next.IsEmpty() {
  7726  			break
  7727  		}
  7728  	}
  7729  	return nil
  7730  }
  7731  
  7732  // Next advances to the next page of values.  If there was an error making
  7733  // the request the page does not advance and the error is returned.
  7734  // Deprecated: Use NextWithContext() instead.
  7735  func (page *LiveEventListResultPage) Next() error {
  7736  	return page.NextWithContext(context.Background())
  7737  }
  7738  
  7739  // NotDone returns true if the page enumeration should be started or is not yet complete.
  7740  func (page LiveEventListResultPage) NotDone() bool {
  7741  	return !page.lelr.IsEmpty()
  7742  }
  7743  
  7744  // Response returns the raw server response from the last page request.
  7745  func (page LiveEventListResultPage) Response() LiveEventListResult {
  7746  	return page.lelr
  7747  }
  7748  
  7749  // Values returns the slice of values for the current page or nil if there are no values.
  7750  func (page LiveEventListResultPage) Values() []LiveEvent {
  7751  	if page.lelr.IsEmpty() {
  7752  		return nil
  7753  	}
  7754  	return *page.lelr.Value
  7755  }
  7756  
  7757  // Creates a new instance of the LiveEventListResultPage type.
  7758  func NewLiveEventListResultPage(cur LiveEventListResult, getNextPage func(context.Context, LiveEventListResult) (LiveEventListResult, error)) LiveEventListResultPage {
  7759  	return LiveEventListResultPage{
  7760  		fn:   getNextPage,
  7761  		lelr: cur,
  7762  	}
  7763  }
  7764  
  7765  // LiveEventOutputTranscriptionTrack describes a transcription track in the output of a live event,
  7766  // generated using speech-to-text transcription. This property is reserved for future use, any value set on
  7767  // this property will be ignored.
  7768  type LiveEventOutputTranscriptionTrack struct {
  7769  	// TrackName - The output track name. This property is reserved for future use, any value set on this property will be ignored.
  7770  	TrackName *string `json:"trackName,omitempty"`
  7771  }
  7772  
  7773  // LiveEventPreview live event preview settings.
  7774  type LiveEventPreview struct {
  7775  	// Endpoints - The endpoints for preview. Do not share the preview URL with the live event audience.
  7776  	Endpoints *[]LiveEventEndpoint `json:"endpoints,omitempty"`
  7777  	// AccessControl - The access control for live event preview.
  7778  	AccessControl *LiveEventPreviewAccessControl `json:"accessControl,omitempty"`
  7779  	// 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.
  7780  	PreviewLocator *string `json:"previewLocator,omitempty"`
  7781  	// StreamingPolicyName - The name of streaming policy used for the live event preview. This value is specified at creation time and cannot be updated.
  7782  	StreamingPolicyName *string `json:"streamingPolicyName,omitempty"`
  7783  	// 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.
  7784  	AlternativeMediaID *string `json:"alternativeMediaId,omitempty"`
  7785  }
  7786  
  7787  // LiveEventPreviewAccessControl the IP access control for the live event preview endpoint.
  7788  type LiveEventPreviewAccessControl struct {
  7789  	// IP - The IP access control properties.
  7790  	IP *IPAccessControl `json:"ip,omitempty"`
  7791  }
  7792  
  7793  // LiveEventProperties the live event properties.
  7794  type LiveEventProperties struct {
  7795  	// Description - A description for the live event.
  7796  	Description *string `json:"description,omitempty"`
  7797  	// Input - Live event input settings. It defines how the live event receives input from a contribution encoder.
  7798  	Input *LiveEventInput `json:"input,omitempty"`
  7799  	// Preview - Live event preview settings. Preview allows live event producers to preview the live streaming content without creating any live output.
  7800  	Preview *LiveEventPreview `json:"preview,omitempty"`
  7801  	// 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.
  7802  	Encoding *LiveEventEncoding `json:"encoding,omitempty"`
  7803  	// Transcriptions - Live transcription settings for the live event. See https://go.microsoft.com/fwlink/?linkid=2133742 for more information about the live transcription feature.
  7804  	Transcriptions *[]LiveEventTranscription `json:"transcriptions,omitempty"`
  7805  	// ProvisioningState - READ-ONLY; The provisioning state of the live event.
  7806  	ProvisioningState *string `json:"provisioningState,omitempty"`
  7807  	// 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'
  7808  	ResourceState LiveEventResourceState `json:"resourceState,omitempty"`
  7809  	// CrossSiteAccessPolicies - Live event cross site access policies.
  7810  	CrossSiteAccessPolicies *CrossSiteAccessPolicies `json:"crossSiteAccessPolicies,omitempty"`
  7811  	// 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
  7812  	UseStaticHostname *bool `json:"useStaticHostname,omitempty"`
  7813  	// 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.
  7814  	HostnamePrefix *string `json:"hostnamePrefix,omitempty"`
  7815  	// 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'.
  7816  	StreamOptions *[]StreamOptionsFlag `json:"streamOptions,omitempty"`
  7817  	// Created - READ-ONLY; The creation time for the live event
  7818  	Created *date.Time `json:"created,omitempty"`
  7819  	// LastModified - READ-ONLY; The last modified time of the live event.
  7820  	LastModified *date.Time `json:"lastModified,omitempty"`
  7821  }
  7822  
  7823  // MarshalJSON is the custom marshaler for LiveEventProperties.
  7824  func (lep LiveEventProperties) MarshalJSON() ([]byte, error) {
  7825  	objectMap := make(map[string]interface{})
  7826  	if lep.Description != nil {
  7827  		objectMap["description"] = lep.Description
  7828  	}
  7829  	if lep.Input != nil {
  7830  		objectMap["input"] = lep.Input
  7831  	}
  7832  	if lep.Preview != nil {
  7833  		objectMap["preview"] = lep.Preview
  7834  	}
  7835  	if lep.Encoding != nil {
  7836  		objectMap["encoding"] = lep.Encoding
  7837  	}
  7838  	if lep.Transcriptions != nil {
  7839  		objectMap["transcriptions"] = lep.Transcriptions
  7840  	}
  7841  	if lep.CrossSiteAccessPolicies != nil {
  7842  		objectMap["crossSiteAccessPolicies"] = lep.CrossSiteAccessPolicies
  7843  	}
  7844  	if lep.UseStaticHostname != nil {
  7845  		objectMap["useStaticHostname"] = lep.UseStaticHostname
  7846  	}
  7847  	if lep.HostnamePrefix != nil {
  7848  		objectMap["hostnamePrefix"] = lep.HostnamePrefix
  7849  	}
  7850  	if lep.StreamOptions != nil {
  7851  		objectMap["streamOptions"] = lep.StreamOptions
  7852  	}
  7853  	return json.Marshal(objectMap)
  7854  }
  7855  
  7856  // LiveEventsAllocateFuture an abstraction for monitoring and retrieving the results of a long-running
  7857  // operation.
  7858  type LiveEventsAllocateFuture struct {
  7859  	azure.FutureAPI
  7860  	// Result returns the result of the asynchronous operation.
  7861  	// If the operation has not completed it will return an error.
  7862  	Result func(LiveEventsClient) (autorest.Response, error)
  7863  }
  7864  
  7865  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7866  func (future *LiveEventsAllocateFuture) UnmarshalJSON(body []byte) error {
  7867  	var azFuture azure.Future
  7868  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7869  		return err
  7870  	}
  7871  	future.FutureAPI = &azFuture
  7872  	future.Result = future.result
  7873  	return nil
  7874  }
  7875  
  7876  // result is the default implementation for LiveEventsAllocateFuture.Result.
  7877  func (future *LiveEventsAllocateFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
  7878  	var done bool
  7879  	done, err = future.DoneWithContext(context.Background(), client)
  7880  	if err != nil {
  7881  		err = autorest.NewErrorWithError(err, "media.LiveEventsAllocateFuture", "Result", future.Response(), "Polling failure")
  7882  		return
  7883  	}
  7884  	if !done {
  7885  		ar.Response = future.Response()
  7886  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsAllocateFuture")
  7887  		return
  7888  	}
  7889  	ar.Response = future.Response()
  7890  	return
  7891  }
  7892  
  7893  // LiveEventsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
  7894  // operation.
  7895  type LiveEventsCreateFuture struct {
  7896  	azure.FutureAPI
  7897  	// Result returns the result of the asynchronous operation.
  7898  	// If the operation has not completed it will return an error.
  7899  	Result func(LiveEventsClient) (LiveEvent, error)
  7900  }
  7901  
  7902  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7903  func (future *LiveEventsCreateFuture) UnmarshalJSON(body []byte) error {
  7904  	var azFuture azure.Future
  7905  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7906  		return err
  7907  	}
  7908  	future.FutureAPI = &azFuture
  7909  	future.Result = future.result
  7910  	return nil
  7911  }
  7912  
  7913  // result is the default implementation for LiveEventsCreateFuture.Result.
  7914  func (future *LiveEventsCreateFuture) result(client LiveEventsClient) (le LiveEvent, err error) {
  7915  	var done bool
  7916  	done, err = future.DoneWithContext(context.Background(), client)
  7917  	if err != nil {
  7918  		err = autorest.NewErrorWithError(err, "media.LiveEventsCreateFuture", "Result", future.Response(), "Polling failure")
  7919  		return
  7920  	}
  7921  	if !done {
  7922  		le.Response.Response = future.Response()
  7923  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsCreateFuture")
  7924  		return
  7925  	}
  7926  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  7927  	if le.Response.Response, err = future.GetResult(sender); err == nil && le.Response.Response.StatusCode != http.StatusNoContent {
  7928  		le, err = client.CreateResponder(le.Response.Response)
  7929  		if err != nil {
  7930  			err = autorest.NewErrorWithError(err, "media.LiveEventsCreateFuture", "Result", le.Response.Response, "Failure responding to request")
  7931  		}
  7932  	}
  7933  	return
  7934  }
  7935  
  7936  // LiveEventsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  7937  // operation.
  7938  type LiveEventsDeleteFuture struct {
  7939  	azure.FutureAPI
  7940  	// Result returns the result of the asynchronous operation.
  7941  	// If the operation has not completed it will return an error.
  7942  	Result func(LiveEventsClient) (autorest.Response, error)
  7943  }
  7944  
  7945  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7946  func (future *LiveEventsDeleteFuture) UnmarshalJSON(body []byte) error {
  7947  	var azFuture azure.Future
  7948  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7949  		return err
  7950  	}
  7951  	future.FutureAPI = &azFuture
  7952  	future.Result = future.result
  7953  	return nil
  7954  }
  7955  
  7956  // result is the default implementation for LiveEventsDeleteFuture.Result.
  7957  func (future *LiveEventsDeleteFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
  7958  	var done bool
  7959  	done, err = future.DoneWithContext(context.Background(), client)
  7960  	if err != nil {
  7961  		err = autorest.NewErrorWithError(err, "media.LiveEventsDeleteFuture", "Result", future.Response(), "Polling failure")
  7962  		return
  7963  	}
  7964  	if !done {
  7965  		ar.Response = future.Response()
  7966  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsDeleteFuture")
  7967  		return
  7968  	}
  7969  	ar.Response = future.Response()
  7970  	return
  7971  }
  7972  
  7973  // LiveEventsResetFuture an abstraction for monitoring and retrieving the results of a long-running
  7974  // operation.
  7975  type LiveEventsResetFuture struct {
  7976  	azure.FutureAPI
  7977  	// Result returns the result of the asynchronous operation.
  7978  	// If the operation has not completed it will return an error.
  7979  	Result func(LiveEventsClient) (autorest.Response, error)
  7980  }
  7981  
  7982  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7983  func (future *LiveEventsResetFuture) UnmarshalJSON(body []byte) error {
  7984  	var azFuture azure.Future
  7985  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7986  		return err
  7987  	}
  7988  	future.FutureAPI = &azFuture
  7989  	future.Result = future.result
  7990  	return nil
  7991  }
  7992  
  7993  // result is the default implementation for LiveEventsResetFuture.Result.
  7994  func (future *LiveEventsResetFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
  7995  	var done bool
  7996  	done, err = future.DoneWithContext(context.Background(), client)
  7997  	if err != nil {
  7998  		err = autorest.NewErrorWithError(err, "media.LiveEventsResetFuture", "Result", future.Response(), "Polling failure")
  7999  		return
  8000  	}
  8001  	if !done {
  8002  		ar.Response = future.Response()
  8003  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsResetFuture")
  8004  		return
  8005  	}
  8006  	ar.Response = future.Response()
  8007  	return
  8008  }
  8009  
  8010  // LiveEventsStartFuture an abstraction for monitoring and retrieving the results of a long-running
  8011  // operation.
  8012  type LiveEventsStartFuture struct {
  8013  	azure.FutureAPI
  8014  	// Result returns the result of the asynchronous operation.
  8015  	// If the operation has not completed it will return an error.
  8016  	Result func(LiveEventsClient) (autorest.Response, error)
  8017  }
  8018  
  8019  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8020  func (future *LiveEventsStartFuture) UnmarshalJSON(body []byte) error {
  8021  	var azFuture azure.Future
  8022  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8023  		return err
  8024  	}
  8025  	future.FutureAPI = &azFuture
  8026  	future.Result = future.result
  8027  	return nil
  8028  }
  8029  
  8030  // result is the default implementation for LiveEventsStartFuture.Result.
  8031  func (future *LiveEventsStartFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
  8032  	var done bool
  8033  	done, err = future.DoneWithContext(context.Background(), client)
  8034  	if err != nil {
  8035  		err = autorest.NewErrorWithError(err, "media.LiveEventsStartFuture", "Result", future.Response(), "Polling failure")
  8036  		return
  8037  	}
  8038  	if !done {
  8039  		ar.Response = future.Response()
  8040  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsStartFuture")
  8041  		return
  8042  	}
  8043  	ar.Response = future.Response()
  8044  	return
  8045  }
  8046  
  8047  // LiveEventsStopFuture an abstraction for monitoring and retrieving the results of a long-running
  8048  // operation.
  8049  type LiveEventsStopFuture struct {
  8050  	azure.FutureAPI
  8051  	// Result returns the result of the asynchronous operation.
  8052  	// If the operation has not completed it will return an error.
  8053  	Result func(LiveEventsClient) (autorest.Response, error)
  8054  }
  8055  
  8056  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8057  func (future *LiveEventsStopFuture) UnmarshalJSON(body []byte) error {
  8058  	var azFuture azure.Future
  8059  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8060  		return err
  8061  	}
  8062  	future.FutureAPI = &azFuture
  8063  	future.Result = future.result
  8064  	return nil
  8065  }
  8066  
  8067  // result is the default implementation for LiveEventsStopFuture.Result.
  8068  func (future *LiveEventsStopFuture) result(client LiveEventsClient) (ar autorest.Response, err error) {
  8069  	var done bool
  8070  	done, err = future.DoneWithContext(context.Background(), client)
  8071  	if err != nil {
  8072  		err = autorest.NewErrorWithError(err, "media.LiveEventsStopFuture", "Result", future.Response(), "Polling failure")
  8073  		return
  8074  	}
  8075  	if !done {
  8076  		ar.Response = future.Response()
  8077  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsStopFuture")
  8078  		return
  8079  	}
  8080  	ar.Response = future.Response()
  8081  	return
  8082  }
  8083  
  8084  // LiveEventsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
  8085  // operation.
  8086  type LiveEventsUpdateFuture struct {
  8087  	azure.FutureAPI
  8088  	// Result returns the result of the asynchronous operation.
  8089  	// If the operation has not completed it will return an error.
  8090  	Result func(LiveEventsClient) (LiveEvent, error)
  8091  }
  8092  
  8093  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8094  func (future *LiveEventsUpdateFuture) UnmarshalJSON(body []byte) error {
  8095  	var azFuture azure.Future
  8096  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8097  		return err
  8098  	}
  8099  	future.FutureAPI = &azFuture
  8100  	future.Result = future.result
  8101  	return nil
  8102  }
  8103  
  8104  // result is the default implementation for LiveEventsUpdateFuture.Result.
  8105  func (future *LiveEventsUpdateFuture) result(client LiveEventsClient) (le LiveEvent, err error) {
  8106  	var done bool
  8107  	done, err = future.DoneWithContext(context.Background(), client)
  8108  	if err != nil {
  8109  		err = autorest.NewErrorWithError(err, "media.LiveEventsUpdateFuture", "Result", future.Response(), "Polling failure")
  8110  		return
  8111  	}
  8112  	if !done {
  8113  		le.Response.Response = future.Response()
  8114  		err = azure.NewAsyncOpIncompleteError("media.LiveEventsUpdateFuture")
  8115  		return
  8116  	}
  8117  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  8118  	if le.Response.Response, err = future.GetResult(sender); err == nil && le.Response.Response.StatusCode != http.StatusNoContent {
  8119  		le, err = client.UpdateResponder(le.Response.Response)
  8120  		if err != nil {
  8121  			err = autorest.NewErrorWithError(err, "media.LiveEventsUpdateFuture", "Result", le.Response.Response, "Failure responding to request")
  8122  		}
  8123  	}
  8124  	return
  8125  }
  8126  
  8127  // LiveEventTranscription describes the transcription tracks in the output of a live event, generated using
  8128  // speech-to-text transcription. This property is reserved for future use, any value set on this property
  8129  // will be ignored.
  8130  type LiveEventTranscription struct {
  8131  	// 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.
  8132  	Language *string `json:"language,omitempty"`
  8133  	// 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.
  8134  	InputTrackSelection *[]LiveEventInputTrackSelection `json:"inputTrackSelection,omitempty"`
  8135  	// 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.
  8136  	OutputTranscriptionTrack *LiveEventOutputTranscriptionTrack `json:"outputTranscriptionTrack,omitempty"`
  8137  }
  8138  
  8139  // LiveOutput the Live Output.
  8140  type LiveOutput struct {
  8141  	autorest.Response `json:"-"`
  8142  	// LiveOutputProperties - Live output properties.
  8143  	*LiveOutputProperties `json:"properties,omitempty"`
  8144  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  8145  	ID *string `json:"id,omitempty"`
  8146  	// Name - READ-ONLY; The name of the resource
  8147  	Name *string `json:"name,omitempty"`
  8148  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  8149  	Type *string `json:"type,omitempty"`
  8150  }
  8151  
  8152  // MarshalJSON is the custom marshaler for LiveOutput.
  8153  func (lo LiveOutput) MarshalJSON() ([]byte, error) {
  8154  	objectMap := make(map[string]interface{})
  8155  	if lo.LiveOutputProperties != nil {
  8156  		objectMap["properties"] = lo.LiveOutputProperties
  8157  	}
  8158  	return json.Marshal(objectMap)
  8159  }
  8160  
  8161  // UnmarshalJSON is the custom unmarshaler for LiveOutput struct.
  8162  func (lo *LiveOutput) UnmarshalJSON(body []byte) error {
  8163  	var m map[string]*json.RawMessage
  8164  	err := json.Unmarshal(body, &m)
  8165  	if err != nil {
  8166  		return err
  8167  	}
  8168  	for k, v := range m {
  8169  		switch k {
  8170  		case "properties":
  8171  			if v != nil {
  8172  				var liveOutputProperties LiveOutputProperties
  8173  				err = json.Unmarshal(*v, &liveOutputProperties)
  8174  				if err != nil {
  8175  					return err
  8176  				}
  8177  				lo.LiveOutputProperties = &liveOutputProperties
  8178  			}
  8179  		case "id":
  8180  			if v != nil {
  8181  				var ID string
  8182  				err = json.Unmarshal(*v, &ID)
  8183  				if err != nil {
  8184  					return err
  8185  				}
  8186  				lo.ID = &ID
  8187  			}
  8188  		case "name":
  8189  			if v != nil {
  8190  				var name string
  8191  				err = json.Unmarshal(*v, &name)
  8192  				if err != nil {
  8193  					return err
  8194  				}
  8195  				lo.Name = &name
  8196  			}
  8197  		case "type":
  8198  			if v != nil {
  8199  				var typeVar string
  8200  				err = json.Unmarshal(*v, &typeVar)
  8201  				if err != nil {
  8202  					return err
  8203  				}
  8204  				lo.Type = &typeVar
  8205  			}
  8206  		}
  8207  	}
  8208  
  8209  	return nil
  8210  }
  8211  
  8212  // LiveOutputListResult the LiveOutput list result.
  8213  type LiveOutputListResult struct {
  8214  	autorest.Response `json:"-"`
  8215  	// Value - The result of the List LiveOutput operation.
  8216  	Value *[]LiveOutput `json:"value,omitempty"`
  8217  	// OdataCount - The number of result.
  8218  	OdataCount *int32 `json:"@odata.count,omitempty"`
  8219  	// OdataNextLink - The link to the next set of results. Not empty if value contains incomplete list of live outputs.
  8220  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
  8221  }
  8222  
  8223  // LiveOutputListResultIterator provides access to a complete listing of LiveOutput values.
  8224  type LiveOutputListResultIterator struct {
  8225  	i    int
  8226  	page LiveOutputListResultPage
  8227  }
  8228  
  8229  // NextWithContext advances to the next value.  If there was an error making
  8230  // the request the iterator does not advance and the error is returned.
  8231  func (iter *LiveOutputListResultIterator) NextWithContext(ctx context.Context) (err error) {
  8232  	if tracing.IsEnabled() {
  8233  		ctx = tracing.StartSpan(ctx, fqdn+"/LiveOutputListResultIterator.NextWithContext")
  8234  		defer func() {
  8235  			sc := -1
  8236  			if iter.Response().Response.Response != nil {
  8237  				sc = iter.Response().Response.Response.StatusCode
  8238  			}
  8239  			tracing.EndSpan(ctx, sc, err)
  8240  		}()
  8241  	}
  8242  	iter.i++
  8243  	if iter.i < len(iter.page.Values()) {
  8244  		return nil
  8245  	}
  8246  	err = iter.page.NextWithContext(ctx)
  8247  	if err != nil {
  8248  		iter.i--
  8249  		return err
  8250  	}
  8251  	iter.i = 0
  8252  	return nil
  8253  }
  8254  
  8255  // Next advances to the next value.  If there was an error making
  8256  // the request the iterator does not advance and the error is returned.
  8257  // Deprecated: Use NextWithContext() instead.
  8258  func (iter *LiveOutputListResultIterator) Next() error {
  8259  	return iter.NextWithContext(context.Background())
  8260  }
  8261  
  8262  // NotDone returns true if the enumeration should be started or is not yet complete.
  8263  func (iter LiveOutputListResultIterator) NotDone() bool {
  8264  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  8265  }
  8266  
  8267  // Response returns the raw server response from the last page request.
  8268  func (iter LiveOutputListResultIterator) Response() LiveOutputListResult {
  8269  	return iter.page.Response()
  8270  }
  8271  
  8272  // Value returns the current value or a zero-initialized value if the
  8273  // iterator has advanced beyond the end of the collection.
  8274  func (iter LiveOutputListResultIterator) Value() LiveOutput {
  8275  	if !iter.page.NotDone() {
  8276  		return LiveOutput{}
  8277  	}
  8278  	return iter.page.Values()[iter.i]
  8279  }
  8280  
  8281  // Creates a new instance of the LiveOutputListResultIterator type.
  8282  func NewLiveOutputListResultIterator(page LiveOutputListResultPage) LiveOutputListResultIterator {
  8283  	return LiveOutputListResultIterator{page: page}
  8284  }
  8285  
  8286  // IsEmpty returns true if the ListResult contains no values.
  8287  func (lolr LiveOutputListResult) IsEmpty() bool {
  8288  	return lolr.Value == nil || len(*lolr.Value) == 0
  8289  }
  8290  
  8291  // hasNextLink returns true if the NextLink is not empty.
  8292  func (lolr LiveOutputListResult) hasNextLink() bool {
  8293  	return lolr.OdataNextLink != nil && len(*lolr.OdataNextLink) != 0
  8294  }
  8295  
  8296  // liveOutputListResultPreparer prepares a request to retrieve the next set of results.
  8297  // It returns nil if no more results exist.
  8298  func (lolr LiveOutputListResult) liveOutputListResultPreparer(ctx context.Context) (*http.Request, error) {
  8299  	if !lolr.hasNextLink() {
  8300  		return nil, nil
  8301  	}
  8302  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  8303  		autorest.AsJSON(),
  8304  		autorest.AsGet(),
  8305  		autorest.WithBaseURL(to.String(lolr.OdataNextLink)))
  8306  }
  8307  
  8308  // LiveOutputListResultPage contains a page of LiveOutput values.
  8309  type LiveOutputListResultPage struct {
  8310  	fn   func(context.Context, LiveOutputListResult) (LiveOutputListResult, error)
  8311  	lolr LiveOutputListResult
  8312  }
  8313  
  8314  // NextWithContext advances to the next page of values.  If there was an error making
  8315  // the request the page does not advance and the error is returned.
  8316  func (page *LiveOutputListResultPage) NextWithContext(ctx context.Context) (err error) {
  8317  	if tracing.IsEnabled() {
  8318  		ctx = tracing.StartSpan(ctx, fqdn+"/LiveOutputListResultPage.NextWithContext")
  8319  		defer func() {
  8320  			sc := -1
  8321  			if page.Response().Response.Response != nil {
  8322  				sc = page.Response().Response.Response.StatusCode
  8323  			}
  8324  			tracing.EndSpan(ctx, sc, err)
  8325  		}()
  8326  	}
  8327  	for {
  8328  		next, err := page.fn(ctx, page.lolr)
  8329  		if err != nil {
  8330  			return err
  8331  		}
  8332  		page.lolr = next
  8333  		if !next.hasNextLink() || !next.IsEmpty() {
  8334  			break
  8335  		}
  8336  	}
  8337  	return nil
  8338  }
  8339  
  8340  // Next advances to the next page of values.  If there was an error making
  8341  // the request the page does not advance and the error is returned.
  8342  // Deprecated: Use NextWithContext() instead.
  8343  func (page *LiveOutputListResultPage) Next() error {
  8344  	return page.NextWithContext(context.Background())
  8345  }
  8346  
  8347  // NotDone returns true if the page enumeration should be started or is not yet complete.
  8348  func (page LiveOutputListResultPage) NotDone() bool {
  8349  	return !page.lolr.IsEmpty()
  8350  }
  8351  
  8352  // Response returns the raw server response from the last page request.
  8353  func (page LiveOutputListResultPage) Response() LiveOutputListResult {
  8354  	return page.lolr
  8355  }
  8356  
  8357  // Values returns the slice of values for the current page or nil if there are no values.
  8358  func (page LiveOutputListResultPage) Values() []LiveOutput {
  8359  	if page.lolr.IsEmpty() {
  8360  		return nil
  8361  	}
  8362  	return *page.lolr.Value
  8363  }
  8364  
  8365  // Creates a new instance of the LiveOutputListResultPage type.
  8366  func NewLiveOutputListResultPage(cur LiveOutputListResult, getNextPage func(context.Context, LiveOutputListResult) (LiveOutputListResult, error)) LiveOutputListResultPage {
  8367  	return LiveOutputListResultPage{
  8368  		fn:   getNextPage,
  8369  		lolr: cur,
  8370  	}
  8371  }
  8372  
  8373  // LiveOutputProperties the JSON object that contains the properties required to create a live output.
  8374  type LiveOutputProperties struct {
  8375  	// Description - The description of the live output.
  8376  	Description *string `json:"description,omitempty"`
  8377  	// AssetName - The asset that the live output will write to.
  8378  	AssetName *string `json:"assetName,omitempty"`
  8379  	// 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.
  8380  	ArchiveWindowLength *string `json:"archiveWindowLength,omitempty"`
  8381  	// ManifestName - The manifest file name. If not provided, the service will generate one automatically.
  8382  	ManifestName *string `json:"manifestName,omitempty"`
  8383  	// Hls - HTTP Live Streaming (HLS) packing setting for the live output.
  8384  	Hls *Hls `json:"hls,omitempty"`
  8385  	// OutputSnapTime - The initial timestamp that the live output will start at, any content before this value will not be archived.
  8386  	OutputSnapTime *int64 `json:"outputSnapTime,omitempty"`
  8387  	// Created - READ-ONLY; The creation time the live output.
  8388  	Created *date.Time `json:"created,omitempty"`
  8389  	// LastModified - READ-ONLY; The time the live output was last modified.
  8390  	LastModified *date.Time `json:"lastModified,omitempty"`
  8391  	// ProvisioningState - READ-ONLY; The provisioning state of the live output.
  8392  	ProvisioningState *string `json:"provisioningState,omitempty"`
  8393  	// ResourceState - READ-ONLY; The resource state of the live output. Possible values include: 'LiveOutputResourceStateCreating', 'LiveOutputResourceStateRunning', 'LiveOutputResourceStateDeleting'
  8394  	ResourceState LiveOutputResourceState `json:"resourceState,omitempty"`
  8395  }
  8396  
  8397  // MarshalJSON is the custom marshaler for LiveOutputProperties.
  8398  func (lop LiveOutputProperties) MarshalJSON() ([]byte, error) {
  8399  	objectMap := make(map[string]interface{})
  8400  	if lop.Description != nil {
  8401  		objectMap["description"] = lop.Description
  8402  	}
  8403  	if lop.AssetName != nil {
  8404  		objectMap["assetName"] = lop.AssetName
  8405  	}
  8406  	if lop.ArchiveWindowLength != nil {
  8407  		objectMap["archiveWindowLength"] = lop.ArchiveWindowLength
  8408  	}
  8409  	if lop.ManifestName != nil {
  8410  		objectMap["manifestName"] = lop.ManifestName
  8411  	}
  8412  	if lop.Hls != nil {
  8413  		objectMap["hls"] = lop.Hls
  8414  	}
  8415  	if lop.OutputSnapTime != nil {
  8416  		objectMap["outputSnapTime"] = lop.OutputSnapTime
  8417  	}
  8418  	return json.Marshal(objectMap)
  8419  }
  8420  
  8421  // LiveOutputsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
  8422  // operation.
  8423  type LiveOutputsCreateFuture struct {
  8424  	azure.FutureAPI
  8425  	// Result returns the result of the asynchronous operation.
  8426  	// If the operation has not completed it will return an error.
  8427  	Result func(LiveOutputsClient) (LiveOutput, error)
  8428  }
  8429  
  8430  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8431  func (future *LiveOutputsCreateFuture) UnmarshalJSON(body []byte) error {
  8432  	var azFuture azure.Future
  8433  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8434  		return err
  8435  	}
  8436  	future.FutureAPI = &azFuture
  8437  	future.Result = future.result
  8438  	return nil
  8439  }
  8440  
  8441  // result is the default implementation for LiveOutputsCreateFuture.Result.
  8442  func (future *LiveOutputsCreateFuture) result(client LiveOutputsClient) (lo LiveOutput, err error) {
  8443  	var done bool
  8444  	done, err = future.DoneWithContext(context.Background(), client)
  8445  	if err != nil {
  8446  		err = autorest.NewErrorWithError(err, "media.LiveOutputsCreateFuture", "Result", future.Response(), "Polling failure")
  8447  		return
  8448  	}
  8449  	if !done {
  8450  		lo.Response.Response = future.Response()
  8451  		err = azure.NewAsyncOpIncompleteError("media.LiveOutputsCreateFuture")
  8452  		return
  8453  	}
  8454  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  8455  	if lo.Response.Response, err = future.GetResult(sender); err == nil && lo.Response.Response.StatusCode != http.StatusNoContent {
  8456  		lo, err = client.CreateResponder(lo.Response.Response)
  8457  		if err != nil {
  8458  			err = autorest.NewErrorWithError(err, "media.LiveOutputsCreateFuture", "Result", lo.Response.Response, "Failure responding to request")
  8459  		}
  8460  	}
  8461  	return
  8462  }
  8463  
  8464  // LiveOutputsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  8465  // operation.
  8466  type LiveOutputsDeleteFuture struct {
  8467  	azure.FutureAPI
  8468  	// Result returns the result of the asynchronous operation.
  8469  	// If the operation has not completed it will return an error.
  8470  	Result func(LiveOutputsClient) (autorest.Response, error)
  8471  }
  8472  
  8473  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8474  func (future *LiveOutputsDeleteFuture) UnmarshalJSON(body []byte) error {
  8475  	var azFuture azure.Future
  8476  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8477  		return err
  8478  	}
  8479  	future.FutureAPI = &azFuture
  8480  	future.Result = future.result
  8481  	return nil
  8482  }
  8483  
  8484  // result is the default implementation for LiveOutputsDeleteFuture.Result.
  8485  func (future *LiveOutputsDeleteFuture) result(client LiveOutputsClient) (ar autorest.Response, err error) {
  8486  	var done bool
  8487  	done, err = future.DoneWithContext(context.Background(), client)
  8488  	if err != nil {
  8489  		err = autorest.NewErrorWithError(err, "media.LiveOutputsDeleteFuture", "Result", future.Response(), "Polling failure")
  8490  		return
  8491  	}
  8492  	if !done {
  8493  		ar.Response = future.Response()
  8494  		err = azure.NewAsyncOpIncompleteError("media.LiveOutputsDeleteFuture")
  8495  		return
  8496  	}
  8497  	ar.Response = future.Response()
  8498  	return
  8499  }
  8500  
  8501  // Location ...
  8502  type Location struct {
  8503  	Name *string `json:"name,omitempty"`
  8504  }
  8505  
  8506  // LogSpecification a diagnostic log emitted by service.
  8507  type LogSpecification struct {
  8508  	// Name - READ-ONLY; The diagnostic log category name.
  8509  	Name *string `json:"name,omitempty"`
  8510  	// DisplayName - READ-ONLY; The diagnostic log category display name.
  8511  	DisplayName *string `json:"displayName,omitempty"`
  8512  	// BlobDuration - READ-ONLY; The time range for requests in each blob.
  8513  	BlobDuration *string `json:"blobDuration,omitempty"`
  8514  }
  8515  
  8516  // MarshalJSON is the custom marshaler for LogSpecification.
  8517  func (ls LogSpecification) MarshalJSON() ([]byte, error) {
  8518  	objectMap := make(map[string]interface{})
  8519  	return json.Marshal(objectMap)
  8520  }
  8521  
  8522  // MetricDimension a metric dimension.
  8523  type MetricDimension struct {
  8524  	// Name - READ-ONLY; The metric dimension name.
  8525  	Name *string `json:"name,omitempty"`
  8526  	// DisplayName - READ-ONLY; The display name for the dimension.
  8527  	DisplayName *string `json:"displayName,omitempty"`
  8528  	// ToBeExportedForShoebox - READ-ONLY; Whether to export metric to shoebox.
  8529  	ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"`
  8530  }
  8531  
  8532  // MarshalJSON is the custom marshaler for MetricDimension.
  8533  func (md MetricDimension) MarshalJSON() ([]byte, error) {
  8534  	objectMap := make(map[string]interface{})
  8535  	return json.Marshal(objectMap)
  8536  }
  8537  
  8538  // MetricSpecification a metric emitted by service.
  8539  type MetricSpecification struct {
  8540  	// Name - READ-ONLY; The metric name.
  8541  	Name *string `json:"name,omitempty"`
  8542  	// DisplayName - READ-ONLY; The metric display name.
  8543  	DisplayName *string `json:"displayName,omitempty"`
  8544  	// DisplayDescription - READ-ONLY; The metric display description.
  8545  	DisplayDescription *string `json:"displayDescription,omitempty"`
  8546  	// Unit - READ-ONLY; The metric unit. Possible values include: 'MetricUnitBytes', 'MetricUnitCount', 'MetricUnitMilliseconds'
  8547  	Unit MetricUnit `json:"unit,omitempty"`
  8548  	// AggregationType - READ-ONLY; The metric aggregation type. Possible values include: 'MetricAggregationTypeAverage', 'MetricAggregationTypeCount', 'MetricAggregationTypeTotal'
  8549  	AggregationType MetricAggregationType `json:"aggregationType,omitempty"`
  8550  	// LockAggregationType - READ-ONLY; The metric lock aggregation type. Possible values include: 'MetricAggregationTypeAverage', 'MetricAggregationTypeCount', 'MetricAggregationTypeTotal'
  8551  	LockAggregationType MetricAggregationType `json:"lockAggregationType,omitempty"`
  8552  	// SupportedAggregationTypes - Supported aggregation types.
  8553  	SupportedAggregationTypes *[]string `json:"supportedAggregationTypes,omitempty"`
  8554  	// Dimensions - READ-ONLY; The metric dimensions.
  8555  	Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
  8556  	// EnableRegionalMdmAccount - READ-ONLY; Indicates whether regional MDM account is enabled.
  8557  	EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"`
  8558  	// SourceMdmAccount - READ-ONLY; The source MDM account.
  8559  	SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"`
  8560  	// SourceMdmNamespace - READ-ONLY; The source MDM namespace.
  8561  	SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"`
  8562  	// SupportedTimeGrainTypes - READ-ONLY; The supported time grain types.
  8563  	SupportedTimeGrainTypes *[]string `json:"supportedTimeGrainTypes,omitempty"`
  8564  }
  8565  
  8566  // MarshalJSON is the custom marshaler for MetricSpecification.
  8567  func (ms MetricSpecification) MarshalJSON() ([]byte, error) {
  8568  	objectMap := make(map[string]interface{})
  8569  	if ms.SupportedAggregationTypes != nil {
  8570  		objectMap["supportedAggregationTypes"] = ms.SupportedAggregationTypes
  8571  	}
  8572  	return json.Marshal(objectMap)
  8573  }
  8574  
  8575  // Mp4Format describes the properties for an output ISO MP4 file.
  8576  type Mp4Format struct {
  8577  	// 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 .
  8578  	OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
  8579  	// 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.
  8580  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  8581  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  8582  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  8583  }
  8584  
  8585  // MarshalJSON is the custom marshaler for Mp4Format.
  8586  func (m4f Mp4Format) MarshalJSON() ([]byte, error) {
  8587  	m4f.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format
  8588  	objectMap := make(map[string]interface{})
  8589  	if m4f.OutputFiles != nil {
  8590  		objectMap["outputFiles"] = m4f.OutputFiles
  8591  	}
  8592  	if m4f.FilenamePattern != nil {
  8593  		objectMap["filenamePattern"] = m4f.FilenamePattern
  8594  	}
  8595  	if m4f.OdataType != "" {
  8596  		objectMap["@odata.type"] = m4f.OdataType
  8597  	}
  8598  	return json.Marshal(objectMap)
  8599  }
  8600  
  8601  // AsImageFormat is the BasicFormat implementation for Mp4Format.
  8602  func (m4f Mp4Format) AsImageFormat() (*ImageFormat, bool) {
  8603  	return nil, false
  8604  }
  8605  
  8606  // AsBasicImageFormat is the BasicFormat implementation for Mp4Format.
  8607  func (m4f Mp4Format) AsBasicImageFormat() (BasicImageFormat, bool) {
  8608  	return nil, false
  8609  }
  8610  
  8611  // AsJpgFormat is the BasicFormat implementation for Mp4Format.
  8612  func (m4f Mp4Format) AsJpgFormat() (*JpgFormat, bool) {
  8613  	return nil, false
  8614  }
  8615  
  8616  // AsPngFormat is the BasicFormat implementation for Mp4Format.
  8617  func (m4f Mp4Format) AsPngFormat() (*PngFormat, bool) {
  8618  	return nil, false
  8619  }
  8620  
  8621  // AsMultiBitrateFormat is the BasicFormat implementation for Mp4Format.
  8622  func (m4f Mp4Format) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  8623  	return nil, false
  8624  }
  8625  
  8626  // AsBasicMultiBitrateFormat is the BasicFormat implementation for Mp4Format.
  8627  func (m4f Mp4Format) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  8628  	return &m4f, true
  8629  }
  8630  
  8631  // AsMp4Format is the BasicFormat implementation for Mp4Format.
  8632  func (m4f Mp4Format) AsMp4Format() (*Mp4Format, bool) {
  8633  	return &m4f, true
  8634  }
  8635  
  8636  // AsTransportStreamFormat is the BasicFormat implementation for Mp4Format.
  8637  func (m4f Mp4Format) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  8638  	return nil, false
  8639  }
  8640  
  8641  // AsFormat is the BasicFormat implementation for Mp4Format.
  8642  func (m4f Mp4Format) AsFormat() (*Format, bool) {
  8643  	return nil, false
  8644  }
  8645  
  8646  // AsBasicFormat is the BasicFormat implementation for Mp4Format.
  8647  func (m4f Mp4Format) AsBasicFormat() (BasicFormat, bool) {
  8648  	return &m4f, true
  8649  }
  8650  
  8651  // BasicMultiBitrateFormat describes the properties for producing a collection of GOP aligned multi-bitrate files. The
  8652  // default behavior is to produce one output file for each video layer which is muxed together with all the audios. The
  8653  // exact output files produced can be controlled by specifying the outputFiles collection.
  8654  type BasicMultiBitrateFormat interface {
  8655  	AsMp4Format() (*Mp4Format, bool)
  8656  	AsTransportStreamFormat() (*TransportStreamFormat, bool)
  8657  	AsMultiBitrateFormat() (*MultiBitrateFormat, bool)
  8658  }
  8659  
  8660  // MultiBitrateFormat describes the properties for producing a collection of GOP aligned multi-bitrate files.
  8661  // The default behavior is to produce one output file for each video layer which is muxed together with all the
  8662  // audios. The exact output files produced can be controlled by specifying the outputFiles collection.
  8663  type MultiBitrateFormat struct {
  8664  	// 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 .
  8665  	OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
  8666  	// 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.
  8667  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  8668  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  8669  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  8670  }
  8671  
  8672  func unmarshalBasicMultiBitrateFormat(body []byte) (BasicMultiBitrateFormat, error) {
  8673  	var m map[string]interface{}
  8674  	err := json.Unmarshal(body, &m)
  8675  	if err != nil {
  8676  		return nil, err
  8677  	}
  8678  
  8679  	switch m["@odata.type"] {
  8680  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format):
  8681  		var m4f Mp4Format
  8682  		err := json.Unmarshal(body, &m4f)
  8683  		return m4f, err
  8684  	case string(OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat):
  8685  		var tsf TransportStreamFormat
  8686  		err := json.Unmarshal(body, &tsf)
  8687  		return tsf, err
  8688  	default:
  8689  		var mbf MultiBitrateFormat
  8690  		err := json.Unmarshal(body, &mbf)
  8691  		return mbf, err
  8692  	}
  8693  }
  8694  func unmarshalBasicMultiBitrateFormatArray(body []byte) ([]BasicMultiBitrateFormat, error) {
  8695  	var rawMessages []*json.RawMessage
  8696  	err := json.Unmarshal(body, &rawMessages)
  8697  	if err != nil {
  8698  		return nil, err
  8699  	}
  8700  
  8701  	mbfArray := make([]BasicMultiBitrateFormat, len(rawMessages))
  8702  
  8703  	for index, rawMessage := range rawMessages {
  8704  		mbf, err := unmarshalBasicMultiBitrateFormat(*rawMessage)
  8705  		if err != nil {
  8706  			return nil, err
  8707  		}
  8708  		mbfArray[index] = mbf
  8709  	}
  8710  	return mbfArray, nil
  8711  }
  8712  
  8713  // MarshalJSON is the custom marshaler for MultiBitrateFormat.
  8714  func (mbf MultiBitrateFormat) MarshalJSON() ([]byte, error) {
  8715  	mbf.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat
  8716  	objectMap := make(map[string]interface{})
  8717  	if mbf.OutputFiles != nil {
  8718  		objectMap["outputFiles"] = mbf.OutputFiles
  8719  	}
  8720  	if mbf.FilenamePattern != nil {
  8721  		objectMap["filenamePattern"] = mbf.FilenamePattern
  8722  	}
  8723  	if mbf.OdataType != "" {
  8724  		objectMap["@odata.type"] = mbf.OdataType
  8725  	}
  8726  	return json.Marshal(objectMap)
  8727  }
  8728  
  8729  // AsImageFormat is the BasicFormat implementation for MultiBitrateFormat.
  8730  func (mbf MultiBitrateFormat) AsImageFormat() (*ImageFormat, bool) {
  8731  	return nil, false
  8732  }
  8733  
  8734  // AsBasicImageFormat is the BasicFormat implementation for MultiBitrateFormat.
  8735  func (mbf MultiBitrateFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
  8736  	return nil, false
  8737  }
  8738  
  8739  // AsJpgFormat is the BasicFormat implementation for MultiBitrateFormat.
  8740  func (mbf MultiBitrateFormat) AsJpgFormat() (*JpgFormat, bool) {
  8741  	return nil, false
  8742  }
  8743  
  8744  // AsPngFormat is the BasicFormat implementation for MultiBitrateFormat.
  8745  func (mbf MultiBitrateFormat) AsPngFormat() (*PngFormat, bool) {
  8746  	return nil, false
  8747  }
  8748  
  8749  // AsMultiBitrateFormat is the BasicFormat implementation for MultiBitrateFormat.
  8750  func (mbf MultiBitrateFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  8751  	return &mbf, true
  8752  }
  8753  
  8754  // AsBasicMultiBitrateFormat is the BasicFormat implementation for MultiBitrateFormat.
  8755  func (mbf MultiBitrateFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  8756  	return &mbf, true
  8757  }
  8758  
  8759  // AsMp4Format is the BasicFormat implementation for MultiBitrateFormat.
  8760  func (mbf MultiBitrateFormat) AsMp4Format() (*Mp4Format, bool) {
  8761  	return nil, false
  8762  }
  8763  
  8764  // AsTransportStreamFormat is the BasicFormat implementation for MultiBitrateFormat.
  8765  func (mbf MultiBitrateFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  8766  	return nil, false
  8767  }
  8768  
  8769  // AsFormat is the BasicFormat implementation for MultiBitrateFormat.
  8770  func (mbf MultiBitrateFormat) AsFormat() (*Format, bool) {
  8771  	return nil, false
  8772  }
  8773  
  8774  // AsBasicFormat is the BasicFormat implementation for MultiBitrateFormat.
  8775  func (mbf MultiBitrateFormat) AsBasicFormat() (BasicFormat, bool) {
  8776  	return &mbf, true
  8777  }
  8778  
  8779  // NoEncryption class for NoEncryption scheme
  8780  type NoEncryption struct {
  8781  	// EnabledProtocols - Representing supported protocols
  8782  	EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"`
  8783  }
  8784  
  8785  // ODataError information about an error.
  8786  type ODataError struct {
  8787  	// Code - A language-independent error name.
  8788  	Code *string `json:"code,omitempty"`
  8789  	// Message - The error message.
  8790  	Message *string `json:"message,omitempty"`
  8791  	// Target - The target of the error (for example, the name of the property in error).
  8792  	Target *string `json:"target,omitempty"`
  8793  	// Details - The error details.
  8794  	Details *[]ODataError `json:"details,omitempty"`
  8795  }
  8796  
  8797  // Operation an operation.
  8798  type Operation struct {
  8799  	// Name - The operation name.
  8800  	Name *string `json:"name,omitempty"`
  8801  	// Display - The operation display name.
  8802  	Display *OperationDisplay `json:"display,omitempty"`
  8803  	// Origin - Origin of the operation.
  8804  	Origin *string `json:"origin,omitempty"`
  8805  	// Properties - Operation properties format.
  8806  	Properties *Properties `json:"properties,omitempty"`
  8807  	// IsDataAction - Whether the operation applies to data-plane.
  8808  	IsDataAction *bool `json:"isDataAction,omitempty"`
  8809  	// ActionType - Indicates the action type. Possible values include: 'ActionTypeInternal'
  8810  	ActionType ActionType `json:"actionType,omitempty"`
  8811  }
  8812  
  8813  // OperationCollection a collection of Operation items.
  8814  type OperationCollection struct {
  8815  	autorest.Response `json:"-"`
  8816  	// Value - A collection of Operation items.
  8817  	Value *[]Operation `json:"value,omitempty"`
  8818  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
  8819  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
  8820  }
  8821  
  8822  // OperationCollectionIterator provides access to a complete listing of Operation values.
  8823  type OperationCollectionIterator struct {
  8824  	i    int
  8825  	page OperationCollectionPage
  8826  }
  8827  
  8828  // NextWithContext advances to the next value.  If there was an error making
  8829  // the request the iterator does not advance and the error is returned.
  8830  func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) {
  8831  	if tracing.IsEnabled() {
  8832  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext")
  8833  		defer func() {
  8834  			sc := -1
  8835  			if iter.Response().Response.Response != nil {
  8836  				sc = iter.Response().Response.Response.StatusCode
  8837  			}
  8838  			tracing.EndSpan(ctx, sc, err)
  8839  		}()
  8840  	}
  8841  	iter.i++
  8842  	if iter.i < len(iter.page.Values()) {
  8843  		return nil
  8844  	}
  8845  	err = iter.page.NextWithContext(ctx)
  8846  	if err != nil {
  8847  		iter.i--
  8848  		return err
  8849  	}
  8850  	iter.i = 0
  8851  	return nil
  8852  }
  8853  
  8854  // Next advances to the next value.  If there was an error making
  8855  // the request the iterator does not advance and the error is returned.
  8856  // Deprecated: Use NextWithContext() instead.
  8857  func (iter *OperationCollectionIterator) Next() error {
  8858  	return iter.NextWithContext(context.Background())
  8859  }
  8860  
  8861  // NotDone returns true if the enumeration should be started or is not yet complete.
  8862  func (iter OperationCollectionIterator) NotDone() bool {
  8863  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  8864  }
  8865  
  8866  // Response returns the raw server response from the last page request.
  8867  func (iter OperationCollectionIterator) Response() OperationCollection {
  8868  	return iter.page.Response()
  8869  }
  8870  
  8871  // Value returns the current value or a zero-initialized value if the
  8872  // iterator has advanced beyond the end of the collection.
  8873  func (iter OperationCollectionIterator) Value() Operation {
  8874  	if !iter.page.NotDone() {
  8875  		return Operation{}
  8876  	}
  8877  	return iter.page.Values()[iter.i]
  8878  }
  8879  
  8880  // Creates a new instance of the OperationCollectionIterator type.
  8881  func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator {
  8882  	return OperationCollectionIterator{page: page}
  8883  }
  8884  
  8885  // IsEmpty returns true if the ListResult contains no values.
  8886  func (oc OperationCollection) IsEmpty() bool {
  8887  	return oc.Value == nil || len(*oc.Value) == 0
  8888  }
  8889  
  8890  // hasNextLink returns true if the NextLink is not empty.
  8891  func (oc OperationCollection) hasNextLink() bool {
  8892  	return oc.OdataNextLink != nil && len(*oc.OdataNextLink) != 0
  8893  }
  8894  
  8895  // operationCollectionPreparer prepares a request to retrieve the next set of results.
  8896  // It returns nil if no more results exist.
  8897  func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) {
  8898  	if !oc.hasNextLink() {
  8899  		return nil, nil
  8900  	}
  8901  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  8902  		autorest.AsJSON(),
  8903  		autorest.AsGet(),
  8904  		autorest.WithBaseURL(to.String(oc.OdataNextLink)))
  8905  }
  8906  
  8907  // OperationCollectionPage contains a page of Operation values.
  8908  type OperationCollectionPage struct {
  8909  	fn func(context.Context, OperationCollection) (OperationCollection, error)
  8910  	oc OperationCollection
  8911  }
  8912  
  8913  // NextWithContext advances to the next page of values.  If there was an error making
  8914  // the request the page does not advance and the error is returned.
  8915  func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) {
  8916  	if tracing.IsEnabled() {
  8917  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext")
  8918  		defer func() {
  8919  			sc := -1
  8920  			if page.Response().Response.Response != nil {
  8921  				sc = page.Response().Response.Response.StatusCode
  8922  			}
  8923  			tracing.EndSpan(ctx, sc, err)
  8924  		}()
  8925  	}
  8926  	for {
  8927  		next, err := page.fn(ctx, page.oc)
  8928  		if err != nil {
  8929  			return err
  8930  		}
  8931  		page.oc = next
  8932  		if !next.hasNextLink() || !next.IsEmpty() {
  8933  			break
  8934  		}
  8935  	}
  8936  	return nil
  8937  }
  8938  
  8939  // Next advances to the next page of values.  If there was an error making
  8940  // the request the page does not advance and the error is returned.
  8941  // Deprecated: Use NextWithContext() instead.
  8942  func (page *OperationCollectionPage) Next() error {
  8943  	return page.NextWithContext(context.Background())
  8944  }
  8945  
  8946  // NotDone returns true if the page enumeration should be started or is not yet complete.
  8947  func (page OperationCollectionPage) NotDone() bool {
  8948  	return !page.oc.IsEmpty()
  8949  }
  8950  
  8951  // Response returns the raw server response from the last page request.
  8952  func (page OperationCollectionPage) Response() OperationCollection {
  8953  	return page.oc
  8954  }
  8955  
  8956  // Values returns the slice of values for the current page or nil if there are no values.
  8957  func (page OperationCollectionPage) Values() []Operation {
  8958  	if page.oc.IsEmpty() {
  8959  		return nil
  8960  	}
  8961  	return *page.oc.Value
  8962  }
  8963  
  8964  // Creates a new instance of the OperationCollectionPage type.
  8965  func NewOperationCollectionPage(cur OperationCollection, getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage {
  8966  	return OperationCollectionPage{
  8967  		fn: getNextPage,
  8968  		oc: cur,
  8969  	}
  8970  }
  8971  
  8972  // OperationDisplay operation details.
  8973  type OperationDisplay struct {
  8974  	// Provider - The service provider.
  8975  	Provider *string `json:"provider,omitempty"`
  8976  	// Resource - Resource on which the operation is performed.
  8977  	Resource *string `json:"resource,omitempty"`
  8978  	// Operation - The operation type.
  8979  	Operation *string `json:"operation,omitempty"`
  8980  	// Description - The operation description.
  8981  	Description *string `json:"description,omitempty"`
  8982  }
  8983  
  8984  // OutputFile represents an output file produced.
  8985  type OutputFile struct {
  8986  	// 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.
  8987  	Labels *[]string `json:"labels,omitempty"`
  8988  }
  8989  
  8990  // BasicOverlay base type for all overlays - image, audio or video.
  8991  type BasicOverlay interface {
  8992  	AsAudioOverlay() (*AudioOverlay, bool)
  8993  	AsVideoOverlay() (*VideoOverlay, bool)
  8994  	AsOverlay() (*Overlay, bool)
  8995  }
  8996  
  8997  // Overlay base type for all overlays - image, audio or video.
  8998  type Overlay struct {
  8999  	// 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.
  9000  	InputLabel *string `json:"inputLabel,omitempty"`
  9001  	// 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.
  9002  	Start *string `json:"start,omitempty"`
  9003  	// 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.
  9004  	End *string `json:"end,omitempty"`
  9005  	// 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).
  9006  	FadeInDuration *string `json:"fadeInDuration,omitempty"`
  9007  	// 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).
  9008  	FadeOutDuration *string `json:"fadeOutDuration,omitempty"`
  9009  	// AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0.
  9010  	AudioGainLevel *float64 `json:"audioGainLevel,omitempty"`
  9011  	// OdataType - Possible values include: 'OdataTypeBasicOverlayOdataTypeOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaVideoOverlay'
  9012  	OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"`
  9013  }
  9014  
  9015  func unmarshalBasicOverlay(body []byte) (BasicOverlay, error) {
  9016  	var m map[string]interface{}
  9017  	err := json.Unmarshal(body, &m)
  9018  	if err != nil {
  9019  		return nil, err
  9020  	}
  9021  
  9022  	switch m["@odata.type"] {
  9023  	case string(OdataTypeBasicOverlayOdataTypeMicrosoftMediaAudioOverlay):
  9024  		var ao AudioOverlay
  9025  		err := json.Unmarshal(body, &ao)
  9026  		return ao, err
  9027  	case string(OdataTypeBasicOverlayOdataTypeMicrosoftMediaVideoOverlay):
  9028  		var vo VideoOverlay
  9029  		err := json.Unmarshal(body, &vo)
  9030  		return vo, err
  9031  	default:
  9032  		var o Overlay
  9033  		err := json.Unmarshal(body, &o)
  9034  		return o, err
  9035  	}
  9036  }
  9037  func unmarshalBasicOverlayArray(body []byte) ([]BasicOverlay, error) {
  9038  	var rawMessages []*json.RawMessage
  9039  	err := json.Unmarshal(body, &rawMessages)
  9040  	if err != nil {
  9041  		return nil, err
  9042  	}
  9043  
  9044  	oArray := make([]BasicOverlay, len(rawMessages))
  9045  
  9046  	for index, rawMessage := range rawMessages {
  9047  		o, err := unmarshalBasicOverlay(*rawMessage)
  9048  		if err != nil {
  9049  			return nil, err
  9050  		}
  9051  		oArray[index] = o
  9052  	}
  9053  	return oArray, nil
  9054  }
  9055  
  9056  // MarshalJSON is the custom marshaler for Overlay.
  9057  func (o Overlay) MarshalJSON() ([]byte, error) {
  9058  	o.OdataType = OdataTypeBasicOverlayOdataTypeOverlay
  9059  	objectMap := make(map[string]interface{})
  9060  	if o.InputLabel != nil {
  9061  		objectMap["inputLabel"] = o.InputLabel
  9062  	}
  9063  	if o.Start != nil {
  9064  		objectMap["start"] = o.Start
  9065  	}
  9066  	if o.End != nil {
  9067  		objectMap["end"] = o.End
  9068  	}
  9069  	if o.FadeInDuration != nil {
  9070  		objectMap["fadeInDuration"] = o.FadeInDuration
  9071  	}
  9072  	if o.FadeOutDuration != nil {
  9073  		objectMap["fadeOutDuration"] = o.FadeOutDuration
  9074  	}
  9075  	if o.AudioGainLevel != nil {
  9076  		objectMap["audioGainLevel"] = o.AudioGainLevel
  9077  	}
  9078  	if o.OdataType != "" {
  9079  		objectMap["@odata.type"] = o.OdataType
  9080  	}
  9081  	return json.Marshal(objectMap)
  9082  }
  9083  
  9084  // AsAudioOverlay is the BasicOverlay implementation for Overlay.
  9085  func (o Overlay) AsAudioOverlay() (*AudioOverlay, bool) {
  9086  	return nil, false
  9087  }
  9088  
  9089  // AsVideoOverlay is the BasicOverlay implementation for Overlay.
  9090  func (o Overlay) AsVideoOverlay() (*VideoOverlay, bool) {
  9091  	return nil, false
  9092  }
  9093  
  9094  // AsOverlay is the BasicOverlay implementation for Overlay.
  9095  func (o Overlay) AsOverlay() (*Overlay, bool) {
  9096  	return &o, true
  9097  }
  9098  
  9099  // AsBasicOverlay is the BasicOverlay implementation for Overlay.
  9100  func (o Overlay) AsBasicOverlay() (BasicOverlay, bool) {
  9101  	return &o, true
  9102  }
  9103  
  9104  // PngFormat describes the settings for producing PNG thumbnails.
  9105  type PngFormat struct {
  9106  	// 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.
  9107  	FilenamePattern *string `json:"filenamePattern,omitempty"`
  9108  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
  9109  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
  9110  }
  9111  
  9112  // MarshalJSON is the custom marshaler for PngFormat.
  9113  func (pf PngFormat) MarshalJSON() ([]byte, error) {
  9114  	pf.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat
  9115  	objectMap := make(map[string]interface{})
  9116  	if pf.FilenamePattern != nil {
  9117  		objectMap["filenamePattern"] = pf.FilenamePattern
  9118  	}
  9119  	if pf.OdataType != "" {
  9120  		objectMap["@odata.type"] = pf.OdataType
  9121  	}
  9122  	return json.Marshal(objectMap)
  9123  }
  9124  
  9125  // AsImageFormat is the BasicFormat implementation for PngFormat.
  9126  func (pf PngFormat) AsImageFormat() (*ImageFormat, bool) {
  9127  	return nil, false
  9128  }
  9129  
  9130  // AsBasicImageFormat is the BasicFormat implementation for PngFormat.
  9131  func (pf PngFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
  9132  	return &pf, true
  9133  }
  9134  
  9135  // AsJpgFormat is the BasicFormat implementation for PngFormat.
  9136  func (pf PngFormat) AsJpgFormat() (*JpgFormat, bool) {
  9137  	return nil, false
  9138  }
  9139  
  9140  // AsPngFormat is the BasicFormat implementation for PngFormat.
  9141  func (pf PngFormat) AsPngFormat() (*PngFormat, bool) {
  9142  	return &pf, true
  9143  }
  9144  
  9145  // AsMultiBitrateFormat is the BasicFormat implementation for PngFormat.
  9146  func (pf PngFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
  9147  	return nil, false
  9148  }
  9149  
  9150  // AsBasicMultiBitrateFormat is the BasicFormat implementation for PngFormat.
  9151  func (pf PngFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
  9152  	return nil, false
  9153  }
  9154  
  9155  // AsMp4Format is the BasicFormat implementation for PngFormat.
  9156  func (pf PngFormat) AsMp4Format() (*Mp4Format, bool) {
  9157  	return nil, false
  9158  }
  9159  
  9160  // AsTransportStreamFormat is the BasicFormat implementation for PngFormat.
  9161  func (pf PngFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
  9162  	return nil, false
  9163  }
  9164  
  9165  // AsFormat is the BasicFormat implementation for PngFormat.
  9166  func (pf PngFormat) AsFormat() (*Format, bool) {
  9167  	return nil, false
  9168  }
  9169  
  9170  // AsBasicFormat is the BasicFormat implementation for PngFormat.
  9171  func (pf PngFormat) AsBasicFormat() (BasicFormat, bool) {
  9172  	return &pf, true
  9173  }
  9174  
  9175  // PngImage describes the properties for producing a series of PNG images from the input video.
  9176  type PngImage struct {
  9177  	// Layers - A collection of output PNG image layers to be produced by the encoder.
  9178  	Layers *[]PngLayer `json:"layers,omitempty"`
  9179  	// 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}.
  9180  	Start *string `json:"start,omitempty"`
  9181  	// 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.
  9182  	Step *string `json:"step,omitempty"`
  9183  	// 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.
  9184  	Range *string `json:"range,omitempty"`
  9185  	// 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.
  9186  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
  9187  	// 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'
  9188  	StretchMode StretchMode `json:"stretchMode,omitempty"`
  9189  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
  9190  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
  9191  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
  9192  	Label *string `json:"label,omitempty"`
  9193  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
  9194  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
  9195  }
  9196  
  9197  // MarshalJSON is the custom marshaler for PngImage.
  9198  func (pi PngImage) MarshalJSON() ([]byte, error) {
  9199  	pi.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage
  9200  	objectMap := make(map[string]interface{})
  9201  	if pi.Layers != nil {
  9202  		objectMap["layers"] = pi.Layers
  9203  	}
  9204  	if pi.Start != nil {
  9205  		objectMap["start"] = pi.Start
  9206  	}
  9207  	if pi.Step != nil {
  9208  		objectMap["step"] = pi.Step
  9209  	}
  9210  	if pi.Range != nil {
  9211  		objectMap["range"] = pi.Range
  9212  	}
  9213  	if pi.KeyFrameInterval != nil {
  9214  		objectMap["keyFrameInterval"] = pi.KeyFrameInterval
  9215  	}
  9216  	if pi.StretchMode != "" {
  9217  		objectMap["stretchMode"] = pi.StretchMode
  9218  	}
  9219  	if pi.SyncMode != "" {
  9220  		objectMap["syncMode"] = pi.SyncMode
  9221  	}
  9222  	if pi.Label != nil {
  9223  		objectMap["label"] = pi.Label
  9224  	}
  9225  	if pi.OdataType != "" {
  9226  		objectMap["@odata.type"] = pi.OdataType
  9227  	}
  9228  	return json.Marshal(objectMap)
  9229  }
  9230  
  9231  // AsAudio is the BasicCodec implementation for PngImage.
  9232  func (pi PngImage) AsAudio() (*Audio, bool) {
  9233  	return nil, false
  9234  }
  9235  
  9236  // AsBasicAudio is the BasicCodec implementation for PngImage.
  9237  func (pi PngImage) AsBasicAudio() (BasicAudio, bool) {
  9238  	return nil, false
  9239  }
  9240  
  9241  // AsAacAudio is the BasicCodec implementation for PngImage.
  9242  func (pi PngImage) AsAacAudio() (*AacAudio, bool) {
  9243  	return nil, false
  9244  }
  9245  
  9246  // AsVideo is the BasicCodec implementation for PngImage.
  9247  func (pi PngImage) AsVideo() (*Video, bool) {
  9248  	return nil, false
  9249  }
  9250  
  9251  // AsBasicVideo is the BasicCodec implementation for PngImage.
  9252  func (pi PngImage) AsBasicVideo() (BasicVideo, bool) {
  9253  	return &pi, true
  9254  }
  9255  
  9256  // AsH265Video is the BasicCodec implementation for PngImage.
  9257  func (pi PngImage) AsH265Video() (*H265Video, bool) {
  9258  	return nil, false
  9259  }
  9260  
  9261  // AsCopyVideo is the BasicCodec implementation for PngImage.
  9262  func (pi PngImage) AsCopyVideo() (*CopyVideo, bool) {
  9263  	return nil, false
  9264  }
  9265  
  9266  // AsImage is the BasicCodec implementation for PngImage.
  9267  func (pi PngImage) AsImage() (*Image, bool) {
  9268  	return nil, false
  9269  }
  9270  
  9271  // AsBasicImage is the BasicCodec implementation for PngImage.
  9272  func (pi PngImage) AsBasicImage() (BasicImage, bool) {
  9273  	return &pi, true
  9274  }
  9275  
  9276  // AsCopyAudio is the BasicCodec implementation for PngImage.
  9277  func (pi PngImage) AsCopyAudio() (*CopyAudio, bool) {
  9278  	return nil, false
  9279  }
  9280  
  9281  // AsH264Video is the BasicCodec implementation for PngImage.
  9282  func (pi PngImage) AsH264Video() (*H264Video, bool) {
  9283  	return nil, false
  9284  }
  9285  
  9286  // AsJpgImage is the BasicCodec implementation for PngImage.
  9287  func (pi PngImage) AsJpgImage() (*JpgImage, bool) {
  9288  	return nil, false
  9289  }
  9290  
  9291  // AsPngImage is the BasicCodec implementation for PngImage.
  9292  func (pi PngImage) AsPngImage() (*PngImage, bool) {
  9293  	return &pi, true
  9294  }
  9295  
  9296  // AsCodec is the BasicCodec implementation for PngImage.
  9297  func (pi PngImage) AsCodec() (*Codec, bool) {
  9298  	return nil, false
  9299  }
  9300  
  9301  // AsBasicCodec is the BasicCodec implementation for PngImage.
  9302  func (pi PngImage) AsBasicCodec() (BasicCodec, bool) {
  9303  	return &pi, true
  9304  }
  9305  
  9306  // PngLayer describes the settings to produce a PNG image from the input video.
  9307  type PngLayer struct {
  9308  	// 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.
  9309  	Width *string `json:"width,omitempty"`
  9310  	// 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.
  9311  	Height *string `json:"height,omitempty"`
  9312  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
  9313  	Label *string `json:"label,omitempty"`
  9314  	// OdataType - Possible values include: 'OdataTypeBasicLayerOdataTypeLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer'
  9315  	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
  9316  }
  9317  
  9318  // MarshalJSON is the custom marshaler for PngLayer.
  9319  func (pl PngLayer) MarshalJSON() ([]byte, error) {
  9320  	pl.OdataType = OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer
  9321  	objectMap := make(map[string]interface{})
  9322  	if pl.Width != nil {
  9323  		objectMap["width"] = pl.Width
  9324  	}
  9325  	if pl.Height != nil {
  9326  		objectMap["height"] = pl.Height
  9327  	}
  9328  	if pl.Label != nil {
  9329  		objectMap["label"] = pl.Label
  9330  	}
  9331  	if pl.OdataType != "" {
  9332  		objectMap["@odata.type"] = pl.OdataType
  9333  	}
  9334  	return json.Marshal(objectMap)
  9335  }
  9336  
  9337  // AsH265VideoLayer is the BasicLayer implementation for PngLayer.
  9338  func (pl PngLayer) AsH265VideoLayer() (*H265VideoLayer, bool) {
  9339  	return nil, false
  9340  }
  9341  
  9342  // AsBasicH265VideoLayer is the BasicLayer implementation for PngLayer.
  9343  func (pl PngLayer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
  9344  	return nil, false
  9345  }
  9346  
  9347  // AsH265Layer is the BasicLayer implementation for PngLayer.
  9348  func (pl PngLayer) AsH265Layer() (*H265Layer, bool) {
  9349  	return nil, false
  9350  }
  9351  
  9352  // AsVideoLayer is the BasicLayer implementation for PngLayer.
  9353  func (pl PngLayer) AsVideoLayer() (*VideoLayer, bool) {
  9354  	return nil, false
  9355  }
  9356  
  9357  // AsBasicVideoLayer is the BasicLayer implementation for PngLayer.
  9358  func (pl PngLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
  9359  	return nil, false
  9360  }
  9361  
  9362  // AsH264Layer is the BasicLayer implementation for PngLayer.
  9363  func (pl PngLayer) AsH264Layer() (*H264Layer, bool) {
  9364  	return nil, false
  9365  }
  9366  
  9367  // AsJpgLayer is the BasicLayer implementation for PngLayer.
  9368  func (pl PngLayer) AsJpgLayer() (*JpgLayer, bool) {
  9369  	return nil, false
  9370  }
  9371  
  9372  // AsPngLayer is the BasicLayer implementation for PngLayer.
  9373  func (pl PngLayer) AsPngLayer() (*PngLayer, bool) {
  9374  	return &pl, true
  9375  }
  9376  
  9377  // AsLayer is the BasicLayer implementation for PngLayer.
  9378  func (pl PngLayer) AsLayer() (*Layer, bool) {
  9379  	return nil, false
  9380  }
  9381  
  9382  // AsBasicLayer is the BasicLayer implementation for PngLayer.
  9383  func (pl PngLayer) AsBasicLayer() (BasicLayer, bool) {
  9384  	return &pl, true
  9385  }
  9386  
  9387  // PresentationTimeRange the presentation time range, this is asset related and not recommended for Account
  9388  // Filter.
  9389  type PresentationTimeRange struct {
  9390  	// StartTimestamp - The absolute start time boundary.
  9391  	StartTimestamp *int64 `json:"startTimestamp,omitempty"`
  9392  	// EndTimestamp - The absolute end time boundary.
  9393  	EndTimestamp *int64 `json:"endTimestamp,omitempty"`
  9394  	// PresentationWindowDuration - The relative to end sliding window.
  9395  	PresentationWindowDuration *int64 `json:"presentationWindowDuration,omitempty"`
  9396  	// LiveBackoffDuration - The relative to end right edge.
  9397  	LiveBackoffDuration *int64 `json:"liveBackoffDuration,omitempty"`
  9398  	// Timescale - The time scale of time stamps.
  9399  	Timescale *int64 `json:"timescale,omitempty"`
  9400  	// ForceEndTimestamp - The indicator of forcing existing of end time stamp.
  9401  	ForceEndTimestamp *bool `json:"forceEndTimestamp,omitempty"`
  9402  }
  9403  
  9404  // BasicPreset base type for all Presets, which define the recipe or instructions on how the input media files should
  9405  // be processed.
  9406  type BasicPreset interface {
  9407  	AsFaceDetectorPreset() (*FaceDetectorPreset, bool)
  9408  	AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool)
  9409  	AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool)
  9410  	AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool)
  9411  	AsStandardEncoderPreset() (*StandardEncoderPreset, bool)
  9412  	AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool)
  9413  	AsPreset() (*Preset, bool)
  9414  }
  9415  
  9416  // Preset base type for all Presets, which define the recipe or instructions on how the input media files
  9417  // should be processed.
  9418  type Preset struct {
  9419  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
  9420  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
  9421  }
  9422  
  9423  func unmarshalBasicPreset(body []byte) (BasicPreset, error) {
  9424  	var m map[string]interface{}
  9425  	err := json.Unmarshal(body, &m)
  9426  	if err != nil {
  9427  		return nil, err
  9428  	}
  9429  
  9430  	switch m["@odata.type"] {
  9431  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset):
  9432  		var fdp FaceDetectorPreset
  9433  		err := json.Unmarshal(body, &fdp)
  9434  		return fdp, err
  9435  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset):
  9436  		var aap AudioAnalyzerPreset
  9437  		err := json.Unmarshal(body, &aap)
  9438  		return aap, err
  9439  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset):
  9440  		var bisep BuiltInStandardEncoderPreset
  9441  		err := json.Unmarshal(body, &bisep)
  9442  		return bisep, err
  9443  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset):
  9444  		var sep StandardEncoderPreset
  9445  		err := json.Unmarshal(body, &sep)
  9446  		return sep, err
  9447  	case string(OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset):
  9448  		var vap VideoAnalyzerPreset
  9449  		err := json.Unmarshal(body, &vap)
  9450  		return vap, err
  9451  	default:
  9452  		var p Preset
  9453  		err := json.Unmarshal(body, &p)
  9454  		return p, err
  9455  	}
  9456  }
  9457  func unmarshalBasicPresetArray(body []byte) ([]BasicPreset, error) {
  9458  	var rawMessages []*json.RawMessage
  9459  	err := json.Unmarshal(body, &rawMessages)
  9460  	if err != nil {
  9461  		return nil, err
  9462  	}
  9463  
  9464  	pArray := make([]BasicPreset, len(rawMessages))
  9465  
  9466  	for index, rawMessage := range rawMessages {
  9467  		p, err := unmarshalBasicPreset(*rawMessage)
  9468  		if err != nil {
  9469  			return nil, err
  9470  		}
  9471  		pArray[index] = p
  9472  	}
  9473  	return pArray, nil
  9474  }
  9475  
  9476  // MarshalJSON is the custom marshaler for Preset.
  9477  func (p Preset) MarshalJSON() ([]byte, error) {
  9478  	p.OdataType = OdataTypeBasicPresetOdataTypePreset
  9479  	objectMap := make(map[string]interface{})
  9480  	if p.OdataType != "" {
  9481  		objectMap["@odata.type"] = p.OdataType
  9482  	}
  9483  	return json.Marshal(objectMap)
  9484  }
  9485  
  9486  // AsFaceDetectorPreset is the BasicPreset implementation for Preset.
  9487  func (p Preset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
  9488  	return nil, false
  9489  }
  9490  
  9491  // AsAudioAnalyzerPreset is the BasicPreset implementation for Preset.
  9492  func (p Preset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
  9493  	return nil, false
  9494  }
  9495  
  9496  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for Preset.
  9497  func (p Preset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
  9498  	return nil, false
  9499  }
  9500  
  9501  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for Preset.
  9502  func (p Preset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
  9503  	return nil, false
  9504  }
  9505  
  9506  // AsStandardEncoderPreset is the BasicPreset implementation for Preset.
  9507  func (p Preset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
  9508  	return nil, false
  9509  }
  9510  
  9511  // AsVideoAnalyzerPreset is the BasicPreset implementation for Preset.
  9512  func (p Preset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
  9513  	return nil, false
  9514  }
  9515  
  9516  // AsPreset is the BasicPreset implementation for Preset.
  9517  func (p Preset) AsPreset() (*Preset, bool) {
  9518  	return &p, true
  9519  }
  9520  
  9521  // AsBasicPreset is the BasicPreset implementation for Preset.
  9522  func (p Preset) AsBasicPreset() (BasicPreset, bool) {
  9523  	return &p, true
  9524  }
  9525  
  9526  // PrivateEndpoint the Private Endpoint resource.
  9527  type PrivateEndpoint struct {
  9528  	// ID - READ-ONLY; The ARM identifier for Private Endpoint
  9529  	ID *string `json:"id,omitempty"`
  9530  }
  9531  
  9532  // MarshalJSON is the custom marshaler for PrivateEndpoint.
  9533  func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) {
  9534  	objectMap := make(map[string]interface{})
  9535  	return json.Marshal(objectMap)
  9536  }
  9537  
  9538  // PrivateEndpointConnection the Private Endpoint Connection resource.
  9539  type PrivateEndpointConnection struct {
  9540  	autorest.Response `json:"-"`
  9541  	// PrivateEndpointConnectionProperties - Resource properties.
  9542  	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
  9543  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  9544  	ID *string `json:"id,omitempty"`
  9545  	// Name - READ-ONLY; The name of the resource
  9546  	Name *string `json:"name,omitempty"`
  9547  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  9548  	Type *string `json:"type,omitempty"`
  9549  }
  9550  
  9551  // MarshalJSON is the custom marshaler for PrivateEndpointConnection.
  9552  func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
  9553  	objectMap := make(map[string]interface{})
  9554  	if pec.PrivateEndpointConnectionProperties != nil {
  9555  		objectMap["properties"] = pec.PrivateEndpointConnectionProperties
  9556  	}
  9557  	return json.Marshal(objectMap)
  9558  }
  9559  
  9560  // UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
  9561  func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
  9562  	var m map[string]*json.RawMessage
  9563  	err := json.Unmarshal(body, &m)
  9564  	if err != nil {
  9565  		return err
  9566  	}
  9567  	for k, v := range m {
  9568  		switch k {
  9569  		case "properties":
  9570  			if v != nil {
  9571  				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
  9572  				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
  9573  				if err != nil {
  9574  					return err
  9575  				}
  9576  				pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
  9577  			}
  9578  		case "id":
  9579  			if v != nil {
  9580  				var ID string
  9581  				err = json.Unmarshal(*v, &ID)
  9582  				if err != nil {
  9583  					return err
  9584  				}
  9585  				pec.ID = &ID
  9586  			}
  9587  		case "name":
  9588  			if v != nil {
  9589  				var name string
  9590  				err = json.Unmarshal(*v, &name)
  9591  				if err != nil {
  9592  					return err
  9593  				}
  9594  				pec.Name = &name
  9595  			}
  9596  		case "type":
  9597  			if v != nil {
  9598  				var typeVar string
  9599  				err = json.Unmarshal(*v, &typeVar)
  9600  				if err != nil {
  9601  					return err
  9602  				}
  9603  				pec.Type = &typeVar
  9604  			}
  9605  		}
  9606  	}
  9607  
  9608  	return nil
  9609  }
  9610  
  9611  // PrivateEndpointConnectionListResult list of private endpoint connection associated with the specified
  9612  // storage account
  9613  type PrivateEndpointConnectionListResult struct {
  9614  	autorest.Response `json:"-"`
  9615  	// Value - Array of private endpoint connections
  9616  	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
  9617  }
  9618  
  9619  // PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties.
  9620  type PrivateEndpointConnectionProperties struct {
  9621  	// PrivateEndpoint - The resource of private end point.
  9622  	PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
  9623  	// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider.
  9624  	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
  9625  	// ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed'
  9626  	ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"`
  9627  }
  9628  
  9629  // PrivateLinkResource a private link resource
  9630  type PrivateLinkResource struct {
  9631  	autorest.Response `json:"-"`
  9632  	// PrivateLinkResourceProperties - Resource properties.
  9633  	*PrivateLinkResourceProperties `json:"properties,omitempty"`
  9634  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  9635  	ID *string `json:"id,omitempty"`
  9636  	// Name - READ-ONLY; The name of the resource
  9637  	Name *string `json:"name,omitempty"`
  9638  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  9639  	Type *string `json:"type,omitempty"`
  9640  }
  9641  
  9642  // MarshalJSON is the custom marshaler for PrivateLinkResource.
  9643  func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
  9644  	objectMap := make(map[string]interface{})
  9645  	if plr.PrivateLinkResourceProperties != nil {
  9646  		objectMap["properties"] = plr.PrivateLinkResourceProperties
  9647  	}
  9648  	return json.Marshal(objectMap)
  9649  }
  9650  
  9651  // UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct.
  9652  func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error {
  9653  	var m map[string]*json.RawMessage
  9654  	err := json.Unmarshal(body, &m)
  9655  	if err != nil {
  9656  		return err
  9657  	}
  9658  	for k, v := range m {
  9659  		switch k {
  9660  		case "properties":
  9661  			if v != nil {
  9662  				var privateLinkResourceProperties PrivateLinkResourceProperties
  9663  				err = json.Unmarshal(*v, &privateLinkResourceProperties)
  9664  				if err != nil {
  9665  					return err
  9666  				}
  9667  				plr.PrivateLinkResourceProperties = &privateLinkResourceProperties
  9668  			}
  9669  		case "id":
  9670  			if v != nil {
  9671  				var ID string
  9672  				err = json.Unmarshal(*v, &ID)
  9673  				if err != nil {
  9674  					return err
  9675  				}
  9676  				plr.ID = &ID
  9677  			}
  9678  		case "name":
  9679  			if v != nil {
  9680  				var name string
  9681  				err = json.Unmarshal(*v, &name)
  9682  				if err != nil {
  9683  					return err
  9684  				}
  9685  				plr.Name = &name
  9686  			}
  9687  		case "type":
  9688  			if v != nil {
  9689  				var typeVar string
  9690  				err = json.Unmarshal(*v, &typeVar)
  9691  				if err != nil {
  9692  					return err
  9693  				}
  9694  				plr.Type = &typeVar
  9695  			}
  9696  		}
  9697  	}
  9698  
  9699  	return nil
  9700  }
  9701  
  9702  // PrivateLinkResourceListResult a list of private link resources
  9703  type PrivateLinkResourceListResult struct {
  9704  	autorest.Response `json:"-"`
  9705  	// Value - Array of private link resources
  9706  	Value *[]PrivateLinkResource `json:"value,omitempty"`
  9707  }
  9708  
  9709  // PrivateLinkResourceProperties properties of a private link resource.
  9710  type PrivateLinkResourceProperties struct {
  9711  	// GroupID - READ-ONLY; The private link resource group id.
  9712  	GroupID *string `json:"groupId,omitempty"`
  9713  	// RequiredMembers - READ-ONLY; The private link resource required member names.
  9714  	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
  9715  	// RequiredZoneNames - The private link resource Private link DNS zone name.
  9716  	RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
  9717  }
  9718  
  9719  // MarshalJSON is the custom marshaler for PrivateLinkResourceProperties.
  9720  func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
  9721  	objectMap := make(map[string]interface{})
  9722  	if plrp.RequiredZoneNames != nil {
  9723  		objectMap["requiredZoneNames"] = plrp.RequiredZoneNames
  9724  	}
  9725  	return json.Marshal(objectMap)
  9726  }
  9727  
  9728  // PrivateLinkServiceConnectionState a collection of information about the state of the connection between
  9729  // service consumer and provider.
  9730  type PrivateLinkServiceConnectionState struct {
  9731  	// Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'PrivateEndpointServiceConnectionStatusPending', 'PrivateEndpointServiceConnectionStatusApproved', 'PrivateEndpointServiceConnectionStatusRejected'
  9732  	Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"`
  9733  	// Description - The reason for approval/rejection of the connection.
  9734  	Description *string `json:"description,omitempty"`
  9735  	// ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer.
  9736  	ActionsRequired *string `json:"actionsRequired,omitempty"`
  9737  }
  9738  
  9739  // Properties the service specification property.
  9740  type Properties struct {
  9741  	// ServiceSpecification - READ-ONLY; The service specifications.
  9742  	ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"`
  9743  }
  9744  
  9745  // MarshalJSON is the custom marshaler for Properties.
  9746  func (p Properties) MarshalJSON() ([]byte, error) {
  9747  	objectMap := make(map[string]interface{})
  9748  	return json.Marshal(objectMap)
  9749  }
  9750  
  9751  // Provider a resource provider.
  9752  type Provider struct {
  9753  	// ProviderName - The provider name.
  9754  	ProviderName *string `json:"providerName,omitempty"`
  9755  }
  9756  
  9757  // ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not
  9758  // have tags and a location
  9759  type ProxyResource struct {
  9760  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  9761  	ID *string `json:"id,omitempty"`
  9762  	// Name - READ-ONLY; The name of the resource
  9763  	Name *string `json:"name,omitempty"`
  9764  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  9765  	Type *string `json:"type,omitempty"`
  9766  }
  9767  
  9768  // MarshalJSON is the custom marshaler for ProxyResource.
  9769  func (pr ProxyResource) MarshalJSON() ([]byte, error) {
  9770  	objectMap := make(map[string]interface{})
  9771  	return json.Marshal(objectMap)
  9772  }
  9773  
  9774  // Rectangle describes the properties of a rectangular window applied to the input media before processing
  9775  // it.
  9776  type Rectangle struct {
  9777  	// 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%).
  9778  	Left *string `json:"left,omitempty"`
  9779  	// 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%).
  9780  	Top *string `json:"top,omitempty"`
  9781  	// 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%).
  9782  	Width *string `json:"width,omitempty"`
  9783  	// 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%).
  9784  	Height *string `json:"height,omitempty"`
  9785  }
  9786  
  9787  // Resource common fields that are returned in the response for all Azure Resource Manager resources
  9788  type Resource struct {
  9789  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  9790  	ID *string `json:"id,omitempty"`
  9791  	// Name - READ-ONLY; The name of the resource
  9792  	Name *string `json:"name,omitempty"`
  9793  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  9794  	Type *string `json:"type,omitempty"`
  9795  }
  9796  
  9797  // MarshalJSON is the custom marshaler for Resource.
  9798  func (r Resource) MarshalJSON() ([]byte, error) {
  9799  	objectMap := make(map[string]interface{})
  9800  	return json.Marshal(objectMap)
  9801  }
  9802  
  9803  // SelectAudioTrackByAttribute select audio tracks from the input by specifying an attribute and an
  9804  // attribute filter.
  9805  type SelectAudioTrackByAttribute struct {
  9806  	// Attribute - The TrackAttribute to filter the tracks by. Possible values include: 'TrackAttributeBitrate', 'TrackAttributeLanguage'
  9807  	Attribute TrackAttribute `json:"attribute,omitempty"`
  9808  	// Filter - The type of AttributeFilter to apply to the TrackAttribute in order to select the tracks. Possible values include: 'AttributeFilterAll', 'AttributeFilterTop', 'AttributeFilterBottom', 'AttributeFilterValueEquals'
  9809  	Filter AttributeFilter `json:"filter,omitempty"`
  9810  	// FilterValue - The value to filter the tracks by.  Only used when AttributeFilter.ValueEquals is specified for the Filter property.
  9811  	FilterValue *string `json:"filterValue,omitempty"`
  9812  	// 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'
  9813  	ChannelMapping ChannelMapping `json:"channelMapping,omitempty"`
  9814  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
  9815  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
  9816  }
  9817  
  9818  // MarshalJSON is the custom marshaler for SelectAudioTrackByAttribute.
  9819  func (satba SelectAudioTrackByAttribute) MarshalJSON() ([]byte, error) {
  9820  	satba.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute
  9821  	objectMap := make(map[string]interface{})
  9822  	if satba.Attribute != "" {
  9823  		objectMap["attribute"] = satba.Attribute
  9824  	}
  9825  	if satba.Filter != "" {
  9826  		objectMap["filter"] = satba.Filter
  9827  	}
  9828  	if satba.FilterValue != nil {
  9829  		objectMap["filterValue"] = satba.FilterValue
  9830  	}
  9831  	if satba.ChannelMapping != "" {
  9832  		objectMap["channelMapping"] = satba.ChannelMapping
  9833  	}
  9834  	if satba.OdataType != "" {
  9835  		objectMap["@odata.type"] = satba.OdataType
  9836  	}
  9837  	return json.Marshal(objectMap)
  9838  }
  9839  
  9840  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9841  func (satba SelectAudioTrackByAttribute) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
  9842  	return nil, false
  9843  }
  9844  
  9845  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9846  func (satba SelectAudioTrackByAttribute) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
  9847  	return &satba, true
  9848  }
  9849  
  9850  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9851  func (satba SelectAudioTrackByAttribute) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
  9852  	return &satba, true
  9853  }
  9854  
  9855  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9856  func (satba SelectAudioTrackByAttribute) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
  9857  	return nil, false
  9858  }
  9859  
  9860  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9861  func (satba SelectAudioTrackByAttribute) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
  9862  	return nil, false
  9863  }
  9864  
  9865  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9866  func (satba SelectAudioTrackByAttribute) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
  9867  	return nil, false
  9868  }
  9869  
  9870  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9871  func (satba SelectAudioTrackByAttribute) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
  9872  	return nil, false
  9873  }
  9874  
  9875  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9876  func (satba SelectAudioTrackByAttribute) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
  9877  	return nil, false
  9878  }
  9879  
  9880  // AsTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9881  func (satba SelectAudioTrackByAttribute) AsTrackDescriptor() (*TrackDescriptor, bool) {
  9882  	return nil, false
  9883  }
  9884  
  9885  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByAttribute.
  9886  func (satba SelectAudioTrackByAttribute) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
  9887  	return &satba, true
  9888  }
  9889  
  9890  // SelectAudioTrackByID select audio tracks from the input by specifying a track identifier.
  9891  type SelectAudioTrackByID struct {
  9892  	// TrackID - Track identifier to select
  9893  	TrackID *int64 `json:"trackId,omitempty"`
  9894  	// 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'
  9895  	ChannelMapping ChannelMapping `json:"channelMapping,omitempty"`
  9896  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
  9897  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
  9898  }
  9899  
  9900  // MarshalJSON is the custom marshaler for SelectAudioTrackByID.
  9901  func (satbi SelectAudioTrackByID) MarshalJSON() ([]byte, error) {
  9902  	satbi.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID
  9903  	objectMap := make(map[string]interface{})
  9904  	if satbi.TrackID != nil {
  9905  		objectMap["trackId"] = satbi.TrackID
  9906  	}
  9907  	if satbi.ChannelMapping != "" {
  9908  		objectMap["channelMapping"] = satbi.ChannelMapping
  9909  	}
  9910  	if satbi.OdataType != "" {
  9911  		objectMap["@odata.type"] = satbi.OdataType
  9912  	}
  9913  	return json.Marshal(objectMap)
  9914  }
  9915  
  9916  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9917  func (satbi SelectAudioTrackByID) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
  9918  	return nil, false
  9919  }
  9920  
  9921  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9922  func (satbi SelectAudioTrackByID) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
  9923  	return &satbi, true
  9924  }
  9925  
  9926  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9927  func (satbi SelectAudioTrackByID) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
  9928  	return nil, false
  9929  }
  9930  
  9931  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9932  func (satbi SelectAudioTrackByID) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
  9933  	return &satbi, true
  9934  }
  9935  
  9936  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9937  func (satbi SelectAudioTrackByID) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
  9938  	return nil, false
  9939  }
  9940  
  9941  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9942  func (satbi SelectAudioTrackByID) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
  9943  	return nil, false
  9944  }
  9945  
  9946  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9947  func (satbi SelectAudioTrackByID) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
  9948  	return nil, false
  9949  }
  9950  
  9951  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9952  func (satbi SelectAudioTrackByID) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
  9953  	return nil, false
  9954  }
  9955  
  9956  // AsTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9957  func (satbi SelectAudioTrackByID) AsTrackDescriptor() (*TrackDescriptor, bool) {
  9958  	return nil, false
  9959  }
  9960  
  9961  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for SelectAudioTrackByID.
  9962  func (satbi SelectAudioTrackByID) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
  9963  	return &satbi, true
  9964  }
  9965  
  9966  // SelectVideoTrackByAttribute select video tracks from the input by specifying an attribute and an
  9967  // attribute filter.
  9968  type SelectVideoTrackByAttribute struct {
  9969  	// Attribute - The TrackAttribute to filter the tracks by. Possible values include: 'TrackAttributeBitrate', 'TrackAttributeLanguage'
  9970  	Attribute TrackAttribute `json:"attribute,omitempty"`
  9971  	// Filter - The type of AttributeFilter to apply to the TrackAttribute in order to select the tracks. Possible values include: 'AttributeFilterAll', 'AttributeFilterTop', 'AttributeFilterBottom', 'AttributeFilterValueEquals'
  9972  	Filter AttributeFilter `json:"filter,omitempty"`
  9973  	// 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.
  9974  	FilterValue *string `json:"filterValue,omitempty"`
  9975  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
  9976  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
  9977  }
  9978  
  9979  // MarshalJSON is the custom marshaler for SelectVideoTrackByAttribute.
  9980  func (svtba SelectVideoTrackByAttribute) MarshalJSON() ([]byte, error) {
  9981  	svtba.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute
  9982  	objectMap := make(map[string]interface{})
  9983  	if svtba.Attribute != "" {
  9984  		objectMap["attribute"] = svtba.Attribute
  9985  	}
  9986  	if svtba.Filter != "" {
  9987  		objectMap["filter"] = svtba.Filter
  9988  	}
  9989  	if svtba.FilterValue != nil {
  9990  		objectMap["filterValue"] = svtba.FilterValue
  9991  	}
  9992  	if svtba.OdataType != "" {
  9993  		objectMap["@odata.type"] = svtba.OdataType
  9994  	}
  9995  	return json.Marshal(objectMap)
  9996  }
  9997  
  9998  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
  9999  func (svtba SelectVideoTrackByAttribute) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
 10000  	return nil, false
 10001  }
 10002  
 10003  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10004  func (svtba SelectVideoTrackByAttribute) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
 10005  	return nil, false
 10006  }
 10007  
 10008  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10009  func (svtba SelectVideoTrackByAttribute) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
 10010  	return nil, false
 10011  }
 10012  
 10013  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10014  func (svtba SelectVideoTrackByAttribute) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
 10015  	return nil, false
 10016  }
 10017  
 10018  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10019  func (svtba SelectVideoTrackByAttribute) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
 10020  	return nil, false
 10021  }
 10022  
 10023  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10024  func (svtba SelectVideoTrackByAttribute) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
 10025  	return &svtba, true
 10026  }
 10027  
 10028  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10029  func (svtba SelectVideoTrackByAttribute) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
 10030  	return &svtba, true
 10031  }
 10032  
 10033  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10034  func (svtba SelectVideoTrackByAttribute) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
 10035  	return nil, false
 10036  }
 10037  
 10038  // AsTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10039  func (svtba SelectVideoTrackByAttribute) AsTrackDescriptor() (*TrackDescriptor, bool) {
 10040  	return nil, false
 10041  }
 10042  
 10043  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByAttribute.
 10044  func (svtba SelectVideoTrackByAttribute) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
 10045  	return &svtba, true
 10046  }
 10047  
 10048  // SelectVideoTrackByID select video tracks from the input by specifying a track identifier.
 10049  type SelectVideoTrackByID struct {
 10050  	// TrackID - Track identifier to select
 10051  	TrackID *int64 `json:"trackId,omitempty"`
 10052  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
 10053  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
 10054  }
 10055  
 10056  // MarshalJSON is the custom marshaler for SelectVideoTrackByID.
 10057  func (svtbi SelectVideoTrackByID) MarshalJSON() ([]byte, error) {
 10058  	svtbi.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID
 10059  	objectMap := make(map[string]interface{})
 10060  	if svtbi.TrackID != nil {
 10061  		objectMap["trackId"] = svtbi.TrackID
 10062  	}
 10063  	if svtbi.OdataType != "" {
 10064  		objectMap["@odata.type"] = svtbi.OdataType
 10065  	}
 10066  	return json.Marshal(objectMap)
 10067  }
 10068  
 10069  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10070  func (svtbi SelectVideoTrackByID) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
 10071  	return nil, false
 10072  }
 10073  
 10074  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10075  func (svtbi SelectVideoTrackByID) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
 10076  	return nil, false
 10077  }
 10078  
 10079  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10080  func (svtbi SelectVideoTrackByID) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
 10081  	return nil, false
 10082  }
 10083  
 10084  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10085  func (svtbi SelectVideoTrackByID) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
 10086  	return nil, false
 10087  }
 10088  
 10089  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10090  func (svtbi SelectVideoTrackByID) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
 10091  	return nil, false
 10092  }
 10093  
 10094  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10095  func (svtbi SelectVideoTrackByID) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
 10096  	return &svtbi, true
 10097  }
 10098  
 10099  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10100  func (svtbi SelectVideoTrackByID) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
 10101  	return nil, false
 10102  }
 10103  
 10104  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10105  func (svtbi SelectVideoTrackByID) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
 10106  	return &svtbi, true
 10107  }
 10108  
 10109  // AsTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10110  func (svtbi SelectVideoTrackByID) AsTrackDescriptor() (*TrackDescriptor, bool) {
 10111  	return nil, false
 10112  }
 10113  
 10114  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for SelectVideoTrackByID.
 10115  func (svtbi SelectVideoTrackByID) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
 10116  	return &svtbi, true
 10117  }
 10118  
 10119  // Service a Media Services account.
 10120  type Service struct {
 10121  	autorest.Response `json:"-"`
 10122  	// ServiceProperties - The resource properties.
 10123  	*ServiceProperties `json:"properties,omitempty"`
 10124  	// Identity - The Managed Identity for the Media Services account.
 10125  	Identity *ServiceIdentity `json:"identity,omitempty"`
 10126  	// SystemData - READ-ONLY; The system metadata relating to this resource.
 10127  	SystemData *SystemData `json:"systemData,omitempty"`
 10128  	// Tags - Resource tags.
 10129  	Tags map[string]*string `json:"tags"`
 10130  	// Location - The geo-location where the resource lives
 10131  	Location *string `json:"location,omitempty"`
 10132  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 10133  	ID *string `json:"id,omitempty"`
 10134  	// Name - READ-ONLY; The name of the resource
 10135  	Name *string `json:"name,omitempty"`
 10136  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 10137  	Type *string `json:"type,omitempty"`
 10138  }
 10139  
 10140  // MarshalJSON is the custom marshaler for Service.
 10141  func (s Service) MarshalJSON() ([]byte, error) {
 10142  	objectMap := make(map[string]interface{})
 10143  	if s.ServiceProperties != nil {
 10144  		objectMap["properties"] = s.ServiceProperties
 10145  	}
 10146  	if s.Identity != nil {
 10147  		objectMap["identity"] = s.Identity
 10148  	}
 10149  	if s.Tags != nil {
 10150  		objectMap["tags"] = s.Tags
 10151  	}
 10152  	if s.Location != nil {
 10153  		objectMap["location"] = s.Location
 10154  	}
 10155  	return json.Marshal(objectMap)
 10156  }
 10157  
 10158  // UnmarshalJSON is the custom unmarshaler for Service struct.
 10159  func (s *Service) UnmarshalJSON(body []byte) error {
 10160  	var m map[string]*json.RawMessage
 10161  	err := json.Unmarshal(body, &m)
 10162  	if err != nil {
 10163  		return err
 10164  	}
 10165  	for k, v := range m {
 10166  		switch k {
 10167  		case "properties":
 10168  			if v != nil {
 10169  				var serviceProperties ServiceProperties
 10170  				err = json.Unmarshal(*v, &serviceProperties)
 10171  				if err != nil {
 10172  					return err
 10173  				}
 10174  				s.ServiceProperties = &serviceProperties
 10175  			}
 10176  		case "identity":
 10177  			if v != nil {
 10178  				var identity ServiceIdentity
 10179  				err = json.Unmarshal(*v, &identity)
 10180  				if err != nil {
 10181  					return err
 10182  				}
 10183  				s.Identity = &identity
 10184  			}
 10185  		case "systemData":
 10186  			if v != nil {
 10187  				var systemData SystemData
 10188  				err = json.Unmarshal(*v, &systemData)
 10189  				if err != nil {
 10190  					return err
 10191  				}
 10192  				s.SystemData = &systemData
 10193  			}
 10194  		case "tags":
 10195  			if v != nil {
 10196  				var tags map[string]*string
 10197  				err = json.Unmarshal(*v, &tags)
 10198  				if err != nil {
 10199  					return err
 10200  				}
 10201  				s.Tags = tags
 10202  			}
 10203  		case "location":
 10204  			if v != nil {
 10205  				var location string
 10206  				err = json.Unmarshal(*v, &location)
 10207  				if err != nil {
 10208  					return err
 10209  				}
 10210  				s.Location = &location
 10211  			}
 10212  		case "id":
 10213  			if v != nil {
 10214  				var ID string
 10215  				err = json.Unmarshal(*v, &ID)
 10216  				if err != nil {
 10217  					return err
 10218  				}
 10219  				s.ID = &ID
 10220  			}
 10221  		case "name":
 10222  			if v != nil {
 10223  				var name string
 10224  				err = json.Unmarshal(*v, &name)
 10225  				if err != nil {
 10226  					return err
 10227  				}
 10228  				s.Name = &name
 10229  			}
 10230  		case "type":
 10231  			if v != nil {
 10232  				var typeVar string
 10233  				err = json.Unmarshal(*v, &typeVar)
 10234  				if err != nil {
 10235  					return err
 10236  				}
 10237  				s.Type = &typeVar
 10238  			}
 10239  		}
 10240  	}
 10241  
 10242  	return nil
 10243  }
 10244  
 10245  // ServiceCollection a collection of MediaService items.
 10246  type ServiceCollection struct {
 10247  	autorest.Response `json:"-"`
 10248  	// Value - A collection of MediaService items.
 10249  	Value *[]Service `json:"value,omitempty"`
 10250  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
 10251  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
 10252  }
 10253  
 10254  // ServiceCollectionIterator provides access to a complete listing of Service values.
 10255  type ServiceCollectionIterator struct {
 10256  	i    int
 10257  	page ServiceCollectionPage
 10258  }
 10259  
 10260  // NextWithContext advances to the next value.  If there was an error making
 10261  // the request the iterator does not advance and the error is returned.
 10262  func (iter *ServiceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
 10263  	if tracing.IsEnabled() {
 10264  		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceCollectionIterator.NextWithContext")
 10265  		defer func() {
 10266  			sc := -1
 10267  			if iter.Response().Response.Response != nil {
 10268  				sc = iter.Response().Response.Response.StatusCode
 10269  			}
 10270  			tracing.EndSpan(ctx, sc, err)
 10271  		}()
 10272  	}
 10273  	iter.i++
 10274  	if iter.i < len(iter.page.Values()) {
 10275  		return nil
 10276  	}
 10277  	err = iter.page.NextWithContext(ctx)
 10278  	if err != nil {
 10279  		iter.i--
 10280  		return err
 10281  	}
 10282  	iter.i = 0
 10283  	return nil
 10284  }
 10285  
 10286  // Next advances to the next value.  If there was an error making
 10287  // the request the iterator does not advance and the error is returned.
 10288  // Deprecated: Use NextWithContext() instead.
 10289  func (iter *ServiceCollectionIterator) Next() error {
 10290  	return iter.NextWithContext(context.Background())
 10291  }
 10292  
 10293  // NotDone returns true if the enumeration should be started or is not yet complete.
 10294  func (iter ServiceCollectionIterator) NotDone() bool {
 10295  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
 10296  }
 10297  
 10298  // Response returns the raw server response from the last page request.
 10299  func (iter ServiceCollectionIterator) Response() ServiceCollection {
 10300  	return iter.page.Response()
 10301  }
 10302  
 10303  // Value returns the current value or a zero-initialized value if the
 10304  // iterator has advanced beyond the end of the collection.
 10305  func (iter ServiceCollectionIterator) Value() Service {
 10306  	if !iter.page.NotDone() {
 10307  		return Service{}
 10308  	}
 10309  	return iter.page.Values()[iter.i]
 10310  }
 10311  
 10312  // Creates a new instance of the ServiceCollectionIterator type.
 10313  func NewServiceCollectionIterator(page ServiceCollectionPage) ServiceCollectionIterator {
 10314  	return ServiceCollectionIterator{page: page}
 10315  }
 10316  
 10317  // IsEmpty returns true if the ListResult contains no values.
 10318  func (sc ServiceCollection) IsEmpty() bool {
 10319  	return sc.Value == nil || len(*sc.Value) == 0
 10320  }
 10321  
 10322  // hasNextLink returns true if the NextLink is not empty.
 10323  func (sc ServiceCollection) hasNextLink() bool {
 10324  	return sc.OdataNextLink != nil && len(*sc.OdataNextLink) != 0
 10325  }
 10326  
 10327  // serviceCollectionPreparer prepares a request to retrieve the next set of results.
 10328  // It returns nil if no more results exist.
 10329  func (sc ServiceCollection) serviceCollectionPreparer(ctx context.Context) (*http.Request, error) {
 10330  	if !sc.hasNextLink() {
 10331  		return nil, nil
 10332  	}
 10333  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
 10334  		autorest.AsJSON(),
 10335  		autorest.AsGet(),
 10336  		autorest.WithBaseURL(to.String(sc.OdataNextLink)))
 10337  }
 10338  
 10339  // ServiceCollectionPage contains a page of Service values.
 10340  type ServiceCollectionPage struct {
 10341  	fn func(context.Context, ServiceCollection) (ServiceCollection, error)
 10342  	sc ServiceCollection
 10343  }
 10344  
 10345  // NextWithContext advances to the next page of values.  If there was an error making
 10346  // the request the page does not advance and the error is returned.
 10347  func (page *ServiceCollectionPage) NextWithContext(ctx context.Context) (err error) {
 10348  	if tracing.IsEnabled() {
 10349  		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceCollectionPage.NextWithContext")
 10350  		defer func() {
 10351  			sc := -1
 10352  			if page.Response().Response.Response != nil {
 10353  				sc = page.Response().Response.Response.StatusCode
 10354  			}
 10355  			tracing.EndSpan(ctx, sc, err)
 10356  		}()
 10357  	}
 10358  	for {
 10359  		next, err := page.fn(ctx, page.sc)
 10360  		if err != nil {
 10361  			return err
 10362  		}
 10363  		page.sc = next
 10364  		if !next.hasNextLink() || !next.IsEmpty() {
 10365  			break
 10366  		}
 10367  	}
 10368  	return nil
 10369  }
 10370  
 10371  // Next advances to the next page of values.  If there was an error making
 10372  // the request the page does not advance and the error is returned.
 10373  // Deprecated: Use NextWithContext() instead.
 10374  func (page *ServiceCollectionPage) Next() error {
 10375  	return page.NextWithContext(context.Background())
 10376  }
 10377  
 10378  // NotDone returns true if the page enumeration should be started or is not yet complete.
 10379  func (page ServiceCollectionPage) NotDone() bool {
 10380  	return !page.sc.IsEmpty()
 10381  }
 10382  
 10383  // Response returns the raw server response from the last page request.
 10384  func (page ServiceCollectionPage) Response() ServiceCollection {
 10385  	return page.sc
 10386  }
 10387  
 10388  // Values returns the slice of values for the current page or nil if there are no values.
 10389  func (page ServiceCollectionPage) Values() []Service {
 10390  	if page.sc.IsEmpty() {
 10391  		return nil
 10392  	}
 10393  	return *page.sc.Value
 10394  }
 10395  
 10396  // Creates a new instance of the ServiceCollectionPage type.
 10397  func NewServiceCollectionPage(cur ServiceCollection, getNextPage func(context.Context, ServiceCollection) (ServiceCollection, error)) ServiceCollectionPage {
 10398  	return ServiceCollectionPage{
 10399  		fn: getNextPage,
 10400  		sc: cur,
 10401  	}
 10402  }
 10403  
 10404  // ServiceIdentity ...
 10405  type ServiceIdentity struct {
 10406  	// Type - The identity type. Possible values include: 'ManagedIdentityTypeSystemAssigned', 'ManagedIdentityTypeNone'
 10407  	Type ManagedIdentityType `json:"type,omitempty"`
 10408  	// PrincipalID - READ-ONLY; The Principal ID of the identity.
 10409  	PrincipalID *string `json:"principalId,omitempty"`
 10410  	// TenantID - READ-ONLY; The Tenant ID of the identity.
 10411  	TenantID *string `json:"tenantId,omitempty"`
 10412  }
 10413  
 10414  // MarshalJSON is the custom marshaler for ServiceIdentity.
 10415  func (si ServiceIdentity) MarshalJSON() ([]byte, error) {
 10416  	objectMap := make(map[string]interface{})
 10417  	if si.Type != "" {
 10418  		objectMap["type"] = si.Type
 10419  	}
 10420  	return json.Marshal(objectMap)
 10421  }
 10422  
 10423  // ServiceProperties properties of the Media Services account.
 10424  type ServiceProperties struct {
 10425  	// MediaServiceID - READ-ONLY; The Media Services account ID.
 10426  	MediaServiceID *uuid.UUID `json:"mediaServiceId,omitempty"`
 10427  	// StorageAccounts - The storage accounts for this resource.
 10428  	StorageAccounts *[]StorageAccount `json:"storageAccounts,omitempty"`
 10429  	// StorageAuthentication - Possible values include: 'StorageAuthenticationSystem', 'StorageAuthenticationManagedIdentity'
 10430  	StorageAuthentication StorageAuthentication `json:"storageAuthentication,omitempty"`
 10431  	// Encryption - The account encryption properties.
 10432  	Encryption *AccountEncryption `json:"encryption,omitempty"`
 10433  	// KeyDelivery - The Key Delivery properties for Media Services account.
 10434  	KeyDelivery *KeyDelivery `json:"keyDelivery,omitempty"`
 10435  }
 10436  
 10437  // MarshalJSON is the custom marshaler for ServiceProperties.
 10438  func (sp ServiceProperties) MarshalJSON() ([]byte, error) {
 10439  	objectMap := make(map[string]interface{})
 10440  	if sp.StorageAccounts != nil {
 10441  		objectMap["storageAccounts"] = sp.StorageAccounts
 10442  	}
 10443  	if sp.StorageAuthentication != "" {
 10444  		objectMap["storageAuthentication"] = sp.StorageAuthentication
 10445  	}
 10446  	if sp.Encryption != nil {
 10447  		objectMap["encryption"] = sp.Encryption
 10448  	}
 10449  	if sp.KeyDelivery != nil {
 10450  		objectMap["keyDelivery"] = sp.KeyDelivery
 10451  	}
 10452  	return json.Marshal(objectMap)
 10453  }
 10454  
 10455  // ServiceSpecification the service metric specifications.
 10456  type ServiceSpecification struct {
 10457  	// LogSpecifications - READ-ONLY; List of log specifications.
 10458  	LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"`
 10459  	// MetricSpecifications - READ-ONLY; List of metric specifications.
 10460  	MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"`
 10461  }
 10462  
 10463  // MarshalJSON is the custom marshaler for ServiceSpecification.
 10464  func (ss ServiceSpecification) MarshalJSON() ([]byte, error) {
 10465  	objectMap := make(map[string]interface{})
 10466  	return json.Marshal(objectMap)
 10467  }
 10468  
 10469  // ServiceUpdate a Media Services account update.
 10470  type ServiceUpdate struct {
 10471  	// Tags - Resource tags.
 10472  	Tags map[string]*string `json:"tags"`
 10473  	// ServiceProperties - The resource properties.
 10474  	*ServiceProperties `json:"properties,omitempty"`
 10475  	// Identity - The Managed Identity for the Media Services account.
 10476  	Identity *ServiceIdentity `json:"identity,omitempty"`
 10477  }
 10478  
 10479  // MarshalJSON is the custom marshaler for ServiceUpdate.
 10480  func (su ServiceUpdate) MarshalJSON() ([]byte, error) {
 10481  	objectMap := make(map[string]interface{})
 10482  	if su.Tags != nil {
 10483  		objectMap["tags"] = su.Tags
 10484  	}
 10485  	if su.ServiceProperties != nil {
 10486  		objectMap["properties"] = su.ServiceProperties
 10487  	}
 10488  	if su.Identity != nil {
 10489  		objectMap["identity"] = su.Identity
 10490  	}
 10491  	return json.Marshal(objectMap)
 10492  }
 10493  
 10494  // UnmarshalJSON is the custom unmarshaler for ServiceUpdate struct.
 10495  func (su *ServiceUpdate) UnmarshalJSON(body []byte) error {
 10496  	var m map[string]*json.RawMessage
 10497  	err := json.Unmarshal(body, &m)
 10498  	if err != nil {
 10499  		return err
 10500  	}
 10501  	for k, v := range m {
 10502  		switch k {
 10503  		case "tags":
 10504  			if v != nil {
 10505  				var tags map[string]*string
 10506  				err = json.Unmarshal(*v, &tags)
 10507  				if err != nil {
 10508  					return err
 10509  				}
 10510  				su.Tags = tags
 10511  			}
 10512  		case "properties":
 10513  			if v != nil {
 10514  				var serviceProperties ServiceProperties
 10515  				err = json.Unmarshal(*v, &serviceProperties)
 10516  				if err != nil {
 10517  					return err
 10518  				}
 10519  				su.ServiceProperties = &serviceProperties
 10520  			}
 10521  		case "identity":
 10522  			if v != nil {
 10523  				var identity ServiceIdentity
 10524  				err = json.Unmarshal(*v, &identity)
 10525  				if err != nil {
 10526  					return err
 10527  				}
 10528  				su.Identity = &identity
 10529  			}
 10530  		}
 10531  	}
 10532  
 10533  	return nil
 10534  }
 10535  
 10536  // StandardEncoderPreset describes all the settings to be used when encoding the input video with the
 10537  // Standard Encoder.
 10538  type StandardEncoderPreset struct {
 10539  	// Filters - One or more filtering operations that are applied to the input media before encoding.
 10540  	Filters *Filters `json:"filters,omitempty"`
 10541  	// Codecs - The list of codecs to be used when encoding the input video.
 10542  	Codecs *[]BasicCodec `json:"codecs,omitempty"`
 10543  	// Formats - The list of outputs to be produced by the encoder.
 10544  	Formats *[]BasicFormat `json:"formats,omitempty"`
 10545  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
 10546  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
 10547  }
 10548  
 10549  // MarshalJSON is the custom marshaler for StandardEncoderPreset.
 10550  func (sep StandardEncoderPreset) MarshalJSON() ([]byte, error) {
 10551  	sep.OdataType = OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset
 10552  	objectMap := make(map[string]interface{})
 10553  	if sep.Filters != nil {
 10554  		objectMap["filters"] = sep.Filters
 10555  	}
 10556  	if sep.Codecs != nil {
 10557  		objectMap["codecs"] = sep.Codecs
 10558  	}
 10559  	if sep.Formats != nil {
 10560  		objectMap["formats"] = sep.Formats
 10561  	}
 10562  	if sep.OdataType != "" {
 10563  		objectMap["@odata.type"] = sep.OdataType
 10564  	}
 10565  	return json.Marshal(objectMap)
 10566  }
 10567  
 10568  // AsFaceDetectorPreset is the BasicPreset implementation for StandardEncoderPreset.
 10569  func (sep StandardEncoderPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
 10570  	return nil, false
 10571  }
 10572  
 10573  // AsAudioAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset.
 10574  func (sep StandardEncoderPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
 10575  	return nil, false
 10576  }
 10577  
 10578  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset.
 10579  func (sep StandardEncoderPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
 10580  	return nil, false
 10581  }
 10582  
 10583  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for StandardEncoderPreset.
 10584  func (sep StandardEncoderPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
 10585  	return nil, false
 10586  }
 10587  
 10588  // AsStandardEncoderPreset is the BasicPreset implementation for StandardEncoderPreset.
 10589  func (sep StandardEncoderPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
 10590  	return &sep, true
 10591  }
 10592  
 10593  // AsVideoAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset.
 10594  func (sep StandardEncoderPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
 10595  	return nil, false
 10596  }
 10597  
 10598  // AsPreset is the BasicPreset implementation for StandardEncoderPreset.
 10599  func (sep StandardEncoderPreset) AsPreset() (*Preset, bool) {
 10600  	return nil, false
 10601  }
 10602  
 10603  // AsBasicPreset is the BasicPreset implementation for StandardEncoderPreset.
 10604  func (sep StandardEncoderPreset) AsBasicPreset() (BasicPreset, bool) {
 10605  	return &sep, true
 10606  }
 10607  
 10608  // UnmarshalJSON is the custom unmarshaler for StandardEncoderPreset struct.
 10609  func (sep *StandardEncoderPreset) UnmarshalJSON(body []byte) error {
 10610  	var m map[string]*json.RawMessage
 10611  	err := json.Unmarshal(body, &m)
 10612  	if err != nil {
 10613  		return err
 10614  	}
 10615  	for k, v := range m {
 10616  		switch k {
 10617  		case "filters":
 10618  			if v != nil {
 10619  				var filters Filters
 10620  				err = json.Unmarshal(*v, &filters)
 10621  				if err != nil {
 10622  					return err
 10623  				}
 10624  				sep.Filters = &filters
 10625  			}
 10626  		case "codecs":
 10627  			if v != nil {
 10628  				codecs, err := unmarshalBasicCodecArray(*v)
 10629  				if err != nil {
 10630  					return err
 10631  				}
 10632  				sep.Codecs = &codecs
 10633  			}
 10634  		case "formats":
 10635  			if v != nil {
 10636  				formats, err := unmarshalBasicFormatArray(*v)
 10637  				if err != nil {
 10638  					return err
 10639  				}
 10640  				sep.Formats = &formats
 10641  			}
 10642  		case "@odata.type":
 10643  			if v != nil {
 10644  				var odataType OdataTypeBasicPreset
 10645  				err = json.Unmarshal(*v, &odataType)
 10646  				if err != nil {
 10647  					return err
 10648  				}
 10649  				sep.OdataType = odataType
 10650  			}
 10651  		}
 10652  	}
 10653  
 10654  	return nil
 10655  }
 10656  
 10657  // StorageAccount the storage account details.
 10658  type StorageAccount struct {
 10659  	// 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.
 10660  	ID *string `json:"id,omitempty"`
 10661  	// Type - The type of the storage account. Possible values include: 'StorageAccountTypePrimary', 'StorageAccountTypeSecondary'
 10662  	Type StorageAccountType `json:"type,omitempty"`
 10663  }
 10664  
 10665  // StorageEncryptedAssetDecryptionData data needed to decrypt asset files encrypted with legacy storage
 10666  // encryption.
 10667  type StorageEncryptedAssetDecryptionData struct {
 10668  	autorest.Response `json:"-"`
 10669  	// Key - The Asset File storage encryption key.
 10670  	Key *[]byte `json:"key,omitempty"`
 10671  	// AssetFileEncryptionMetadata - Asset File encryption metadata.
 10672  	AssetFileEncryptionMetadata *[]AssetFileEncryptionMetadata `json:"assetFileEncryptionMetadata,omitempty"`
 10673  }
 10674  
 10675  // StreamingEndpoint the streaming endpoint.
 10676  type StreamingEndpoint struct {
 10677  	autorest.Response `json:"-"`
 10678  	// StreamingEndpointProperties - The streaming endpoint properties.
 10679  	*StreamingEndpointProperties `json:"properties,omitempty"`
 10680  	// SystemData - READ-ONLY; The system metadata relating to this resource.
 10681  	SystemData *SystemData `json:"systemData,omitempty"`
 10682  	// Tags - Resource tags.
 10683  	Tags map[string]*string `json:"tags"`
 10684  	// Location - The geo-location where the resource lives
 10685  	Location *string `json:"location,omitempty"`
 10686  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 10687  	ID *string `json:"id,omitempty"`
 10688  	// Name - READ-ONLY; The name of the resource
 10689  	Name *string `json:"name,omitempty"`
 10690  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 10691  	Type *string `json:"type,omitempty"`
 10692  }
 10693  
 10694  // MarshalJSON is the custom marshaler for StreamingEndpoint.
 10695  func (se StreamingEndpoint) MarshalJSON() ([]byte, error) {
 10696  	objectMap := make(map[string]interface{})
 10697  	if se.StreamingEndpointProperties != nil {
 10698  		objectMap["properties"] = se.StreamingEndpointProperties
 10699  	}
 10700  	if se.Tags != nil {
 10701  		objectMap["tags"] = se.Tags
 10702  	}
 10703  	if se.Location != nil {
 10704  		objectMap["location"] = se.Location
 10705  	}
 10706  	return json.Marshal(objectMap)
 10707  }
 10708  
 10709  // UnmarshalJSON is the custom unmarshaler for StreamingEndpoint struct.
 10710  func (se *StreamingEndpoint) UnmarshalJSON(body []byte) error {
 10711  	var m map[string]*json.RawMessage
 10712  	err := json.Unmarshal(body, &m)
 10713  	if err != nil {
 10714  		return err
 10715  	}
 10716  	for k, v := range m {
 10717  		switch k {
 10718  		case "properties":
 10719  			if v != nil {
 10720  				var streamingEndpointProperties StreamingEndpointProperties
 10721  				err = json.Unmarshal(*v, &streamingEndpointProperties)
 10722  				if err != nil {
 10723  					return err
 10724  				}
 10725  				se.StreamingEndpointProperties = &streamingEndpointProperties
 10726  			}
 10727  		case "systemData":
 10728  			if v != nil {
 10729  				var systemData SystemData
 10730  				err = json.Unmarshal(*v, &systemData)
 10731  				if err != nil {
 10732  					return err
 10733  				}
 10734  				se.SystemData = &systemData
 10735  			}
 10736  		case "tags":
 10737  			if v != nil {
 10738  				var tags map[string]*string
 10739  				err = json.Unmarshal(*v, &tags)
 10740  				if err != nil {
 10741  					return err
 10742  				}
 10743  				se.Tags = tags
 10744  			}
 10745  		case "location":
 10746  			if v != nil {
 10747  				var location string
 10748  				err = json.Unmarshal(*v, &location)
 10749  				if err != nil {
 10750  					return err
 10751  				}
 10752  				se.Location = &location
 10753  			}
 10754  		case "id":
 10755  			if v != nil {
 10756  				var ID string
 10757  				err = json.Unmarshal(*v, &ID)
 10758  				if err != nil {
 10759  					return err
 10760  				}
 10761  				se.ID = &ID
 10762  			}
 10763  		case "name":
 10764  			if v != nil {
 10765  				var name string
 10766  				err = json.Unmarshal(*v, &name)
 10767  				if err != nil {
 10768  					return err
 10769  				}
 10770  				se.Name = &name
 10771  			}
 10772  		case "type":
 10773  			if v != nil {
 10774  				var typeVar string
 10775  				err = json.Unmarshal(*v, &typeVar)
 10776  				if err != nil {
 10777  					return err
 10778  				}
 10779  				se.Type = &typeVar
 10780  			}
 10781  		}
 10782  	}
 10783  
 10784  	return nil
 10785  }
 10786  
 10787  // StreamingEndpointAccessControl streaming endpoint access control definition.
 10788  type StreamingEndpointAccessControl struct {
 10789  	// Akamai - The access control of Akamai
 10790  	Akamai *AkamaiAccessControl `json:"akamai,omitempty"`
 10791  	// IP - The IP access control of the streaming endpoint.
 10792  	IP *IPAccessControl `json:"ip,omitempty"`
 10793  }
 10794  
 10795  // StreamingEndpointListResult the streaming endpoint list result.
 10796  type StreamingEndpointListResult struct {
 10797  	autorest.Response `json:"-"`
 10798  	// Value - The result of the List StreamingEndpoint operation.
 10799  	Value *[]StreamingEndpoint `json:"value,omitempty"`
 10800  	// OdataCount - The number of result.
 10801  	OdataCount *int32 `json:"@odata.count,omitempty"`
 10802  	// OdataNextLink - The link to the next set of results. Not empty if value contains incomplete list of streaming endpoints.
 10803  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
 10804  }
 10805  
 10806  // StreamingEndpointListResultIterator provides access to a complete listing of StreamingEndpoint values.
 10807  type StreamingEndpointListResultIterator struct {
 10808  	i    int
 10809  	page StreamingEndpointListResultPage
 10810  }
 10811  
 10812  // NextWithContext advances to the next value.  If there was an error making
 10813  // the request the iterator does not advance and the error is returned.
 10814  func (iter *StreamingEndpointListResultIterator) NextWithContext(ctx context.Context) (err error) {
 10815  	if tracing.IsEnabled() {
 10816  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingEndpointListResultIterator.NextWithContext")
 10817  		defer func() {
 10818  			sc := -1
 10819  			if iter.Response().Response.Response != nil {
 10820  				sc = iter.Response().Response.Response.StatusCode
 10821  			}
 10822  			tracing.EndSpan(ctx, sc, err)
 10823  		}()
 10824  	}
 10825  	iter.i++
 10826  	if iter.i < len(iter.page.Values()) {
 10827  		return nil
 10828  	}
 10829  	err = iter.page.NextWithContext(ctx)
 10830  	if err != nil {
 10831  		iter.i--
 10832  		return err
 10833  	}
 10834  	iter.i = 0
 10835  	return nil
 10836  }
 10837  
 10838  // Next advances to the next value.  If there was an error making
 10839  // the request the iterator does not advance and the error is returned.
 10840  // Deprecated: Use NextWithContext() instead.
 10841  func (iter *StreamingEndpointListResultIterator) Next() error {
 10842  	return iter.NextWithContext(context.Background())
 10843  }
 10844  
 10845  // NotDone returns true if the enumeration should be started or is not yet complete.
 10846  func (iter StreamingEndpointListResultIterator) NotDone() bool {
 10847  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
 10848  }
 10849  
 10850  // Response returns the raw server response from the last page request.
 10851  func (iter StreamingEndpointListResultIterator) Response() StreamingEndpointListResult {
 10852  	return iter.page.Response()
 10853  }
 10854  
 10855  // Value returns the current value or a zero-initialized value if the
 10856  // iterator has advanced beyond the end of the collection.
 10857  func (iter StreamingEndpointListResultIterator) Value() StreamingEndpoint {
 10858  	if !iter.page.NotDone() {
 10859  		return StreamingEndpoint{}
 10860  	}
 10861  	return iter.page.Values()[iter.i]
 10862  }
 10863  
 10864  // Creates a new instance of the StreamingEndpointListResultIterator type.
 10865  func NewStreamingEndpointListResultIterator(page StreamingEndpointListResultPage) StreamingEndpointListResultIterator {
 10866  	return StreamingEndpointListResultIterator{page: page}
 10867  }
 10868  
 10869  // IsEmpty returns true if the ListResult contains no values.
 10870  func (selr StreamingEndpointListResult) IsEmpty() bool {
 10871  	return selr.Value == nil || len(*selr.Value) == 0
 10872  }
 10873  
 10874  // hasNextLink returns true if the NextLink is not empty.
 10875  func (selr StreamingEndpointListResult) hasNextLink() bool {
 10876  	return selr.OdataNextLink != nil && len(*selr.OdataNextLink) != 0
 10877  }
 10878  
 10879  // streamingEndpointListResultPreparer prepares a request to retrieve the next set of results.
 10880  // It returns nil if no more results exist.
 10881  func (selr StreamingEndpointListResult) streamingEndpointListResultPreparer(ctx context.Context) (*http.Request, error) {
 10882  	if !selr.hasNextLink() {
 10883  		return nil, nil
 10884  	}
 10885  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
 10886  		autorest.AsJSON(),
 10887  		autorest.AsGet(),
 10888  		autorest.WithBaseURL(to.String(selr.OdataNextLink)))
 10889  }
 10890  
 10891  // StreamingEndpointListResultPage contains a page of StreamingEndpoint values.
 10892  type StreamingEndpointListResultPage struct {
 10893  	fn   func(context.Context, StreamingEndpointListResult) (StreamingEndpointListResult, error)
 10894  	selr StreamingEndpointListResult
 10895  }
 10896  
 10897  // NextWithContext advances to the next page of values.  If there was an error making
 10898  // the request the page does not advance and the error is returned.
 10899  func (page *StreamingEndpointListResultPage) NextWithContext(ctx context.Context) (err error) {
 10900  	if tracing.IsEnabled() {
 10901  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingEndpointListResultPage.NextWithContext")
 10902  		defer func() {
 10903  			sc := -1
 10904  			if page.Response().Response.Response != nil {
 10905  				sc = page.Response().Response.Response.StatusCode
 10906  			}
 10907  			tracing.EndSpan(ctx, sc, err)
 10908  		}()
 10909  	}
 10910  	for {
 10911  		next, err := page.fn(ctx, page.selr)
 10912  		if err != nil {
 10913  			return err
 10914  		}
 10915  		page.selr = next
 10916  		if !next.hasNextLink() || !next.IsEmpty() {
 10917  			break
 10918  		}
 10919  	}
 10920  	return nil
 10921  }
 10922  
 10923  // Next advances to the next page of values.  If there was an error making
 10924  // the request the page does not advance and the error is returned.
 10925  // Deprecated: Use NextWithContext() instead.
 10926  func (page *StreamingEndpointListResultPage) Next() error {
 10927  	return page.NextWithContext(context.Background())
 10928  }
 10929  
 10930  // NotDone returns true if the page enumeration should be started or is not yet complete.
 10931  func (page StreamingEndpointListResultPage) NotDone() bool {
 10932  	return !page.selr.IsEmpty()
 10933  }
 10934  
 10935  // Response returns the raw server response from the last page request.
 10936  func (page StreamingEndpointListResultPage) Response() StreamingEndpointListResult {
 10937  	return page.selr
 10938  }
 10939  
 10940  // Values returns the slice of values for the current page or nil if there are no values.
 10941  func (page StreamingEndpointListResultPage) Values() []StreamingEndpoint {
 10942  	if page.selr.IsEmpty() {
 10943  		return nil
 10944  	}
 10945  	return *page.selr.Value
 10946  }
 10947  
 10948  // Creates a new instance of the StreamingEndpointListResultPage type.
 10949  func NewStreamingEndpointListResultPage(cur StreamingEndpointListResult, getNextPage func(context.Context, StreamingEndpointListResult) (StreamingEndpointListResult, error)) StreamingEndpointListResultPage {
 10950  	return StreamingEndpointListResultPage{
 10951  		fn:   getNextPage,
 10952  		selr: cur,
 10953  	}
 10954  }
 10955  
 10956  // StreamingEndpointProperties the streaming endpoint properties.
 10957  type StreamingEndpointProperties struct {
 10958  	// Description - The streaming endpoint description.
 10959  	Description *string `json:"description,omitempty"`
 10960  	// ScaleUnits - The number of scale units. Use the Scale operation to adjust this value.
 10961  	ScaleUnits *int32 `json:"scaleUnits,omitempty"`
 10962  	// AvailabilitySetName - This feature is deprecated, do not set a value for this property.
 10963  	AvailabilitySetName *string `json:"availabilitySetName,omitempty"`
 10964  	// AccessControl - The access control definition of the streaming endpoint.
 10965  	AccessControl *StreamingEndpointAccessControl `json:"accessControl,omitempty"`
 10966  	// MaxCacheAge - Max cache age
 10967  	MaxCacheAge *int64 `json:"maxCacheAge,omitempty"`
 10968  	// CustomHostNames - The custom host names of the streaming endpoint
 10969  	CustomHostNames *[]string `json:"customHostNames,omitempty"`
 10970  	// HostName - READ-ONLY; The streaming endpoint host name.
 10971  	HostName *string `json:"hostName,omitempty"`
 10972  	// CdnEnabled - The CDN enabled flag.
 10973  	CdnEnabled *bool `json:"cdnEnabled,omitempty"`
 10974  	// CdnProvider - The CDN provider name.
 10975  	CdnProvider *string `json:"cdnProvider,omitempty"`
 10976  	// CdnProfile - The CDN profile name.
 10977  	CdnProfile *string `json:"cdnProfile,omitempty"`
 10978  	// ProvisioningState - READ-ONLY; The provisioning state of the streaming endpoint.
 10979  	ProvisioningState *string `json:"provisioningState,omitempty"`
 10980  	// ResourceState - READ-ONLY; The resource state of the streaming endpoint. Possible values include: 'StreamingEndpointResourceStateStopped', 'StreamingEndpointResourceStateStarting', 'StreamingEndpointResourceStateRunning', 'StreamingEndpointResourceStateStopping', 'StreamingEndpointResourceStateDeleting', 'StreamingEndpointResourceStateScaling'
 10981  	ResourceState StreamingEndpointResourceState `json:"resourceState,omitempty"`
 10982  	// CrossSiteAccessPolicies - The streaming endpoint access policies.
 10983  	CrossSiteAccessPolicies *CrossSiteAccessPolicies `json:"crossSiteAccessPolicies,omitempty"`
 10984  	// FreeTrialEndTime - READ-ONLY; The free trial expiration time.
 10985  	FreeTrialEndTime *date.Time `json:"freeTrialEndTime,omitempty"`
 10986  	// Created - READ-ONLY; The exact time the streaming endpoint was created.
 10987  	Created *date.Time `json:"created,omitempty"`
 10988  	// LastModified - READ-ONLY; The exact time the streaming endpoint was last modified.
 10989  	LastModified *date.Time `json:"lastModified,omitempty"`
 10990  }
 10991  
 10992  // MarshalJSON is the custom marshaler for StreamingEndpointProperties.
 10993  func (sep StreamingEndpointProperties) MarshalJSON() ([]byte, error) {
 10994  	objectMap := make(map[string]interface{})
 10995  	if sep.Description != nil {
 10996  		objectMap["description"] = sep.Description
 10997  	}
 10998  	if sep.ScaleUnits != nil {
 10999  		objectMap["scaleUnits"] = sep.ScaleUnits
 11000  	}
 11001  	if sep.AvailabilitySetName != nil {
 11002  		objectMap["availabilitySetName"] = sep.AvailabilitySetName
 11003  	}
 11004  	if sep.AccessControl != nil {
 11005  		objectMap["accessControl"] = sep.AccessControl
 11006  	}
 11007  	if sep.MaxCacheAge != nil {
 11008  		objectMap["maxCacheAge"] = sep.MaxCacheAge
 11009  	}
 11010  	if sep.CustomHostNames != nil {
 11011  		objectMap["customHostNames"] = sep.CustomHostNames
 11012  	}
 11013  	if sep.CdnEnabled != nil {
 11014  		objectMap["cdnEnabled"] = sep.CdnEnabled
 11015  	}
 11016  	if sep.CdnProvider != nil {
 11017  		objectMap["cdnProvider"] = sep.CdnProvider
 11018  	}
 11019  	if sep.CdnProfile != nil {
 11020  		objectMap["cdnProfile"] = sep.CdnProfile
 11021  	}
 11022  	if sep.CrossSiteAccessPolicies != nil {
 11023  		objectMap["crossSiteAccessPolicies"] = sep.CrossSiteAccessPolicies
 11024  	}
 11025  	return json.Marshal(objectMap)
 11026  }
 11027  
 11028  // StreamingEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a
 11029  // long-running operation.
 11030  type StreamingEndpointsCreateFuture struct {
 11031  	azure.FutureAPI
 11032  	// Result returns the result of the asynchronous operation.
 11033  	// If the operation has not completed it will return an error.
 11034  	Result func(StreamingEndpointsClient) (StreamingEndpoint, error)
 11035  }
 11036  
 11037  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 11038  func (future *StreamingEndpointsCreateFuture) UnmarshalJSON(body []byte) error {
 11039  	var azFuture azure.Future
 11040  	if err := json.Unmarshal(body, &azFuture); err != nil {
 11041  		return err
 11042  	}
 11043  	future.FutureAPI = &azFuture
 11044  	future.Result = future.result
 11045  	return nil
 11046  }
 11047  
 11048  // result is the default implementation for StreamingEndpointsCreateFuture.Result.
 11049  func (future *StreamingEndpointsCreateFuture) result(client StreamingEndpointsClient) (se StreamingEndpoint, err error) {
 11050  	var done bool
 11051  	done, err = future.DoneWithContext(context.Background(), client)
 11052  	if err != nil {
 11053  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsCreateFuture", "Result", future.Response(), "Polling failure")
 11054  		return
 11055  	}
 11056  	if !done {
 11057  		se.Response.Response = future.Response()
 11058  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsCreateFuture")
 11059  		return
 11060  	}
 11061  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
 11062  	if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent {
 11063  		se, err = client.CreateResponder(se.Response.Response)
 11064  		if err != nil {
 11065  			err = autorest.NewErrorWithError(err, "media.StreamingEndpointsCreateFuture", "Result", se.Response.Response, "Failure responding to request")
 11066  		}
 11067  	}
 11068  	return
 11069  }
 11070  
 11071  // StreamingEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a
 11072  // long-running operation.
 11073  type StreamingEndpointsDeleteFuture struct {
 11074  	azure.FutureAPI
 11075  	// Result returns the result of the asynchronous operation.
 11076  	// If the operation has not completed it will return an error.
 11077  	Result func(StreamingEndpointsClient) (autorest.Response, error)
 11078  }
 11079  
 11080  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 11081  func (future *StreamingEndpointsDeleteFuture) UnmarshalJSON(body []byte) error {
 11082  	var azFuture azure.Future
 11083  	if err := json.Unmarshal(body, &azFuture); err != nil {
 11084  		return err
 11085  	}
 11086  	future.FutureAPI = &azFuture
 11087  	future.Result = future.result
 11088  	return nil
 11089  }
 11090  
 11091  // result is the default implementation for StreamingEndpointsDeleteFuture.Result.
 11092  func (future *StreamingEndpointsDeleteFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
 11093  	var done bool
 11094  	done, err = future.DoneWithContext(context.Background(), client)
 11095  	if err != nil {
 11096  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsDeleteFuture", "Result", future.Response(), "Polling failure")
 11097  		return
 11098  	}
 11099  	if !done {
 11100  		ar.Response = future.Response()
 11101  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsDeleteFuture")
 11102  		return
 11103  	}
 11104  	ar.Response = future.Response()
 11105  	return
 11106  }
 11107  
 11108  // StreamingEndpointsScaleFuture an abstraction for monitoring and retrieving the results of a long-running
 11109  // operation.
 11110  type StreamingEndpointsScaleFuture struct {
 11111  	azure.FutureAPI
 11112  	// Result returns the result of the asynchronous operation.
 11113  	// If the operation has not completed it will return an error.
 11114  	Result func(StreamingEndpointsClient) (autorest.Response, error)
 11115  }
 11116  
 11117  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 11118  func (future *StreamingEndpointsScaleFuture) UnmarshalJSON(body []byte) error {
 11119  	var azFuture azure.Future
 11120  	if err := json.Unmarshal(body, &azFuture); err != nil {
 11121  		return err
 11122  	}
 11123  	future.FutureAPI = &azFuture
 11124  	future.Result = future.result
 11125  	return nil
 11126  }
 11127  
 11128  // result is the default implementation for StreamingEndpointsScaleFuture.Result.
 11129  func (future *StreamingEndpointsScaleFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
 11130  	var done bool
 11131  	done, err = future.DoneWithContext(context.Background(), client)
 11132  	if err != nil {
 11133  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsScaleFuture", "Result", future.Response(), "Polling failure")
 11134  		return
 11135  	}
 11136  	if !done {
 11137  		ar.Response = future.Response()
 11138  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsScaleFuture")
 11139  		return
 11140  	}
 11141  	ar.Response = future.Response()
 11142  	return
 11143  }
 11144  
 11145  // StreamingEndpointsStartFuture an abstraction for monitoring and retrieving the results of a long-running
 11146  // operation.
 11147  type StreamingEndpointsStartFuture struct {
 11148  	azure.FutureAPI
 11149  	// Result returns the result of the asynchronous operation.
 11150  	// If the operation has not completed it will return an error.
 11151  	Result func(StreamingEndpointsClient) (autorest.Response, error)
 11152  }
 11153  
 11154  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 11155  func (future *StreamingEndpointsStartFuture) UnmarshalJSON(body []byte) error {
 11156  	var azFuture azure.Future
 11157  	if err := json.Unmarshal(body, &azFuture); err != nil {
 11158  		return err
 11159  	}
 11160  	future.FutureAPI = &azFuture
 11161  	future.Result = future.result
 11162  	return nil
 11163  }
 11164  
 11165  // result is the default implementation for StreamingEndpointsStartFuture.Result.
 11166  func (future *StreamingEndpointsStartFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
 11167  	var done bool
 11168  	done, err = future.DoneWithContext(context.Background(), client)
 11169  	if err != nil {
 11170  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsStartFuture", "Result", future.Response(), "Polling failure")
 11171  		return
 11172  	}
 11173  	if !done {
 11174  		ar.Response = future.Response()
 11175  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsStartFuture")
 11176  		return
 11177  	}
 11178  	ar.Response = future.Response()
 11179  	return
 11180  }
 11181  
 11182  // StreamingEndpointsStopFuture an abstraction for monitoring and retrieving the results of a long-running
 11183  // operation.
 11184  type StreamingEndpointsStopFuture struct {
 11185  	azure.FutureAPI
 11186  	// Result returns the result of the asynchronous operation.
 11187  	// If the operation has not completed it will return an error.
 11188  	Result func(StreamingEndpointsClient) (autorest.Response, error)
 11189  }
 11190  
 11191  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 11192  func (future *StreamingEndpointsStopFuture) UnmarshalJSON(body []byte) error {
 11193  	var azFuture azure.Future
 11194  	if err := json.Unmarshal(body, &azFuture); err != nil {
 11195  		return err
 11196  	}
 11197  	future.FutureAPI = &azFuture
 11198  	future.Result = future.result
 11199  	return nil
 11200  }
 11201  
 11202  // result is the default implementation for StreamingEndpointsStopFuture.Result.
 11203  func (future *StreamingEndpointsStopFuture) result(client StreamingEndpointsClient) (ar autorest.Response, err error) {
 11204  	var done bool
 11205  	done, err = future.DoneWithContext(context.Background(), client)
 11206  	if err != nil {
 11207  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsStopFuture", "Result", future.Response(), "Polling failure")
 11208  		return
 11209  	}
 11210  	if !done {
 11211  		ar.Response = future.Response()
 11212  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsStopFuture")
 11213  		return
 11214  	}
 11215  	ar.Response = future.Response()
 11216  	return
 11217  }
 11218  
 11219  // StreamingEndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a
 11220  // long-running operation.
 11221  type StreamingEndpointsUpdateFuture struct {
 11222  	azure.FutureAPI
 11223  	// Result returns the result of the asynchronous operation.
 11224  	// If the operation has not completed it will return an error.
 11225  	Result func(StreamingEndpointsClient) (StreamingEndpoint, error)
 11226  }
 11227  
 11228  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
 11229  func (future *StreamingEndpointsUpdateFuture) UnmarshalJSON(body []byte) error {
 11230  	var azFuture azure.Future
 11231  	if err := json.Unmarshal(body, &azFuture); err != nil {
 11232  		return err
 11233  	}
 11234  	future.FutureAPI = &azFuture
 11235  	future.Result = future.result
 11236  	return nil
 11237  }
 11238  
 11239  // result is the default implementation for StreamingEndpointsUpdateFuture.Result.
 11240  func (future *StreamingEndpointsUpdateFuture) result(client StreamingEndpointsClient) (se StreamingEndpoint, err error) {
 11241  	var done bool
 11242  	done, err = future.DoneWithContext(context.Background(), client)
 11243  	if err != nil {
 11244  		err = autorest.NewErrorWithError(err, "media.StreamingEndpointsUpdateFuture", "Result", future.Response(), "Polling failure")
 11245  		return
 11246  	}
 11247  	if !done {
 11248  		se.Response.Response = future.Response()
 11249  		err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsUpdateFuture")
 11250  		return
 11251  	}
 11252  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
 11253  	if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent {
 11254  		se, err = client.UpdateResponder(se.Response.Response)
 11255  		if err != nil {
 11256  			err = autorest.NewErrorWithError(err, "media.StreamingEndpointsUpdateFuture", "Result", se.Response.Response, "Failure responding to request")
 11257  		}
 11258  	}
 11259  	return
 11260  }
 11261  
 11262  // StreamingEntityScaleUnit scale units definition
 11263  type StreamingEntityScaleUnit struct {
 11264  	// ScaleUnit - The scale unit number of the streaming endpoint.
 11265  	ScaleUnit *int32 `json:"scaleUnit,omitempty"`
 11266  }
 11267  
 11268  // StreamingLocator a Streaming Locator resource
 11269  type StreamingLocator struct {
 11270  	autorest.Response           `json:"-"`
 11271  	*StreamingLocatorProperties `json:"properties,omitempty"`
 11272  	// SystemData - READ-ONLY; The system metadata relating to this resource.
 11273  	SystemData *SystemData `json:"systemData,omitempty"`
 11274  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 11275  	ID *string `json:"id,omitempty"`
 11276  	// Name - READ-ONLY; The name of the resource
 11277  	Name *string `json:"name,omitempty"`
 11278  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 11279  	Type *string `json:"type,omitempty"`
 11280  }
 11281  
 11282  // MarshalJSON is the custom marshaler for StreamingLocator.
 11283  func (sl StreamingLocator) MarshalJSON() ([]byte, error) {
 11284  	objectMap := make(map[string]interface{})
 11285  	if sl.StreamingLocatorProperties != nil {
 11286  		objectMap["properties"] = sl.StreamingLocatorProperties
 11287  	}
 11288  	return json.Marshal(objectMap)
 11289  }
 11290  
 11291  // UnmarshalJSON is the custom unmarshaler for StreamingLocator struct.
 11292  func (sl *StreamingLocator) UnmarshalJSON(body []byte) error {
 11293  	var m map[string]*json.RawMessage
 11294  	err := json.Unmarshal(body, &m)
 11295  	if err != nil {
 11296  		return err
 11297  	}
 11298  	for k, v := range m {
 11299  		switch k {
 11300  		case "properties":
 11301  			if v != nil {
 11302  				var streamingLocatorProperties StreamingLocatorProperties
 11303  				err = json.Unmarshal(*v, &streamingLocatorProperties)
 11304  				if err != nil {
 11305  					return err
 11306  				}
 11307  				sl.StreamingLocatorProperties = &streamingLocatorProperties
 11308  			}
 11309  		case "systemData":
 11310  			if v != nil {
 11311  				var systemData SystemData
 11312  				err = json.Unmarshal(*v, &systemData)
 11313  				if err != nil {
 11314  					return err
 11315  				}
 11316  				sl.SystemData = &systemData
 11317  			}
 11318  		case "id":
 11319  			if v != nil {
 11320  				var ID string
 11321  				err = json.Unmarshal(*v, &ID)
 11322  				if err != nil {
 11323  					return err
 11324  				}
 11325  				sl.ID = &ID
 11326  			}
 11327  		case "name":
 11328  			if v != nil {
 11329  				var name string
 11330  				err = json.Unmarshal(*v, &name)
 11331  				if err != nil {
 11332  					return err
 11333  				}
 11334  				sl.Name = &name
 11335  			}
 11336  		case "type":
 11337  			if v != nil {
 11338  				var typeVar string
 11339  				err = json.Unmarshal(*v, &typeVar)
 11340  				if err != nil {
 11341  					return err
 11342  				}
 11343  				sl.Type = &typeVar
 11344  			}
 11345  		}
 11346  	}
 11347  
 11348  	return nil
 11349  }
 11350  
 11351  // StreamingLocatorCollection a collection of StreamingLocator items.
 11352  type StreamingLocatorCollection struct {
 11353  	autorest.Response `json:"-"`
 11354  	// Value - A collection of StreamingLocator items.
 11355  	Value *[]StreamingLocator `json:"value,omitempty"`
 11356  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
 11357  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
 11358  }
 11359  
 11360  // StreamingLocatorCollectionIterator provides access to a complete listing of StreamingLocator values.
 11361  type StreamingLocatorCollectionIterator struct {
 11362  	i    int
 11363  	page StreamingLocatorCollectionPage
 11364  }
 11365  
 11366  // NextWithContext advances to the next value.  If there was an error making
 11367  // the request the iterator does not advance and the error is returned.
 11368  func (iter *StreamingLocatorCollectionIterator) NextWithContext(ctx context.Context) (err error) {
 11369  	if tracing.IsEnabled() {
 11370  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorCollectionIterator.NextWithContext")
 11371  		defer func() {
 11372  			sc := -1
 11373  			if iter.Response().Response.Response != nil {
 11374  				sc = iter.Response().Response.Response.StatusCode
 11375  			}
 11376  			tracing.EndSpan(ctx, sc, err)
 11377  		}()
 11378  	}
 11379  	iter.i++
 11380  	if iter.i < len(iter.page.Values()) {
 11381  		return nil
 11382  	}
 11383  	err = iter.page.NextWithContext(ctx)
 11384  	if err != nil {
 11385  		iter.i--
 11386  		return err
 11387  	}
 11388  	iter.i = 0
 11389  	return nil
 11390  }
 11391  
 11392  // Next advances to the next value.  If there was an error making
 11393  // the request the iterator does not advance and the error is returned.
 11394  // Deprecated: Use NextWithContext() instead.
 11395  func (iter *StreamingLocatorCollectionIterator) Next() error {
 11396  	return iter.NextWithContext(context.Background())
 11397  }
 11398  
 11399  // NotDone returns true if the enumeration should be started or is not yet complete.
 11400  func (iter StreamingLocatorCollectionIterator) NotDone() bool {
 11401  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
 11402  }
 11403  
 11404  // Response returns the raw server response from the last page request.
 11405  func (iter StreamingLocatorCollectionIterator) Response() StreamingLocatorCollection {
 11406  	return iter.page.Response()
 11407  }
 11408  
 11409  // Value returns the current value or a zero-initialized value if the
 11410  // iterator has advanced beyond the end of the collection.
 11411  func (iter StreamingLocatorCollectionIterator) Value() StreamingLocator {
 11412  	if !iter.page.NotDone() {
 11413  		return StreamingLocator{}
 11414  	}
 11415  	return iter.page.Values()[iter.i]
 11416  }
 11417  
 11418  // Creates a new instance of the StreamingLocatorCollectionIterator type.
 11419  func NewStreamingLocatorCollectionIterator(page StreamingLocatorCollectionPage) StreamingLocatorCollectionIterator {
 11420  	return StreamingLocatorCollectionIterator{page: page}
 11421  }
 11422  
 11423  // IsEmpty returns true if the ListResult contains no values.
 11424  func (slc StreamingLocatorCollection) IsEmpty() bool {
 11425  	return slc.Value == nil || len(*slc.Value) == 0
 11426  }
 11427  
 11428  // hasNextLink returns true if the NextLink is not empty.
 11429  func (slc StreamingLocatorCollection) hasNextLink() bool {
 11430  	return slc.OdataNextLink != nil && len(*slc.OdataNextLink) != 0
 11431  }
 11432  
 11433  // streamingLocatorCollectionPreparer prepares a request to retrieve the next set of results.
 11434  // It returns nil if no more results exist.
 11435  func (slc StreamingLocatorCollection) streamingLocatorCollectionPreparer(ctx context.Context) (*http.Request, error) {
 11436  	if !slc.hasNextLink() {
 11437  		return nil, nil
 11438  	}
 11439  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
 11440  		autorest.AsJSON(),
 11441  		autorest.AsGet(),
 11442  		autorest.WithBaseURL(to.String(slc.OdataNextLink)))
 11443  }
 11444  
 11445  // StreamingLocatorCollectionPage contains a page of StreamingLocator values.
 11446  type StreamingLocatorCollectionPage struct {
 11447  	fn  func(context.Context, StreamingLocatorCollection) (StreamingLocatorCollection, error)
 11448  	slc StreamingLocatorCollection
 11449  }
 11450  
 11451  // NextWithContext advances to the next page of values.  If there was an error making
 11452  // the request the page does not advance and the error is returned.
 11453  func (page *StreamingLocatorCollectionPage) NextWithContext(ctx context.Context) (err error) {
 11454  	if tracing.IsEnabled() {
 11455  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorCollectionPage.NextWithContext")
 11456  		defer func() {
 11457  			sc := -1
 11458  			if page.Response().Response.Response != nil {
 11459  				sc = page.Response().Response.Response.StatusCode
 11460  			}
 11461  			tracing.EndSpan(ctx, sc, err)
 11462  		}()
 11463  	}
 11464  	for {
 11465  		next, err := page.fn(ctx, page.slc)
 11466  		if err != nil {
 11467  			return err
 11468  		}
 11469  		page.slc = next
 11470  		if !next.hasNextLink() || !next.IsEmpty() {
 11471  			break
 11472  		}
 11473  	}
 11474  	return nil
 11475  }
 11476  
 11477  // Next advances to the next page of values.  If there was an error making
 11478  // the request the page does not advance and the error is returned.
 11479  // Deprecated: Use NextWithContext() instead.
 11480  func (page *StreamingLocatorCollectionPage) Next() error {
 11481  	return page.NextWithContext(context.Background())
 11482  }
 11483  
 11484  // NotDone returns true if the page enumeration should be started or is not yet complete.
 11485  func (page StreamingLocatorCollectionPage) NotDone() bool {
 11486  	return !page.slc.IsEmpty()
 11487  }
 11488  
 11489  // Response returns the raw server response from the last page request.
 11490  func (page StreamingLocatorCollectionPage) Response() StreamingLocatorCollection {
 11491  	return page.slc
 11492  }
 11493  
 11494  // Values returns the slice of values for the current page or nil if there are no values.
 11495  func (page StreamingLocatorCollectionPage) Values() []StreamingLocator {
 11496  	if page.slc.IsEmpty() {
 11497  		return nil
 11498  	}
 11499  	return *page.slc.Value
 11500  }
 11501  
 11502  // Creates a new instance of the StreamingLocatorCollectionPage type.
 11503  func NewStreamingLocatorCollectionPage(cur StreamingLocatorCollection, getNextPage func(context.Context, StreamingLocatorCollection) (StreamingLocatorCollection, error)) StreamingLocatorCollectionPage {
 11504  	return StreamingLocatorCollectionPage{
 11505  		fn:  getNextPage,
 11506  		slc: cur,
 11507  	}
 11508  }
 11509  
 11510  // StreamingLocatorContentKey class for content key in Streaming Locator
 11511  type StreamingLocatorContentKey struct {
 11512  	// ID - ID of Content Key
 11513  	ID *uuid.UUID `json:"id,omitempty"`
 11514  	// Type - READ-ONLY; Encryption type of Content Key. Possible values include: 'StreamingLocatorContentKeyTypeCommonEncryptionCenc', 'StreamingLocatorContentKeyTypeCommonEncryptionCbcs', 'StreamingLocatorContentKeyTypeEnvelopeEncryption'
 11515  	Type StreamingLocatorContentKeyType `json:"type,omitempty"`
 11516  	// LabelReferenceInStreamingPolicy - Label of Content Key as specified in the Streaming Policy
 11517  	LabelReferenceInStreamingPolicy *string `json:"labelReferenceInStreamingPolicy,omitempty"`
 11518  	// Value - Value of Content Key
 11519  	Value *string `json:"value,omitempty"`
 11520  	// PolicyName - READ-ONLY; ContentKeyPolicy used by Content Key
 11521  	PolicyName *string `json:"policyName,omitempty"`
 11522  	// Tracks - READ-ONLY; Tracks which use this Content Key
 11523  	Tracks *[]TrackSelection `json:"tracks,omitempty"`
 11524  }
 11525  
 11526  // MarshalJSON is the custom marshaler for StreamingLocatorContentKey.
 11527  func (slck StreamingLocatorContentKey) MarshalJSON() ([]byte, error) {
 11528  	objectMap := make(map[string]interface{})
 11529  	if slck.ID != nil {
 11530  		objectMap["id"] = slck.ID
 11531  	}
 11532  	if slck.LabelReferenceInStreamingPolicy != nil {
 11533  		objectMap["labelReferenceInStreamingPolicy"] = slck.LabelReferenceInStreamingPolicy
 11534  	}
 11535  	if slck.Value != nil {
 11536  		objectMap["value"] = slck.Value
 11537  	}
 11538  	return json.Marshal(objectMap)
 11539  }
 11540  
 11541  // StreamingLocatorProperties properties of the Streaming Locator.
 11542  type StreamingLocatorProperties struct {
 11543  	// AssetName - Asset Name
 11544  	AssetName *string `json:"assetName,omitempty"`
 11545  	// Created - READ-ONLY; The creation time of the Streaming Locator.
 11546  	Created *date.Time `json:"created,omitempty"`
 11547  	// StartTime - The start time of the Streaming Locator.
 11548  	StartTime *date.Time `json:"startTime,omitempty"`
 11549  	// EndTime - The end time of the Streaming Locator.
 11550  	EndTime *date.Time `json:"endTime,omitempty"`
 11551  	// StreamingLocatorID - The StreamingLocatorId of the Streaming Locator.
 11552  	StreamingLocatorID *uuid.UUID `json:"streamingLocatorId,omitempty"`
 11553  	// 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'
 11554  	StreamingPolicyName *string `json:"streamingPolicyName,omitempty"`
 11555  	// DefaultContentKeyPolicyName - Name of the default ContentKeyPolicy used by this Streaming Locator.
 11556  	DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"`
 11557  	// ContentKeys - The ContentKeys used by this Streaming Locator.
 11558  	ContentKeys *[]StreamingLocatorContentKey `json:"contentKeys,omitempty"`
 11559  	// AlternativeMediaID - Alternative Media ID of this Streaming Locator
 11560  	AlternativeMediaID *string `json:"alternativeMediaId,omitempty"`
 11561  	// Filters - A list of asset or account filters which apply to this streaming locator
 11562  	Filters *[]string `json:"filters,omitempty"`
 11563  }
 11564  
 11565  // MarshalJSON is the custom marshaler for StreamingLocatorProperties.
 11566  func (slp StreamingLocatorProperties) MarshalJSON() ([]byte, error) {
 11567  	objectMap := make(map[string]interface{})
 11568  	if slp.AssetName != nil {
 11569  		objectMap["assetName"] = slp.AssetName
 11570  	}
 11571  	if slp.StartTime != nil {
 11572  		objectMap["startTime"] = slp.StartTime
 11573  	}
 11574  	if slp.EndTime != nil {
 11575  		objectMap["endTime"] = slp.EndTime
 11576  	}
 11577  	if slp.StreamingLocatorID != nil {
 11578  		objectMap["streamingLocatorId"] = slp.StreamingLocatorID
 11579  	}
 11580  	if slp.StreamingPolicyName != nil {
 11581  		objectMap["streamingPolicyName"] = slp.StreamingPolicyName
 11582  	}
 11583  	if slp.DefaultContentKeyPolicyName != nil {
 11584  		objectMap["defaultContentKeyPolicyName"] = slp.DefaultContentKeyPolicyName
 11585  	}
 11586  	if slp.ContentKeys != nil {
 11587  		objectMap["contentKeys"] = slp.ContentKeys
 11588  	}
 11589  	if slp.AlternativeMediaID != nil {
 11590  		objectMap["alternativeMediaId"] = slp.AlternativeMediaID
 11591  	}
 11592  	if slp.Filters != nil {
 11593  		objectMap["filters"] = slp.Filters
 11594  	}
 11595  	return json.Marshal(objectMap)
 11596  }
 11597  
 11598  // StreamingPath class of paths for streaming
 11599  type StreamingPath struct {
 11600  	// StreamingProtocol - Streaming protocol. Possible values include: 'StreamingPolicyStreamingProtocolHls', 'StreamingPolicyStreamingProtocolDash', 'StreamingPolicyStreamingProtocolSmoothStreaming', 'StreamingPolicyStreamingProtocolDownload'
 11601  	StreamingProtocol StreamingPolicyStreamingProtocol `json:"streamingProtocol,omitempty"`
 11602  	// EncryptionScheme - Encryption scheme. Possible values include: 'EncryptionSchemeNoEncryption', 'EncryptionSchemeEnvelopeEncryption', 'EncryptionSchemeCommonEncryptionCenc', 'EncryptionSchemeCommonEncryptionCbcs'
 11603  	EncryptionScheme EncryptionScheme `json:"encryptionScheme,omitempty"`
 11604  	// Paths - Streaming paths for each protocol and encryptionScheme pair
 11605  	Paths *[]string `json:"paths,omitempty"`
 11606  }
 11607  
 11608  // StreamingPolicy a Streaming Policy resource
 11609  type StreamingPolicy struct {
 11610  	autorest.Response          `json:"-"`
 11611  	*StreamingPolicyProperties `json:"properties,omitempty"`
 11612  	// SystemData - READ-ONLY; The system metadata relating to this resource.
 11613  	SystemData *SystemData `json:"systemData,omitempty"`
 11614  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 11615  	ID *string `json:"id,omitempty"`
 11616  	// Name - READ-ONLY; The name of the resource
 11617  	Name *string `json:"name,omitempty"`
 11618  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 11619  	Type *string `json:"type,omitempty"`
 11620  }
 11621  
 11622  // MarshalJSON is the custom marshaler for StreamingPolicy.
 11623  func (sp StreamingPolicy) MarshalJSON() ([]byte, error) {
 11624  	objectMap := make(map[string]interface{})
 11625  	if sp.StreamingPolicyProperties != nil {
 11626  		objectMap["properties"] = sp.StreamingPolicyProperties
 11627  	}
 11628  	return json.Marshal(objectMap)
 11629  }
 11630  
 11631  // UnmarshalJSON is the custom unmarshaler for StreamingPolicy struct.
 11632  func (sp *StreamingPolicy) UnmarshalJSON(body []byte) error {
 11633  	var m map[string]*json.RawMessage
 11634  	err := json.Unmarshal(body, &m)
 11635  	if err != nil {
 11636  		return err
 11637  	}
 11638  	for k, v := range m {
 11639  		switch k {
 11640  		case "properties":
 11641  			if v != nil {
 11642  				var streamingPolicyProperties StreamingPolicyProperties
 11643  				err = json.Unmarshal(*v, &streamingPolicyProperties)
 11644  				if err != nil {
 11645  					return err
 11646  				}
 11647  				sp.StreamingPolicyProperties = &streamingPolicyProperties
 11648  			}
 11649  		case "systemData":
 11650  			if v != nil {
 11651  				var systemData SystemData
 11652  				err = json.Unmarshal(*v, &systemData)
 11653  				if err != nil {
 11654  					return err
 11655  				}
 11656  				sp.SystemData = &systemData
 11657  			}
 11658  		case "id":
 11659  			if v != nil {
 11660  				var ID string
 11661  				err = json.Unmarshal(*v, &ID)
 11662  				if err != nil {
 11663  					return err
 11664  				}
 11665  				sp.ID = &ID
 11666  			}
 11667  		case "name":
 11668  			if v != nil {
 11669  				var name string
 11670  				err = json.Unmarshal(*v, &name)
 11671  				if err != nil {
 11672  					return err
 11673  				}
 11674  				sp.Name = &name
 11675  			}
 11676  		case "type":
 11677  			if v != nil {
 11678  				var typeVar string
 11679  				err = json.Unmarshal(*v, &typeVar)
 11680  				if err != nil {
 11681  					return err
 11682  				}
 11683  				sp.Type = &typeVar
 11684  			}
 11685  		}
 11686  	}
 11687  
 11688  	return nil
 11689  }
 11690  
 11691  // StreamingPolicyCollection a collection of StreamingPolicy items.
 11692  type StreamingPolicyCollection struct {
 11693  	autorest.Response `json:"-"`
 11694  	// Value - A collection of StreamingPolicy items.
 11695  	Value *[]StreamingPolicy `json:"value,omitempty"`
 11696  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
 11697  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
 11698  }
 11699  
 11700  // StreamingPolicyCollectionIterator provides access to a complete listing of StreamingPolicy values.
 11701  type StreamingPolicyCollectionIterator struct {
 11702  	i    int
 11703  	page StreamingPolicyCollectionPage
 11704  }
 11705  
 11706  // NextWithContext advances to the next value.  If there was an error making
 11707  // the request the iterator does not advance and the error is returned.
 11708  func (iter *StreamingPolicyCollectionIterator) NextWithContext(ctx context.Context) (err error) {
 11709  	if tracing.IsEnabled() {
 11710  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingPolicyCollectionIterator.NextWithContext")
 11711  		defer func() {
 11712  			sc := -1
 11713  			if iter.Response().Response.Response != nil {
 11714  				sc = iter.Response().Response.Response.StatusCode
 11715  			}
 11716  			tracing.EndSpan(ctx, sc, err)
 11717  		}()
 11718  	}
 11719  	iter.i++
 11720  	if iter.i < len(iter.page.Values()) {
 11721  		return nil
 11722  	}
 11723  	err = iter.page.NextWithContext(ctx)
 11724  	if err != nil {
 11725  		iter.i--
 11726  		return err
 11727  	}
 11728  	iter.i = 0
 11729  	return nil
 11730  }
 11731  
 11732  // Next advances to the next value.  If there was an error making
 11733  // the request the iterator does not advance and the error is returned.
 11734  // Deprecated: Use NextWithContext() instead.
 11735  func (iter *StreamingPolicyCollectionIterator) Next() error {
 11736  	return iter.NextWithContext(context.Background())
 11737  }
 11738  
 11739  // NotDone returns true if the enumeration should be started or is not yet complete.
 11740  func (iter StreamingPolicyCollectionIterator) NotDone() bool {
 11741  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
 11742  }
 11743  
 11744  // Response returns the raw server response from the last page request.
 11745  func (iter StreamingPolicyCollectionIterator) Response() StreamingPolicyCollection {
 11746  	return iter.page.Response()
 11747  }
 11748  
 11749  // Value returns the current value or a zero-initialized value if the
 11750  // iterator has advanced beyond the end of the collection.
 11751  func (iter StreamingPolicyCollectionIterator) Value() StreamingPolicy {
 11752  	if !iter.page.NotDone() {
 11753  		return StreamingPolicy{}
 11754  	}
 11755  	return iter.page.Values()[iter.i]
 11756  }
 11757  
 11758  // Creates a new instance of the StreamingPolicyCollectionIterator type.
 11759  func NewStreamingPolicyCollectionIterator(page StreamingPolicyCollectionPage) StreamingPolicyCollectionIterator {
 11760  	return StreamingPolicyCollectionIterator{page: page}
 11761  }
 11762  
 11763  // IsEmpty returns true if the ListResult contains no values.
 11764  func (spc StreamingPolicyCollection) IsEmpty() bool {
 11765  	return spc.Value == nil || len(*spc.Value) == 0
 11766  }
 11767  
 11768  // hasNextLink returns true if the NextLink is not empty.
 11769  func (spc StreamingPolicyCollection) hasNextLink() bool {
 11770  	return spc.OdataNextLink != nil && len(*spc.OdataNextLink) != 0
 11771  }
 11772  
 11773  // streamingPolicyCollectionPreparer prepares a request to retrieve the next set of results.
 11774  // It returns nil if no more results exist.
 11775  func (spc StreamingPolicyCollection) streamingPolicyCollectionPreparer(ctx context.Context) (*http.Request, error) {
 11776  	if !spc.hasNextLink() {
 11777  		return nil, nil
 11778  	}
 11779  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
 11780  		autorest.AsJSON(),
 11781  		autorest.AsGet(),
 11782  		autorest.WithBaseURL(to.String(spc.OdataNextLink)))
 11783  }
 11784  
 11785  // StreamingPolicyCollectionPage contains a page of StreamingPolicy values.
 11786  type StreamingPolicyCollectionPage struct {
 11787  	fn  func(context.Context, StreamingPolicyCollection) (StreamingPolicyCollection, error)
 11788  	spc StreamingPolicyCollection
 11789  }
 11790  
 11791  // NextWithContext advances to the next page of values.  If there was an error making
 11792  // the request the page does not advance and the error is returned.
 11793  func (page *StreamingPolicyCollectionPage) NextWithContext(ctx context.Context) (err error) {
 11794  	if tracing.IsEnabled() {
 11795  		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingPolicyCollectionPage.NextWithContext")
 11796  		defer func() {
 11797  			sc := -1
 11798  			if page.Response().Response.Response != nil {
 11799  				sc = page.Response().Response.Response.StatusCode
 11800  			}
 11801  			tracing.EndSpan(ctx, sc, err)
 11802  		}()
 11803  	}
 11804  	for {
 11805  		next, err := page.fn(ctx, page.spc)
 11806  		if err != nil {
 11807  			return err
 11808  		}
 11809  		page.spc = next
 11810  		if !next.hasNextLink() || !next.IsEmpty() {
 11811  			break
 11812  		}
 11813  	}
 11814  	return nil
 11815  }
 11816  
 11817  // Next advances to the next page of values.  If there was an error making
 11818  // the request the page does not advance and the error is returned.
 11819  // Deprecated: Use NextWithContext() instead.
 11820  func (page *StreamingPolicyCollectionPage) Next() error {
 11821  	return page.NextWithContext(context.Background())
 11822  }
 11823  
 11824  // NotDone returns true if the page enumeration should be started or is not yet complete.
 11825  func (page StreamingPolicyCollectionPage) NotDone() bool {
 11826  	return !page.spc.IsEmpty()
 11827  }
 11828  
 11829  // Response returns the raw server response from the last page request.
 11830  func (page StreamingPolicyCollectionPage) Response() StreamingPolicyCollection {
 11831  	return page.spc
 11832  }
 11833  
 11834  // Values returns the slice of values for the current page or nil if there are no values.
 11835  func (page StreamingPolicyCollectionPage) Values() []StreamingPolicy {
 11836  	if page.spc.IsEmpty() {
 11837  		return nil
 11838  	}
 11839  	return *page.spc.Value
 11840  }
 11841  
 11842  // Creates a new instance of the StreamingPolicyCollectionPage type.
 11843  func NewStreamingPolicyCollectionPage(cur StreamingPolicyCollection, getNextPage func(context.Context, StreamingPolicyCollection) (StreamingPolicyCollection, error)) StreamingPolicyCollectionPage {
 11844  	return StreamingPolicyCollectionPage{
 11845  		fn:  getNextPage,
 11846  		spc: cur,
 11847  	}
 11848  }
 11849  
 11850  // StreamingPolicyContentKey class to specify properties of content key
 11851  type StreamingPolicyContentKey struct {
 11852  	// Label - Label can be used to specify Content Key when creating a Streaming Locator
 11853  	Label *string `json:"label,omitempty"`
 11854  	// PolicyName - Policy used by Content Key
 11855  	PolicyName *string `json:"policyName,omitempty"`
 11856  	// Tracks - Tracks which use this content key
 11857  	Tracks *[]TrackSelection `json:"tracks,omitempty"`
 11858  }
 11859  
 11860  // StreamingPolicyContentKeys class to specify properties of all content keys in Streaming Policy
 11861  type StreamingPolicyContentKeys struct {
 11862  	// DefaultKey - Default content key for an encryption scheme
 11863  	DefaultKey *DefaultKey `json:"defaultKey,omitempty"`
 11864  	// KeyToTrackMappings - Representing tracks needs separate content key
 11865  	KeyToTrackMappings *[]StreamingPolicyContentKey `json:"keyToTrackMappings,omitempty"`
 11866  }
 11867  
 11868  // StreamingPolicyFairPlayConfiguration class to specify configurations of FairPlay in Streaming Policy
 11869  type StreamingPolicyFairPlayConfiguration struct {
 11870  	// 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.
 11871  	CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"`
 11872  	// AllowPersistentLicense - All license to be persistent or not
 11873  	AllowPersistentLicense *bool `json:"allowPersistentLicense,omitempty"`
 11874  }
 11875  
 11876  // StreamingPolicyPlayReadyConfiguration class to specify configurations of PlayReady in Streaming Policy
 11877  type StreamingPolicyPlayReadyConfiguration struct {
 11878  	// 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.
 11879  	CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"`
 11880  	// PlayReadyCustomAttributes - Custom attributes for PlayReady
 11881  	PlayReadyCustomAttributes *string `json:"playReadyCustomAttributes,omitempty"`
 11882  }
 11883  
 11884  // StreamingPolicyProperties class to specify properties of Streaming Policy
 11885  type StreamingPolicyProperties struct {
 11886  	// Created - READ-ONLY; Creation time of Streaming Policy
 11887  	Created *date.Time `json:"created,omitempty"`
 11888  	// DefaultContentKeyPolicyName - Default ContentKey used by current Streaming Policy
 11889  	DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"`
 11890  	// EnvelopeEncryption - Configuration of EnvelopeEncryption
 11891  	EnvelopeEncryption *EnvelopeEncryption `json:"envelopeEncryption,omitempty"`
 11892  	// CommonEncryptionCenc - Configuration of CommonEncryptionCenc
 11893  	CommonEncryptionCenc *CommonEncryptionCenc `json:"commonEncryptionCenc,omitempty"`
 11894  	// CommonEncryptionCbcs - Configuration of CommonEncryptionCbcs
 11895  	CommonEncryptionCbcs *CommonEncryptionCbcs `json:"commonEncryptionCbcs,omitempty"`
 11896  	// NoEncryption - Configurations of NoEncryption
 11897  	NoEncryption *NoEncryption `json:"noEncryption,omitempty"`
 11898  }
 11899  
 11900  // MarshalJSON is the custom marshaler for StreamingPolicyProperties.
 11901  func (spp StreamingPolicyProperties) MarshalJSON() ([]byte, error) {
 11902  	objectMap := make(map[string]interface{})
 11903  	if spp.DefaultContentKeyPolicyName != nil {
 11904  		objectMap["defaultContentKeyPolicyName"] = spp.DefaultContentKeyPolicyName
 11905  	}
 11906  	if spp.EnvelopeEncryption != nil {
 11907  		objectMap["envelopeEncryption"] = spp.EnvelopeEncryption
 11908  	}
 11909  	if spp.CommonEncryptionCenc != nil {
 11910  		objectMap["commonEncryptionCenc"] = spp.CommonEncryptionCenc
 11911  	}
 11912  	if spp.CommonEncryptionCbcs != nil {
 11913  		objectMap["commonEncryptionCbcs"] = spp.CommonEncryptionCbcs
 11914  	}
 11915  	if spp.NoEncryption != nil {
 11916  		objectMap["noEncryption"] = spp.NoEncryption
 11917  	}
 11918  	return json.Marshal(objectMap)
 11919  }
 11920  
 11921  // StreamingPolicyWidevineConfiguration class to specify configurations of Widevine in Streaming Policy
 11922  type StreamingPolicyWidevineConfiguration struct {
 11923  	// 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.
 11924  	CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"`
 11925  }
 11926  
 11927  // SyncStorageKeysInput the input to the sync storage keys request.
 11928  type SyncStorageKeysInput struct {
 11929  	// ID - The ID of the storage account resource.
 11930  	ID *string `json:"id,omitempty"`
 11931  }
 11932  
 11933  // SystemData metadata pertaining to creation and last modification of the resource.
 11934  type SystemData struct {
 11935  	// CreatedBy - The identity that created the resource.
 11936  	CreatedBy *string `json:"createdBy,omitempty"`
 11937  	// CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
 11938  	CreatedByType CreatedByType `json:"createdByType,omitempty"`
 11939  	// CreatedAt - The timestamp of resource creation (UTC).
 11940  	CreatedAt *date.Time `json:"createdAt,omitempty"`
 11941  	// LastModifiedBy - The identity that last modified the resource.
 11942  	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
 11943  	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
 11944  	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
 11945  	// LastModifiedAt - The timestamp of resource last modification (UTC)
 11946  	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
 11947  }
 11948  
 11949  // BasicTrackDescriptor base type for all TrackDescriptor types, which define the metadata and selection for tracks
 11950  // that should be processed by a Job
 11951  type BasicTrackDescriptor interface {
 11952  	AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool)
 11953  	AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool)
 11954  	AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool)
 11955  	AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool)
 11956  	AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool)
 11957  	AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool)
 11958  	AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool)
 11959  	AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool)
 11960  	AsTrackDescriptor() (*TrackDescriptor, bool)
 11961  }
 11962  
 11963  // TrackDescriptor base type for all TrackDescriptor types, which define the metadata and selection for tracks
 11964  // that should be processed by a Job
 11965  type TrackDescriptor struct {
 11966  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
 11967  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
 11968  }
 11969  
 11970  func unmarshalBasicTrackDescriptor(body []byte) (BasicTrackDescriptor, error) {
 11971  	var m map[string]interface{}
 11972  	err := json.Unmarshal(body, &m)
 11973  	if err != nil {
 11974  		return nil, err
 11975  	}
 11976  
 11977  	switch m["@odata.type"] {
 11978  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor):
 11979  		var atd AudioTrackDescriptor
 11980  		err := json.Unmarshal(body, &atd)
 11981  		return atd, err
 11982  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute):
 11983  		var satba SelectAudioTrackByAttribute
 11984  		err := json.Unmarshal(body, &satba)
 11985  		return satba, err
 11986  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID):
 11987  		var satbi SelectAudioTrackByID
 11988  		err := json.Unmarshal(body, &satbi)
 11989  		return satbi, err
 11990  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor):
 11991  		var vtd VideoTrackDescriptor
 11992  		err := json.Unmarshal(body, &vtd)
 11993  		return vtd, err
 11994  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute):
 11995  		var svtba SelectVideoTrackByAttribute
 11996  		err := json.Unmarshal(body, &svtba)
 11997  		return svtba, err
 11998  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID):
 11999  		var svtbi SelectVideoTrackByID
 12000  		err := json.Unmarshal(body, &svtbi)
 12001  		return svtbi, err
 12002  	default:
 12003  		var td TrackDescriptor
 12004  		err := json.Unmarshal(body, &td)
 12005  		return td, err
 12006  	}
 12007  }
 12008  func unmarshalBasicTrackDescriptorArray(body []byte) ([]BasicTrackDescriptor, error) {
 12009  	var rawMessages []*json.RawMessage
 12010  	err := json.Unmarshal(body, &rawMessages)
 12011  	if err != nil {
 12012  		return nil, err
 12013  	}
 12014  
 12015  	tdArray := make([]BasicTrackDescriptor, len(rawMessages))
 12016  
 12017  	for index, rawMessage := range rawMessages {
 12018  		td, err := unmarshalBasicTrackDescriptor(*rawMessage)
 12019  		if err != nil {
 12020  			return nil, err
 12021  		}
 12022  		tdArray[index] = td
 12023  	}
 12024  	return tdArray, nil
 12025  }
 12026  
 12027  // MarshalJSON is the custom marshaler for TrackDescriptor.
 12028  func (td TrackDescriptor) MarshalJSON() ([]byte, error) {
 12029  	td.OdataType = OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor
 12030  	objectMap := make(map[string]interface{})
 12031  	if td.OdataType != "" {
 12032  		objectMap["@odata.type"] = td.OdataType
 12033  	}
 12034  	return json.Marshal(objectMap)
 12035  }
 12036  
 12037  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12038  func (td TrackDescriptor) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
 12039  	return nil, false
 12040  }
 12041  
 12042  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12043  func (td TrackDescriptor) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
 12044  	return nil, false
 12045  }
 12046  
 12047  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for TrackDescriptor.
 12048  func (td TrackDescriptor) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
 12049  	return nil, false
 12050  }
 12051  
 12052  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for TrackDescriptor.
 12053  func (td TrackDescriptor) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
 12054  	return nil, false
 12055  }
 12056  
 12057  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12058  func (td TrackDescriptor) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
 12059  	return nil, false
 12060  }
 12061  
 12062  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12063  func (td TrackDescriptor) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
 12064  	return nil, false
 12065  }
 12066  
 12067  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for TrackDescriptor.
 12068  func (td TrackDescriptor) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
 12069  	return nil, false
 12070  }
 12071  
 12072  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for TrackDescriptor.
 12073  func (td TrackDescriptor) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
 12074  	return nil, false
 12075  }
 12076  
 12077  // AsTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12078  func (td TrackDescriptor) AsTrackDescriptor() (*TrackDescriptor, bool) {
 12079  	return &td, true
 12080  }
 12081  
 12082  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for TrackDescriptor.
 12083  func (td TrackDescriptor) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
 12084  	return &td, true
 12085  }
 12086  
 12087  // TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource
 12088  // which has 'tags' and a 'location'
 12089  type TrackedResource struct {
 12090  	// Tags - Resource tags.
 12091  	Tags map[string]*string `json:"tags"`
 12092  	// Location - The geo-location where the resource lives
 12093  	Location *string `json:"location,omitempty"`
 12094  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 12095  	ID *string `json:"id,omitempty"`
 12096  	// Name - READ-ONLY; The name of the resource
 12097  	Name *string `json:"name,omitempty"`
 12098  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 12099  	Type *string `json:"type,omitempty"`
 12100  }
 12101  
 12102  // MarshalJSON is the custom marshaler for TrackedResource.
 12103  func (tr TrackedResource) MarshalJSON() ([]byte, error) {
 12104  	objectMap := make(map[string]interface{})
 12105  	if tr.Tags != nil {
 12106  		objectMap["tags"] = tr.Tags
 12107  	}
 12108  	if tr.Location != nil {
 12109  		objectMap["location"] = tr.Location
 12110  	}
 12111  	return json.Marshal(objectMap)
 12112  }
 12113  
 12114  // TrackPropertyCondition class to specify one track property condition
 12115  type TrackPropertyCondition struct {
 12116  	// Property - Track property type. Possible values include: 'TrackPropertyTypeUnknown', 'TrackPropertyTypeFourCC'
 12117  	Property TrackPropertyType `json:"property,omitempty"`
 12118  	// Operation - Track property condition operation. Possible values include: 'TrackPropertyCompareOperationUnknown', 'TrackPropertyCompareOperationEqual'
 12119  	Operation TrackPropertyCompareOperation `json:"operation,omitempty"`
 12120  	// Value - Track property value
 12121  	Value *string `json:"value,omitempty"`
 12122  }
 12123  
 12124  // TrackSelection class to select a track
 12125  type TrackSelection struct {
 12126  	// TrackSelections - TrackSelections is a track property condition list which can specify track(s)
 12127  	TrackSelections *[]TrackPropertyCondition `json:"trackSelections,omitempty"`
 12128  }
 12129  
 12130  // Transform a Transform encapsulates the rules or instructions for generating desired outputs from input
 12131  // media, such as by transcoding or by extracting insights. After the Transform is created, it can be
 12132  // applied to input media by creating Jobs.
 12133  type Transform struct {
 12134  	autorest.Response `json:"-"`
 12135  	// TransformProperties - The resource properties.
 12136  	*TransformProperties `json:"properties,omitempty"`
 12137  	// SystemData - READ-ONLY; The system metadata relating to this resource.
 12138  	SystemData *SystemData `json:"systemData,omitempty"`
 12139  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
 12140  	ID *string `json:"id,omitempty"`
 12141  	// Name - READ-ONLY; The name of the resource
 12142  	Name *string `json:"name,omitempty"`
 12143  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
 12144  	Type *string `json:"type,omitempty"`
 12145  }
 12146  
 12147  // MarshalJSON is the custom marshaler for Transform.
 12148  func (t Transform) MarshalJSON() ([]byte, error) {
 12149  	objectMap := make(map[string]interface{})
 12150  	if t.TransformProperties != nil {
 12151  		objectMap["properties"] = t.TransformProperties
 12152  	}
 12153  	return json.Marshal(objectMap)
 12154  }
 12155  
 12156  // UnmarshalJSON is the custom unmarshaler for Transform struct.
 12157  func (t *Transform) UnmarshalJSON(body []byte) error {
 12158  	var m map[string]*json.RawMessage
 12159  	err := json.Unmarshal(body, &m)
 12160  	if err != nil {
 12161  		return err
 12162  	}
 12163  	for k, v := range m {
 12164  		switch k {
 12165  		case "properties":
 12166  			if v != nil {
 12167  				var transformProperties TransformProperties
 12168  				err = json.Unmarshal(*v, &transformProperties)
 12169  				if err != nil {
 12170  					return err
 12171  				}
 12172  				t.TransformProperties = &transformProperties
 12173  			}
 12174  		case "systemData":
 12175  			if v != nil {
 12176  				var systemData SystemData
 12177  				err = json.Unmarshal(*v, &systemData)
 12178  				if err != nil {
 12179  					return err
 12180  				}
 12181  				t.SystemData = &systemData
 12182  			}
 12183  		case "id":
 12184  			if v != nil {
 12185  				var ID string
 12186  				err = json.Unmarshal(*v, &ID)
 12187  				if err != nil {
 12188  					return err
 12189  				}
 12190  				t.ID = &ID
 12191  			}
 12192  		case "name":
 12193  			if v != nil {
 12194  				var name string
 12195  				err = json.Unmarshal(*v, &name)
 12196  				if err != nil {
 12197  					return err
 12198  				}
 12199  				t.Name = &name
 12200  			}
 12201  		case "type":
 12202  			if v != nil {
 12203  				var typeVar string
 12204  				err = json.Unmarshal(*v, &typeVar)
 12205  				if err != nil {
 12206  					return err
 12207  				}
 12208  				t.Type = &typeVar
 12209  			}
 12210  		}
 12211  	}
 12212  
 12213  	return nil
 12214  }
 12215  
 12216  // TransformCollection a collection of Transform items.
 12217  type TransformCollection struct {
 12218  	autorest.Response `json:"-"`
 12219  	// Value - A collection of Transform items.
 12220  	Value *[]Transform `json:"value,omitempty"`
 12221  	// OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response).
 12222  	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
 12223  }
 12224  
 12225  // TransformCollectionIterator provides access to a complete listing of Transform values.
 12226  type TransformCollectionIterator struct {
 12227  	i    int
 12228  	page TransformCollectionPage
 12229  }
 12230  
 12231  // NextWithContext advances to the next value.  If there was an error making
 12232  // the request the iterator does not advance and the error is returned.
 12233  func (iter *TransformCollectionIterator) NextWithContext(ctx context.Context) (err error) {
 12234  	if tracing.IsEnabled() {
 12235  		ctx = tracing.StartSpan(ctx, fqdn+"/TransformCollectionIterator.NextWithContext")
 12236  		defer func() {
 12237  			sc := -1
 12238  			if iter.Response().Response.Response != nil {
 12239  				sc = iter.Response().Response.Response.StatusCode
 12240  			}
 12241  			tracing.EndSpan(ctx, sc, err)
 12242  		}()
 12243  	}
 12244  	iter.i++
 12245  	if iter.i < len(iter.page.Values()) {
 12246  		return nil
 12247  	}
 12248  	err = iter.page.NextWithContext(ctx)
 12249  	if err != nil {
 12250  		iter.i--
 12251  		return err
 12252  	}
 12253  	iter.i = 0
 12254  	return nil
 12255  }
 12256  
 12257  // Next advances to the next value.  If there was an error making
 12258  // the request the iterator does not advance and the error is returned.
 12259  // Deprecated: Use NextWithContext() instead.
 12260  func (iter *TransformCollectionIterator) Next() error {
 12261  	return iter.NextWithContext(context.Background())
 12262  }
 12263  
 12264  // NotDone returns true if the enumeration should be started or is not yet complete.
 12265  func (iter TransformCollectionIterator) NotDone() bool {
 12266  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
 12267  }
 12268  
 12269  // Response returns the raw server response from the last page request.
 12270  func (iter TransformCollectionIterator) Response() TransformCollection {
 12271  	return iter.page.Response()
 12272  }
 12273  
 12274  // Value returns the current value or a zero-initialized value if the
 12275  // iterator has advanced beyond the end of the collection.
 12276  func (iter TransformCollectionIterator) Value() Transform {
 12277  	if !iter.page.NotDone() {
 12278  		return Transform{}
 12279  	}
 12280  	return iter.page.Values()[iter.i]
 12281  }
 12282  
 12283  // Creates a new instance of the TransformCollectionIterator type.
 12284  func NewTransformCollectionIterator(page TransformCollectionPage) TransformCollectionIterator {
 12285  	return TransformCollectionIterator{page: page}
 12286  }
 12287  
 12288  // IsEmpty returns true if the ListResult contains no values.
 12289  func (tc TransformCollection) IsEmpty() bool {
 12290  	return tc.Value == nil || len(*tc.Value) == 0
 12291  }
 12292  
 12293  // hasNextLink returns true if the NextLink is not empty.
 12294  func (tc TransformCollection) hasNextLink() bool {
 12295  	return tc.OdataNextLink != nil && len(*tc.OdataNextLink) != 0
 12296  }
 12297  
 12298  // transformCollectionPreparer prepares a request to retrieve the next set of results.
 12299  // It returns nil if no more results exist.
 12300  func (tc TransformCollection) transformCollectionPreparer(ctx context.Context) (*http.Request, error) {
 12301  	if !tc.hasNextLink() {
 12302  		return nil, nil
 12303  	}
 12304  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
 12305  		autorest.AsJSON(),
 12306  		autorest.AsGet(),
 12307  		autorest.WithBaseURL(to.String(tc.OdataNextLink)))
 12308  }
 12309  
 12310  // TransformCollectionPage contains a page of Transform values.
 12311  type TransformCollectionPage struct {
 12312  	fn func(context.Context, TransformCollection) (TransformCollection, error)
 12313  	tc TransformCollection
 12314  }
 12315  
 12316  // NextWithContext advances to the next page of values.  If there was an error making
 12317  // the request the page does not advance and the error is returned.
 12318  func (page *TransformCollectionPage) NextWithContext(ctx context.Context) (err error) {
 12319  	if tracing.IsEnabled() {
 12320  		ctx = tracing.StartSpan(ctx, fqdn+"/TransformCollectionPage.NextWithContext")
 12321  		defer func() {
 12322  			sc := -1
 12323  			if page.Response().Response.Response != nil {
 12324  				sc = page.Response().Response.Response.StatusCode
 12325  			}
 12326  			tracing.EndSpan(ctx, sc, err)
 12327  		}()
 12328  	}
 12329  	for {
 12330  		next, err := page.fn(ctx, page.tc)
 12331  		if err != nil {
 12332  			return err
 12333  		}
 12334  		page.tc = next
 12335  		if !next.hasNextLink() || !next.IsEmpty() {
 12336  			break
 12337  		}
 12338  	}
 12339  	return nil
 12340  }
 12341  
 12342  // Next advances to the next page of values.  If there was an error making
 12343  // the request the page does not advance and the error is returned.
 12344  // Deprecated: Use NextWithContext() instead.
 12345  func (page *TransformCollectionPage) Next() error {
 12346  	return page.NextWithContext(context.Background())
 12347  }
 12348  
 12349  // NotDone returns true if the page enumeration should be started or is not yet complete.
 12350  func (page TransformCollectionPage) NotDone() bool {
 12351  	return !page.tc.IsEmpty()
 12352  }
 12353  
 12354  // Response returns the raw server response from the last page request.
 12355  func (page TransformCollectionPage) Response() TransformCollection {
 12356  	return page.tc
 12357  }
 12358  
 12359  // Values returns the slice of values for the current page or nil if there are no values.
 12360  func (page TransformCollectionPage) Values() []Transform {
 12361  	if page.tc.IsEmpty() {
 12362  		return nil
 12363  	}
 12364  	return *page.tc.Value
 12365  }
 12366  
 12367  // Creates a new instance of the TransformCollectionPage type.
 12368  func NewTransformCollectionPage(cur TransformCollection, getNextPage func(context.Context, TransformCollection) (TransformCollection, error)) TransformCollectionPage {
 12369  	return TransformCollectionPage{
 12370  		fn: getNextPage,
 12371  		tc: cur,
 12372  	}
 12373  }
 12374  
 12375  // TransformOutput describes the properties of a TransformOutput, which are the rules to be applied while
 12376  // generating the desired output.
 12377  type TransformOutput struct {
 12378  	// 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'
 12379  	OnError OnErrorType `json:"onError,omitempty"`
 12380  	// 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'
 12381  	RelativePriority Priority `json:"relativePriority,omitempty"`
 12382  	// Preset - Preset that describes the operations that will be used to modify, transcode, or extract insights from the source file to generate the output.
 12383  	Preset BasicPreset `json:"preset,omitempty"`
 12384  }
 12385  
 12386  // UnmarshalJSON is the custom unmarshaler for TransformOutput struct.
 12387  func (toVar *TransformOutput) UnmarshalJSON(body []byte) error {
 12388  	var m map[string]*json.RawMessage
 12389  	err := json.Unmarshal(body, &m)
 12390  	if err != nil {
 12391  		return err
 12392  	}
 12393  	for k, v := range m {
 12394  		switch k {
 12395  		case "onError":
 12396  			if v != nil {
 12397  				var onError OnErrorType
 12398  				err = json.Unmarshal(*v, &onError)
 12399  				if err != nil {
 12400  					return err
 12401  				}
 12402  				toVar.OnError = onError
 12403  			}
 12404  		case "relativePriority":
 12405  			if v != nil {
 12406  				var relativePriority Priority
 12407  				err = json.Unmarshal(*v, &relativePriority)
 12408  				if err != nil {
 12409  					return err
 12410  				}
 12411  				toVar.RelativePriority = relativePriority
 12412  			}
 12413  		case "preset":
 12414  			if v != nil {
 12415  				preset, err := unmarshalBasicPreset(*v)
 12416  				if err != nil {
 12417  					return err
 12418  				}
 12419  				toVar.Preset = preset
 12420  			}
 12421  		}
 12422  	}
 12423  
 12424  	return nil
 12425  }
 12426  
 12427  // TransformProperties a Transform.
 12428  type TransformProperties struct {
 12429  	// Created - READ-ONLY; The UTC date and time when the Transform was created, in 'YYYY-MM-DDThh:mm:ssZ' format.
 12430  	Created *date.Time `json:"created,omitempty"`
 12431  	// Description - An optional verbose description of the Transform.
 12432  	Description *string `json:"description,omitempty"`
 12433  	// LastModified - READ-ONLY; The UTC date and time when the Transform was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format.
 12434  	LastModified *date.Time `json:"lastModified,omitempty"`
 12435  	// Outputs - An array of one or more TransformOutputs that the Transform should generate.
 12436  	Outputs *[]TransformOutput `json:"outputs,omitempty"`
 12437  }
 12438  
 12439  // MarshalJSON is the custom marshaler for TransformProperties.
 12440  func (tp TransformProperties) MarshalJSON() ([]byte, error) {
 12441  	objectMap := make(map[string]interface{})
 12442  	if tp.Description != nil {
 12443  		objectMap["description"] = tp.Description
 12444  	}
 12445  	if tp.Outputs != nil {
 12446  		objectMap["outputs"] = tp.Outputs
 12447  	}
 12448  	return json.Marshal(objectMap)
 12449  }
 12450  
 12451  // TransportStreamFormat describes the properties for generating an MPEG-2 Transport Stream (ISO/IEC
 12452  // 13818-1) output video file(s).
 12453  type TransportStreamFormat struct {
 12454  	// 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 .
 12455  	OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
 12456  	// 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.
 12457  	FilenamePattern *string `json:"filenamePattern,omitempty"`
 12458  	// OdataType - Possible values include: 'OdataTypeBasicFormatOdataTypeFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaImageFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaJpgFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaPngFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaMp4Format', 'OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat'
 12459  	OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"`
 12460  }
 12461  
 12462  // MarshalJSON is the custom marshaler for TransportStreamFormat.
 12463  func (tsf TransportStreamFormat) MarshalJSON() ([]byte, error) {
 12464  	tsf.OdataType = OdataTypeBasicFormatOdataTypeMicrosoftMediaTransportStreamFormat
 12465  	objectMap := make(map[string]interface{})
 12466  	if tsf.OutputFiles != nil {
 12467  		objectMap["outputFiles"] = tsf.OutputFiles
 12468  	}
 12469  	if tsf.FilenamePattern != nil {
 12470  		objectMap["filenamePattern"] = tsf.FilenamePattern
 12471  	}
 12472  	if tsf.OdataType != "" {
 12473  		objectMap["@odata.type"] = tsf.OdataType
 12474  	}
 12475  	return json.Marshal(objectMap)
 12476  }
 12477  
 12478  // AsImageFormat is the BasicFormat implementation for TransportStreamFormat.
 12479  func (tsf TransportStreamFormat) AsImageFormat() (*ImageFormat, bool) {
 12480  	return nil, false
 12481  }
 12482  
 12483  // AsBasicImageFormat is the BasicFormat implementation for TransportStreamFormat.
 12484  func (tsf TransportStreamFormat) AsBasicImageFormat() (BasicImageFormat, bool) {
 12485  	return nil, false
 12486  }
 12487  
 12488  // AsJpgFormat is the BasicFormat implementation for TransportStreamFormat.
 12489  func (tsf TransportStreamFormat) AsJpgFormat() (*JpgFormat, bool) {
 12490  	return nil, false
 12491  }
 12492  
 12493  // AsPngFormat is the BasicFormat implementation for TransportStreamFormat.
 12494  func (tsf TransportStreamFormat) AsPngFormat() (*PngFormat, bool) {
 12495  	return nil, false
 12496  }
 12497  
 12498  // AsMultiBitrateFormat is the BasicFormat implementation for TransportStreamFormat.
 12499  func (tsf TransportStreamFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) {
 12500  	return nil, false
 12501  }
 12502  
 12503  // AsBasicMultiBitrateFormat is the BasicFormat implementation for TransportStreamFormat.
 12504  func (tsf TransportStreamFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) {
 12505  	return &tsf, true
 12506  }
 12507  
 12508  // AsMp4Format is the BasicFormat implementation for TransportStreamFormat.
 12509  func (tsf TransportStreamFormat) AsMp4Format() (*Mp4Format, bool) {
 12510  	return nil, false
 12511  }
 12512  
 12513  // AsTransportStreamFormat is the BasicFormat implementation for TransportStreamFormat.
 12514  func (tsf TransportStreamFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) {
 12515  	return &tsf, true
 12516  }
 12517  
 12518  // AsFormat is the BasicFormat implementation for TransportStreamFormat.
 12519  func (tsf TransportStreamFormat) AsFormat() (*Format, bool) {
 12520  	return nil, false
 12521  }
 12522  
 12523  // AsBasicFormat is the BasicFormat implementation for TransportStreamFormat.
 12524  func (tsf TransportStreamFormat) AsBasicFormat() (BasicFormat, bool) {
 12525  	return &tsf, true
 12526  }
 12527  
 12528  // UtcClipTime specifies the clip time as a Utc time position in the media file.  The Utc time can point to
 12529  // a different position depending on whether the media file starts from a timestamp of zero or not.
 12530  type UtcClipTime struct {
 12531  	// Time - The time position on the timeline of the input media based on Utc time.
 12532  	Time *date.Time `json:"time,omitempty"`
 12533  	// OdataType - Possible values include: 'OdataTypeBasicClipTimeOdataTypeClipTime', 'OdataTypeBasicClipTimeOdataTypeMicrosoftMediaAbsoluteClipTime', 'OdataTypeBasicClipTimeOdataTypeMicrosoftMediaUtcClipTime'
 12534  	OdataType OdataTypeBasicClipTime `json:"@odata.type,omitempty"`
 12535  }
 12536  
 12537  // MarshalJSON is the custom marshaler for UtcClipTime.
 12538  func (uct UtcClipTime) MarshalJSON() ([]byte, error) {
 12539  	uct.OdataType = OdataTypeBasicClipTimeOdataTypeMicrosoftMediaUtcClipTime
 12540  	objectMap := make(map[string]interface{})
 12541  	if uct.Time != nil {
 12542  		objectMap["time"] = uct.Time
 12543  	}
 12544  	if uct.OdataType != "" {
 12545  		objectMap["@odata.type"] = uct.OdataType
 12546  	}
 12547  	return json.Marshal(objectMap)
 12548  }
 12549  
 12550  // AsAbsoluteClipTime is the BasicClipTime implementation for UtcClipTime.
 12551  func (uct UtcClipTime) AsAbsoluteClipTime() (*AbsoluteClipTime, bool) {
 12552  	return nil, false
 12553  }
 12554  
 12555  // AsUtcClipTime is the BasicClipTime implementation for UtcClipTime.
 12556  func (uct UtcClipTime) AsUtcClipTime() (*UtcClipTime, bool) {
 12557  	return &uct, true
 12558  }
 12559  
 12560  // AsClipTime is the BasicClipTime implementation for UtcClipTime.
 12561  func (uct UtcClipTime) AsClipTime() (*ClipTime, bool) {
 12562  	return nil, false
 12563  }
 12564  
 12565  // AsBasicClipTime is the BasicClipTime implementation for UtcClipTime.
 12566  func (uct UtcClipTime) AsBasicClipTime() (BasicClipTime, bool) {
 12567  	return &uct, true
 12568  }
 12569  
 12570  // BasicVideo describes the basic properties for encoding the input video.
 12571  type BasicVideo interface {
 12572  	AsH265Video() (*H265Video, bool)
 12573  	AsImage() (*Image, bool)
 12574  	AsBasicImage() (BasicImage, bool)
 12575  	AsH264Video() (*H264Video, bool)
 12576  	AsJpgImage() (*JpgImage, bool)
 12577  	AsPngImage() (*PngImage, bool)
 12578  	AsVideo() (*Video, bool)
 12579  }
 12580  
 12581  // Video describes the basic properties for encoding the input video.
 12582  type Video struct {
 12583  	// 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.
 12584  	KeyFrameInterval *string `json:"keyFrameInterval,omitempty"`
 12585  	// 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'
 12586  	StretchMode StretchMode `json:"stretchMode,omitempty"`
 12587  	// SyncMode - The Video Sync Mode. Possible values include: 'VideoSyncModeAuto', 'VideoSyncModePassthrough', 'VideoSyncModeCfr', 'VideoSyncModeVfr'
 12588  	SyncMode VideoSyncMode `json:"syncMode,omitempty"`
 12589  	// Label - An optional label for the codec. The label can be used to control muxing behavior.
 12590  	Label *string `json:"label,omitempty"`
 12591  	// OdataType - Possible values include: 'OdataTypeBasicCodecOdataTypeCodec', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaAacAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyVideo', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaCopyAudio', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage', 'OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage'
 12592  	OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"`
 12593  }
 12594  
 12595  func unmarshalBasicVideo(body []byte) (BasicVideo, error) {
 12596  	var m map[string]interface{}
 12597  	err := json.Unmarshal(body, &m)
 12598  	if err != nil {
 12599  		return nil, err
 12600  	}
 12601  
 12602  	switch m["@odata.type"] {
 12603  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaH265Video):
 12604  		var hv H265Video
 12605  		err := json.Unmarshal(body, &hv)
 12606  		return hv, err
 12607  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaImage):
 12608  		var i Image
 12609  		err := json.Unmarshal(body, &i)
 12610  		return i, err
 12611  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaH264Video):
 12612  		var hv H264Video
 12613  		err := json.Unmarshal(body, &hv)
 12614  		return hv, err
 12615  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaJpgImage):
 12616  		var ji JpgImage
 12617  		err := json.Unmarshal(body, &ji)
 12618  		return ji, err
 12619  	case string(OdataTypeBasicCodecOdataTypeMicrosoftMediaPngImage):
 12620  		var pi PngImage
 12621  		err := json.Unmarshal(body, &pi)
 12622  		return pi, err
 12623  	default:
 12624  		var vVar Video
 12625  		err := json.Unmarshal(body, &vVar)
 12626  		return vVar, err
 12627  	}
 12628  }
 12629  func unmarshalBasicVideoArray(body []byte) ([]BasicVideo, error) {
 12630  	var rawMessages []*json.RawMessage
 12631  	err := json.Unmarshal(body, &rawMessages)
 12632  	if err != nil {
 12633  		return nil, err
 12634  	}
 12635  
 12636  	vVarArray := make([]BasicVideo, len(rawMessages))
 12637  
 12638  	for index, rawMessage := range rawMessages {
 12639  		vVar, err := unmarshalBasicVideo(*rawMessage)
 12640  		if err != nil {
 12641  			return nil, err
 12642  		}
 12643  		vVarArray[index] = vVar
 12644  	}
 12645  	return vVarArray, nil
 12646  }
 12647  
 12648  // MarshalJSON is the custom marshaler for Video.
 12649  func (vVar Video) MarshalJSON() ([]byte, error) {
 12650  	vVar.OdataType = OdataTypeBasicCodecOdataTypeMicrosoftMediaVideo
 12651  	objectMap := make(map[string]interface{})
 12652  	if vVar.KeyFrameInterval != nil {
 12653  		objectMap["keyFrameInterval"] = vVar.KeyFrameInterval
 12654  	}
 12655  	if vVar.StretchMode != "" {
 12656  		objectMap["stretchMode"] = vVar.StretchMode
 12657  	}
 12658  	if vVar.SyncMode != "" {
 12659  		objectMap["syncMode"] = vVar.SyncMode
 12660  	}
 12661  	if vVar.Label != nil {
 12662  		objectMap["label"] = vVar.Label
 12663  	}
 12664  	if vVar.OdataType != "" {
 12665  		objectMap["@odata.type"] = vVar.OdataType
 12666  	}
 12667  	return json.Marshal(objectMap)
 12668  }
 12669  
 12670  // AsAudio is the BasicCodec implementation for Video.
 12671  func (vVar Video) AsAudio() (*Audio, bool) {
 12672  	return nil, false
 12673  }
 12674  
 12675  // AsBasicAudio is the BasicCodec implementation for Video.
 12676  func (vVar Video) AsBasicAudio() (BasicAudio, bool) {
 12677  	return nil, false
 12678  }
 12679  
 12680  // AsAacAudio is the BasicCodec implementation for Video.
 12681  func (vVar Video) AsAacAudio() (*AacAudio, bool) {
 12682  	return nil, false
 12683  }
 12684  
 12685  // AsVideo is the BasicCodec implementation for Video.
 12686  func (vVar Video) AsVideo() (*Video, bool) {
 12687  	return &vVar, true
 12688  }
 12689  
 12690  // AsBasicVideo is the BasicCodec implementation for Video.
 12691  func (vVar Video) AsBasicVideo() (BasicVideo, bool) {
 12692  	return &vVar, true
 12693  }
 12694  
 12695  // AsH265Video is the BasicCodec implementation for Video.
 12696  func (vVar Video) AsH265Video() (*H265Video, bool) {
 12697  	return nil, false
 12698  }
 12699  
 12700  // AsCopyVideo is the BasicCodec implementation for Video.
 12701  func (vVar Video) AsCopyVideo() (*CopyVideo, bool) {
 12702  	return nil, false
 12703  }
 12704  
 12705  // AsImage is the BasicCodec implementation for Video.
 12706  func (vVar Video) AsImage() (*Image, bool) {
 12707  	return nil, false
 12708  }
 12709  
 12710  // AsBasicImage is the BasicCodec implementation for Video.
 12711  func (vVar Video) AsBasicImage() (BasicImage, bool) {
 12712  	return nil, false
 12713  }
 12714  
 12715  // AsCopyAudio is the BasicCodec implementation for Video.
 12716  func (vVar Video) AsCopyAudio() (*CopyAudio, bool) {
 12717  	return nil, false
 12718  }
 12719  
 12720  // AsH264Video is the BasicCodec implementation for Video.
 12721  func (vVar Video) AsH264Video() (*H264Video, bool) {
 12722  	return nil, false
 12723  }
 12724  
 12725  // AsJpgImage is the BasicCodec implementation for Video.
 12726  func (vVar Video) AsJpgImage() (*JpgImage, bool) {
 12727  	return nil, false
 12728  }
 12729  
 12730  // AsPngImage is the BasicCodec implementation for Video.
 12731  func (vVar Video) AsPngImage() (*PngImage, bool) {
 12732  	return nil, false
 12733  }
 12734  
 12735  // AsCodec is the BasicCodec implementation for Video.
 12736  func (vVar Video) AsCodec() (*Codec, bool) {
 12737  	return nil, false
 12738  }
 12739  
 12740  // AsBasicCodec is the BasicCodec implementation for Video.
 12741  func (vVar Video) AsBasicCodec() (BasicCodec, bool) {
 12742  	return &vVar, true
 12743  }
 12744  
 12745  // VideoAnalyzerPreset a video analyzer preset that extracts insights (rich metadata) from both audio and
 12746  // video, and outputs a JSON format file.
 12747  type VideoAnalyzerPreset struct {
 12748  	// 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'
 12749  	InsightsToExtract InsightsType `json:"insightsToExtract,omitempty"`
 12750  	// 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
 12751  	AudioLanguage *string `json:"audioLanguage,omitempty"`
 12752  	// Mode - Determines the set of audio analysis operations to be performed. If unspecified, the Standard AudioAnalysisMode would be chosen. Possible values include: 'AudioAnalysisModeStandard', 'AudioAnalysisModeBasic'
 12753  	Mode AudioAnalysisMode `json:"mode,omitempty"`
 12754  	// ExperimentalOptions - Dictionary containing key value pairs for parameters not exposed in the preset itself
 12755  	ExperimentalOptions map[string]*string `json:"experimentalOptions"`
 12756  	// OdataType - Possible values include: 'OdataTypeBasicPresetOdataTypePreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset'
 12757  	OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"`
 12758  }
 12759  
 12760  // MarshalJSON is the custom marshaler for VideoAnalyzerPreset.
 12761  func (vap VideoAnalyzerPreset) MarshalJSON() ([]byte, error) {
 12762  	vap.OdataType = OdataTypeBasicPresetOdataTypeMicrosoftMediaVideoAnalyzerPreset
 12763  	objectMap := make(map[string]interface{})
 12764  	if vap.InsightsToExtract != "" {
 12765  		objectMap["insightsToExtract"] = vap.InsightsToExtract
 12766  	}
 12767  	if vap.AudioLanguage != nil {
 12768  		objectMap["audioLanguage"] = vap.AudioLanguage
 12769  	}
 12770  	if vap.Mode != "" {
 12771  		objectMap["mode"] = vap.Mode
 12772  	}
 12773  	if vap.ExperimentalOptions != nil {
 12774  		objectMap["experimentalOptions"] = vap.ExperimentalOptions
 12775  	}
 12776  	if vap.OdataType != "" {
 12777  		objectMap["@odata.type"] = vap.OdataType
 12778  	}
 12779  	return json.Marshal(objectMap)
 12780  }
 12781  
 12782  // AsFaceDetectorPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12783  func (vap VideoAnalyzerPreset) AsFaceDetectorPreset() (*FaceDetectorPreset, bool) {
 12784  	return nil, false
 12785  }
 12786  
 12787  // AsAudioAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12788  func (vap VideoAnalyzerPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) {
 12789  	return nil, false
 12790  }
 12791  
 12792  // AsBasicAudioAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12793  func (vap VideoAnalyzerPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) {
 12794  	return &vap, true
 12795  }
 12796  
 12797  // AsBuiltInStandardEncoderPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12798  func (vap VideoAnalyzerPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) {
 12799  	return nil, false
 12800  }
 12801  
 12802  // AsStandardEncoderPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12803  func (vap VideoAnalyzerPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) {
 12804  	return nil, false
 12805  }
 12806  
 12807  // AsVideoAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12808  func (vap VideoAnalyzerPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) {
 12809  	return &vap, true
 12810  }
 12811  
 12812  // AsPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12813  func (vap VideoAnalyzerPreset) AsPreset() (*Preset, bool) {
 12814  	return nil, false
 12815  }
 12816  
 12817  // AsBasicPreset is the BasicPreset implementation for VideoAnalyzerPreset.
 12818  func (vap VideoAnalyzerPreset) AsBasicPreset() (BasicPreset, bool) {
 12819  	return &vap, true
 12820  }
 12821  
 12822  // BasicVideoLayer describes the settings to be used when encoding the input video into a desired output bitrate layer.
 12823  type BasicVideoLayer interface {
 12824  	AsH264Layer() (*H264Layer, bool)
 12825  	AsVideoLayer() (*VideoLayer, bool)
 12826  }
 12827  
 12828  // VideoLayer describes the settings to be used when encoding the input video into a desired output bitrate
 12829  // layer.
 12830  type VideoLayer struct {
 12831  	// Bitrate - The average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field.
 12832  	Bitrate *int32 `json:"bitrate,omitempty"`
 12833  	// 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.
 12834  	MaxBitrate *int32 `json:"maxBitrate,omitempty"`
 12835  	// 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.
 12836  	BFrames *int32 `json:"bFrames,omitempty"`
 12837  	// 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.
 12838  	FrameRate *string `json:"frameRate,omitempty"`
 12839  	// 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.
 12840  	Slices *int32 `json:"slices,omitempty"`
 12841  	// 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.
 12842  	AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"`
 12843  	// 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.
 12844  	Width *string `json:"width,omitempty"`
 12845  	// 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.
 12846  	Height *string `json:"height,omitempty"`
 12847  	// Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file.
 12848  	Label *string `json:"label,omitempty"`
 12849  	// OdataType - Possible values include: 'OdataTypeBasicLayerOdataTypeLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265VideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH265Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaJpgLayer', 'OdataTypeBasicLayerOdataTypeMicrosoftMediaPngLayer'
 12850  	OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"`
 12851  }
 12852  
 12853  func unmarshalBasicVideoLayer(body []byte) (BasicVideoLayer, error) {
 12854  	var m map[string]interface{}
 12855  	err := json.Unmarshal(body, &m)
 12856  	if err != nil {
 12857  		return nil, err
 12858  	}
 12859  
 12860  	switch m["@odata.type"] {
 12861  	case string(OdataTypeBasicLayerOdataTypeMicrosoftMediaH264Layer):
 12862  		var hl H264Layer
 12863  		err := json.Unmarshal(body, &hl)
 12864  		return hl, err
 12865  	default:
 12866  		var vl VideoLayer
 12867  		err := json.Unmarshal(body, &vl)
 12868  		return vl, err
 12869  	}
 12870  }
 12871  func unmarshalBasicVideoLayerArray(body []byte) ([]BasicVideoLayer, error) {
 12872  	var rawMessages []*json.RawMessage
 12873  	err := json.Unmarshal(body, &rawMessages)
 12874  	if err != nil {
 12875  		return nil, err
 12876  	}
 12877  
 12878  	vlArray := make([]BasicVideoLayer, len(rawMessages))
 12879  
 12880  	for index, rawMessage := range rawMessages {
 12881  		vl, err := unmarshalBasicVideoLayer(*rawMessage)
 12882  		if err != nil {
 12883  			return nil, err
 12884  		}
 12885  		vlArray[index] = vl
 12886  	}
 12887  	return vlArray, nil
 12888  }
 12889  
 12890  // MarshalJSON is the custom marshaler for VideoLayer.
 12891  func (vl VideoLayer) MarshalJSON() ([]byte, error) {
 12892  	vl.OdataType = OdataTypeBasicLayerOdataTypeMicrosoftMediaVideoLayer
 12893  	objectMap := make(map[string]interface{})
 12894  	if vl.Bitrate != nil {
 12895  		objectMap["bitrate"] = vl.Bitrate
 12896  	}
 12897  	if vl.MaxBitrate != nil {
 12898  		objectMap["maxBitrate"] = vl.MaxBitrate
 12899  	}
 12900  	if vl.BFrames != nil {
 12901  		objectMap["bFrames"] = vl.BFrames
 12902  	}
 12903  	if vl.FrameRate != nil {
 12904  		objectMap["frameRate"] = vl.FrameRate
 12905  	}
 12906  	if vl.Slices != nil {
 12907  		objectMap["slices"] = vl.Slices
 12908  	}
 12909  	if vl.AdaptiveBFrame != nil {
 12910  		objectMap["adaptiveBFrame"] = vl.AdaptiveBFrame
 12911  	}
 12912  	if vl.Width != nil {
 12913  		objectMap["width"] = vl.Width
 12914  	}
 12915  	if vl.Height != nil {
 12916  		objectMap["height"] = vl.Height
 12917  	}
 12918  	if vl.Label != nil {
 12919  		objectMap["label"] = vl.Label
 12920  	}
 12921  	if vl.OdataType != "" {
 12922  		objectMap["@odata.type"] = vl.OdataType
 12923  	}
 12924  	return json.Marshal(objectMap)
 12925  }
 12926  
 12927  // AsH265VideoLayer is the BasicLayer implementation for VideoLayer.
 12928  func (vl VideoLayer) AsH265VideoLayer() (*H265VideoLayer, bool) {
 12929  	return nil, false
 12930  }
 12931  
 12932  // AsBasicH265VideoLayer is the BasicLayer implementation for VideoLayer.
 12933  func (vl VideoLayer) AsBasicH265VideoLayer() (BasicH265VideoLayer, bool) {
 12934  	return nil, false
 12935  }
 12936  
 12937  // AsH265Layer is the BasicLayer implementation for VideoLayer.
 12938  func (vl VideoLayer) AsH265Layer() (*H265Layer, bool) {
 12939  	return nil, false
 12940  }
 12941  
 12942  // AsVideoLayer is the BasicLayer implementation for VideoLayer.
 12943  func (vl VideoLayer) AsVideoLayer() (*VideoLayer, bool) {
 12944  	return &vl, true
 12945  }
 12946  
 12947  // AsBasicVideoLayer is the BasicLayer implementation for VideoLayer.
 12948  func (vl VideoLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) {
 12949  	return &vl, true
 12950  }
 12951  
 12952  // AsH264Layer is the BasicLayer implementation for VideoLayer.
 12953  func (vl VideoLayer) AsH264Layer() (*H264Layer, bool) {
 12954  	return nil, false
 12955  }
 12956  
 12957  // AsJpgLayer is the BasicLayer implementation for VideoLayer.
 12958  func (vl VideoLayer) AsJpgLayer() (*JpgLayer, bool) {
 12959  	return nil, false
 12960  }
 12961  
 12962  // AsPngLayer is the BasicLayer implementation for VideoLayer.
 12963  func (vl VideoLayer) AsPngLayer() (*PngLayer, bool) {
 12964  	return nil, false
 12965  }
 12966  
 12967  // AsLayer is the BasicLayer implementation for VideoLayer.
 12968  func (vl VideoLayer) AsLayer() (*Layer, bool) {
 12969  	return nil, false
 12970  }
 12971  
 12972  // AsBasicLayer is the BasicLayer implementation for VideoLayer.
 12973  func (vl VideoLayer) AsBasicLayer() (BasicLayer, bool) {
 12974  	return &vl, true
 12975  }
 12976  
 12977  // VideoOverlay describes the properties of a video overlay.
 12978  type VideoOverlay struct {
 12979  	// Position - The location in the input video where the overlay is applied.
 12980  	Position *Rectangle `json:"position,omitempty"`
 12981  	// 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.
 12982  	Opacity *float64 `json:"opacity,omitempty"`
 12983  	// CropRectangle - An optional rectangular window used to crop the overlay image or video.
 12984  	CropRectangle *Rectangle `json:"cropRectangle,omitempty"`
 12985  	// 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.
 12986  	InputLabel *string `json:"inputLabel,omitempty"`
 12987  	// 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.
 12988  	Start *string `json:"start,omitempty"`
 12989  	// 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.
 12990  	End *string `json:"end,omitempty"`
 12991  	// 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).
 12992  	FadeInDuration *string `json:"fadeInDuration,omitempty"`
 12993  	// 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).
 12994  	FadeOutDuration *string `json:"fadeOutDuration,omitempty"`
 12995  	// AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0.
 12996  	AudioGainLevel *float64 `json:"audioGainLevel,omitempty"`
 12997  	// OdataType - Possible values include: 'OdataTypeBasicOverlayOdataTypeOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeBasicOverlayOdataTypeMicrosoftMediaVideoOverlay'
 12998  	OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"`
 12999  }
 13000  
 13001  // MarshalJSON is the custom marshaler for VideoOverlay.
 13002  func (vo VideoOverlay) MarshalJSON() ([]byte, error) {
 13003  	vo.OdataType = OdataTypeBasicOverlayOdataTypeMicrosoftMediaVideoOverlay
 13004  	objectMap := make(map[string]interface{})
 13005  	if vo.Position != nil {
 13006  		objectMap["position"] = vo.Position
 13007  	}
 13008  	if vo.Opacity != nil {
 13009  		objectMap["opacity"] = vo.Opacity
 13010  	}
 13011  	if vo.CropRectangle != nil {
 13012  		objectMap["cropRectangle"] = vo.CropRectangle
 13013  	}
 13014  	if vo.InputLabel != nil {
 13015  		objectMap["inputLabel"] = vo.InputLabel
 13016  	}
 13017  	if vo.Start != nil {
 13018  		objectMap["start"] = vo.Start
 13019  	}
 13020  	if vo.End != nil {
 13021  		objectMap["end"] = vo.End
 13022  	}
 13023  	if vo.FadeInDuration != nil {
 13024  		objectMap["fadeInDuration"] = vo.FadeInDuration
 13025  	}
 13026  	if vo.FadeOutDuration != nil {
 13027  		objectMap["fadeOutDuration"] = vo.FadeOutDuration
 13028  	}
 13029  	if vo.AudioGainLevel != nil {
 13030  		objectMap["audioGainLevel"] = vo.AudioGainLevel
 13031  	}
 13032  	if vo.OdataType != "" {
 13033  		objectMap["@odata.type"] = vo.OdataType
 13034  	}
 13035  	return json.Marshal(objectMap)
 13036  }
 13037  
 13038  // AsAudioOverlay is the BasicOverlay implementation for VideoOverlay.
 13039  func (vo VideoOverlay) AsAudioOverlay() (*AudioOverlay, bool) {
 13040  	return nil, false
 13041  }
 13042  
 13043  // AsVideoOverlay is the BasicOverlay implementation for VideoOverlay.
 13044  func (vo VideoOverlay) AsVideoOverlay() (*VideoOverlay, bool) {
 13045  	return &vo, true
 13046  }
 13047  
 13048  // AsOverlay is the BasicOverlay implementation for VideoOverlay.
 13049  func (vo VideoOverlay) AsOverlay() (*Overlay, bool) {
 13050  	return nil, false
 13051  }
 13052  
 13053  // AsBasicOverlay is the BasicOverlay implementation for VideoOverlay.
 13054  func (vo VideoOverlay) AsBasicOverlay() (BasicOverlay, bool) {
 13055  	return &vo, true
 13056  }
 13057  
 13058  // BasicVideoTrackDescriptor a TrackSelection to select video tracks.
 13059  type BasicVideoTrackDescriptor interface {
 13060  	AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool)
 13061  	AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool)
 13062  	AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool)
 13063  }
 13064  
 13065  // VideoTrackDescriptor a TrackSelection to select video tracks.
 13066  type VideoTrackDescriptor struct {
 13067  	// OdataType - Possible values include: 'OdataTypeBasicTrackDescriptorOdataTypeTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaAudioTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectAudioTrackByID', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute', 'OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID'
 13068  	OdataType OdataTypeBasicTrackDescriptor `json:"@odata.type,omitempty"`
 13069  }
 13070  
 13071  func unmarshalBasicVideoTrackDescriptor(body []byte) (BasicVideoTrackDescriptor, error) {
 13072  	var m map[string]interface{}
 13073  	err := json.Unmarshal(body, &m)
 13074  	if err != nil {
 13075  		return nil, err
 13076  	}
 13077  
 13078  	switch m["@odata.type"] {
 13079  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByAttribute):
 13080  		var svtba SelectVideoTrackByAttribute
 13081  		err := json.Unmarshal(body, &svtba)
 13082  		return svtba, err
 13083  	case string(OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaSelectVideoTrackByID):
 13084  		var svtbi SelectVideoTrackByID
 13085  		err := json.Unmarshal(body, &svtbi)
 13086  		return svtbi, err
 13087  	default:
 13088  		var vtd VideoTrackDescriptor
 13089  		err := json.Unmarshal(body, &vtd)
 13090  		return vtd, err
 13091  	}
 13092  }
 13093  func unmarshalBasicVideoTrackDescriptorArray(body []byte) ([]BasicVideoTrackDescriptor, error) {
 13094  	var rawMessages []*json.RawMessage
 13095  	err := json.Unmarshal(body, &rawMessages)
 13096  	if err != nil {
 13097  		return nil, err
 13098  	}
 13099  
 13100  	vtdArray := make([]BasicVideoTrackDescriptor, len(rawMessages))
 13101  
 13102  	for index, rawMessage := range rawMessages {
 13103  		vtd, err := unmarshalBasicVideoTrackDescriptor(*rawMessage)
 13104  		if err != nil {
 13105  			return nil, err
 13106  		}
 13107  		vtdArray[index] = vtd
 13108  	}
 13109  	return vtdArray, nil
 13110  }
 13111  
 13112  // MarshalJSON is the custom marshaler for VideoTrackDescriptor.
 13113  func (vtd VideoTrackDescriptor) MarshalJSON() ([]byte, error) {
 13114  	vtd.OdataType = OdataTypeBasicTrackDescriptorOdataTypeMicrosoftMediaVideoTrackDescriptor
 13115  	objectMap := make(map[string]interface{})
 13116  	if vtd.OdataType != "" {
 13117  		objectMap["@odata.type"] = vtd.OdataType
 13118  	}
 13119  	return json.Marshal(objectMap)
 13120  }
 13121  
 13122  // AsAudioTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13123  func (vtd VideoTrackDescriptor) AsAudioTrackDescriptor() (*AudioTrackDescriptor, bool) {
 13124  	return nil, false
 13125  }
 13126  
 13127  // AsBasicAudioTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13128  func (vtd VideoTrackDescriptor) AsBasicAudioTrackDescriptor() (BasicAudioTrackDescriptor, bool) {
 13129  	return nil, false
 13130  }
 13131  
 13132  // AsSelectAudioTrackByAttribute is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13133  func (vtd VideoTrackDescriptor) AsSelectAudioTrackByAttribute() (*SelectAudioTrackByAttribute, bool) {
 13134  	return nil, false
 13135  }
 13136  
 13137  // AsSelectAudioTrackByID is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13138  func (vtd VideoTrackDescriptor) AsSelectAudioTrackByID() (*SelectAudioTrackByID, bool) {
 13139  	return nil, false
 13140  }
 13141  
 13142  // AsVideoTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13143  func (vtd VideoTrackDescriptor) AsVideoTrackDescriptor() (*VideoTrackDescriptor, bool) {
 13144  	return &vtd, true
 13145  }
 13146  
 13147  // AsBasicVideoTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13148  func (vtd VideoTrackDescriptor) AsBasicVideoTrackDescriptor() (BasicVideoTrackDescriptor, bool) {
 13149  	return &vtd, true
 13150  }
 13151  
 13152  // AsSelectVideoTrackByAttribute is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13153  func (vtd VideoTrackDescriptor) AsSelectVideoTrackByAttribute() (*SelectVideoTrackByAttribute, bool) {
 13154  	return nil, false
 13155  }
 13156  
 13157  // AsSelectVideoTrackByID is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13158  func (vtd VideoTrackDescriptor) AsSelectVideoTrackByID() (*SelectVideoTrackByID, bool) {
 13159  	return nil, false
 13160  }
 13161  
 13162  // AsTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13163  func (vtd VideoTrackDescriptor) AsTrackDescriptor() (*TrackDescriptor, bool) {
 13164  	return nil, false
 13165  }
 13166  
 13167  // AsBasicTrackDescriptor is the BasicTrackDescriptor implementation for VideoTrackDescriptor.
 13168  func (vtd VideoTrackDescriptor) AsBasicTrackDescriptor() (BasicTrackDescriptor, bool) {
 13169  	return &vtd, true
 13170  }
 13171  

View as plain text