/// <summary>
 /// Adds the new output asset.
 /// </summary>
 /// <param name="assetName">The asset name.</param>
 /// <param name="options">The asset creation options</param>
 /// <param name="formatOption">The asset format option.</param>
 /// <returns>The new asset.</returns>
 public IAsset AddNew(string assetName, AssetCreationOptions options, AssetFormatOption formatOption)
 {
     if (this._cloudMediaContext.DefaultStorageAccount == null)
     {
         throw new InvalidOperationException(StringTable.DefaultStorageAccountIsNull);
     }
     return(this.AddNew(assetName, _cloudMediaContext.DefaultStorageAccount.Name, options, formatOption));
 }
        /// <summary>
        /// Adds the new output asset.
        /// </summary>
        /// <param name="assetName">The asset name.</param>
        /// <param name="storageAccountName">The name of storage account where asset will be hosted</param>
        /// <param name="options">The asset creation options.</param>
        /// <param name="formatOption">The asset format option.</param>
        /// <returns>The new asset.</returns>
        public IAsset AddNew(string assetName, string storageAccountName, AssetCreationOptions options, AssetFormatOption formatOption)
        {
            this.CheckIfTaskIsPersistedAndThrowNotSupported();

            var asset = new OutputAsset
            {
                Name               = assetName,
                Options            = options,
                StorageAccountName = storageAccountName,
                AssociatedJob      = _task.GetParentJob(),
                FormatOption       = formatOption
            };

            this._assets.Add(asset);

            return(asset);
        }