diff --git a/sdk/search/Azure.Search.Documents/src/Generated/DataSourcesRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/DataSourcesRestClient.cs
index 21c7e50a8648..b7c3c14477a0 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/DataSourcesRestClient.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/DataSourcesRestClient.cs
@@ -40,7 +40,7 @@ public DataSourcesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline p
_pipeline = pipeline;
}
- internal HttpMessage CreateCreateOrUpdateRequest(string dataSourceName, SearchIndexerDataSourceConnection dataSource, string ifMatch, string ifNoneMatch, bool? ignoreResetRequirements)
+ internal HttpMessage CreateCreateOrUpdateRequest(string dataSourceName, SearchIndexerDataSourceConnection dataSource, string ifMatch, string ifNoneMatch, bool? skipIndexerResetRequirementForCache)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
@@ -51,9 +51,9 @@ internal HttpMessage CreateCreateOrUpdateRequest(string dataSourceName, SearchIn
uri.AppendPath(dataSourceName, true);
uri.AppendPath("')", false);
uri.AppendQuery("api-version", apiVersion, true);
- if (ignoreResetRequirements != null)
+ if (skipIndexerResetRequirementForCache != null)
{
- uri.AppendQuery("ignoreResetRequirements", ignoreResetRequirements.Value, true);
+ uri.AppendQuery("ignoreResetRequirements", skipIndexerResetRequirementForCache.Value, true);
}
request.Uri = uri;
if (ifMatch != null)
@@ -78,10 +78,10 @@ internal HttpMessage CreateCreateOrUpdateRequest(string dataSourceName, SearchIn
/// The definition of the datasource to create or update.
/// Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.
/// Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
- /// Ignores cache reset requirements.
+ /// Ignores cache reset requirements.
/// The cancellation token to use.
/// or is null.
- public async Task> CreateOrUpdateAsync(string dataSourceName, SearchIndexerDataSourceConnection dataSource, string ifMatch = null, string ifNoneMatch = null, bool? ignoreResetRequirements = null, CancellationToken cancellationToken = default)
+ public async Task> CreateOrUpdateAsync(string dataSourceName, SearchIndexerDataSourceConnection dataSource, string ifMatch = null, string ifNoneMatch = null, bool? skipIndexerResetRequirementForCache = null, CancellationToken cancellationToken = default)
{
if (dataSourceName == null)
{
@@ -92,7 +92,7 @@ public async Task> CreateOrUpdateAsy
throw new ArgumentNullException(nameof(dataSource));
}
- using var message = CreateCreateOrUpdateRequest(dataSourceName, dataSource, ifMatch, ifNoneMatch, ignoreResetRequirements);
+ using var message = CreateCreateOrUpdateRequest(dataSourceName, dataSource, ifMatch, ifNoneMatch, skipIndexerResetRequirementForCache);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
@@ -114,10 +114,10 @@ public async Task> CreateOrUpdateAsy
/// The definition of the datasource to create or update.
/// Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.
/// Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
- /// Ignores cache reset requirements.
+ /// Ignores cache reset requirements.
/// The cancellation token to use.
/// or is null.
- public Response CreateOrUpdate(string dataSourceName, SearchIndexerDataSourceConnection dataSource, string ifMatch = null, string ifNoneMatch = null, bool? ignoreResetRequirements = null, CancellationToken cancellationToken = default)
+ public Response CreateOrUpdate(string dataSourceName, SearchIndexerDataSourceConnection dataSource, string ifMatch = null, string ifNoneMatch = null, bool? skipIndexerResetRequirementForCache = null, CancellationToken cancellationToken = default)
{
if (dataSourceName == null)
{
@@ -128,7 +128,7 @@ public Response CreateOrUpdate(string dataSou
throw new ArgumentNullException(nameof(dataSource));
}
- using var message = CreateCreateOrUpdateRequest(dataSourceName, dataSource, ifMatch, ifNoneMatch, ignoreResetRequirements);
+ using var message = CreateCreateOrUpdateRequest(dataSourceName, dataSource, ifMatch, ifNoneMatch, skipIndexerResetRequirementForCache);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/IndexersRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/IndexersRestClient.cs
index f06c59cc48c3..87be8d2969a1 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/IndexersRestClient.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/IndexersRestClient.cs
@@ -13,6 +13,7 @@
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.Search.Documents.Indexes.Models;
+using Azure.Search.Documents.Models;
namespace Azure.Search.Documents
{
@@ -100,6 +101,81 @@ public Response Reset(string indexerName, CancellationToken cancellationToken =
}
}
+ internal HttpMessage CreateResetDocsRequest(string indexerName, bool? overwrite, Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema keysOrIds)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/indexers('", false);
+ uri.AppendPath(indexerName, true);
+ uri.AppendPath("')/search.resetdocs", false);
+ if (overwrite != null)
+ {
+ uri.AppendQuery("overwrite", overwrite.Value, true);
+ }
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json; odata.metadata=minimal");
+ if (keysOrIds != null)
+ {
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(keysOrIds);
+ request.Content = content;
+ }
+ return message;
+ }
+
+ /// Resets specific documents in the datasource to be selectively re-ingested by the indexer.
+ /// The name of the indexer to reset documents for.
+ /// If false, keys or ids will be appended to existing ones. If true, only the keys or ids in this payload will be queued to be re-ingested.
+ /// The Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema to use.
+ /// The cancellation token to use.
+ /// is null.
+ public async Task ResetDocsAsync(string indexerName, bool? overwrite = null, Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema keysOrIds = null, CancellationToken cancellationToken = default)
+ {
+ if (indexerName == null)
+ {
+ throw new ArgumentNullException(nameof(indexerName));
+ }
+
+ using var message = CreateResetDocsRequest(indexerName, overwrite, keysOrIds);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 204:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Resets specific documents in the datasource to be selectively re-ingested by the indexer.
+ /// The name of the indexer to reset documents for.
+ /// If false, keys or ids will be appended to existing ones. If true, only the keys or ids in this payload will be queued to be re-ingested.
+ /// The Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema to use.
+ /// The cancellation token to use.
+ /// is null.
+ public Response ResetDocs(string indexerName, bool? overwrite = null, Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema keysOrIds = null, CancellationToken cancellationToken = default)
+ {
+ if (indexerName == null)
+ {
+ throw new ArgumentNullException(nameof(indexerName));
+ }
+
+ using var message = CreateResetDocsRequest(indexerName, overwrite, keysOrIds);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 204:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
internal HttpMessage CreateRunRequest(string indexerName)
{
var message = _pipeline.CreateMessage();
@@ -160,7 +236,7 @@ public Response Run(string indexerName, CancellationToken cancellationToken = de
}
}
- internal HttpMessage CreateCreateOrUpdateRequest(string indexerName, SearchIndexer indexer, string ifMatch, string ifNoneMatch, bool? disableCacheReprocessingChangeDetection, bool? ignoreResetRequirements)
+ internal HttpMessage CreateCreateOrUpdateRequest(string indexerName, SearchIndexer indexer, string ifMatch, string ifNoneMatch, bool? skipIndexerResetRequirementForCache, bool? disableCacheReprocessingChangeDetection)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
@@ -171,13 +247,13 @@ internal HttpMessage CreateCreateOrUpdateRequest(string indexerName, SearchIndex
uri.AppendPath(indexerName, true);
uri.AppendPath("')", false);
uri.AppendQuery("api-version", apiVersion, true);
- if (disableCacheReprocessingChangeDetection != null)
+ if (skipIndexerResetRequirementForCache != null)
{
- uri.AppendQuery("disableCacheReprocessingChangeDetection", disableCacheReprocessingChangeDetection.Value, true);
+ uri.AppendQuery("ignoreResetRequirements", skipIndexerResetRequirementForCache.Value, true);
}
- if (ignoreResetRequirements != null)
+ if (disableCacheReprocessingChangeDetection != null)
{
- uri.AppendQuery("ignoreResetRequirements", ignoreResetRequirements.Value, true);
+ uri.AppendQuery("disableCacheReprocessingChangeDetection", disableCacheReprocessingChangeDetection.Value, true);
}
request.Uri = uri;
if (ifMatch != null)
@@ -202,11 +278,11 @@ internal HttpMessage CreateCreateOrUpdateRequest(string indexerName, SearchIndex
/// The definition of the indexer to create or update.
/// Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.
/// Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ /// Ignores cache reset requirements.
/// Disables cache reprocessing change detection.
- /// Ignores cache reset requirements.
/// The cancellation token to use.
/// or is null.
- public async Task> CreateOrUpdateAsync(string indexerName, SearchIndexer indexer, string ifMatch = null, string ifNoneMatch = null, bool? disableCacheReprocessingChangeDetection = null, bool? ignoreResetRequirements = null, CancellationToken cancellationToken = default)
+ public async Task> CreateOrUpdateAsync(string indexerName, SearchIndexer indexer, string ifMatch = null, string ifNoneMatch = null, bool? skipIndexerResetRequirementForCache = null, bool? disableCacheReprocessingChangeDetection = null, CancellationToken cancellationToken = default)
{
if (indexerName == null)
{
@@ -217,7 +293,7 @@ public async Task> CreateOrUpdateAsync(string indexerNam
throw new ArgumentNullException(nameof(indexer));
}
- using var message = CreateCreateOrUpdateRequest(indexerName, indexer, ifMatch, ifNoneMatch, disableCacheReprocessingChangeDetection, ignoreResetRequirements);
+ using var message = CreateCreateOrUpdateRequest(indexerName, indexer, ifMatch, ifNoneMatch, skipIndexerResetRequirementForCache, disableCacheReprocessingChangeDetection);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
@@ -239,11 +315,11 @@ public async Task> CreateOrUpdateAsync(string indexerNam
/// The definition of the indexer to create or update.
/// Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.
/// Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ /// Ignores cache reset requirements.
/// Disables cache reprocessing change detection.
- /// Ignores cache reset requirements.
/// The cancellation token to use.
/// or is null.
- public Response CreateOrUpdate(string indexerName, SearchIndexer indexer, string ifMatch = null, string ifNoneMatch = null, bool? disableCacheReprocessingChangeDetection = null, bool? ignoreResetRequirements = null, CancellationToken cancellationToken = default)
+ public Response CreateOrUpdate(string indexerName, SearchIndexer indexer, string ifMatch = null, string ifNoneMatch = null, bool? skipIndexerResetRequirementForCache = null, bool? disableCacheReprocessingChangeDetection = null, CancellationToken cancellationToken = default)
{
if (indexerName == null)
{
@@ -254,7 +330,7 @@ public Response CreateOrUpdate(string indexerName, SearchIndexer
throw new ArgumentNullException(nameof(indexer));
}
- using var message = CreateCreateOrUpdateRequest(indexerName, indexer, ifMatch, ifNoneMatch, disableCacheReprocessingChangeDetection, ignoreResetRequirements);
+ using var message = CreateCreateOrUpdateRequest(indexerName, indexer, ifMatch, ifNoneMatch, skipIndexerResetRequirementForCache, disableCacheReprocessingChangeDetection);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/FieldMappingFunction.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/FieldMappingFunction.Serialization.cs
index 5bd26ae9354e..58039b18f68b 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/FieldMappingFunction.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/FieldMappingFunction.Serialization.cs
@@ -20,14 +20,21 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
writer.WriteStringValue(Name);
if (Optional.IsCollectionDefined(Parameters))
{
- writer.WritePropertyName("parameters");
- writer.WriteStartObject();
- foreach (var item in Parameters)
+ if (Parameters != null)
{
- writer.WritePropertyName(item.Key);
- writer.WriteObjectValue(item.Value);
+ writer.WritePropertyName("parameters");
+ writer.WriteStartObject();
+ foreach (var item in Parameters)
+ {
+ writer.WritePropertyName(item.Key);
+ writer.WriteObjectValue(item.Value);
+ }
+ writer.WriteEndObject();
+ }
+ else
+ {
+ writer.WriteNull("parameters");
}
- writer.WriteEndObject();
}
writer.WriteEndObject();
}
@@ -47,7 +54,7 @@ internal static FieldMappingFunction DeserializeFieldMappingFunction(JsonElement
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
- property.ThrowNonNullablePropertyIsNull();
+ parameters = null;
continue;
}
Dictionary dictionary = new Dictionary();
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerCurrentState.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerCurrentState.Serialization.cs
new file mode 100644
index 000000000000..688f5761d1ad
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerCurrentState.Serialization.cs
@@ -0,0 +1,91 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ public partial class IndexerCurrentState
+ {
+ internal static IndexerCurrentState DeserializeIndexerCurrentState(JsonElement element)
+ {
+ Optional mode = default;
+ Optional allDocsInitialChangeTrackingState = default;
+ Optional allDocsFinalChangeTrackingState = default;
+ Optional resetDocsInitialChangeTrackingState = default;
+ Optional resetDocsFinalChangeTrackingState = default;
+ Optional> resetDocumentKeys = default;
+ Optional> resetDatasourceDocumentIds = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("mode"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ property.ThrowNonNullablePropertyIsNull();
+ continue;
+ }
+ mode = new IndexingMode(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("allDocsInitialChangeTrackingState"))
+ {
+ allDocsInitialChangeTrackingState = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("allDocsFinalChangeTrackingState"))
+ {
+ allDocsFinalChangeTrackingState = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("resetDocsInitialChangeTrackingState"))
+ {
+ resetDocsInitialChangeTrackingState = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("resetDocsFinalChangeTrackingState"))
+ {
+ resetDocsFinalChangeTrackingState = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("resetDocumentKeys"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ property.ThrowNonNullablePropertyIsNull();
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(item.GetString());
+ }
+ resetDocumentKeys = array;
+ continue;
+ }
+ if (property.NameEquals("resetDatasourceDocumentIds"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ property.ThrowNonNullablePropertyIsNull();
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(item.GetString());
+ }
+ resetDatasourceDocumentIds = array;
+ continue;
+ }
+ }
+ return new IndexerCurrentState(Optional.ToNullable(mode), allDocsInitialChangeTrackingState.Value, allDocsFinalChangeTrackingState.Value, resetDocsInitialChangeTrackingState.Value, resetDocsFinalChangeTrackingState.Value, Optional.ToList(resetDocumentKeys), Optional.ToList(resetDatasourceDocumentIds));
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerCurrentState.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerCurrentState.cs
new file mode 100644
index 000000000000..96d8e3e5c6ec
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerCurrentState.cs
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// Represents all of the state that defines and dictates the indexer's current execution.
+ public partial class IndexerCurrentState
+ {
+ /// Initializes a new instance of IndexerCurrentState.
+ internal IndexerCurrentState()
+ {
+ ResetDocumentKeys = new ChangeTrackingList();
+ ResetDatasourceDocumentIds = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of IndexerCurrentState.
+ /// The mode the indexer is running in.
+ /// Change tracking state used when indexing starts on all documents in the datasource.
+ /// Change tracking state value when indexing finishes on all documents in the datasource.
+ /// Change tracking state used when indexing starts on select, reset documents in the datasource.
+ /// Change tracking state value when indexing finishes on select, reset documents in the datasource.
+ /// The list of document keys that have been reset. The document key is the document's unique identifier for the data in the search index. The indexer will prioritize selectively re-ingesting these keys.
+ /// The list of datasource document ids that have been reset. The datasource document id is the unique identifier for the data in the datasource. The indexer will prioritize selectively re-ingesting these ids.
+ internal IndexerCurrentState(IndexingMode? mode, string allDocsInitialChangeTrackingState, string allDocsFinalChangeTrackingState, string resetDocsInitialChangeTrackingState, string resetDocsFinalChangeTrackingState, IReadOnlyList resetDocumentKeys, IReadOnlyList resetDatasourceDocumentIds)
+ {
+ Mode = mode;
+ AllDocsInitialChangeTrackingState = allDocsInitialChangeTrackingState;
+ AllDocsFinalChangeTrackingState = allDocsFinalChangeTrackingState;
+ ResetDocsInitialChangeTrackingState = resetDocsInitialChangeTrackingState;
+ ResetDocsFinalChangeTrackingState = resetDocsFinalChangeTrackingState;
+ ResetDocumentKeys = resetDocumentKeys;
+ ResetDatasourceDocumentIds = resetDatasourceDocumentIds;
+ }
+
+ /// The mode the indexer is running in.
+ public IndexingMode? Mode { get; }
+ /// Change tracking state used when indexing starts on all documents in the datasource.
+ public string AllDocsInitialChangeTrackingState { get; }
+ /// Change tracking state value when indexing finishes on all documents in the datasource.
+ public string AllDocsFinalChangeTrackingState { get; }
+ /// Change tracking state used when indexing starts on select, reset documents in the datasource.
+ public string ResetDocsInitialChangeTrackingState { get; }
+ /// Change tracking state value when indexing finishes on select, reset documents in the datasource.
+ public string ResetDocsFinalChangeTrackingState { get; }
+ /// The list of document keys that have been reset. The document key is the document's unique identifier for the data in the search index. The indexer will prioritize selectively re-ingesting these keys.
+ public IReadOnlyList ResetDocumentKeys { get; }
+ /// The list of datasource document ids that have been reset. The datasource document id is the unique identifier for the data in the datasource. The indexer will prioritize selectively re-ingesting these ids.
+ public IReadOnlyList ResetDatasourceDocumentIds { get; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionResult.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionResult.Serialization.cs
index 5767601e21e8..eef4b6f357ce 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionResult.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionResult.Serialization.cs
@@ -17,6 +17,8 @@ public partial class IndexerExecutionResult
internal static IndexerExecutionResult DeserializeIndexerExecutionResult(JsonElement element)
{
IndexerExecutionStatus status = default;
+ Optional statusDetail = default;
+ Optional currentState = default;
Optional errorMessage = default;
Optional startTime = default;
Optional endTime = default;
@@ -33,6 +35,26 @@ internal static IndexerExecutionResult DeserializeIndexerExecutionResult(JsonEle
status = property.Value.GetString().ToIndexerExecutionStatus();
continue;
}
+ if (property.NameEquals("statusDetail"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ property.ThrowNonNullablePropertyIsNull();
+ continue;
+ }
+ statusDetail = new IndexerExecutionStatusDetail(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("currentState"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ property.ThrowNonNullablePropertyIsNull();
+ continue;
+ }
+ currentState = IndexerCurrentState.DeserializeIndexerCurrentState(property.Value);
+ continue;
+ }
if (property.NameEquals("errorMessage"))
{
errorMessage = property.Value.GetString();
@@ -99,7 +121,7 @@ internal static IndexerExecutionResult DeserializeIndexerExecutionResult(JsonEle
continue;
}
}
- return new IndexerExecutionResult(status, errorMessage.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime), errors, warnings, itemsProcessed, itemsFailed, initialTrackingState.Value, finalTrackingState.Value);
+ return new IndexerExecutionResult(status, Optional.ToNullable(statusDetail), currentState.Value, errorMessage.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime), errors, warnings, itemsProcessed, itemsFailed, initialTrackingState.Value, finalTrackingState.Value);
}
}
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionResult.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionResult.cs
index 041c23d16606..811beae6f690 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionResult.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionResult.cs
@@ -41,6 +41,8 @@ internal IndexerExecutionResult(IndexerExecutionStatus status, IEnumerable Initializes a new instance of IndexerExecutionResult.
/// The outcome of this indexer execution.
+ /// The outcome of this indexer execution.
+ /// All of the state that defines and dictates the indexer's current execution.
/// The error message indicating the top-level error, if any.
/// The start time of this indexer execution.
/// The end time of this indexer execution, if the execution has already completed.
@@ -50,9 +52,11 @@ internal IndexerExecutionResult(IndexerExecutionStatus status, IEnumerable The number of items that failed to be indexed during this indexer execution.
/// Change tracking state with which an indexer execution started.
/// Change tracking state with which an indexer execution finished.
- internal IndexerExecutionResult(IndexerExecutionStatus status, string errorMessage, DateTimeOffset? startTime, DateTimeOffset? endTime, IReadOnlyList errors, IReadOnlyList warnings, int itemCount, int failedItemCount, string initialTrackingState, string finalTrackingState)
+ internal IndexerExecutionResult(IndexerExecutionStatus status, IndexerExecutionStatusDetail? statusDetail, IndexerCurrentState currentState, string errorMessage, DateTimeOffset? startTime, DateTimeOffset? endTime, IReadOnlyList errors, IReadOnlyList warnings, int itemCount, int failedItemCount, string initialTrackingState, string finalTrackingState)
{
Status = status;
+ StatusDetail = statusDetail;
+ CurrentState = currentState;
ErrorMessage = errorMessage;
StartTime = startTime;
EndTime = endTime;
@@ -66,6 +70,10 @@ internal IndexerExecutionResult(IndexerExecutionStatus status, string errorMessa
/// The outcome of this indexer execution.
public IndexerExecutionStatus Status { get; }
+ /// The outcome of this indexer execution.
+ public IndexerExecutionStatusDetail? StatusDetail { get; }
+ /// All of the state that defines and dictates the indexer's current execution.
+ public IndexerCurrentState CurrentState { get; }
/// The error message indicating the top-level error, if any.
public string ErrorMessage { get; }
/// The start time of this indexer execution.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionStatusDetail.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionStatusDetail.cs
new file mode 100644
index 000000000000..56729c0877ac
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionStatusDetail.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// Details the status of an individual indexer execution.
+ public readonly partial struct IndexerExecutionStatusDetail : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public IndexerExecutionStatusDetail(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string ResetDocsValue = "resetDocs";
+
+ /// Indicates that the reset that occurred was for a call to ResetDocs.
+ public static IndexerExecutionStatusDetail ResetDocs { get; } = new IndexerExecutionStatusDetail(ResetDocsValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(IndexerExecutionStatusDetail left, IndexerExecutionStatusDetail right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(IndexerExecutionStatusDetail left, IndexerExecutionStatusDetail right) => !left.Equals(right);
+ /// Converts a string to a .
+ public static implicit operator IndexerExecutionStatusDetail(string value) => new IndexerExecutionStatusDetail(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is IndexerExecutionStatusDetail other && Equals(other);
+ ///
+ public bool Equals(IndexerExecutionStatusDetail other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value?.GetHashCode() ?? 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexingMode.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexingMode.cs
new file mode 100644
index 000000000000..4090a56dc4cd
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexingMode.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// Represents the mode the indexer is executing in.
+ public readonly partial struct IndexingMode : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public IndexingMode(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string IndexingAllDocsValue = "indexingAllDocs";
+ private const string IndexingResetDocsValue = "indexingResetDocs";
+
+ /// The indexer is indexing all documents in the datasource.
+ public static IndexingMode IndexingAllDocs { get; } = new IndexingMode(IndexingAllDocsValue);
+ /// The indexer is indexing selective, reset documents in the datasource. The documents being indexed are defined on indexer status.
+ public static IndexingMode IndexingResetDocs { get; } = new IndexingMode(IndexingResetDocsValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(IndexingMode left, IndexingMode right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(IndexingMode left, IndexingMode right) => !left.Equals(right);
+ /// Converts a string to a .
+ public static implicit operator IndexingMode(string value) => new IndexingMode(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is IndexingMode other && Equals(other);
+ ///
+ public bool Equals(IndexingMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value?.GetHashCode() ?? 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema.Serialization.cs
new file mode 100644
index 000000000000..cee830fb7d21
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema.Serialization.cs
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ if (Optional.IsCollectionDefined(DocumentKeys))
+ {
+ writer.WritePropertyName("documentKeys");
+ writer.WriteStartArray();
+ foreach (var item in DocumentKeys)
+ {
+ writer.WriteStringValue(item);
+ }
+ writer.WriteEndArray();
+ }
+ if (Optional.IsCollectionDefined(DatasourceDocumentIds))
+ {
+ writer.WritePropertyName("datasourceDocumentIds");
+ writer.WriteStartArray();
+ foreach (var item in DatasourceDocumentIds)
+ {
+ writer.WriteStringValue(item);
+ }
+ writer.WriteEndArray();
+ }
+ writer.WriteEndObject();
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema.cs
new file mode 100644
index 000000000000..fc7e232174a8
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema.cs
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Models
+{
+ /// The Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema.
+ public partial class Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema
+ {
+ /// Initializes a new instance of Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema.
+ public Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema()
+ {
+ DocumentKeys = new ChangeTrackingList();
+ DatasourceDocumentIds = new ChangeTrackingList();
+ }
+
+ /// document keys to be reset.
+ public IList DocumentKeys { get; }
+ /// datasource document identifiers to be reset.
+ public IList DatasourceDocumentIds { get; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/Paths1Ju2XepSkillsetsSkillsetnameSearchResetskillsPostRequestbodyContentApplicationJsonSchema.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/Paths1Ju2XepSkillsetsSkillsetnameSearchResetskillsPostRequestbodyContentApplicationJsonSchema.Serialization.cs
new file mode 100644
index 000000000000..0899336a7ecd
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/Paths1Ju2XepSkillsetsSkillsetnameSearchResetskillsPostRequestbodyContentApplicationJsonSchema.Serialization.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class Paths1Ju2XepSkillsetsSkillsetnameSearchResetskillsPostRequestbodyContentApplicationJsonSchema : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ if (Optional.IsCollectionDefined(SkillNames))
+ {
+ writer.WritePropertyName("skillNames");
+ writer.WriteStartArray();
+ foreach (var item in SkillNames)
+ {
+ writer.WriteStringValue(item);
+ }
+ writer.WriteEndArray();
+ }
+ writer.WriteEndObject();
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/Paths1Ju2XepSkillsetsSkillsetnameSearchResetskillsPostRequestbodyContentApplicationJsonSchema.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/Paths1Ju2XepSkillsetsSkillsetnameSearchResetskillsPostRequestbodyContentApplicationJsonSchema.cs
new file mode 100644
index 000000000000..a9b5728a5fc1
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/Paths1Ju2XepSkillsetsSkillsetnameSearchResetskillsPostRequestbodyContentApplicationJsonSchema.cs
@@ -0,0 +1,25 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Models
+{
+ /// The Paths1Ju2XepSkillsetsSkillsetnameSearchResetskillsPostRequestbodyContentApplicationJsonSchema.
+ public partial class Paths1Ju2XepSkillsetsSkillsetnameSearchResetskillsPostRequestbodyContentApplicationJsonSchema
+ {
+ /// Initializes a new instance of Paths1Ju2XepSkillsetsSkillsetnameSearchResetskillsPostRequestbodyContentApplicationJsonSchema.
+ public Paths1Ju2XepSkillsetsSkillsetnameSearchResetskillsPostRequestbodyContentApplicationJsonSchema()
+ {
+ SkillNames = new ChangeTrackingList();
+ }
+
+ /// the names of skills to be reset.
+ public IList SkillNames { get; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/SearchModelFactory.cs b/sdk/search/Azure.Search.Documents/src/Generated/SearchModelFactory.cs
index 6f2d72e817ba..ea298fd5ee83 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/SearchModelFactory.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/SearchModelFactory.cs
@@ -68,6 +68,8 @@ public static SearchIndexerStatus SearchIndexerStatus(IndexerStatus status = def
/// Initializes a new instance of IndexerExecutionResult.
/// The outcome of this indexer execution.
+ /// The outcome of this indexer execution.
+ /// All of the state that defines and dictates the indexer's current execution.
/// The error message indicating the top-level error, if any.
/// The start time of this indexer execution.
/// The end time of this indexer execution, if the execution has already completed.
@@ -78,12 +80,29 @@ public static SearchIndexerStatus SearchIndexerStatus(IndexerStatus status = def
/// Change tracking state with which an indexer execution started.
/// Change tracking state with which an indexer execution finished.
/// A new instance for mocking.
- public static IndexerExecutionResult IndexerExecutionResult(IndexerExecutionStatus status = default, string errorMessage = null, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, IEnumerable errors = null, IEnumerable warnings = null, int itemCount = default, int failedItemCount = default, string initialTrackingState = null, string finalTrackingState = null)
+ public static IndexerExecutionResult IndexerExecutionResult(IndexerExecutionStatus status = default, IndexerExecutionStatusDetail? statusDetail = null, IndexerCurrentState currentState = null, string errorMessage = null, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, IEnumerable errors = null, IEnumerable warnings = null, int itemCount = default, int failedItemCount = default, string initialTrackingState = null, string finalTrackingState = null)
{
errors ??= new List();
warnings ??= new List();
- return new IndexerExecutionResult(status, errorMessage, startTime, endTime, errors?.ToList(), warnings?.ToList(), itemCount, failedItemCount, initialTrackingState, finalTrackingState);
+ return new IndexerExecutionResult(status, statusDetail, currentState, errorMessage, startTime, endTime, errors?.ToList(), warnings?.ToList(), itemCount, failedItemCount, initialTrackingState, finalTrackingState);
+ }
+
+ /// Initializes a new instance of IndexerCurrentState.
+ /// The mode the indexer is running in.
+ /// Change tracking state used when indexing starts on all documents in the datasource.
+ /// Change tracking state value when indexing finishes on all documents in the datasource.
+ /// Change tracking state used when indexing starts on select, reset documents in the datasource.
+ /// Change tracking state value when indexing finishes on select, reset documents in the datasource.
+ /// The list of document keys that have been reset. The document key is the document's unique identifier for the data in the search index. The indexer will prioritize selectively re-ingesting these keys.
+ /// The list of datasource document ids that have been reset. The datasource document id is the unique identifier for the data in the datasource. The indexer will prioritize selectively re-ingesting these ids.
+ /// A new instance for mocking.
+ public static IndexerCurrentState IndexerCurrentState(IndexingMode? mode = null, string allDocsInitialChangeTrackingState = null, string allDocsFinalChangeTrackingState = null, string resetDocsInitialChangeTrackingState = null, string resetDocsFinalChangeTrackingState = null, IEnumerable resetDocumentKeys = null, IEnumerable resetDatasourceDocumentIds = null)
+ {
+ resetDocumentKeys ??= new List();
+ resetDatasourceDocumentIds ??= new List();
+
+ return new IndexerCurrentState(mode, allDocsInitialChangeTrackingState, allDocsFinalChangeTrackingState, resetDocsInitialChangeTrackingState, resetDocsFinalChangeTrackingState, resetDocumentKeys?.ToList(), resetDatasourceDocumentIds?.ToList());
}
}
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/SkillsetsRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/SkillsetsRestClient.cs
index 90c5e97bf01b..2ac1198dc3f3 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/SkillsetsRestClient.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/SkillsetsRestClient.cs
@@ -13,6 +13,7 @@
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.Search.Documents.Indexes.Models;
+using Azure.Search.Documents.Models;
namespace Azure.Search.Documents
{
@@ -40,7 +41,7 @@ public SkillsetsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pip
_pipeline = pipeline;
}
- internal HttpMessage CreateCreateOrUpdateRequest(string skillsetName, SearchIndexerSkillset skillset, string ifMatch, string ifNoneMatch, bool? disableCacheReprocessingChangeDetection, bool? ignoreResetRequirements)
+ internal HttpMessage CreateCreateOrUpdateRequest(string skillsetName, SearchIndexerSkillset skillset, string ifMatch, string ifNoneMatch, bool? skipIndexerResetRequirementForCache, bool? disableCacheReprocessingChangeDetection)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
@@ -51,13 +52,13 @@ internal HttpMessage CreateCreateOrUpdateRequest(string skillsetName, SearchInde
uri.AppendPath(skillsetName, true);
uri.AppendPath("')", false);
uri.AppendQuery("api-version", apiVersion, true);
- if (disableCacheReprocessingChangeDetection != null)
+ if (skipIndexerResetRequirementForCache != null)
{
- uri.AppendQuery("disableCacheReprocessingChangeDetection", disableCacheReprocessingChangeDetection.Value, true);
+ uri.AppendQuery("ignoreResetRequirements", skipIndexerResetRequirementForCache.Value, true);
}
- if (ignoreResetRequirements != null)
+ if (disableCacheReprocessingChangeDetection != null)
{
- uri.AppendQuery("ignoreResetRequirements", ignoreResetRequirements.Value, true);
+ uri.AppendQuery("disableCacheReprocessingChangeDetection", disableCacheReprocessingChangeDetection.Value, true);
}
request.Uri = uri;
if (ifMatch != null)
@@ -82,11 +83,11 @@ internal HttpMessage CreateCreateOrUpdateRequest(string skillsetName, SearchInde
/// The skillset containing one or more skills to create or update in a search service.
/// Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.
/// Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ /// Ignores cache reset requirements.
/// Disables cache reprocessing change detection.
- /// Ignores cache reset requirements.
/// The cancellation token to use.
/// or is null.
- public async Task> CreateOrUpdateAsync(string skillsetName, SearchIndexerSkillset skillset, string ifMatch = null, string ifNoneMatch = null, bool? disableCacheReprocessingChangeDetection = null, bool? ignoreResetRequirements = null, CancellationToken cancellationToken = default)
+ public async Task> CreateOrUpdateAsync(string skillsetName, SearchIndexerSkillset skillset, string ifMatch = null, string ifNoneMatch = null, bool? skipIndexerResetRequirementForCache = null, bool? disableCacheReprocessingChangeDetection = null, CancellationToken cancellationToken = default)
{
if (skillsetName == null)
{
@@ -97,7 +98,7 @@ public async Task> CreateOrUpdateAsync(string sk
throw new ArgumentNullException(nameof(skillset));
}
- using var message = CreateCreateOrUpdateRequest(skillsetName, skillset, ifMatch, ifNoneMatch, disableCacheReprocessingChangeDetection, ignoreResetRequirements);
+ using var message = CreateCreateOrUpdateRequest(skillsetName, skillset, ifMatch, ifNoneMatch, skipIndexerResetRequirementForCache, disableCacheReprocessingChangeDetection);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
@@ -119,11 +120,11 @@ public async Task> CreateOrUpdateAsync(string sk
/// The skillset containing one or more skills to create or update in a search service.
/// Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.
/// Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ /// Ignores cache reset requirements.
/// Disables cache reprocessing change detection.
- /// Ignores cache reset requirements.
/// The cancellation token to use.
/// or is null.
- public Response CreateOrUpdate(string skillsetName, SearchIndexerSkillset skillset, string ifMatch = null, string ifNoneMatch = null, bool? disableCacheReprocessingChangeDetection = null, bool? ignoreResetRequirements = null, CancellationToken cancellationToken = default)
+ public Response CreateOrUpdate(string skillsetName, SearchIndexerSkillset skillset, string ifMatch = null, string ifNoneMatch = null, bool? skipIndexerResetRequirementForCache = null, bool? disableCacheReprocessingChangeDetection = null, CancellationToken cancellationToken = default)
{
if (skillsetName == null)
{
@@ -134,7 +135,7 @@ public Response CreateOrUpdate(string skillsetName, Searc
throw new ArgumentNullException(nameof(skillset));
}
- using var message = CreateCreateOrUpdateRequest(skillsetName, skillset, ifMatch, ifNoneMatch, disableCacheReprocessingChangeDetection, ignoreResetRequirements);
+ using var message = CreateCreateOrUpdateRequest(skillsetName, skillset, ifMatch, ifNoneMatch, skipIndexerResetRequirementForCache, disableCacheReprocessingChangeDetection);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
@@ -426,5 +427,79 @@ public Response Create(SearchIndexerSkillset skillset, Ca
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
}
}
+
+ internal HttpMessage CreateResetSkillsRequest(string skillsetName, Paths1Ju2XepSkillsetsSkillsetnameSearchResetskillsPostRequestbodyContentApplicationJsonSchema skillNames)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/skillsets('", false);
+ uri.AppendPath(skillsetName, true);
+ uri.AppendPath("')/search.resetskills", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json; odata.metadata=minimal");
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(skillNames);
+ request.Content = content;
+ return message;
+ }
+
+ /// Reset an existing skillset in a search service.
+ /// The name of the skillset to reset.
+ /// The names of skills to reset.
+ /// The cancellation token to use.
+ /// or is null.
+ public async Task ResetSkillsAsync(string skillsetName, Paths1Ju2XepSkillsetsSkillsetnameSearchResetskillsPostRequestbodyContentApplicationJsonSchema skillNames, CancellationToken cancellationToken = default)
+ {
+ if (skillsetName == null)
+ {
+ throw new ArgumentNullException(nameof(skillsetName));
+ }
+ if (skillNames == null)
+ {
+ throw new ArgumentNullException(nameof(skillNames));
+ }
+
+ using var message = CreateResetSkillsRequest(skillsetName, skillNames);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 204:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Reset an existing skillset in a search service.
+ /// The name of the skillset to reset.
+ /// The names of skills to reset.
+ /// The cancellation token to use.
+ /// or is null.
+ public Response ResetSkills(string skillsetName, Paths1Ju2XepSkillsetsSkillsetnameSearchResetskillsPostRequestbodyContentApplicationJsonSchema skillNames, CancellationToken cancellationToken = default)
+ {
+ if (skillsetName == null)
+ {
+ throw new ArgumentNullException(nameof(skillsetName));
+ }
+ if (skillNames == null)
+ {
+ throw new ArgumentNullException(nameof(skillNames));
+ }
+
+ using var message = CreateResetSkillsRequest(skillsetName, skillNames);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 204:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
}
}
diff --git a/sdk/search/Azure.Search.Documents/src/autorest.md b/sdk/search/Azure.Search.Documents/src/autorest.md
index 35f1790414df..2ccce4e70573 100644
--- a/sdk/search/Azure.Search.Documents/src/autorest.md
+++ b/sdk/search/Azure.Search.Documents/src/autorest.md
@@ -14,7 +14,7 @@ copy them locally in `/sdk/search/generate.ps1` and reference them here.
title: SearchServiceClient
input-file:
- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/c99fbb96d7993daec8135a40681d9d807e3f5751/specification/search/data-plane/Azure.Search/preview/2021-04-30-Preview/searchindex.json
-- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/c99fbb96d7993daec8135a40681d9d807e3f5751/specification/search/data-plane/Azure.Search/preview/2021-04-30-Preview/searchservice.json
+- https://github.com/Azure/azure-rest-api-specs/blob/175e00f59aebb5edde69b3bb3c33eb0464fbd11e/specification/search/data-plane/Azure.Search/preview/2021-04-30-Preview/searchservice.json
```
## Release hacks