示例#1
0
 /// <summary>
 /// Creates a new Azure Search indexer.
 /// <see href="https://msdn.microsoft.com/library/azure/dn946899.aspx" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='indexer'>
 /// The definition of the indexer to create.
 /// </param>
 /// <param name='searchRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Indexer> CreateAsync(this IIndexersOperations operations, Indexer indexer, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateWithHttpMessagesAsync(indexer, searchRequestOptions, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#2
0
 /// <summary>
 /// Returns the current status and execution history of an indexer.
 /// <see href="https://msdn.microsoft.com/library/azure/dn946884.aspx" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='indexerName'>
 /// The name of the indexer for which to retrieve status.
 /// </param>
 /// <param name='searchRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IndexerExecutionInfo> GetStatusAsync(this IIndexersOperations operations, string indexerName, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetStatusWithHttpMessagesAsync(indexerName, searchRequestOptions, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#3
0
 /// <summary>
 /// Determines whether or not the given indexer exists in the Azure Search service.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name="indexerName">
 /// The name of the indexer.
 /// </param>
 /// <param name='searchRequestOptions'>
 /// Additional parameters for the operation.
 /// </param>
 /// <returns>
 /// <c>true</c> if the indexer exists; <c>false</c> otherwise.
 /// </returns>
 public static bool Exists(
     this IIndexersOperations operations,
     string indexerName,
     SearchRequestOptions searchRequestOptions = default(SearchRequestOptions))
 {
     return(operations.ExistsAsync(indexerName, searchRequestOptions).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Determines whether or not the given indexer exists in the Azure Search service.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name="indexerName">
 /// The name of the indexer.
 /// </param>
 /// <param name='searchRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <returns>
 /// <c>true</c> if the indexer exists; <c>false</c> otherwise.
 /// </returns>
 public static bool Exists(
     this IIndexersOperations operations,
     string indexerName,
     SearchRequestOptions searchRequestOptions = default(SearchRequestOptions))
 {
     return(Task.Factory.StartNew(s => ((IIndexersOperations)s).ExistsAsync(indexerName, searchRequestOptions), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
示例#5
0
        /// <summary>
        /// Determines whether or not the given indexer exists in the Azure Search service.
        /// </summary>
        /// <param name='operations'>
        /// The operations group for this extension method.
        /// </param>
        /// <param name="indexerName">
        /// The name of the indexer.
        /// </param>
        /// <param name='searchRequestOptions'>
        /// Additional parameters for the operation.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <returns>
        /// <c>true</c> if the indexer exists; <c>false</c> otherwise.
        /// </returns>
        public static async Task <bool> ExistsAsync(
            this IIndexersOperations operations,
            string indexerName,
            SearchRequestOptions searchRequestOptions = default(SearchRequestOptions),
            CancellationToken cancellationToken       = default(CancellationToken))
        {
            AzureOperationResponse <bool> result = await operations.ExistsWithHttpMessagesAsync(indexerName, searchRequestOptions, null, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }
示例#6
0
 /// <summary>
 /// Runs an Azure Search indexer on-demand.
 /// <see href="https://msdn.microsoft.com/library/azure/dn946885.aspx" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='indexerName'>
 /// The name of the indexer to run.
 /// </param>
 /// <param name='searchRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task RunAsync(this IIndexersOperations operations, string indexerName, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.RunWithHttpMessagesAsync(indexerName, searchRequestOptions, null, cancellationToken).ConfigureAwait(false);
 }
示例#7
0
 /// <summary>
 /// Lists all indexers available for an Azure Search service.
 /// <see href="https://msdn.microsoft.com/library/azure/dn946883.aspx" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='searchRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static IndexerListResult List(this IIndexersOperations operations, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions))
 {
     return(Task.Factory.StartNew(s => ((IIndexersOperations)s).ListAsync(searchRequestOptions), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
示例#8
0
 /// <summary>
 /// Deletes an Azure Search indexer.
 /// <see href="https://msdn.microsoft.com/library/azure/dn946898.aspx" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='indexerName'>
 /// The name of the indexer to delete.
 /// </param>
 /// <param name='searchRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='accessCondition'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IIndexersOperations operations, string indexerName, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), AccessCondition accessCondition = default(AccessCondition), CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.DeleteWithHttpMessagesAsync(indexerName, searchRequestOptions, accessCondition, null, cancellationToken).ConfigureAwait(false);
 }
示例#9
0
 /// <summary>
 /// Deletes an Azure Search indexer.
 /// <see href="https://msdn.microsoft.com/library/azure/dn946898.aspx" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='indexerName'>
 /// The name of the indexer to delete.
 /// </param>
 /// <param name='searchRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='accessCondition'>
 /// Additional parameters for the operation
 /// </param>
 public static void Delete(this IIndexersOperations operations, string indexerName, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), AccessCondition accessCondition = default(AccessCondition))
 {
     Task.Factory.StartNew(s => ((IIndexersOperations)s).DeleteAsync(indexerName, searchRequestOptions, accessCondition), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
示例#10
0
 /// <summary>
 /// Creates a new Azure Search indexer or updates an indexer if it already
 /// exists.
 /// <see href="https://docs.microsoft.com/rest/api/searchservice/Create-Indexer" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='indexer'>
 /// The definition of the indexer to create or update.
 /// </param>
 /// <param name='searchRequestOptions'>
 /// Additional parameters for the operation.
 /// </param>
 /// <param name='accessCondition'>
 /// Additional parameters for the operation.
 /// </param>
 /// <returns>
 /// The indexer that was created or updated.
 /// </returns>
 public static Indexer CreateOrUpdate(this IIndexersOperations operations, Indexer indexer, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), AccessCondition accessCondition = default(AccessCondition))
 {
     return(operations.CreateOrUpdateAsync(indexer, searchRequestOptions, accessCondition).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Runs an indexer on-demand.
 /// <see href="https://docs.microsoft.com/rest/api/searchservice/Run-Indexer" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='indexerName'>
 /// The name of the indexer to run.
 /// </param>
 /// <param name='searchRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static void Run(this IIndexersOperations operations, string indexerName, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions))
 {
     operations.RunAsync(indexerName, searchRequestOptions).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Returns the current status and execution history of an indexer.
 /// <see href="https://docs.microsoft.com/rest/api/searchservice/Get-Indexer-Status" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='indexerName'>
 /// The name of the indexer for which to retrieve status.
 /// </param>
 /// <param name='searchRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static IndexerExecutionInfo GetStatus(this IIndexersOperations operations, string indexerName, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions))
 {
     return(operations.GetStatusAsync(indexerName, searchRequestOptions).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Creates a new indexer.
 /// <see href="https://docs.microsoft.com/rest/api/searchservice/Create-Indexer" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='indexer'>
 /// The definition of the indexer to create.
 /// </param>
 /// <param name='searchRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static Indexer Create(this IIndexersOperations operations, Indexer indexer, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions))
 {
     return(operations.CreateAsync(indexer, searchRequestOptions).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Lists all indexers available for a search service.
 /// <see href="https://docs.microsoft.com/rest/api/searchservice/List-Indexers" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='searchRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static IndexerListResult List(this IIndexersOperations operations, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions))
 {
     return(operations.ListAsync(searchRequestOptions).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Deletes an indexer.
 /// <see href="https://docs.microsoft.com/rest/api/searchservice/Delete-Indexer" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='indexerName'>
 /// The name of the indexer to delete.
 /// </param>
 /// <param name='searchRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='accessCondition'>
 /// Additional parameters for the operation
 /// </param>
 public static void Delete(this IIndexersOperations operations, string indexerName, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), AccessCondition accessCondition = default(AccessCondition))
 {
     operations.DeleteAsync(indexerName, searchRequestOptions, accessCondition).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Creates a new Azure Search indexer or updates an indexer if it already
 /// exists.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='indexer'>
 /// The definition of the indexer to create or update.
 /// </param>
 /// <param name='searchRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='accessCondition'>
 /// Additional parameters for the operation
 /// </param>
 public static Indexer CreateOrUpdate(this IIndexersOperations operations, Indexer indexer, SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), AccessCondition accessCondition = default(AccessCondition))
 {
     return(Task.Factory.StartNew(s => ((IIndexersOperations)s).CreateOrUpdateAsync(indexer, searchRequestOptions, accessCondition), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }