/// <summary>
        /// Builds a model and returns the associated <see cref="DisposableBuildModel"/> instance. Upon disposal, the model will be deleted.
        /// </summary>
        /// <param name="modelId">Model Id.</param>
        /// <param name="containerType">Type of container to use to execute training.</param>
        /// <param name="buildMode">The technique to use to build the model. Defaults to <see cref="DocumentBuildMode.Template"/>.</param>
        /// <returns>A <see cref="DisposableBuildModel"/> instance from which the trained model ID can be obtained.</returns>
        protected async Task <DisposableBuildModel> CreateDisposableBuildModelAsync(string modelId, ContainerType containerType = default, DocumentBuildMode buildMode = default)
        {
            var adminClient = CreateDocumentModelAdministrationClient();

            string trainingFiles = containerType switch
            {
                ContainerType.Singleforms => TestEnvironment.BlobContainerSasUrl,
                ContainerType.MultipageFiles => TestEnvironment.MultipageBlobContainerSasUrl,
                ContainerType.SelectionMarks => TestEnvironment.SelectionMarkBlobContainerSasUrl,
                ContainerType.TableVariableRows => TestEnvironment.TableDynamicRowsContainerSasUrl,
                ContainerType.TableFixedRows => TestEnvironment.TableFixedRowsContainerSasUrl,
                _ => TestEnvironment.BlobContainerSasUrl,
            };
            var trainingFilesUri = new Uri(trainingFiles);

            buildMode = (buildMode == default)
                ? DocumentBuildMode.Template
                : buildMode;

            return(await DisposableBuildModel.BuildModelAsync(adminClient, trainingFilesUri, buildMode, modelId));
        }
        /// <summary>
        /// Builds a model using the specified <see cref="DocumentModelAdministrationClient"/> and the specified set of training files. A
        /// <see cref="DisposableBuildModel"/> instance is returned. Upon disposal,
        /// the associated model will be deleted.
        /// </summary>
        /// <param name="adminClient">The client to use for building and for deleting the model upon disposal.</param>
        /// <param name="trainingFilesUri">An externally accessible Azure storage blob container Uri.</param>
        /// <param name="buildMode">The technique to use to build the model.</param>
        /// <param name="modelId">Model Id.</param>
        /// <returns>A <see cref="DisposableBuildModel"/> instance from which the trained model ID can be obtained.</returns>
        public static async Task<DisposableBuildModel> BuildModelAsync(DocumentModelAdministrationClient adminClient, Uri trainingFilesUri, DocumentBuildMode buildMode, string modelId)
        {
            BuildModelOperation operation = await adminClient.StartBuildModelAsync(trainingFilesUri, buildMode, modelId);
            await operation.WaitForCompletionAsync();

            Assert.IsTrue(operation.HasValue);

            return new DisposableBuildModel(adminClient, operation.Value.ModelId);
        }