diff --git a/sdk/search/Azure.Search.Documents.Indexes/Azure.Search.Documents.Indexes.sln b/sdk/search/Azure.Search.Documents.Indexes/Azure.Search.Documents.Indexes.sln new file mode 100644 index 000000000000..c6e4d8616b88 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/Azure.Search.Documents.Indexes.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Search.Documents.Indexes", "src\Azure.Search.Documents.Indexes.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Search.Documents.Indexes.Tests", "tests\Azure.Search.Documents.Indexes.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/search/Azure.Search.Documents.Indexes/CHANGELOG.md b/sdk/search/Azure.Search.Documents.Indexes/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes \ No newline at end of file diff --git a/sdk/search/Azure.Search.Documents.Indexes/Directory.Build.props b/sdk/search/Azure.Search.Documents.Indexes/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/search/Azure.Search.Documents.Indexes/README.md b/sdk/search/Azure.Search.Documents.Indexes/README.md new file mode 100644 index 000000000000..3f49cbf0a8d0 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/README.md @@ -0,0 +1,107 @@ +# Azure.Search.Documents.Indexes client library for .NET + +Azure.Search.Documents.Indexes is a managed service that helps developers get secret simply and securely. + +Use the client library for to: + +* [Get secret](https://docs.microsoft.com/azure) + +[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples] + + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents.Indexes/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + +## Getting started + +This section should include everything a developer needs to do to install and create their first client connection *very quickly*. + +### Install the package + +First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository. + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.Search.Documents.Indexes --prerelease +``` + +### Prerequisites + +Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: + +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. + +### Authenticate the client + +If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. + +For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. + +### Service API versions + +The client library targets the latest service API version by default. A client instance accepts an optional service API version parameter from its options to specify which API version service to communicate. + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when instantiating a client by configuring its associated options. This ensures that the client can communicate with services using the specified API version. + +For example, + +```C# Snippet:CreateClientForSpecificApiVersion +Uri endpoint = new Uri(""); +DefaultAzureCredential credential = new DefaultAzureCredential(); +ClientOptions options = new ClientOptions(ClientOptions.ServiceVersion.) +var client = new Client(endpoint, credential, options); +``` + +When selecting an API version, it's important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility. + +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. + +## Key concepts + +The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. + +Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of: + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts + +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) + + +## Examples + +You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Azure.Search.Documents.Indexes/samples). + +## Troubleshooting + +Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. + +Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. + +If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. + +## Next steps + +* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. +* If appropriate, point users to other packages that might be useful. +* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. + +## Contributing + +This is a template, but your SDK readme should include details on how to contribute code to the repo/package. + + +[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/search/Azure.Search.Documents.Indexes/README.png) \ No newline at end of file diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Azure.Search.Documents.Indexes.csproj b/sdk/search/Azure.Search.Documents.Indexes/src/Azure.Search.Documents.Indexes.csproj new file mode 100644 index 000000000000..7f6a7e205dc5 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Azure.Search.Documents.Indexes.csproj @@ -0,0 +1,20 @@ + + + This is the Azure.Search.Documents.Indexes client library for developing .NET applications with rich experience. + Azure SDK Code Generation Azure.Search.Documents.Indexes for Azure Data Plane + 1.0.0-beta.1 + Azure.Search.Documents.Indexes + $(RequiredTargetFrameworks) + true + + + + + + + + + + + + diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzeRequest.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzeRequest.Serialization.cs new file mode 100644 index 000000000000..a9d945ab2031 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzeRequest.Serialization.cs @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class AnalyzeRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AnalyzeRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + if (Optional.IsDefined(Analyzer)) + { + writer.WritePropertyName("analyzer"u8); + writer.WriteStringValue(Analyzer.Value.ToString()); + } + if (Optional.IsDefined(Tokenizer)) + { + writer.WritePropertyName("tokenizer"u8); + writer.WriteStringValue(Tokenizer.Value.ToString()); + } + if (Optional.IsCollectionDefined(TokenFilters)) + { + writer.WritePropertyName("tokenFilters"u8); + writer.WriteStartArray(); + foreach (var item in TokenFilters) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(CharFilters)) + { + writer.WritePropertyName("charFilters"u8); + writer.WriteStartArray(); + foreach (var item in CharFilters) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AnalyzeRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AnalyzeRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAnalyzeRequest(document.RootElement, options); + } + + internal static AnalyzeRequest DeserializeAnalyzeRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string text = default; + LexicalAnalyzerName? analyzer = default; + LexicalTokenizerName? tokenizer = default; + IList tokenFilters = default; + IList charFilters = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("analyzer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + analyzer = new LexicalAnalyzerName(property.Value.GetString()); + continue; + } + if (property.NameEquals("tokenizer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tokenizer = new LexicalTokenizerName(property.Value.GetString()); + continue; + } + if (property.NameEquals("tokenFilters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new TokenFilterName(item.GetString())); + } + tokenFilters = array; + continue; + } + if (property.NameEquals("charFilters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new CharFilterName(item.GetString())); + } + charFilters = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AnalyzeRequest( + text, + analyzer, + tokenizer, + tokenFilters ?? new ChangeTrackingList(), + charFilters ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AnalyzeRequest)} does not support writing '{options.Format}' format."); + } + } + + AnalyzeRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAnalyzeRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AnalyzeRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AnalyzeRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAnalyzeRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzeRequest.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzeRequest.cs new file mode 100644 index 000000000000..92686886a4b3 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzeRequest.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Specifies some text and analysis components used to break that text into tokens. + public partial class AnalyzeRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The text to break into tokens. + /// is null. + public AnalyzeRequest(string text) + { + Argument.AssertNotNull(text, nameof(text)); + + Text = text; + TokenFilters = new ChangeTrackingList(); + CharFilters = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The text to break into tokens. + /// + /// The name of the analyzer to use to break the given text. If this parameter is + /// not specified, you must specify a tokenizer instead. The tokenizer and analyzer + /// parameters are mutually exclusive. + /// + /// + /// The name of the tokenizer to use to break the given text. If this parameter is + /// not specified, you must specify an analyzer instead. The tokenizer and analyzer + /// parameters are mutually exclusive. + /// + /// + /// An optional list of token filters to use when breaking the given text. This + /// parameter can only be set when using the tokenizer parameter. + /// + /// + /// An optional list of character filters to use when breaking the given text. This + /// parameter can only be set when using the tokenizer parameter. + /// + /// Keeps track of any properties unknown to the library. + internal AnalyzeRequest(string text, LexicalAnalyzerName? analyzer, LexicalTokenizerName? tokenizer, IList tokenFilters, IList charFilters, IDictionary serializedAdditionalRawData) + { + Text = text; + Analyzer = analyzer; + Tokenizer = tokenizer; + TokenFilters = tokenFilters; + CharFilters = charFilters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AnalyzeRequest() + { + } + + /// The text to break into tokens. + public string Text { get; } + /// + /// The name of the analyzer to use to break the given text. If this parameter is + /// not specified, you must specify a tokenizer instead. The tokenizer and analyzer + /// parameters are mutually exclusive. + /// + public LexicalAnalyzerName? Analyzer { get; set; } + /// + /// The name of the tokenizer to use to break the given text. If this parameter is + /// not specified, you must specify an analyzer instead. The tokenizer and analyzer + /// parameters are mutually exclusive. + /// + public LexicalTokenizerName? Tokenizer { get; set; } + /// + /// An optional list of token filters to use when breaking the given text. This + /// parameter can only be set when using the tokenizer parameter. + /// + public IList TokenFilters { get; } + /// + /// An optional list of character filters to use when breaking the given text. This + /// parameter can only be set when using the tokenizer parameter. + /// + public IList CharFilters { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzeResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzeResult.Serialization.cs new file mode 100644 index 000000000000..1fa42f39c00c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzeResult.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class AnalyzeResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AnalyzeResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("tokens"u8); + writer.WriteStartArray(); + foreach (var item in Tokens) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AnalyzeResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AnalyzeResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAnalyzeResult(document.RootElement, options); + } + + internal static AnalyzeResult DeserializeAnalyzeResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList tokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AnalyzedTokenInfo.DeserializeAnalyzedTokenInfo(item, options)); + } + tokens = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AnalyzeResult(tokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AnalyzeResult)} does not support writing '{options.Format}' format."); + } + } + + AnalyzeResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAnalyzeResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AnalyzeResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AnalyzeResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAnalyzeResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzeResult.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzeResult.cs new file mode 100644 index 000000000000..0239a8f2ec5a --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzeResult.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// The result of testing an analyzer on text. + public partial class AnalyzeResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of tokens returned by the analyzer specified in the request. + /// is null. + internal AnalyzeResult(IEnumerable tokens) + { + Argument.AssertNotNull(tokens, nameof(tokens)); + + Tokens = tokens.ToList(); + } + + /// Initializes a new instance of . + /// The list of tokens returned by the analyzer specified in the request. + /// Keeps track of any properties unknown to the library. + internal AnalyzeResult(IReadOnlyList tokens, IDictionary serializedAdditionalRawData) + { + Tokens = tokens; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AnalyzeResult() + { + } + + /// The list of tokens returned by the analyzer specified in the request. + public IReadOnlyList Tokens { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzedTokenInfo.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzedTokenInfo.Serialization.cs new file mode 100644 index 000000000000..e270286b89b9 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzedTokenInfo.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class AnalyzedTokenInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AnalyzedTokenInfo)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("token"u8); + writer.WriteStringValue(Token); + writer.WritePropertyName("startOffset"u8); + writer.WriteNumberValue(StartOffset); + writer.WritePropertyName("endOffset"u8); + writer.WriteNumberValue(EndOffset); + writer.WritePropertyName("position"u8); + writer.WriteNumberValue(Position); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AnalyzedTokenInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AnalyzedTokenInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAnalyzedTokenInfo(document.RootElement, options); + } + + internal static AnalyzedTokenInfo DeserializeAnalyzedTokenInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string token = default; + int startOffset = default; + int endOffset = default; + int position = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("token"u8)) + { + token = property.Value.GetString(); + continue; + } + if (property.NameEquals("startOffset"u8)) + { + startOffset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("endOffset"u8)) + { + endOffset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("position"u8)) + { + position = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AnalyzedTokenInfo(token, startOffset, endOffset, position, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AnalyzedTokenInfo)} does not support writing '{options.Format}' format."); + } + } + + AnalyzedTokenInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAnalyzedTokenInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AnalyzedTokenInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AnalyzedTokenInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAnalyzedTokenInfo(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzedTokenInfo.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzedTokenInfo.cs new file mode 100644 index 000000000000..e981a23717e7 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AnalyzedTokenInfo.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Information about a token returned by an analyzer. + public partial class AnalyzedTokenInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The token returned by the analyzer. + /// The index of the first character of the token in the input text. + /// The index of the last character of the token in the input text. + /// + /// The position of the token in the input text relative to other tokens. The first + /// token in the input text has position 0, the next has position 1, and so on. + /// Depending on the analyzer used, some tokens might have the same position, for + /// example if they are synonyms of each other. + /// + /// is null. + internal AnalyzedTokenInfo(string token, int startOffset, int endOffset, int position) + { + Argument.AssertNotNull(token, nameof(token)); + + Token = token; + StartOffset = startOffset; + EndOffset = endOffset; + Position = position; + } + + /// Initializes a new instance of . + /// The token returned by the analyzer. + /// The index of the first character of the token in the input text. + /// The index of the last character of the token in the input text. + /// + /// The position of the token in the input text relative to other tokens. The first + /// token in the input text has position 0, the next has position 1, and so on. + /// Depending on the analyzer used, some tokens might have the same position, for + /// example if they are synonyms of each other. + /// + /// Keeps track of any properties unknown to the library. + internal AnalyzedTokenInfo(string token, int startOffset, int endOffset, int position, IDictionary serializedAdditionalRawData) + { + Token = token; + StartOffset = startOffset; + EndOffset = endOffset; + Position = position; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AnalyzedTokenInfo() + { + } + + /// The token returned by the analyzer. + public string Token { get; } + /// The index of the first character of the token in the input text. + public int StartOffset { get; } + /// The index of the last character of the token in the input text. + public int EndOffset { get; } + /// + /// The position of the token in the input text relative to other tokens. The first + /// token in the input text has position 0, the next has position 1, and so on. + /// Depending on the analyzer used, some tokens might have the same position, for + /// example if they are synonyms of each other. + /// + public int Position { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AsciiFoldingTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AsciiFoldingTokenFilter.Serialization.cs new file mode 100644 index 000000000000..65ede07fe0bb --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AsciiFoldingTokenFilter.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class AsciiFoldingTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AsciiFoldingTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(PreserveOriginal)) + { + writer.WritePropertyName("preserveOriginal"u8); + writer.WriteBooleanValue(PreserveOriginal.Value); + } + } + + AsciiFoldingTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AsciiFoldingTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAsciiFoldingTokenFilter(document.RootElement, options); + } + + internal static AsciiFoldingTokenFilter DeserializeAsciiFoldingTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? preserveOriginal = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("preserveOriginal"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + preserveOriginal = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AsciiFoldingTokenFilter(odataType, name, serializedAdditionalRawData, preserveOriginal); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AsciiFoldingTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + AsciiFoldingTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAsciiFoldingTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AsciiFoldingTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new AsciiFoldingTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAsciiFoldingTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AsciiFoldingTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AsciiFoldingTokenFilter.cs new file mode 100644 index 000000000000..726d5ca14f38 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AsciiFoldingTokenFilter.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Converts alphabetic, numeric, and symbolic Unicode characters which are not in + /// the first 127 ASCII characters (the "Basic Latin" Unicode block) into their + /// ASCII equivalents, if such equivalents exist. This token filter is implemented + /// using Apache Lucene. + /// + public partial class AsciiFoldingTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// is null. + public AsciiFoldingTokenFilter(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.AsciiFoldingTokenFilter"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// A value indicating whether the original token will be kept. Default is false. + internal AsciiFoldingTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, bool? preserveOriginal) : base(odataType, name, serializedAdditionalRawData) + { + PreserveOriginal = preserveOriginal; + } + + /// Initializes a new instance of for deserialization. + internal AsciiFoldingTokenFilter() + { + } + + /// A value indicating whether the original token will be kept. Default is false. + public bool? PreserveOriginal { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureActiveDirectoryApplicationCredentials.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureActiveDirectoryApplicationCredentials.Serialization.cs new file mode 100644 index 000000000000..452a76720415 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureActiveDirectoryApplicationCredentials.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class AzureActiveDirectoryApplicationCredentials : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureActiveDirectoryApplicationCredentials)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("applicationId"u8); + writer.WriteStringValue(ApplicationId); + if (Optional.IsDefined(ApplicationSecret)) + { + writer.WritePropertyName("applicationSecret"u8); + writer.WriteStringValue(ApplicationSecret); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureActiveDirectoryApplicationCredentials IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureActiveDirectoryApplicationCredentials)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureActiveDirectoryApplicationCredentials(document.RootElement, options); + } + + internal static AzureActiveDirectoryApplicationCredentials DeserializeAzureActiveDirectoryApplicationCredentials(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string applicationId = default; + string applicationSecret = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("applicationId"u8)) + { + applicationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("applicationSecret"u8)) + { + applicationSecret = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureActiveDirectoryApplicationCredentials(applicationId, applicationSecret, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureActiveDirectoryApplicationCredentials)} does not support writing '{options.Format}' format."); + } + } + + AzureActiveDirectoryApplicationCredentials IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAzureActiveDirectoryApplicationCredentials(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureActiveDirectoryApplicationCredentials)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureActiveDirectoryApplicationCredentials FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAzureActiveDirectoryApplicationCredentials(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureActiveDirectoryApplicationCredentials.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureActiveDirectoryApplicationCredentials.cs new file mode 100644 index 000000000000..74efc6941b70 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureActiveDirectoryApplicationCredentials.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Credentials of a registered application created for your search service, used + /// for authenticated access to the encryption keys stored in Azure Key Vault. + /// + public partial class AzureActiveDirectoryApplicationCredentials + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// An AAD Application ID that was granted the required access permissions to the + /// Azure Key Vault that is to be used when encrypting your data at rest. The + /// Application ID should not be confused with the Object ID for your AAD + /// Application. + /// + /// is null. + public AzureActiveDirectoryApplicationCredentials(string applicationId) + { + Argument.AssertNotNull(applicationId, nameof(applicationId)); + + ApplicationId = applicationId; + } + + /// Initializes a new instance of . + /// + /// An AAD Application ID that was granted the required access permissions to the + /// Azure Key Vault that is to be used when encrypting your data at rest. The + /// Application ID should not be confused with the Object ID for your AAD + /// Application. + /// + /// The authentication key of the specified AAD application. + /// Keeps track of any properties unknown to the library. + internal AzureActiveDirectoryApplicationCredentials(string applicationId, string applicationSecret, IDictionary serializedAdditionalRawData) + { + ApplicationId = applicationId; + ApplicationSecret = applicationSecret; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureActiveDirectoryApplicationCredentials() + { + } + + /// + /// An AAD Application ID that was granted the required access permissions to the + /// Azure Key Vault that is to be used when encrypting your data at rest. The + /// Application ID should not be confused with the Object ID for your AAD + /// Application. + /// + public string ApplicationId { get; set; } + /// The authentication key of the specified AAD application. + public string ApplicationSecret { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIEmbeddingSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIEmbeddingSkill.Serialization.cs new file mode 100644 index 000000000000..539ee9fc7518 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIEmbeddingSkill.Serialization.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class AzureOpenAIEmbeddingSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOpenAIEmbeddingSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(ResourceUri)) + { + writer.WritePropertyName("resourceUri"u8); + writer.WriteStringValue(ResourceUri.AbsoluteUri); + } + if (Optional.IsDefined(DeploymentId)) + { + writer.WritePropertyName("deploymentId"u8); + writer.WriteStringValue(DeploymentId); + } + if (Optional.IsDefined(ApiKey)) + { + writer.WritePropertyName("apiKey"u8); + writer.WriteStringValue(ApiKey); + } + if (Optional.IsDefined(AuthIdentity)) + { + writer.WritePropertyName("authIdentity"u8); + writer.WriteObjectValue(AuthIdentity, options); + } + if (Optional.IsDefined(ModelName)) + { + writer.WritePropertyName("modelName"u8); + writer.WriteStringValue(ModelName.Value.ToString()); + } + if (Optional.IsDefined(Dimensions)) + { + writer.WritePropertyName("dimensions"u8); + writer.WriteNumberValue(Dimensions.Value); + } + } + + AzureOpenAIEmbeddingSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOpenAIEmbeddingSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureOpenAIEmbeddingSkill(document.RootElement, options); + } + + internal static AzureOpenAIEmbeddingSkill DeserializeAzureOpenAIEmbeddingSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri resourceUri = default; + string deploymentId = default; + string apiKey = default; + SearchIndexerDataIdentity authIdentity = default; + AzureOpenAIModelName? modelName = default; + int? dimensions = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("deploymentId"u8)) + { + deploymentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("apiKey"u8)) + { + apiKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("authIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authIdentity = SearchIndexerDataIdentity.DeserializeSearchIndexerDataIdentity(property.Value, options); + continue; + } + if (property.NameEquals("modelName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + modelName = new AzureOpenAIModelName(property.Value.GetString()); + continue; + } + if (property.NameEquals("dimensions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dimensions = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureOpenAIEmbeddingSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + resourceUri, + deploymentId, + apiKey, + authIdentity, + modelName, + dimensions); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureOpenAIEmbeddingSkill)} does not support writing '{options.Format}' format."); + } + } + + AzureOpenAIEmbeddingSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAzureOpenAIEmbeddingSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureOpenAIEmbeddingSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new AzureOpenAIEmbeddingSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAzureOpenAIEmbeddingSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIEmbeddingSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIEmbeddingSkill.cs new file mode 100644 index 000000000000..070bba6d7378 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIEmbeddingSkill.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Allows you to generate a vector embedding for a given text input using the + /// Azure OpenAI resource. + /// + public partial class AzureOpenAIEmbeddingSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public AzureOpenAIEmbeddingSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// The resource URI of the Azure OpenAI resource. + /// ID of the Azure OpenAI model deployment on the designated resource. + /// API key of the designated Azure OpenAI resource. + /// + /// The user-assigned managed identity used for outbound connections. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// + /// The name of the embedding model that is deployed at the provided deploymentId + /// path. + /// + /// + /// The number of dimensions the resulting output embeddings should have. Only + /// supported in text-embedding-3 and later models. + /// + internal AzureOpenAIEmbeddingSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, Uri resourceUri, string deploymentId, string apiKey, SearchIndexerDataIdentity authIdentity, AzureOpenAIModelName? modelName, int? dimensions) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + ResourceUri = resourceUri; + DeploymentId = deploymentId; + ApiKey = apiKey; + AuthIdentity = authIdentity; + ModelName = modelName; + Dimensions = dimensions; + } + + /// Initializes a new instance of for deserialization. + internal AzureOpenAIEmbeddingSkill() + { + } + + /// The resource URI of the Azure OpenAI resource. + public Uri ResourceUri { get; set; } + /// ID of the Azure OpenAI model deployment on the designated resource. + public string DeploymentId { get; set; } + /// API key of the designated Azure OpenAI resource. + public string ApiKey { get; set; } + /// + /// The user-assigned managed identity used for outbound connections. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public SearchIndexerDataIdentity AuthIdentity { get; set; } + /// + /// The name of the embedding model that is deployed at the provided deploymentId + /// path. + /// + public AzureOpenAIModelName? ModelName { get; set; } + /// + /// The number of dimensions the resulting output embeddings should have. Only + /// supported in text-embedding-3 and later models. + /// + public int? Dimensions { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIModelName.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIModelName.cs new file mode 100644 index 000000000000..cd595cd31c52 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIModelName.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// The Azure Open AI model name that will be called. + public readonly partial struct AzureOpenAIModelName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureOpenAIModelName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TextEmbeddingAda002Value = "text-embedding-ada-002"; + private const string TextEmbedding3LargeValue = "text-embedding-3-large"; + private const string TextEmbedding3SmallValue = "text-embedding-3-small"; + + /// TextEmbeddingAda002 model. + public static AzureOpenAIModelName TextEmbeddingAda002 { get; } = new AzureOpenAIModelName(TextEmbeddingAda002Value); + /// TextEmbedding3Large model. + public static AzureOpenAIModelName TextEmbedding3Large { get; } = new AzureOpenAIModelName(TextEmbedding3LargeValue); + /// TextEmbedding3Small model. + public static AzureOpenAIModelName TextEmbedding3Small { get; } = new AzureOpenAIModelName(TextEmbedding3SmallValue); + /// Determines if two values are the same. + public static bool operator ==(AzureOpenAIModelName left, AzureOpenAIModelName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureOpenAIModelName left, AzureOpenAIModelName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureOpenAIModelName(string value) => new AzureOpenAIModelName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureOpenAIModelName other && Equals(other); + /// + public bool Equals(AzureOpenAIModelName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIVectorizer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIVectorizer.Serialization.cs new file mode 100644 index 000000000000..c92b8909214d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIVectorizer.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class AzureOpenAIVectorizer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOpenAIVectorizer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(AzureOpenAIParameters)) + { + writer.WritePropertyName("azureOpenAIParameters"u8); + writer.WriteObjectValue(AzureOpenAIParameters, options); + } + } + + AzureOpenAIVectorizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOpenAIVectorizer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureOpenAIVectorizer(document.RootElement, options); + } + + internal static AzureOpenAIVectorizer DeserializeAzureOpenAIVectorizer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureOpenAIVectorizerParameters azureOpenAIParameters = default; + string name = default; + VectorSearchVectorizerKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureOpenAIParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureOpenAIParameters = AzureOpenAIVectorizerParameters.DeserializeAzureOpenAIVectorizerParameters(property.Value, options); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new VectorSearchVectorizerKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureOpenAIVectorizer(name, kind, serializedAdditionalRawData, azureOpenAIParameters); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureOpenAIVectorizer)} does not support writing '{options.Format}' format."); + } + } + + AzureOpenAIVectorizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAzureOpenAIVectorizer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureOpenAIVectorizer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new AzureOpenAIVectorizer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAzureOpenAIVectorizer(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIVectorizer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIVectorizer.cs new file mode 100644 index 000000000000..a6b3996b73a0 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIVectorizer.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Specifies the Azure OpenAI resource used to vectorize a query string. + public partial class AzureOpenAIVectorizer : VectorSearchVectorizer + { + /// Initializes a new instance of . + /// The name to associate with this particular vectorization method. + /// is null. + public AzureOpenAIVectorizer(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + Kind = VectorSearchVectorizerKind.AzureOpenAI; + } + + /// Initializes a new instance of . + /// The name to associate with this particular vectorization method. + /// Type of VectorSearchVectorizer. + /// Keeps track of any properties unknown to the library. + /// Contains the parameters specific to Azure OpenAI embedding vectorization. + internal AzureOpenAIVectorizer(string name, VectorSearchVectorizerKind kind, IDictionary serializedAdditionalRawData, AzureOpenAIVectorizerParameters azureOpenAIParameters) : base(name, kind, serializedAdditionalRawData) + { + AzureOpenAIParameters = azureOpenAIParameters; + } + + /// Initializes a new instance of for deserialization. + internal AzureOpenAIVectorizer() + { + } + + /// Contains the parameters specific to Azure OpenAI embedding vectorization. + public AzureOpenAIVectorizerParameters AzureOpenAIParameters { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIVectorizerParameters.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIVectorizerParameters.Serialization.cs new file mode 100644 index 000000000000..585afc04a0bb --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIVectorizerParameters.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class AzureOpenAIVectorizerParameters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOpenAIVectorizerParameters)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ResourceUri)) + { + writer.WritePropertyName("resourceUri"u8); + writer.WriteStringValue(ResourceUri.AbsoluteUri); + } + if (Optional.IsDefined(DeploymentId)) + { + writer.WritePropertyName("deploymentId"u8); + writer.WriteStringValue(DeploymentId); + } + if (Optional.IsDefined(ApiKey)) + { + writer.WritePropertyName("apiKey"u8); + writer.WriteStringValue(ApiKey); + } + if (Optional.IsDefined(AuthIdentity)) + { + writer.WritePropertyName("authIdentity"u8); + writer.WriteObjectValue(AuthIdentity, options); + } + if (Optional.IsDefined(ModelName)) + { + writer.WritePropertyName("modelName"u8); + writer.WriteStringValue(ModelName.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureOpenAIVectorizerParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOpenAIVectorizerParameters)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureOpenAIVectorizerParameters(document.RootElement, options); + } + + internal static AzureOpenAIVectorizerParameters DeserializeAzureOpenAIVectorizerParameters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri resourceUri = default; + string deploymentId = default; + string apiKey = default; + SearchIndexerDataIdentity authIdentity = default; + AzureOpenAIModelName? modelName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("deploymentId"u8)) + { + deploymentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("apiKey"u8)) + { + apiKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("authIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authIdentity = SearchIndexerDataIdentity.DeserializeSearchIndexerDataIdentity(property.Value, options); + continue; + } + if (property.NameEquals("modelName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + modelName = new AzureOpenAIModelName(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureOpenAIVectorizerParameters( + resourceUri, + deploymentId, + apiKey, + authIdentity, + modelName, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureOpenAIVectorizerParameters)} does not support writing '{options.Format}' format."); + } + } + + AzureOpenAIVectorizerParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAzureOpenAIVectorizerParameters(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureOpenAIVectorizerParameters)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureOpenAIVectorizerParameters FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAzureOpenAIVectorizerParameters(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIVectorizerParameters.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIVectorizerParameters.cs new file mode 100644 index 000000000000..c6d660b564ed --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/AzureOpenAIVectorizerParameters.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Specifies the parameters for connecting to the Azure OpenAI resource. + public partial class AzureOpenAIVectorizerParameters + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AzureOpenAIVectorizerParameters() + { + } + + /// Initializes a new instance of . + /// The resource URI of the Azure OpenAI resource. + /// ID of the Azure OpenAI model deployment on the designated resource. + /// API key of the designated Azure OpenAI resource. + /// + /// The user-assigned managed identity used for outbound connections. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// + /// The name of the embedding model that is deployed at the provided deploymentId + /// path. + /// + /// Keeps track of any properties unknown to the library. + internal AzureOpenAIVectorizerParameters(Uri resourceUri, string deploymentId, string apiKey, SearchIndexerDataIdentity authIdentity, AzureOpenAIModelName? modelName, IDictionary serializedAdditionalRawData) + { + ResourceUri = resourceUri; + DeploymentId = deploymentId; + ApiKey = apiKey; + AuthIdentity = authIdentity; + ModelName = modelName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource URI of the Azure OpenAI resource. + public Uri ResourceUri { get; set; } + /// ID of the Azure OpenAI model deployment on the designated resource. + public string DeploymentId { get; set; } + /// API key of the designated Azure OpenAI resource. + public string ApiKey { get; set; } + /// + /// The user-assigned managed identity used for outbound connections. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public SearchIndexerDataIdentity AuthIdentity { get; set; } + /// + /// The name of the embedding model that is deployed at the provided deploymentId + /// path. + /// + public AzureOpenAIModelName? ModelName { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BM25SimilarityAlgorithm.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BM25SimilarityAlgorithm.Serialization.cs new file mode 100644 index 000000000000..4b44522d0941 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BM25SimilarityAlgorithm.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class BM25SimilarityAlgorithm : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BM25SimilarityAlgorithm)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(K1)) + { + writer.WritePropertyName("k1"u8); + writer.WriteNumberValue(K1.Value); + } + if (Optional.IsDefined(B)) + { + writer.WritePropertyName("b"u8); + writer.WriteNumberValue(B.Value); + } + } + + BM25SimilarityAlgorithm IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BM25SimilarityAlgorithm)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBM25SimilarityAlgorithm(document.RootElement, options); + } + + internal static BM25SimilarityAlgorithm DeserializeBM25SimilarityAlgorithm(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double? k1 = default; + double? b = default; + string odataType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("k1"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + k1 = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("b"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + b = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BM25SimilarityAlgorithm(odataType, serializedAdditionalRawData, k1, b); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BM25SimilarityAlgorithm)} does not support writing '{options.Format}' format."); + } + } + + BM25SimilarityAlgorithm IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBM25SimilarityAlgorithm(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BM25SimilarityAlgorithm)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new BM25SimilarityAlgorithm FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBM25SimilarityAlgorithm(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BM25SimilarityAlgorithm.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BM25SimilarityAlgorithm.cs new file mode 100644 index 000000000000..e5db97b66d00 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BM25SimilarityAlgorithm.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Ranking function based on the Okapi BM25 similarity algorithm. BM25 is a + /// TF-IDF-like algorithm that includes length normalization (controlled by the 'b' + /// parameter) as well as term frequency saturation (controlled by the 'k1' + /// parameter). + /// + public partial class BM25SimilarityAlgorithm : SimilarityAlgorithm + { + /// Initializes a new instance of . + public BM25SimilarityAlgorithm() + { + OdataType = "#Microsoft.Azure.Search.BM25Similarity"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// Keeps track of any properties unknown to the library. + /// + /// This property controls the scaling function between the term frequency of each + /// matching terms and the final relevance score of a document-query pair. By + /// default, a value of 1.2 is used. A value of 0.0 means the score does not scale + /// with an increase in term frequency. + /// + /// + /// This property controls how the length of a document affects the relevance + /// score. By default, a value of 0.75 is used. A value of 0.0 means no length + /// normalization is applied, while a value of 1.0 means the score is fully + /// normalized by the length of the document. + /// + internal BM25SimilarityAlgorithm(string odataType, IDictionary serializedAdditionalRawData, double? k1, double? b) : base(odataType, serializedAdditionalRawData) + { + K1 = k1; + B = b; + } + + /// + /// This property controls the scaling function between the term frequency of each + /// matching terms and the final relevance score of a document-query pair. By + /// default, a value of 1.2 is used. A value of 0.0 means the score does not scale + /// with an increase in term frequency. + /// + public double? K1 { get; set; } + /// + /// This property controls how the length of a document affects the relevance + /// score. By default, a value of 0.75 is used. A value of 0.0 means no length + /// normalization is applied, while a value of 1.0 means the score is fully + /// normalized by the length of the document. + /// + public double? B { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BinaryQuantizationCompression.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BinaryQuantizationCompression.Serialization.cs new file mode 100644 index 000000000000..91ee763ec20b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BinaryQuantizationCompression.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class BinaryQuantizationCompression : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BinaryQuantizationCompression)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + BinaryQuantizationCompression IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BinaryQuantizationCompression)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBinaryQuantizationCompression(document.RootElement, options); + } + + internal static BinaryQuantizationCompression DeserializeBinaryQuantizationCompression(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + bool? rerankWithOriginalVectors = default; + double? defaultOversampling = default; + VectorSearchCompressionKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("rerankWithOriginalVectors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rerankWithOriginalVectors = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("defaultOversampling"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultOversampling = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new VectorSearchCompressionKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BinaryQuantizationCompression(name, rerankWithOriginalVectors, defaultOversampling, kind, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BinaryQuantizationCompression)} does not support writing '{options.Format}' format."); + } + } + + BinaryQuantizationCompression IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBinaryQuantizationCompression(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BinaryQuantizationCompression)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new BinaryQuantizationCompression FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBinaryQuantizationCompression(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BinaryQuantizationCompression.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BinaryQuantizationCompression.cs new file mode 100644 index 000000000000..eded9a63313b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BinaryQuantizationCompression.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Contains configuration options specific to the binary quantization compression + /// method used during indexing and querying. + /// + public partial class BinaryQuantizationCompression : VectorSearchCompression + { + /// Initializes a new instance of . + /// The name to associate with this particular configuration. + /// is null. + public BinaryQuantizationCompression(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + Kind = VectorSearchCompressionKind.BinaryQuantization; + } + + /// Initializes a new instance of . + /// The name to associate with this particular configuration. + /// + /// If set to true, once the ordered set of results calculated using compressed + /// vectors are obtained, they will be reranked again by recalculating the + /// full-precision similarity scores. This will improve recall at the expense of + /// latency. + /// + /// + /// Default oversampling factor. Oversampling will internally request more + /// documents (specified by this multiplier) in the initial search. This increases + /// the set of results that will be reranked using recomputed similarity scores + /// from full-precision vectors. Minimum value is 1, meaning no oversampling (1x). + /// This parameter can only be set when rerankWithOriginalVectors is true. Higher + /// values improve recall at the expense of latency. + /// + /// Type of VectorSearchCompression. + /// Keeps track of any properties unknown to the library. + internal BinaryQuantizationCompression(string name, bool? rerankWithOriginalVectors, double? defaultOversampling, VectorSearchCompressionKind kind, IDictionary serializedAdditionalRawData) : base(name, rerankWithOriginalVectors, defaultOversampling, kind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal BinaryQuantizationCompression() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BlobIndexerDataToExtract.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BlobIndexerDataToExtract.cs new file mode 100644 index 000000000000..9cda3f7c856b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BlobIndexerDataToExtract.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Specifies the data to extract from Azure blob storage and tells the indexer + /// which data to extract from image content when "imageAction" is set to a value + /// other than "none". This applies to embedded image content in a .PDF or other + /// application, or image files such as .jpg and .png, in Azure blobs. + /// + public readonly partial struct BlobIndexerDataToExtract : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BlobIndexerDataToExtract(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StorageMetadataValue = "storageMetadata"; + private const string AllMetadataValue = "allMetadata"; + private const string ContentAndMetadataValue = "contentAndMetadata"; + + /// Indexes just the standard blob properties and user-specified metadata. + public static BlobIndexerDataToExtract StorageMetadata { get; } = new BlobIndexerDataToExtract(StorageMetadataValue); + /// + /// Extracts metadata provided by the Azure blob storage subsystem and the + /// content-type specific metadata (for example, metadata unique to just .png files + /// are indexed). + /// + public static BlobIndexerDataToExtract AllMetadata { get; } = new BlobIndexerDataToExtract(AllMetadataValue); + /// Extracts all metadata and textual content from each blob. + public static BlobIndexerDataToExtract ContentAndMetadata { get; } = new BlobIndexerDataToExtract(ContentAndMetadataValue); + /// Determines if two values are the same. + public static bool operator ==(BlobIndexerDataToExtract left, BlobIndexerDataToExtract right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BlobIndexerDataToExtract left, BlobIndexerDataToExtract right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BlobIndexerDataToExtract(string value) => new BlobIndexerDataToExtract(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BlobIndexerDataToExtract other && Equals(other); + /// + public bool Equals(BlobIndexerDataToExtract other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BlobIndexerImageAction.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BlobIndexerImageAction.cs new file mode 100644 index 000000000000..144688d7f1c0 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BlobIndexerImageAction.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Determines how to process embedded images and image files in Azure blob + /// storage. Setting the "imageAction" configuration to any value other than + /// "none" requires that a skillset also be attached to that indexer. + /// + public readonly partial struct BlobIndexerImageAction : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BlobIndexerImageAction(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "none"; + private const string GenerateNormalizedImagesValue = "generateNormalizedImages"; + private const string GenerateNormalizedImagePerPageValue = "generateNormalizedImagePerPage"; + + /// Ignores embedded images or image files in the data set. This is the default. + public static BlobIndexerImageAction None { get; } = new BlobIndexerImageAction(NoneValue); + /// + /// Extracts text from images (for example, the word "STOP" from a traffic stop + /// sign), and embeds it into the content field. This action requires that + /// "dataToExtract" is set to "contentAndMetadata". A normalized image refers to + /// additional processing resulting in uniform image output, sized and rotated to + /// promote consistent rendering when you include images in visual search results. + /// This information is generated for each image when you use this option. + /// + public static BlobIndexerImageAction GenerateNormalizedImages { get; } = new BlobIndexerImageAction(GenerateNormalizedImagesValue); + /// + /// Extracts text from images (for example, the word "STOP" from a traffic stop + /// sign), and embeds it into the content field, but treats PDF files differently + /// in that each page will be rendered as an image and normalized accordingly, + /// instead of extracting embedded images. Non-PDF file types will be treated the + /// same as if "generateNormalizedImages" was set. + /// + public static BlobIndexerImageAction GenerateNormalizedImagePerPage { get; } = new BlobIndexerImageAction(GenerateNormalizedImagePerPageValue); + /// Determines if two values are the same. + public static bool operator ==(BlobIndexerImageAction left, BlobIndexerImageAction right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BlobIndexerImageAction left, BlobIndexerImageAction right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BlobIndexerImageAction(string value) => new BlobIndexerImageAction(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BlobIndexerImageAction other && Equals(other); + /// + public bool Equals(BlobIndexerImageAction other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BlobIndexerPDFTextRotationAlgorithm.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BlobIndexerPDFTextRotationAlgorithm.cs new file mode 100644 index 000000000000..84c5c4c27230 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BlobIndexerPDFTextRotationAlgorithm.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Determines algorithm for text extraction from PDF files in Azure blob storage. + public readonly partial struct BlobIndexerPDFTextRotationAlgorithm : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BlobIndexerPDFTextRotationAlgorithm(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "none"; + private const string DetectAnglesValue = "detectAngles"; + + /// Leverages normal text extraction. This is the default. + public static BlobIndexerPDFTextRotationAlgorithm None { get; } = new BlobIndexerPDFTextRotationAlgorithm(NoneValue); + /// + /// May produce better and more readable text extraction from PDF files that have + /// rotated text within them. Note that there may be a small performance speed + /// impact when this parameter is used. This parameter only applies to PDF files, + /// and only to PDFs with embedded text. If the rotated text appears within an + /// embedded image in the PDF, this parameter does not apply. + /// + public static BlobIndexerPDFTextRotationAlgorithm DetectAngles { get; } = new BlobIndexerPDFTextRotationAlgorithm(DetectAnglesValue); + /// Determines if two values are the same. + public static bool operator ==(BlobIndexerPDFTextRotationAlgorithm left, BlobIndexerPDFTextRotationAlgorithm right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BlobIndexerPDFTextRotationAlgorithm left, BlobIndexerPDFTextRotationAlgorithm right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BlobIndexerPDFTextRotationAlgorithm(string value) => new BlobIndexerPDFTextRotationAlgorithm(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BlobIndexerPDFTextRotationAlgorithm other && Equals(other); + /// + public bool Equals(BlobIndexerPDFTextRotationAlgorithm other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BlobIndexerParsingMode.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BlobIndexerParsingMode.cs new file mode 100644 index 000000000000..0ee33835b136 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/BlobIndexerParsingMode.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents the parsing mode for indexing from an Azure blob data source. + public readonly partial struct BlobIndexerParsingMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BlobIndexerParsingMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "default"; + private const string TextValue = "text"; + private const string DelimitedTextValue = "delimitedText"; + private const string JsonValue = "json"; + private const string JsonArrayValue = "jsonArray"; + private const string JsonLinesValue = "jsonLines"; + + /// Set to default for normal file processing. + public static BlobIndexerParsingMode Default { get; } = new BlobIndexerParsingMode(DefaultValue); + /// Set to text to improve indexing performance on plain text files in blob storage. + public static BlobIndexerParsingMode Text { get; } = new BlobIndexerParsingMode(TextValue); + /// Set to delimitedText when blobs are plain CSV files. + public static BlobIndexerParsingMode DelimitedText { get; } = new BlobIndexerParsingMode(DelimitedTextValue); + /// Set to json to extract structured content from JSON files. + public static BlobIndexerParsingMode Json { get; } = new BlobIndexerParsingMode(JsonValue); + /// + /// Set to jsonArray to extract individual elements of a JSON array as separate + /// documents. + /// + public static BlobIndexerParsingMode JsonArray { get; } = new BlobIndexerParsingMode(JsonArrayValue); + /// + /// Set to jsonLines to extract individual JSON entities, separated by a new line, + /// as separate documents. + /// + public static BlobIndexerParsingMode JsonLines { get; } = new BlobIndexerParsingMode(JsonLinesValue); + /// Determines if two values are the same. + public static bool operator ==(BlobIndexerParsingMode left, BlobIndexerParsingMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BlobIndexerParsingMode left, BlobIndexerParsingMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BlobIndexerParsingMode(string value) => new BlobIndexerParsingMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BlobIndexerParsingMode other && Equals(other); + /// + public bool Equals(BlobIndexerParsingMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CharFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CharFilter.Serialization.cs new file mode 100644 index 000000000000..2c4117da1369 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CharFilter.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + [PersistableModelProxy(typeof(UnknownCharFilter))] + public partial class CharFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CharFilter)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("@odata.type"u8); + writer.WriteStringValue(OdataType); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CharFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CharFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCharFilter(document.RootElement, options); + } + + internal static CharFilter DeserializeCharFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("@odata.type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "#Microsoft.Azure.Search.MappingCharFilter": return MappingCharFilter.DeserializeMappingCharFilter(element, options); + case "#Microsoft.Azure.Search.PatternReplaceCharFilter": return PatternReplaceCharFilter.DeserializePatternReplaceCharFilter(element, options); + } + } + return UnknownCharFilter.DeserializeUnknownCharFilter(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CharFilter)} does not support writing '{options.Format}' format."); + } + } + + CharFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCharFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CharFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CharFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCharFilter(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CharFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CharFilter.cs new file mode 100644 index 000000000000..3e8a180fabcb --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CharFilter.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Base type for character filters. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class CharFilter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// The name of the char filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// is null. + protected CharFilter(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the char filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + internal CharFilter(string odataType, string name, IDictionary serializedAdditionalRawData) + { + OdataType = odataType; + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CharFilter() + { + } + + /// The discriminator for derived types. + internal string OdataType { get; set; } + /// + /// The name of the char filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + public string Name { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CharFilterName.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CharFilterName.cs new file mode 100644 index 000000000000..1b4006ab6867 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CharFilterName.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 +{ + /// Defines the names of all character filters supported by the search engine. + public readonly partial struct CharFilterName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CharFilterName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HtmlStripValue = "html_strip"; + + /// + /// A character filter that attempts to strip out HTML constructs. See + /// https://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/charfilter/HTMLStripCharFilter.html + /// + public static CharFilterName HtmlStrip { get; } = new CharFilterName(HtmlStripValue); + /// Determines if two values are the same. + public static bool operator ==(CharFilterName left, CharFilterName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CharFilterName left, CharFilterName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CharFilterName(string value) => new CharFilterName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CharFilterName other && Equals(other); + /// + public bool Equals(CharFilterName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CjkBigramTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CjkBigramTokenFilter.Serialization.cs new file mode 100644 index 000000000000..7aca89494775 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CjkBigramTokenFilter.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class CjkBigramTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CjkBigramTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(IgnoreScripts)) + { + writer.WritePropertyName("ignoreScripts"u8); + writer.WriteStartArray(); + foreach (var item in IgnoreScripts) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(OutputUnigrams)) + { + writer.WritePropertyName("outputUnigrams"u8); + writer.WriteBooleanValue(OutputUnigrams.Value); + } + } + + CjkBigramTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CjkBigramTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCjkBigramTokenFilter(document.RootElement, options); + } + + internal static CjkBigramTokenFilter DeserializeCjkBigramTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList ignoreScripts = default; + bool? outputUnigrams = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ignoreScripts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new CjkBigramTokenFilterScripts(item.GetString())); + } + ignoreScripts = array; + continue; + } + if (property.NameEquals("outputUnigrams"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + outputUnigrams = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CjkBigramTokenFilter(odataType, name, serializedAdditionalRawData, ignoreScripts ?? new ChangeTrackingList(), outputUnigrams); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CjkBigramTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + CjkBigramTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCjkBigramTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CjkBigramTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CjkBigramTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCjkBigramTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CjkBigramTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CjkBigramTokenFilter.cs new file mode 100644 index 000000000000..164823eeff2f --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CjkBigramTokenFilter.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Forms bigrams of CJK terms that are generated from the standard tokenizer. This + /// token filter is implemented using Apache Lucene. + /// + public partial class CjkBigramTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// is null. + public CjkBigramTokenFilter(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.CjkBigramTokenFilter"; + IgnoreScripts = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// The scripts to ignore. + /// + /// A value indicating whether to output both unigrams and bigrams (if true), or + /// just bigrams (if false). Default is false. + /// + internal CjkBigramTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, IList ignoreScripts, bool? outputUnigrams) : base(odataType, name, serializedAdditionalRawData) + { + IgnoreScripts = ignoreScripts; + OutputUnigrams = outputUnigrams; + } + + /// Initializes a new instance of for deserialization. + internal CjkBigramTokenFilter() + { + } + + /// The scripts to ignore. + public IList IgnoreScripts { get; } + /// + /// A value indicating whether to output both unigrams and bigrams (if true), or + /// just bigrams (if false). Default is false. + /// + public bool? OutputUnigrams { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CjkBigramTokenFilterScripts.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CjkBigramTokenFilterScripts.cs new file mode 100644 index 000000000000..7ec8adf00937 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CjkBigramTokenFilterScripts.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Scripts that can be ignored by CjkBigramTokenFilter. + public readonly partial struct CjkBigramTokenFilterScripts : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CjkBigramTokenFilterScripts(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HanValue = "han"; + private const string HiraganaValue = "hiragana"; + private const string KatakanaValue = "katakana"; + private const string HangulValue = "hangul"; + + /// Ignore Han script when forming bigrams of CJK terms. + public static CjkBigramTokenFilterScripts Han { get; } = new CjkBigramTokenFilterScripts(HanValue); + /// Ignore Hiragana script when forming bigrams of CJK terms. + public static CjkBigramTokenFilterScripts Hiragana { get; } = new CjkBigramTokenFilterScripts(HiraganaValue); + /// Ignore Katakana script when forming bigrams of CJK terms. + public static CjkBigramTokenFilterScripts Katakana { get; } = new CjkBigramTokenFilterScripts(KatakanaValue); + /// Ignore Hangul script when forming bigrams of CJK terms. + public static CjkBigramTokenFilterScripts Hangul { get; } = new CjkBigramTokenFilterScripts(HangulValue); + /// Determines if two values are the same. + public static bool operator ==(CjkBigramTokenFilterScripts left, CjkBigramTokenFilterScripts right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CjkBigramTokenFilterScripts left, CjkBigramTokenFilterScripts right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CjkBigramTokenFilterScripts(string value) => new CjkBigramTokenFilterScripts(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CjkBigramTokenFilterScripts other && Equals(other); + /// + public bool Equals(CjkBigramTokenFilterScripts other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ClassicSimilarityAlgorithm.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ClassicSimilarityAlgorithm.Serialization.cs new file mode 100644 index 000000000000..9124ca4649c2 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ClassicSimilarityAlgorithm.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ClassicSimilarityAlgorithm : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClassicSimilarityAlgorithm)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ClassicSimilarityAlgorithm IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClassicSimilarityAlgorithm)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClassicSimilarityAlgorithm(document.RootElement, options); + } + + internal static ClassicSimilarityAlgorithm DeserializeClassicSimilarityAlgorithm(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string odataType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ClassicSimilarityAlgorithm(odataType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ClassicSimilarityAlgorithm)} does not support writing '{options.Format}' format."); + } + } + + ClassicSimilarityAlgorithm IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClassicSimilarityAlgorithm(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClassicSimilarityAlgorithm)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ClassicSimilarityAlgorithm FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClassicSimilarityAlgorithm(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ClassicSimilarityAlgorithm.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ClassicSimilarityAlgorithm.cs new file mode 100644 index 000000000000..d0bbda23159e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ClassicSimilarityAlgorithm.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Legacy similarity algorithm which uses the Lucene TFIDFSimilarity + /// implementation of TF-IDF. This variation of TF-IDF introduces static document + /// length normalization as well as coordinating factors that penalize documents + /// that only partially match the searched queries. + /// + public partial class ClassicSimilarityAlgorithm : SimilarityAlgorithm + { + /// Initializes a new instance of . + public ClassicSimilarityAlgorithm() + { + OdataType = "#Microsoft.Azure.Search.ClassicSimilarity"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// Keeps track of any properties unknown to the library. + internal ClassicSimilarityAlgorithm(string odataType, IDictionary serializedAdditionalRawData) : base(odataType, serializedAdditionalRawData) + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ClassicTokenizer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ClassicTokenizer.Serialization.cs new file mode 100644 index 000000000000..5b3652d00d6c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ClassicTokenizer.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ClassicTokenizer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClassicTokenizer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(MaxTokenLength)) + { + writer.WritePropertyName("maxTokenLength"u8); + writer.WriteNumberValue(MaxTokenLength.Value); + } + } + + ClassicTokenizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClassicTokenizer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClassicTokenizer(document.RootElement, options); + } + + internal static ClassicTokenizer DeserializeClassicTokenizer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxTokenLength = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxTokenLength"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxTokenLength = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ClassicTokenizer(odataType, name, serializedAdditionalRawData, maxTokenLength); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ClassicTokenizer)} does not support writing '{options.Format}' format."); + } + } + + ClassicTokenizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClassicTokenizer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClassicTokenizer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ClassicTokenizer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClassicTokenizer(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ClassicTokenizer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ClassicTokenizer.cs new file mode 100644 index 000000000000..17a81c26e54a --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ClassicTokenizer.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Grammar-based tokenizer that is suitable for processing most European-language + /// documents. This tokenizer is implemented using Apache Lucene. + /// + public partial class ClassicTokenizer : LexicalTokenizer + { + /// Initializes a new instance of . + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// is null. + public ClassicTokenizer(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.ClassicTokenizer"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// The maximum token length. Default is 255. Tokens longer than the maximum length + /// are split. The maximum token length that can be used is 300 characters. + /// + internal ClassicTokenizer(string odataType, string name, IDictionary serializedAdditionalRawData, int? maxTokenLength) : base(odataType, name, serializedAdditionalRawData) + { + MaxTokenLength = maxTokenLength; + } + + /// Initializes a new instance of for deserialization. + internal ClassicTokenizer() + { + } + + /// + /// The maximum token length. Default is 255. Tokens longer than the maximum length + /// are split. The maximum token length that can be used is 300 characters. + /// + public int? MaxTokenLength { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CognitiveServicesAccount.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CognitiveServicesAccount.Serialization.cs new file mode 100644 index 000000000000..5f5257309f13 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CognitiveServicesAccount.Serialization.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + [PersistableModelProxy(typeof(UnknownCognitiveServicesAccount))] + public partial class CognitiveServicesAccount : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CognitiveServicesAccount)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("@odata.type"u8); + writer.WriteStringValue(OdataType); + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CognitiveServicesAccount IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CognitiveServicesAccount)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCognitiveServicesAccount(document.RootElement, options); + } + + internal static CognitiveServicesAccount DeserializeCognitiveServicesAccount(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("@odata.type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "#Microsoft.Azure.Search.CognitiveServicesByKey": return CognitiveServicesAccountKey.DeserializeCognitiveServicesAccountKey(element, options); + case "#Microsoft.Azure.Search.DefaultCognitiveServices": return DefaultCognitiveServicesAccount.DeserializeDefaultCognitiveServicesAccount(element, options); + } + } + return UnknownCognitiveServicesAccount.DeserializeUnknownCognitiveServicesAccount(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CognitiveServicesAccount)} does not support writing '{options.Format}' format."); + } + } + + CognitiveServicesAccount IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCognitiveServicesAccount(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CognitiveServicesAccount)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CognitiveServicesAccount FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCognitiveServicesAccount(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CognitiveServicesAccount.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CognitiveServicesAccount.cs new file mode 100644 index 000000000000..0eb785838eb0 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CognitiveServicesAccount.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Base type for describing any Azure AI service resource attached to a skillset. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class CognitiveServicesAccount + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected CognitiveServicesAccount() + { + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// Description of the Azure AI service resource attached to a skillset. + /// Keeps track of any properties unknown to the library. + internal CognitiveServicesAccount(string odataType, string description, IDictionary serializedAdditionalRawData) + { + OdataType = odataType; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The discriminator for derived types. + internal string OdataType { get; set; } + /// Description of the Azure AI service resource attached to a skillset. + public string Description { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CognitiveServicesAccountKey.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CognitiveServicesAccountKey.Serialization.cs new file mode 100644 index 000000000000..9f808f9d27ed --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CognitiveServicesAccountKey.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class CognitiveServicesAccountKey : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CognitiveServicesAccountKey)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + + CognitiveServicesAccountKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CognitiveServicesAccountKey)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCognitiveServicesAccountKey(document.RootElement, options); + } + + internal static CognitiveServicesAccountKey DeserializeCognitiveServicesAccountKey(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + string odataType = default; + string description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CognitiveServicesAccountKey(odataType, description, serializedAdditionalRawData, key); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CognitiveServicesAccountKey)} does not support writing '{options.Format}' format."); + } + } + + CognitiveServicesAccountKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCognitiveServicesAccountKey(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CognitiveServicesAccountKey)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CognitiveServicesAccountKey FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCognitiveServicesAccountKey(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CognitiveServicesAccountKey.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CognitiveServicesAccountKey.cs new file mode 100644 index 000000000000..7e70f56d0641 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CognitiveServicesAccountKey.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// The multi-region account key of an Azure AI service resource that's attached to + /// a skillset. + /// + public partial class CognitiveServicesAccountKey : CognitiveServicesAccount + { + /// Initializes a new instance of . + /// The key used to provision the Azure AI service resource attached to a skillset. + /// is null. + public CognitiveServicesAccountKey(string key) + { + Argument.AssertNotNull(key, nameof(key)); + + OdataType = "#Microsoft.Azure.Search.CognitiveServicesByKey"; + Key = key; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// Description of the Azure AI service resource attached to a skillset. + /// Keeps track of any properties unknown to the library. + /// The key used to provision the Azure AI service resource attached to a skillset. + internal CognitiveServicesAccountKey(string odataType, string description, IDictionary serializedAdditionalRawData, string key) : base(odataType, description, serializedAdditionalRawData) + { + Key = key; + } + + /// Initializes a new instance of for deserialization. + internal CognitiveServicesAccountKey() + { + } + + /// The key used to provision the Azure AI service resource attached to a skillset. + public string Key { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CommonGramTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CommonGramTokenFilter.Serialization.cs new file mode 100644 index 000000000000..c95a9c1ca89d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CommonGramTokenFilter.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class CommonGramTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CommonGramTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("commonWords"u8); + writer.WriteStartArray(); + foreach (var item in CommonWords) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(IgnoreCase)) + { + writer.WritePropertyName("ignoreCase"u8); + writer.WriteBooleanValue(IgnoreCase.Value); + } + if (Optional.IsDefined(QueryMode)) + { + writer.WritePropertyName("queryMode"u8); + writer.WriteBooleanValue(QueryMode.Value); + } + } + + CommonGramTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CommonGramTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCommonGramTokenFilter(document.RootElement, options); + } + + internal static CommonGramTokenFilter DeserializeCommonGramTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList commonWords = default; + bool? ignoreCase = default; + bool? queryMode = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("commonWords"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + commonWords = array; + continue; + } + if (property.NameEquals("ignoreCase"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ignoreCase = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("queryMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + queryMode = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CommonGramTokenFilter( + odataType, + name, + serializedAdditionalRawData, + commonWords, + ignoreCase, + queryMode); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CommonGramTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + CommonGramTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCommonGramTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CommonGramTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CommonGramTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCommonGramTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CommonGramTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CommonGramTokenFilter.cs new file mode 100644 index 000000000000..58262c835cb3 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CommonGramTokenFilter.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Construct bigrams for frequently occurring terms while indexing. Single terms + /// are still indexed too, with bigrams overlaid. This token filter is implemented + /// using Apache Lucene. + /// + public partial class CommonGramTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// The set of common words. + /// or is null. + public CommonGramTokenFilter(string name, IEnumerable commonWords) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(commonWords, nameof(commonWords)); + + OdataType = "#Microsoft.Azure.Search.CommonGramTokenFilter"; + CommonWords = commonWords.ToList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// The set of common words. + /// + /// A value indicating whether common words matching will be case insensitive. + /// Default is false. + /// + /// + /// A value that indicates whether the token filter is in query mode. When in query + /// mode, the token filter generates bigrams and then removes common words and + /// single terms followed by a common word. Default is false. + /// + internal CommonGramTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, IList commonWords, bool? ignoreCase, bool? queryMode) : base(odataType, name, serializedAdditionalRawData) + { + CommonWords = commonWords; + IgnoreCase = ignoreCase; + QueryMode = queryMode; + } + + /// Initializes a new instance of for deserialization. + internal CommonGramTokenFilter() + { + } + + /// The set of common words. + public IList CommonWords { get; } + /// + /// A value indicating whether common words matching will be case insensitive. + /// Default is false. + /// + public bool? IgnoreCase { get; set; } + /// + /// A value that indicates whether the token filter is in query mode. When in query + /// mode, the token filter generates bigrams and then removes common words and + /// single terms followed by a common word. Default is false. + /// + public bool? QueryMode { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ConditionalSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ConditionalSkill.Serialization.cs new file mode 100644 index 000000000000..cee8f490504d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ConditionalSkill.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ConditionalSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConditionalSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ConditionalSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConditionalSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConditionalSkill(document.RootElement, options); + } + + internal static ConditionalSkill DeserializeConditionalSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConditionalSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConditionalSkill)} does not support writing '{options.Format}' format."); + } + } + + ConditionalSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConditionalSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConditionalSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ConditionalSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConditionalSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ConditionalSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ConditionalSkill.cs new file mode 100644 index 000000000000..0ee860231b73 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ConditionalSkill.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// A skill that enables scenarios that require a Boolean operation to determine + /// the data to assign to an output. + /// + public partial class ConditionalSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public ConditionalSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Util.ConditionalSkill"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + internal ConditionalSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal ConditionalSkill() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CorsOptions.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CorsOptions.Serialization.cs new file mode 100644 index 000000000000..cffa81f624d3 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CorsOptions.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class CorsOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CorsOptions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("allowedOrigins"u8); + writer.WriteStartArray(); + foreach (var item in AllowedOrigins) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(MaxAgeInSeconds)) + { + writer.WritePropertyName("maxAgeInSeconds"u8); + writer.WriteNumberValue(MaxAgeInSeconds.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CorsOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CorsOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCorsOptions(document.RootElement, options); + } + + internal static CorsOptions DeserializeCorsOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList allowedOrigins = default; + long? maxAgeInSeconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("allowedOrigins"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedOrigins = array; + continue; + } + if (property.NameEquals("maxAgeInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxAgeInSeconds = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CorsOptions(allowedOrigins, maxAgeInSeconds, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CorsOptions)} does not support writing '{options.Format}' format."); + } + } + + CorsOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCorsOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CorsOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CorsOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCorsOptions(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CorsOptions.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CorsOptions.cs new file mode 100644 index 000000000000..86bb98f5c610 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CorsOptions.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// Defines options to control Cross-Origin Resource Sharing (CORS) for an index. + public partial class CorsOptions + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// The list of origins from which JavaScript code will be granted access to your + /// index. Can contain a list of hosts of the form + /// {protocol}://{fully-qualified-domain-name}[:{port#}], or a single '*' to allow + /// all origins (not recommended). + /// + /// is null. + public CorsOptions(IEnumerable allowedOrigins) + { + Argument.AssertNotNull(allowedOrigins, nameof(allowedOrigins)); + + AllowedOrigins = allowedOrigins.ToList(); + } + + /// Initializes a new instance of . + /// + /// The list of origins from which JavaScript code will be granted access to your + /// index. Can contain a list of hosts of the form + /// {protocol}://{fully-qualified-domain-name}[:{port#}], or a single '*' to allow + /// all origins (not recommended). + /// + /// + /// The duration for which browsers should cache CORS preflight responses. Defaults + /// to 5 minutes. + /// + /// Keeps track of any properties unknown to the library. + internal CorsOptions(IList allowedOrigins, long? maxAgeInSeconds, IDictionary serializedAdditionalRawData) + { + AllowedOrigins = allowedOrigins; + MaxAgeInSeconds = maxAgeInSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CorsOptions() + { + } + + /// + /// The list of origins from which JavaScript code will be granted access to your + /// index. Can contain a list of hosts of the form + /// {protocol}://{fully-qualified-domain-name}[:{port#}], or a single '*' to allow + /// all origins (not recommended). + /// + public IList AllowedOrigins { get; } + /// + /// The duration for which browsers should cache CORS preflight responses. Defaults + /// to 5 minutes. + /// + public long? MaxAgeInSeconds { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomAnalyzer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomAnalyzer.Serialization.cs new file mode 100644 index 000000000000..864c2005c383 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomAnalyzer.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class CustomAnalyzer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomAnalyzer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("tokenizer"u8); + writer.WriteStringValue(Tokenizer.ToString()); + if (Optional.IsCollectionDefined(TokenFilters)) + { + writer.WritePropertyName("tokenFilters"u8); + writer.WriteStartArray(); + foreach (var item in TokenFilters) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(CharFilters)) + { + writer.WritePropertyName("charFilters"u8); + writer.WriteStartArray(); + foreach (var item in CharFilters) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + } + + CustomAnalyzer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomAnalyzer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomAnalyzer(document.RootElement, options); + } + + internal static CustomAnalyzer DeserializeCustomAnalyzer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + LexicalTokenizerName tokenizer = default; + IList tokenFilters = default; + IList charFilters = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tokenizer"u8)) + { + tokenizer = new LexicalTokenizerName(property.Value.GetString()); + continue; + } + if (property.NameEquals("tokenFilters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new TokenFilterName(item.GetString())); + } + tokenFilters = array; + continue; + } + if (property.NameEquals("charFilters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new CharFilterName(item.GetString())); + } + charFilters = array; + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomAnalyzer( + odataType, + name, + serializedAdditionalRawData, + tokenizer, + tokenFilters ?? new ChangeTrackingList(), + charFilters ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomAnalyzer)} does not support writing '{options.Format}' format."); + } + } + + CustomAnalyzer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCustomAnalyzer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomAnalyzer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomAnalyzer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCustomAnalyzer(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomAnalyzer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomAnalyzer.cs new file mode 100644 index 000000000000..bfb5c3f39bc9 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomAnalyzer.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Allows you to take control over the process of converting text into + /// indexable/searchable tokens. It's a user-defined configuration consisting of a + /// single predefined tokenizer and one or more filters. The tokenizer is + /// responsible for breaking text into tokens, and the filters for modifying tokens + /// emitted by the tokenizer. + /// + public partial class CustomAnalyzer : LexicalAnalyzer + { + /// Initializes a new instance of . + /// + /// The name of the analyzer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// + /// The name of the tokenizer to use to divide continuous text into a sequence of + /// tokens, such as breaking a sentence into words. + /// + /// is null. + public CustomAnalyzer(string name, LexicalTokenizerName tokenizer) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.CustomAnalyzer"; + Tokenizer = tokenizer; + TokenFilters = new ChangeTrackingList(); + CharFilters = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the analyzer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// The name of the tokenizer to use to divide continuous text into a sequence of + /// tokens, such as breaking a sentence into words. + /// + /// + /// A list of token filters used to filter out or modify the tokens generated by a + /// tokenizer. For example, you can specify a lowercase filter that converts all + /// characters to lowercase. The filters are run in the order in which they are + /// listed. + /// + /// + /// A list of character filters used to prepare input text before it is processed + /// by the tokenizer. For instance, they can replace certain characters or symbols. + /// The filters are run in the order in which they are listed. + /// + internal CustomAnalyzer(string odataType, string name, IDictionary serializedAdditionalRawData, LexicalTokenizerName tokenizer, IList tokenFilters, IList charFilters) : base(odataType, name, serializedAdditionalRawData) + { + Tokenizer = tokenizer; + TokenFilters = tokenFilters; + CharFilters = charFilters; + } + + /// Initializes a new instance of for deserialization. + internal CustomAnalyzer() + { + } + + /// + /// The name of the tokenizer to use to divide continuous text into a sequence of + /// tokens, such as breaking a sentence into words. + /// + public LexicalTokenizerName Tokenizer { get; set; } + /// + /// A list of token filters used to filter out or modify the tokens generated by a + /// tokenizer. For example, you can specify a lowercase filter that converts all + /// characters to lowercase. The filters are run in the order in which they are + /// listed. + /// + public IList TokenFilters { get; } + /// + /// A list of character filters used to prepare input text before it is processed + /// by the tokenizer. For instance, they can replace certain characters or symbols. + /// The filters are run in the order in which they are listed. + /// + public IList CharFilters { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntity.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntity.Serialization.cs new file mode 100644 index 000000000000..4ea10176007f --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntity.Serialization.cs @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class CustomEntity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomEntity)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (Optional.IsDefined(Subtype)) + { + writer.WritePropertyName("subtype"u8); + writer.WriteStringValue(Subtype); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(CaseSensitive)) + { + writer.WritePropertyName("caseSensitive"u8); + writer.WriteBooleanValue(CaseSensitive.Value); + } + if (Optional.IsDefined(AccentSensitive)) + { + writer.WritePropertyName("accentSensitive"u8); + writer.WriteBooleanValue(AccentSensitive.Value); + } + if (Optional.IsDefined(FuzzyEditDistance)) + { + writer.WritePropertyName("fuzzyEditDistance"u8); + writer.WriteNumberValue(FuzzyEditDistance.Value); + } + if (Optional.IsDefined(DefaultCaseSensitive)) + { + writer.WritePropertyName("defaultCaseSensitive"u8); + writer.WriteBooleanValue(DefaultCaseSensitive.Value); + } + if (Optional.IsDefined(DefaultAccentSensitive)) + { + writer.WritePropertyName("defaultAccentSensitive"u8); + writer.WriteBooleanValue(DefaultAccentSensitive.Value); + } + if (Optional.IsDefined(DefaultFuzzyEditDistance)) + { + writer.WritePropertyName("defaultFuzzyEditDistance"u8); + writer.WriteNumberValue(DefaultFuzzyEditDistance.Value); + } + if (Optional.IsCollectionDefined(Aliases)) + { + writer.WritePropertyName("aliases"u8); + writer.WriteStartArray(); + foreach (var item in Aliases) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CustomEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomEntity(document.RootElement, options); + } + + internal static CustomEntity DeserializeCustomEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string description = default; + string type = default; + string subtype = default; + string id = default; + bool? caseSensitive = default; + bool? accentSensitive = default; + int? fuzzyEditDistance = default; + bool? defaultCaseSensitive = default; + bool? defaultAccentSensitive = default; + int? defaultFuzzyEditDistance = default; + IList aliases = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("subtype"u8)) + { + subtype = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("caseSensitive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + caseSensitive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("accentSensitive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + accentSensitive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("fuzzyEditDistance"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fuzzyEditDistance = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("defaultCaseSensitive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultCaseSensitive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("defaultAccentSensitive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultAccentSensitive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("defaultFuzzyEditDistance"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultFuzzyEditDistance = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("aliases"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CustomEntityAlias.DeserializeCustomEntityAlias(item, options)); + } + aliases = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomEntity( + name, + description, + type, + subtype, + id, + caseSensitive, + accentSensitive, + fuzzyEditDistance, + defaultCaseSensitive, + defaultAccentSensitive, + defaultFuzzyEditDistance, + aliases ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomEntity)} does not support writing '{options.Format}' format."); + } + } + + CustomEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCustomEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomEntity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CustomEntity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCustomEntity(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntity.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntity.cs new file mode 100644 index 000000000000..fd61960aedbe --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntity.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// An object that contains information about the matches that were found, and + /// related metadata. + /// + public partial class CustomEntity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// The top-level entity descriptor. Matches in the skill output will be grouped by + /// this name, and it should represent the "normalized" form of the text being + /// found. + /// + /// is null. + public CustomEntity(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + Aliases = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The top-level entity descriptor. Matches in the skill output will be grouped by + /// this name, and it should represent the "normalized" form of the text being + /// found. + /// + /// + /// This field can be used as a passthrough for custom metadata about the matched + /// text(s). The value of this field will appear with every match of its entity in + /// the skill output. + /// + /// + /// This field can be used as a passthrough for custom metadata about the matched + /// text(s). The value of this field will appear with every match of its entity in + /// the skill output. + /// + /// + /// This field can be used as a passthrough for custom metadata about the matched + /// text(s). The value of this field will appear with every match of its entity in + /// the skill output. + /// + /// + /// This field can be used as a passthrough for custom metadata about the matched + /// text(s). The value of this field will appear with every match of its entity in + /// the skill output. + /// + /// + /// Defaults to false. Boolean value denoting whether comparisons with the entity + /// name should be sensitive to character casing. Sample case insensitive matches + /// of "Microsoft" could be: microsoft, microSoft, MICROSOFT. + /// + /// + /// Defaults to false. Boolean value denoting whether comparisons with the entity + /// name should be sensitive to accent. + /// + /// + /// Defaults to 0. Maximum value of 5. Denotes the acceptable number of divergent + /// characters that would still constitute a match with the entity name. The + /// smallest possible fuzziness for any given match is returned. For instance, if + /// the edit distance is set to 3, "Windows10" would still match "Windows", + /// "Windows10" and "Windows 7". When case sensitivity is set to false, case + /// differences do NOT count towards fuzziness tolerance, but otherwise do. + /// + /// + /// Changes the default case sensitivity value for this entity. It be used to + /// change the default value of all aliases caseSensitive values. + /// + /// + /// Changes the default accent sensitivity value for this entity. It be used to + /// change the default value of all aliases accentSensitive values. + /// + /// + /// Changes the default fuzzy edit distance value for this entity. It can be used + /// to change the default value of all aliases fuzzyEditDistance values. + /// + /// + /// An array of complex objects that can be used to specify alternative spellings + /// or synonyms to the root entity name. + /// + /// Keeps track of any properties unknown to the library. + internal CustomEntity(string name, string description, string type, string subtype, string id, bool? caseSensitive, bool? accentSensitive, int? fuzzyEditDistance, bool? defaultCaseSensitive, bool? defaultAccentSensitive, int? defaultFuzzyEditDistance, IList aliases, IDictionary serializedAdditionalRawData) + { + Name = name; + Description = description; + Type = type; + Subtype = subtype; + Id = id; + CaseSensitive = caseSensitive; + AccentSensitive = accentSensitive; + FuzzyEditDistance = fuzzyEditDistance; + DefaultCaseSensitive = defaultCaseSensitive; + DefaultAccentSensitive = defaultAccentSensitive; + DefaultFuzzyEditDistance = defaultFuzzyEditDistance; + Aliases = aliases; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CustomEntity() + { + } + + /// + /// The top-level entity descriptor. Matches in the skill output will be grouped by + /// this name, and it should represent the "normalized" form of the text being + /// found. + /// + public string Name { get; set; } + /// + /// This field can be used as a passthrough for custom metadata about the matched + /// text(s). The value of this field will appear with every match of its entity in + /// the skill output. + /// + public string Description { get; set; } + /// + /// This field can be used as a passthrough for custom metadata about the matched + /// text(s). The value of this field will appear with every match of its entity in + /// the skill output. + /// + public string Type { get; set; } + /// + /// This field can be used as a passthrough for custom metadata about the matched + /// text(s). The value of this field will appear with every match of its entity in + /// the skill output. + /// + public string Subtype { get; set; } + /// + /// This field can be used as a passthrough for custom metadata about the matched + /// text(s). The value of this field will appear with every match of its entity in + /// the skill output. + /// + public string Id { get; set; } + /// + /// Defaults to false. Boolean value denoting whether comparisons with the entity + /// name should be sensitive to character casing. Sample case insensitive matches + /// of "Microsoft" could be: microsoft, microSoft, MICROSOFT. + /// + public bool? CaseSensitive { get; set; } + /// + /// Defaults to false. Boolean value denoting whether comparisons with the entity + /// name should be sensitive to accent. + /// + public bool? AccentSensitive { get; set; } + /// + /// Defaults to 0. Maximum value of 5. Denotes the acceptable number of divergent + /// characters that would still constitute a match with the entity name. The + /// smallest possible fuzziness for any given match is returned. For instance, if + /// the edit distance is set to 3, "Windows10" would still match "Windows", + /// "Windows10" and "Windows 7". When case sensitivity is set to false, case + /// differences do NOT count towards fuzziness tolerance, but otherwise do. + /// + public int? FuzzyEditDistance { get; set; } + /// + /// Changes the default case sensitivity value for this entity. It be used to + /// change the default value of all aliases caseSensitive values. + /// + public bool? DefaultCaseSensitive { get; set; } + /// + /// Changes the default accent sensitivity value for this entity. It be used to + /// change the default value of all aliases accentSensitive values. + /// + public bool? DefaultAccentSensitive { get; set; } + /// + /// Changes the default fuzzy edit distance value for this entity. It can be used + /// to change the default value of all aliases fuzzyEditDistance values. + /// + public int? DefaultFuzzyEditDistance { get; set; } + /// + /// An array of complex objects that can be used to specify alternative spellings + /// or synonyms to the root entity name. + /// + public IList Aliases { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntityAlias.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntityAlias.Serialization.cs new file mode 100644 index 000000000000..f461b6c175c7 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntityAlias.Serialization.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class CustomEntityAlias : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomEntityAlias)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + if (Optional.IsDefined(CaseSensitive)) + { + writer.WritePropertyName("caseSensitive"u8); + writer.WriteBooleanValue(CaseSensitive.Value); + } + if (Optional.IsDefined(AccentSensitive)) + { + writer.WritePropertyName("accentSensitive"u8); + writer.WriteBooleanValue(AccentSensitive.Value); + } + if (Optional.IsDefined(FuzzyEditDistance)) + { + writer.WritePropertyName("fuzzyEditDistance"u8); + writer.WriteNumberValue(FuzzyEditDistance.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CustomEntityAlias IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomEntityAlias)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomEntityAlias(document.RootElement, options); + } + + internal static CustomEntityAlias DeserializeCustomEntityAlias(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string text = default; + bool? caseSensitive = default; + bool? accentSensitive = default; + int? fuzzyEditDistance = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("caseSensitive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + caseSensitive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("accentSensitive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + accentSensitive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("fuzzyEditDistance"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fuzzyEditDistance = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomEntityAlias(text, caseSensitive, accentSensitive, fuzzyEditDistance, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomEntityAlias)} does not support writing '{options.Format}' format."); + } + } + + CustomEntityAlias IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCustomEntityAlias(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomEntityAlias)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CustomEntityAlias FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCustomEntityAlias(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntityAlias.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntityAlias.cs new file mode 100644 index 000000000000..0a7d29e536f0 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntityAlias.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// A complex object that can be used to specify alternative spellings or synonyms + /// to the root entity name. + /// + public partial class CustomEntityAlias + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The text of the alias. + /// is null. + public CustomEntityAlias(string text) + { + Argument.AssertNotNull(text, nameof(text)); + + Text = text; + } + + /// Initializes a new instance of . + /// The text of the alias. + /// Determine if the alias is case sensitive. + /// Determine if the alias is accent sensitive. + /// Determine the fuzzy edit distance of the alias. + /// Keeps track of any properties unknown to the library. + internal CustomEntityAlias(string text, bool? caseSensitive, bool? accentSensitive, int? fuzzyEditDistance, IDictionary serializedAdditionalRawData) + { + Text = text; + CaseSensitive = caseSensitive; + AccentSensitive = accentSensitive; + FuzzyEditDistance = fuzzyEditDistance; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CustomEntityAlias() + { + } + + /// The text of the alias. + public string Text { get; set; } + /// Determine if the alias is case sensitive. + public bool? CaseSensitive { get; set; } + /// Determine if the alias is accent sensitive. + public bool? AccentSensitive { get; set; } + /// Determine the fuzzy edit distance of the alias. + public int? FuzzyEditDistance { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntityLookupSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntityLookupSkill.Serialization.cs new file mode 100644 index 000000000000..d8aa7ba6e260 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntityLookupSkill.Serialization.cs @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class CustomEntityLookupSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomEntityLookupSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(DefaultLanguageCode)) + { + writer.WritePropertyName("defaultLanguageCode"u8); + writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + } + if (Optional.IsDefined(EntitiesDefinitionUri)) + { + writer.WritePropertyName("entitiesDefinitionUri"u8); + writer.WriteStringValue(EntitiesDefinitionUri); + } + if (Optional.IsCollectionDefined(InlineEntitiesDefinition)) + { + writer.WritePropertyName("inlineEntitiesDefinition"u8); + writer.WriteStartArray(); + foreach (var item in InlineEntitiesDefinition) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(GlobalDefaultCaseSensitive)) + { + writer.WritePropertyName("globalDefaultCaseSensitive"u8); + writer.WriteBooleanValue(GlobalDefaultCaseSensitive.Value); + } + if (Optional.IsDefined(GlobalDefaultAccentSensitive)) + { + writer.WritePropertyName("globalDefaultAccentSensitive"u8); + writer.WriteBooleanValue(GlobalDefaultAccentSensitive.Value); + } + if (Optional.IsDefined(GlobalDefaultFuzzyEditDistance)) + { + writer.WritePropertyName("globalDefaultFuzzyEditDistance"u8); + writer.WriteNumberValue(GlobalDefaultFuzzyEditDistance.Value); + } + } + + CustomEntityLookupSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomEntityLookupSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomEntityLookupSkill(document.RootElement, options); + } + + internal static CustomEntityLookupSkill DeserializeCustomEntityLookupSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CustomEntityLookupSkillLanguage? defaultLanguageCode = default; + string entitiesDefinitionUri = default; + IList inlineEntitiesDefinition = default; + bool? globalDefaultCaseSensitive = default; + bool? globalDefaultAccentSensitive = default; + int? globalDefaultFuzzyEditDistance = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("defaultLanguageCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultLanguageCode = new CustomEntityLookupSkillLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("entitiesDefinitionUri"u8)) + { + entitiesDefinitionUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("inlineEntitiesDefinition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CustomEntity.DeserializeCustomEntity(item, options)); + } + inlineEntitiesDefinition = array; + continue; + } + if (property.NameEquals("globalDefaultCaseSensitive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + globalDefaultCaseSensitive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("globalDefaultAccentSensitive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + globalDefaultAccentSensitive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("globalDefaultFuzzyEditDistance"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + globalDefaultFuzzyEditDistance = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomEntityLookupSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + defaultLanguageCode, + entitiesDefinitionUri, + inlineEntitiesDefinition ?? new ChangeTrackingList(), + globalDefaultCaseSensitive, + globalDefaultAccentSensitive, + globalDefaultFuzzyEditDistance); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomEntityLookupSkill)} does not support writing '{options.Format}' format."); + } + } + + CustomEntityLookupSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCustomEntityLookupSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomEntityLookupSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomEntityLookupSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCustomEntityLookupSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntityLookupSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntityLookupSkill.cs new file mode 100644 index 000000000000..82a8fffe4d81 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntityLookupSkill.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// A skill looks for text from a custom, user-defined list of words and phrases. + public partial class CustomEntityLookupSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public CustomEntityLookupSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Text.CustomEntityLookupSkill"; + InlineEntitiesDefinition = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// A value indicating which language code to use. Default is `en`. + /// + /// Path to a JSON or CSV file containing all the target text to match against. + /// This entity definition is read at the beginning of an indexer run. Any updates + /// to this file during an indexer run will not take effect until subsequent runs. + /// This config must be accessible over HTTPS. + /// + /// The inline CustomEntity definition. + /// + /// A global flag for CaseSensitive. If CaseSensitive is not set in CustomEntity, + /// this value will be the default value. + /// + /// + /// A global flag for AccentSensitive. If AccentSensitive is not set in + /// CustomEntity, this value will be the default value. + /// + /// + /// A global flag for FuzzyEditDistance. If FuzzyEditDistance is not set in + /// CustomEntity, this value will be the default value. + /// + internal CustomEntityLookupSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, CustomEntityLookupSkillLanguage? defaultLanguageCode, string entitiesDefinitionUri, IList inlineEntitiesDefinition, bool? globalDefaultCaseSensitive, bool? globalDefaultAccentSensitive, int? globalDefaultFuzzyEditDistance) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + DefaultLanguageCode = defaultLanguageCode; + EntitiesDefinitionUri = entitiesDefinitionUri; + InlineEntitiesDefinition = inlineEntitiesDefinition; + GlobalDefaultCaseSensitive = globalDefaultCaseSensitive; + GlobalDefaultAccentSensitive = globalDefaultAccentSensitive; + GlobalDefaultFuzzyEditDistance = globalDefaultFuzzyEditDistance; + } + + /// Initializes a new instance of for deserialization. + internal CustomEntityLookupSkill() + { + } + + /// A value indicating which language code to use. Default is `en`. + public CustomEntityLookupSkillLanguage? DefaultLanguageCode { get; set; } + /// + /// Path to a JSON or CSV file containing all the target text to match against. + /// This entity definition is read at the beginning of an indexer run. Any updates + /// to this file during an indexer run will not take effect until subsequent runs. + /// This config must be accessible over HTTPS. + /// + public string EntitiesDefinitionUri { get; set; } + /// The inline CustomEntity definition. + public IList InlineEntitiesDefinition { get; } + /// + /// A global flag for CaseSensitive. If CaseSensitive is not set in CustomEntity, + /// this value will be the default value. + /// + public bool? GlobalDefaultCaseSensitive { get; set; } + /// + /// A global flag for AccentSensitive. If AccentSensitive is not set in + /// CustomEntity, this value will be the default value. + /// + public bool? GlobalDefaultAccentSensitive { get; set; } + /// + /// A global flag for FuzzyEditDistance. If FuzzyEditDistance is not set in + /// CustomEntity, this value will be the default value. + /// + public int? GlobalDefaultFuzzyEditDistance { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntityLookupSkillLanguage.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntityLookupSkillLanguage.cs new file mode 100644 index 000000000000..4bce91fbc882 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/CustomEntityLookupSkillLanguage.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// The language codes supported for input text by CustomEntityLookupSkill. + public readonly partial struct CustomEntityLookupSkillLanguage : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CustomEntityLookupSkillLanguage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DaValue = "da"; + private const string DeValue = "de"; + private const string EnValue = "en"; + private const string EsValue = "es"; + private const string FiValue = "fi"; + private const string FrValue = "fr"; + private const string ItValue = "it"; + private const string KoValue = "ko"; + private const string PtValue = "pt"; + + /// Danish. + public static CustomEntityLookupSkillLanguage Da { get; } = new CustomEntityLookupSkillLanguage(DaValue); + /// German. + public static CustomEntityLookupSkillLanguage De { get; } = new CustomEntityLookupSkillLanguage(DeValue); + /// English. + public static CustomEntityLookupSkillLanguage En { get; } = new CustomEntityLookupSkillLanguage(EnValue); + /// Spanish. + public static CustomEntityLookupSkillLanguage Es { get; } = new CustomEntityLookupSkillLanguage(EsValue); + /// Finnish. + public static CustomEntityLookupSkillLanguage Fi { get; } = new CustomEntityLookupSkillLanguage(FiValue); + /// French. + public static CustomEntityLookupSkillLanguage Fr { get; } = new CustomEntityLookupSkillLanguage(FrValue); + /// Italian. + public static CustomEntityLookupSkillLanguage It { get; } = new CustomEntityLookupSkillLanguage(ItValue); + /// Korean. + public static CustomEntityLookupSkillLanguage Ko { get; } = new CustomEntityLookupSkillLanguage(KoValue); + /// Portuguese. + public static CustomEntityLookupSkillLanguage Pt { get; } = new CustomEntityLookupSkillLanguage(PtValue); + /// Determines if two values are the same. + public static bool operator ==(CustomEntityLookupSkillLanguage left, CustomEntityLookupSkillLanguage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CustomEntityLookupSkillLanguage left, CustomEntityLookupSkillLanguage right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CustomEntityLookupSkillLanguage(string value) => new CustomEntityLookupSkillLanguage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CustomEntityLookupSkillLanguage other && Equals(other); + /// + public bool Equals(CustomEntityLookupSkillLanguage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataChangeDetectionPolicy.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataChangeDetectionPolicy.Serialization.cs new file mode 100644 index 000000000000..a54d8594dcca --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataChangeDetectionPolicy.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + [PersistableModelProxy(typeof(UnknownDataChangeDetectionPolicy))] + public partial class DataChangeDetectionPolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataChangeDetectionPolicy)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("@odata.type"u8); + writer.WriteStringValue(OdataType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataChangeDetectionPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataChangeDetectionPolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataChangeDetectionPolicy(document.RootElement, options); + } + + internal static DataChangeDetectionPolicy DeserializeDataChangeDetectionPolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("@odata.type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy": return HighWaterMarkChangeDetectionPolicy.DeserializeHighWaterMarkChangeDetectionPolicy(element, options); + case "#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy": return SqlIntegratedChangeTrackingPolicy.DeserializeSqlIntegratedChangeTrackingPolicy(element, options); + } + } + return UnknownDataChangeDetectionPolicy.DeserializeUnknownDataChangeDetectionPolicy(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataChangeDetectionPolicy)} does not support writing '{options.Format}' format."); + } + } + + DataChangeDetectionPolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataChangeDetectionPolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataChangeDetectionPolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DataChangeDetectionPolicy FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataChangeDetectionPolicy(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataChangeDetectionPolicy.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataChangeDetectionPolicy.cs new file mode 100644 index 000000000000..5d59be3d9979 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataChangeDetectionPolicy.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Base type for data change detection policies. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class DataChangeDetectionPolicy + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataChangeDetectionPolicy() + { + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// Keeps track of any properties unknown to the library. + internal DataChangeDetectionPolicy(string odataType, IDictionary serializedAdditionalRawData) + { + OdataType = odataType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The discriminator for derived types. + internal string OdataType { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataDeletionDetectionPolicy.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataDeletionDetectionPolicy.Serialization.cs new file mode 100644 index 000000000000..fd23d9af7551 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataDeletionDetectionPolicy.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + [PersistableModelProxy(typeof(UnknownDataDeletionDetectionPolicy))] + public partial class DataDeletionDetectionPolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataDeletionDetectionPolicy)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("@odata.type"u8); + writer.WriteStringValue(OdataType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataDeletionDetectionPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataDeletionDetectionPolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataDeletionDetectionPolicy(document.RootElement, options); + } + + internal static DataDeletionDetectionPolicy DeserializeDataDeletionDetectionPolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("@odata.type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy": return SoftDeleteColumnDeletionDetectionPolicy.DeserializeSoftDeleteColumnDeletionDetectionPolicy(element, options); + } + } + return UnknownDataDeletionDetectionPolicy.DeserializeUnknownDataDeletionDetectionPolicy(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataDeletionDetectionPolicy)} does not support writing '{options.Format}' format."); + } + } + + DataDeletionDetectionPolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataDeletionDetectionPolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataDeletionDetectionPolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DataDeletionDetectionPolicy FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataDeletionDetectionPolicy(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataDeletionDetectionPolicy.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataDeletionDetectionPolicy.cs new file mode 100644 index 000000000000..5c69829f3901 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataDeletionDetectionPolicy.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Base type for data deletion detection policies. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public abstract partial class DataDeletionDetectionPolicy + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataDeletionDetectionPolicy() + { + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// Keeps track of any properties unknown to the library. + internal DataDeletionDetectionPolicy(string odataType, IDictionary serializedAdditionalRawData) + { + OdataType = odataType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The discriminator for derived types. + internal string OdataType { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataSourceCredentials.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataSourceCredentials.Serialization.cs new file mode 100644 index 000000000000..d17c1d4461c7 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataSourceCredentials.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class DataSourceCredentials : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataSourceCredentials)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ConnectionString)) + { + writer.WritePropertyName("connectionString"u8); + writer.WriteStringValue(ConnectionString); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataSourceCredentials IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataSourceCredentials)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataSourceCredentials(document.RootElement, options); + } + + internal static DataSourceCredentials DeserializeDataSourceCredentials(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string connectionString = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("connectionString"u8)) + { + connectionString = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataSourceCredentials(connectionString, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataSourceCredentials)} does not support writing '{options.Format}' format."); + } + } + + DataSourceCredentials IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataSourceCredentials(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataSourceCredentials)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DataSourceCredentials FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataSourceCredentials(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataSourceCredentials.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataSourceCredentials.cs new file mode 100644 index 000000000000..d1db04bfb6b7 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataSourceCredentials.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents credentials that can be used to connect to a datasource. + public partial class DataSourceCredentials + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataSourceCredentials() + { + } + + /// Initializes a new instance of . + /// + /// The connection string for the datasource. Set to `<unchanged>` (with brackets) + /// if you don't want the connection string updated. Set to `<redacted>` if you + /// want to remove the connection string value from the datasource. + /// + /// Keeps track of any properties unknown to the library. + internal DataSourceCredentials(string connectionString, IDictionary serializedAdditionalRawData) + { + ConnectionString = connectionString; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The connection string for the datasource. Set to `<unchanged>` (with brackets) + /// if you don't want the connection string updated. Set to `<redacted>` if you + /// want to remove the connection string value from the datasource. + /// + public string ConnectionString { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataSources.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataSources.cs new file mode 100644 index 000000000000..7613df7a63fe --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DataSources.cs @@ -0,0 +1,695 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Search.Documents.Indexes +{ + // Data plane generated sub-client. + /// The DataSources sub-client. + public partial class DataSources + { + private const string AuthorizationHeader = "api-key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://search.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of DataSources for mocking. + protected DataSources() + { + } + + /// Initializes a new instance of DataSources. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The key credential to copy. + /// The token credential to copy. + /// Service host. + /// The API version to use for this operation. + internal DataSources(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _keyCredential = keyCredential; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Creates a new datasource or updates a datasource if it already exists. + /// The name of the datasource. + /// The definition of the datasource to create or update. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CreateOrUpdateAsync(string dataSourceName, SearchIndexerDataSource dataSource, MatchConditions matchConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataSourceName, nameof(dataSourceName)); + Argument.AssertNotNull(dataSource, nameof(dataSource)); + + using RequestContent content = dataSource.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateOrUpdateAsync(dataSourceName, content, matchConditions, context).ConfigureAwait(false); + return Response.FromValue(SearchIndexerDataSource.FromResponse(response), response); + } + + /// Creates a new datasource or updates a datasource if it already exists. + /// The name of the datasource. + /// The definition of the datasource to create or update. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CreateOrUpdate(string dataSourceName, SearchIndexerDataSource dataSource, MatchConditions matchConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataSourceName, nameof(dataSourceName)); + Argument.AssertNotNull(dataSource, nameof(dataSource)); + + using RequestContent content = dataSource.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateOrUpdate(dataSourceName, content, matchConditions, context); + return Response.FromValue(SearchIndexerDataSource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Creates a new datasource or updates a datasource if it already exists. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the datasource. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrUpdateAsync(string dataSourceName, RequestContent content, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(dataSourceName, nameof(dataSourceName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("DataSources.CreateOrUpdate"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateRequest(dataSourceName, content, matchConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new datasource or updates a datasource if it already exists. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the datasource. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrUpdate(string dataSourceName, RequestContent content, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(dataSourceName, nameof(dataSourceName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("DataSources.CreateOrUpdate"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateRequest(dataSourceName, content, matchConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a datasource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The name of the datasource. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteAsync(string dataSourceName, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(dataSourceName, nameof(dataSourceName)); + + using var scope = ClientDiagnostics.CreateScope("DataSources.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(dataSourceName, matchConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a datasource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The name of the datasource. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Delete(string dataSourceName, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(dataSourceName, nameof(dataSourceName)); + + using var scope = ClientDiagnostics.CreateScope("DataSources.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(dataSourceName, matchConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieves a datasource definition. + /// The name of the datasource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDataSourceAsync(string dataSourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataSourceName, nameof(dataSourceName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDataSourceAsync(dataSourceName, context).ConfigureAwait(false); + return Response.FromValue(SearchIndexerDataSource.FromResponse(response), response); + } + + /// Retrieves a datasource definition. + /// The name of the datasource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDataSource(string dataSourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataSourceName, nameof(dataSourceName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDataSource(dataSourceName, context); + return Response.FromValue(SearchIndexerDataSource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieves a datasource definition. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the datasource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetDataSourceAsync(string dataSourceName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(dataSourceName, nameof(dataSourceName)); + + using var scope = ClientDiagnostics.CreateScope("DataSources.GetDataSource"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDataSourceRequest(dataSourceName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieves a datasource definition. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the datasource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetDataSource(string dataSourceName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(dataSourceName, nameof(dataSourceName)); + + using var scope = ClientDiagnostics.CreateScope("DataSources.GetDataSource"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDataSourceRequest(dataSourceName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists all datasources available for a search service. + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The cancellation token to use. + /// + public virtual async Task> GetDataSourcesAsync(string select = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDataSourcesAsync(select, context).ConfigureAwait(false); + return Response.FromValue(ListDataSourcesResult.FromResponse(response), response); + } + + /// Lists all datasources available for a search service. + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The cancellation token to use. + /// + public virtual Response GetDataSources(string select = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDataSources(select, context); + return Response.FromValue(ListDataSourcesResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Lists all datasources available for a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetDataSourcesAsync(string select, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("DataSources.GetDataSources"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDataSourcesRequest(select, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists all datasources available for a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetDataSources(string select, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("DataSources.GetDataSources"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDataSourcesRequest(select, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a new datasource. + /// The definition of the datasource to create. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> CreateAsync(SearchIndexerDataSource dataSource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(dataSource, nameof(dataSource)); + + using RequestContent content = dataSource.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateAsync(content, context).ConfigureAwait(false); + return Response.FromValue(SearchIndexerDataSource.FromResponse(response), response); + } + + /// Creates a new datasource. + /// The definition of the datasource to create. + /// The cancellation token to use. + /// is null. + /// + public virtual Response Create(SearchIndexerDataSource dataSource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(dataSource, nameof(dataSource)); + + using RequestContent content = dataSource.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Create(content, context); + return Response.FromValue(SearchIndexerDataSource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Creates a new datasource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateAsync(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("DataSources.Create"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateRequest(content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new datasource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Create(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("DataSources.Create"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateRequest(content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string dataSourceName, RequestContent content, MatchConditions matchConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/datasources('", false); + uri.AppendPath(dataSourceName, true); + uri.AppendPath("')", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Prefer", "return=representation"); + request.Headers.Add("Accept", "application/json"); + if (matchConditions != null) + { + request.Headers.Add(matchConditions); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteRequest(string dataSourceName, MatchConditions matchConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204404); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/datasources('", false); + uri.AppendPath(dataSourceName, true); + uri.AppendPath("')", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (matchConditions != null) + { + request.Headers.Add(matchConditions); + } + return message; + } + + internal HttpMessage CreateGetDataSourceRequest(string dataSourceName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/datasources('", false); + uri.AppendPath(dataSourceName, true); + uri.AppendPath("')", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDataSourcesRequest(string select, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/datasources", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier201); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/datasources", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + private static ResponseClassifier _responseClassifier204404; + private static ResponseClassifier ResponseClassifier204404 => _responseClassifier204404 ??= new StatusCodeClassifier(stackalloc ushort[] { 204, 404 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier201; + private static ResponseClassifier ResponseClassifier201 => _responseClassifier201 ??= new StatusCodeClassifier(stackalloc ushort[] { 201 }); + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DefaultCognitiveServicesAccount.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DefaultCognitiveServicesAccount.Serialization.cs new file mode 100644 index 000000000000..893830fc2066 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DefaultCognitiveServicesAccount.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class DefaultCognitiveServicesAccount : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DefaultCognitiveServicesAccount)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DefaultCognitiveServicesAccount IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DefaultCognitiveServicesAccount)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDefaultCognitiveServicesAccount(document.RootElement, options); + } + + internal static DefaultCognitiveServicesAccount DeserializeDefaultCognitiveServicesAccount(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string odataType = default; + string description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DefaultCognitiveServicesAccount(odataType, description, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DefaultCognitiveServicesAccount)} does not support writing '{options.Format}' format."); + } + } + + DefaultCognitiveServicesAccount IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDefaultCognitiveServicesAccount(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DefaultCognitiveServicesAccount)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new DefaultCognitiveServicesAccount FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDefaultCognitiveServicesAccount(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DefaultCognitiveServicesAccount.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DefaultCognitiveServicesAccount.cs new file mode 100644 index 000000000000..f81542255f3e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DefaultCognitiveServicesAccount.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// An empty object that represents the default Azure AI service resource for a + /// skillset. + /// + public partial class DefaultCognitiveServicesAccount : CognitiveServicesAccount + { + /// Initializes a new instance of . + public DefaultCognitiveServicesAccount() + { + OdataType = "#Microsoft.Azure.Search.DefaultCognitiveServices"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// Description of the Azure AI service resource attached to a skillset. + /// Keeps track of any properties unknown to the library. + internal DefaultCognitiveServicesAccount(string odataType, string description, IDictionary serializedAdditionalRawData) : base(odataType, description, serializedAdditionalRawData) + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DictionaryDecompounderTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DictionaryDecompounderTokenFilter.Serialization.cs new file mode 100644 index 000000000000..500dd60918d5 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DictionaryDecompounderTokenFilter.Serialization.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class DictionaryDecompounderTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DictionaryDecompounderTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("wordList"u8); + writer.WriteStartArray(); + foreach (var item in WordList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(MinWordSize)) + { + writer.WritePropertyName("minWordSize"u8); + writer.WriteNumberValue(MinWordSize.Value); + } + if (Optional.IsDefined(MinSubwordSize)) + { + writer.WritePropertyName("minSubwordSize"u8); + writer.WriteNumberValue(MinSubwordSize.Value); + } + if (Optional.IsDefined(MaxSubwordSize)) + { + writer.WritePropertyName("maxSubwordSize"u8); + writer.WriteNumberValue(MaxSubwordSize.Value); + } + if (Optional.IsDefined(OnlyLongestMatch)) + { + writer.WritePropertyName("onlyLongestMatch"u8); + writer.WriteBooleanValue(OnlyLongestMatch.Value); + } + } + + DictionaryDecompounderTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DictionaryDecompounderTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDictionaryDecompounderTokenFilter(document.RootElement, options); + } + + internal static DictionaryDecompounderTokenFilter DeserializeDictionaryDecompounderTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList wordList = default; + int? minWordSize = default; + int? minSubwordSize = default; + int? maxSubwordSize = default; + bool? onlyLongestMatch = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("wordList"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + wordList = array; + continue; + } + if (property.NameEquals("minWordSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minWordSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("minSubwordSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minSubwordSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxSubwordSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxSubwordSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("onlyLongestMatch"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + onlyLongestMatch = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DictionaryDecompounderTokenFilter( + odataType, + name, + serializedAdditionalRawData, + wordList, + minWordSize, + minSubwordSize, + maxSubwordSize, + onlyLongestMatch); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DictionaryDecompounderTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + DictionaryDecompounderTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDictionaryDecompounderTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DictionaryDecompounderTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new DictionaryDecompounderTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDictionaryDecompounderTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DictionaryDecompounderTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DictionaryDecompounderTokenFilter.cs new file mode 100644 index 000000000000..779460991c0d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DictionaryDecompounderTokenFilter.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Decomposes compound words found in many Germanic languages. This token filter + /// is implemented using Apache Lucene. + /// + public partial class DictionaryDecompounderTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// The list of words to match against. + /// or is null. + public DictionaryDecompounderTokenFilter(string name, IEnumerable wordList) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(wordList, nameof(wordList)); + + OdataType = "#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter"; + WordList = wordList.ToList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// The list of words to match against. + /// + /// The minimum word size. Only words longer than this get processed. Default is 5. + /// Maximum is 300. + /// + /// + /// The minimum subword size. Only subwords longer than this are outputted. Default + /// is 2. Maximum is 300. + /// + /// + /// The maximum subword size. Only subwords shorter than this are outputted. + /// Default is 15. Maximum is 300. + /// + /// + /// A value indicating whether to add only the longest matching subword to the + /// output. Default is false. + /// + internal DictionaryDecompounderTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, IList wordList, int? minWordSize, int? minSubwordSize, int? maxSubwordSize, bool? onlyLongestMatch) : base(odataType, name, serializedAdditionalRawData) + { + WordList = wordList; + MinWordSize = minWordSize; + MinSubwordSize = minSubwordSize; + MaxSubwordSize = maxSubwordSize; + OnlyLongestMatch = onlyLongestMatch; + } + + /// Initializes a new instance of for deserialization. + internal DictionaryDecompounderTokenFilter() + { + } + + /// The list of words to match against. + public IList WordList { get; } + /// + /// The minimum word size. Only words longer than this get processed. Default is 5. + /// Maximum is 300. + /// + public int? MinWordSize { get; set; } + /// + /// The minimum subword size. Only subwords longer than this are outputted. Default + /// is 2. Maximum is 300. + /// + public int? MinSubwordSize { get; set; } + /// + /// The maximum subword size. Only subwords shorter than this are outputted. + /// Default is 15. Maximum is 300. + /// + public int? MaxSubwordSize { get; set; } + /// + /// A value indicating whether to add only the longest matching subword to the + /// output. Default is false. + /// + public bool? OnlyLongestMatch { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DistanceScoringFunction.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DistanceScoringFunction.Serialization.cs new file mode 100644 index 000000000000..e2aea6aeb8e8 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DistanceScoringFunction.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class DistanceScoringFunction : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DistanceScoringFunction)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("distance"u8); + writer.WriteObjectValue(Distance, options); + } + + DistanceScoringFunction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DistanceScoringFunction)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDistanceScoringFunction(document.RootElement, options); + } + + internal static DistanceScoringFunction DeserializeDistanceScoringFunction(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DistanceScoringParameters distance = default; + string fieldName = default; + double boost = default; + ScoringFunctionInterpolation? interpolation = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("distance"u8)) + { + distance = DistanceScoringParameters.DeserializeDistanceScoringParameters(property.Value, options); + continue; + } + if (property.NameEquals("fieldName"u8)) + { + fieldName = property.Value.GetString(); + continue; + } + if (property.NameEquals("boost"u8)) + { + boost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("interpolation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + interpolation = new ScoringFunctionInterpolation(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DistanceScoringFunction( + fieldName, + boost, + interpolation, + type, + serializedAdditionalRawData, + distance); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DistanceScoringFunction)} does not support writing '{options.Format}' format."); + } + } + + DistanceScoringFunction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDistanceScoringFunction(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DistanceScoringFunction)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new DistanceScoringFunction FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDistanceScoringFunction(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DistanceScoringFunction.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DistanceScoringFunction.cs new file mode 100644 index 000000000000..6da34faeec93 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DistanceScoringFunction.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Defines a function that boosts scores based on distance from a geographic + /// location. + /// + public partial class DistanceScoringFunction : ScoringFunction + { + /// Initializes a new instance of . + /// The name of the field used as input to the scoring function. + /// A multiplier for the raw score. Must be a positive number not equal to 1.0. + /// Parameter values for the distance scoring function. + /// or is null. + public DistanceScoringFunction(string fieldName, double boost, DistanceScoringParameters distance) : base(fieldName, boost) + { + Argument.AssertNotNull(fieldName, nameof(fieldName)); + Argument.AssertNotNull(distance, nameof(distance)); + + Type = "distance"; + Distance = distance; + } + + /// Initializes a new instance of . + /// The name of the field used as input to the scoring function. + /// A multiplier for the raw score. Must be a positive number not equal to 1.0. + /// + /// A value indicating how boosting will be interpolated across document scores; + /// defaults to "Linear". + /// + /// Type of ScoringFunction. + /// Keeps track of any properties unknown to the library. + /// Parameter values for the distance scoring function. + internal DistanceScoringFunction(string fieldName, double boost, ScoringFunctionInterpolation? interpolation, string type, IDictionary serializedAdditionalRawData, DistanceScoringParameters distance) : base(fieldName, boost, interpolation, type, serializedAdditionalRawData) + { + Distance = distance; + } + + /// Initializes a new instance of for deserialization. + internal DistanceScoringFunction() + { + } + + /// Parameter values for the distance scoring function. + public DistanceScoringParameters Distance { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DistanceScoringParameters.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DistanceScoringParameters.Serialization.cs new file mode 100644 index 000000000000..59ed4d59cd4f --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DistanceScoringParameters.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class DistanceScoringParameters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DistanceScoringParameters)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("referencePointParameter"u8); + writer.WriteStringValue(ReferencePointParameter); + writer.WritePropertyName("boostingDistance"u8); + writer.WriteNumberValue(BoostingDistance); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DistanceScoringParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DistanceScoringParameters)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDistanceScoringParameters(document.RootElement, options); + } + + internal static DistanceScoringParameters DeserializeDistanceScoringParameters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string referencePointParameter = default; + double boostingDistance = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("referencePointParameter"u8)) + { + referencePointParameter = property.Value.GetString(); + continue; + } + if (property.NameEquals("boostingDistance"u8)) + { + boostingDistance = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DistanceScoringParameters(referencePointParameter, boostingDistance, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DistanceScoringParameters)} does not support writing '{options.Format}' format."); + } + } + + DistanceScoringParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDistanceScoringParameters(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DistanceScoringParameters)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DistanceScoringParameters FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDistanceScoringParameters(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DistanceScoringParameters.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DistanceScoringParameters.cs new file mode 100644 index 000000000000..d02828e97bf1 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DistanceScoringParameters.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Provides parameter values to a distance scoring function. + public partial class DistanceScoringParameters + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// The name of the parameter passed in search queries to specify the reference + /// location. + /// + /// + /// The distance in kilometers from the reference location where the boosting range + /// ends. + /// + /// is null. + public DistanceScoringParameters(string referencePointParameter, double boostingDistance) + { + Argument.AssertNotNull(referencePointParameter, nameof(referencePointParameter)); + + ReferencePointParameter = referencePointParameter; + BoostingDistance = boostingDistance; + } + + /// Initializes a new instance of . + /// + /// The name of the parameter passed in search queries to specify the reference + /// location. + /// + /// + /// The distance in kilometers from the reference location where the boosting range + /// ends. + /// + /// Keeps track of any properties unknown to the library. + internal DistanceScoringParameters(string referencePointParameter, double boostingDistance, IDictionary serializedAdditionalRawData) + { + ReferencePointParameter = referencePointParameter; + BoostingDistance = boostingDistance; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DistanceScoringParameters() + { + } + + /// + /// The name of the parameter passed in search queries to specify the reference + /// location. + /// + public string ReferencePointParameter { get; set; } + /// + /// The distance in kilometers from the reference location where the boosting range + /// ends. + /// + public double BoostingDistance { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/DataSources.xml b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/DataSources.xml new file mode 100644 index 000000000000..c31d412d0dfb --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/DataSources.xml @@ -0,0 +1,473 @@ + + + + + +This sample shows how to call CreateOrUpdateAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +SearchIndexerDataSource dataSource = new SearchIndexerDataSource("mydocdbdatasource", SearchIndexerDataSourceType.CosmosDb, new DataSourceCredentials +{ + ConnectionString = "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId", +}, new SearchIndexerDataContainer("myDocDbCollectionId") +{ + Query = "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts", +}) +{ + Description = "My Cosmos DB data source.", + DataChangeDetectionPolicy = new HighWaterMarkChangeDetectionPolicy("_ts"), + DataDeletionDetectionPolicy = new SoftDeleteColumnDeletionDetectionPolicy + { + SoftDeleteColumnName = "isDeleted", + SoftDeleteMarkerValue = "true", + }, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), +}; +Response response = await client.CreateOrUpdateAsync("mydatasource", dataSource); +]]> + + + +This sample shows how to call CreateOrUpdate. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +SearchIndexerDataSource dataSource = new SearchIndexerDataSource("mydocdbdatasource", SearchIndexerDataSourceType.CosmosDb, new DataSourceCredentials +{ + ConnectionString = "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId", +}, new SearchIndexerDataContainer("myDocDbCollectionId") +{ + Query = "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts", +}) +{ + Description = "My Cosmos DB data source.", + DataChangeDetectionPolicy = new HighWaterMarkChangeDetectionPolicy("_ts"), + DataDeletionDetectionPolicy = new SoftDeleteColumnDeletionDetectionPolicy + { + SoftDeleteColumnName = "isDeleted", + SoftDeleteMarkerValue = "true", + }, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), +}; +Response response = client.CreateOrUpdate("mydatasource", dataSource); +]]> + + + +This sample shows how to call CreateOrUpdateAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "mydocdbdatasource", + description = "My Cosmos DB data source.", + type = "cosmosdb", + credentials = new + { + connectionString = "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId", + }, + container = new + { + name = "myDocDbCollectionId", + query = "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts", + }, + dataChangeDetectionPolicy = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy", + ["highWaterMarkColumnName"] = "_ts" + }, + dataDeletionDetectionPolicy = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy", + ["softDeleteColumnName"] = "isDeleted", + ["softDeleteMarkerValue"] = "true" + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, +}); +Response response = await client.CreateOrUpdateAsync("mydatasource", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("credentials").ToString()); +Console.WriteLine(result.GetProperty("container").GetProperty("name").ToString()); +]]> + + + +This sample shows how to call CreateOrUpdate and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "mydocdbdatasource", + description = "My Cosmos DB data source.", + type = "cosmosdb", + credentials = new + { + connectionString = "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId", + }, + container = new + { + name = "myDocDbCollectionId", + query = "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts", + }, + dataChangeDetectionPolicy = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy", + ["highWaterMarkColumnName"] = "_ts" + }, + dataDeletionDetectionPolicy = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy", + ["softDeleteColumnName"] = "isDeleted", + ["softDeleteMarkerValue"] = "true" + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, +}); +Response response = client.CreateOrUpdate("mydatasource", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("credentials").ToString()); +Console.WriteLine(result.GetProperty("container").GetProperty("name").ToString()); +]]> + + + +This sample shows how to call DeleteAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +Response response = await client.DeleteAsync("mydatasource"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call Delete. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +Response response = client.Delete("mydatasource"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetDataSourceAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +Response response = await client.GetDataSourceAsync("mydatasource"); +]]> + + + +This sample shows how to call GetDataSource. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +Response response = client.GetDataSource("mydatasource"); +]]> + + + +This sample shows how to call GetDataSourceAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +Response response = await client.GetDataSourceAsync("mydatasource", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("credentials").ToString()); +Console.WriteLine(result.GetProperty("container").GetProperty("name").ToString()); +]]> + + + +This sample shows how to call GetDataSource and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +Response response = client.GetDataSource("mydatasource", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("credentials").ToString()); +Console.WriteLine(result.GetProperty("container").GetProperty("name").ToString()); +]]> + + + +This sample shows how to call GetDataSourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +Response response = await client.GetDataSourcesAsync(); +]]> + + + +This sample shows how to call GetDataSources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +Response response = client.GetDataSources(); +]]> + + + +This sample shows how to call GetDataSourcesAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +Response response = await client.GetDataSourcesAsync("*", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("credentials").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("container").GetProperty("name").ToString()); +]]> + + + +This sample shows how to call GetDataSources and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +Response response = client.GetDataSources("*", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("credentials").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("container").GetProperty("name").ToString()); +]]> + + + +This sample shows how to call CreateAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +SearchIndexerDataSource dataSource = new SearchIndexerDataSource("mydocdbdatasource", SearchIndexerDataSourceType.CosmosDb, new DataSourceCredentials +{ + ConnectionString = "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId", +}, new SearchIndexerDataContainer("myDocDbCollectionId") +{ + Query = "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts", +}) +{ + Description = "My Cosmos DB data source.", + DataChangeDetectionPolicy = new HighWaterMarkChangeDetectionPolicy("_ts"), + DataDeletionDetectionPolicy = new SoftDeleteColumnDeletionDetectionPolicy + { + SoftDeleteColumnName = "isDeleted", + SoftDeleteMarkerValue = "true", + }, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "", + }, + }, +}; +Response response = await client.CreateAsync(dataSource); +]]> + + + +This sample shows how to call Create. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +SearchIndexerDataSource dataSource = new SearchIndexerDataSource("mydocdbdatasource", SearchIndexerDataSourceType.CosmosDb, new DataSourceCredentials +{ + ConnectionString = "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId", +}, new SearchIndexerDataContainer("myDocDbCollectionId") +{ + Query = "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts", +}) +{ + Description = "My Cosmos DB data source.", + DataChangeDetectionPolicy = new HighWaterMarkChangeDetectionPolicy("_ts"), + DataDeletionDetectionPolicy = new SoftDeleteColumnDeletionDetectionPolicy + { + SoftDeleteColumnName = "isDeleted", + SoftDeleteMarkerValue = "true", + }, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "", + }, + }, +}; +Response response = client.Create(dataSource); +]]> + + + +This sample shows how to call CreateAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "mydocdbdatasource", + description = "My Cosmos DB data source.", + type = "cosmosdb", + credentials = new + { + connectionString = "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId", + }, + container = new + { + name = "myDocDbCollectionId", + query = "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts", + }, + dataChangeDetectionPolicy = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy", + ["highWaterMarkColumnName"] = "_ts" + }, + dataDeletionDetectionPolicy = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy", + ["softDeleteColumnName"] = "isDeleted", + ["softDeleteMarkerValue"] = "true" + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "", + }, + }, +}); +Response response = await client.CreateAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("credentials").ToString()); +Console.WriteLine(result.GetProperty("container").GetProperty("name").ToString()); +]]> + + + +This sample shows how to call Create and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "mydocdbdatasource", + description = "My Cosmos DB data source.", + type = "cosmosdb", + credentials = new + { + connectionString = "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId", + }, + container = new + { + name = "myDocDbCollectionId", + query = "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts", + }, + dataChangeDetectionPolicy = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy", + ["highWaterMarkColumnName"] = "_ts" + }, + dataDeletionDetectionPolicy = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy", + ["softDeleteColumnName"] = "isDeleted", + ["softDeleteMarkerValue"] = "true" + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "", + }, + }, +}); +Response response = client.Create(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("credentials").ToString()); +Console.WriteLine(result.GetProperty("container").GetProperty("name").ToString()); +]]> + + + \ No newline at end of file diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/Indexers.xml b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/Indexers.xml new file mode 100644 index 000000000000..0630ebfd1c99 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/Indexers.xml @@ -0,0 +1,533 @@ + + + + + +This sample shows how to call ResetAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = await client.ResetAsync("myindexer"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call Reset. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = client.Reset("myindexer"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call RunAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = await client.RunAsync("myindexer"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call Run. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = client.Run("myindexer"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call CreateOrUpdateAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +SearchIndexer indexer = new SearchIndexer("myindexer", "mydatasource", "orders") +{ + Description = "a cool indexer", + Schedule = new IndexingSchedule(XmlConvert.ToTimeSpan("PT1H")) + { + StartTime = DateTimeOffset.Parse("2015-01-01T00:00:00Z"), + }, + Parameters = new IndexingParameters + { + MaxFailedItems = 10, + MaxFailedItemsPerBatch = 5, + }, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), +}; +Response response = await client.CreateOrUpdateAsync("myindexer", indexer); +]]> + + + +This sample shows how to call CreateOrUpdate. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +SearchIndexer indexer = new SearchIndexer("myindexer", "mydatasource", "orders") +{ + Description = "a cool indexer", + Schedule = new IndexingSchedule(XmlConvert.ToTimeSpan("PT1H")) + { + StartTime = DateTimeOffset.Parse("2015-01-01T00:00:00Z"), + }, + Parameters = new IndexingParameters + { + MaxFailedItems = 10, + MaxFailedItemsPerBatch = 5, + }, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), +}; +Response response = client.CreateOrUpdate("myindexer", indexer); +]]> + + + +This sample shows how to call CreateOrUpdateAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "myindexer", + description = "a cool indexer", + dataSourceName = "mydatasource", + targetIndexName = "orders", + schedule = new + { + interval = "PT1H", + startTime = "2015-01-01T00:00:00Z", + }, + parameters = new + { + maxFailedItems = 10, + maxFailedItemsPerBatch = 5, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, +}); +Response response = await client.CreateOrUpdateAsync("myindexer", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("dataSourceName").ToString()); +Console.WriteLine(result.GetProperty("targetIndexName").ToString()); +]]> + + + +This sample shows how to call CreateOrUpdate and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "myindexer", + description = "a cool indexer", + dataSourceName = "mydatasource", + targetIndexName = "orders", + schedule = new + { + interval = "PT1H", + startTime = "2015-01-01T00:00:00Z", + }, + parameters = new + { + maxFailedItems = 10, + maxFailedItemsPerBatch = 5, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, +}); +Response response = client.CreateOrUpdate("myindexer", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("dataSourceName").ToString()); +Console.WriteLine(result.GetProperty("targetIndexName").ToString()); +]]> + + + +This sample shows how to call DeleteAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = await client.DeleteAsync("myindexer"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call Delete. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = client.Delete("myindexer"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetIndexerAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = await client.GetIndexerAsync("myindexer"); +]]> + + + +This sample shows how to call GetIndexer. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = client.GetIndexer("myindexer"); +]]> + + + +This sample shows how to call GetIndexerAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = await client.GetIndexerAsync("myindexer", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("dataSourceName").ToString()); +Console.WriteLine(result.GetProperty("targetIndexName").ToString()); +]]> + + + +This sample shows how to call GetIndexer and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = client.GetIndexer("myindexer", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("dataSourceName").ToString()); +Console.WriteLine(result.GetProperty("targetIndexName").ToString()); +]]> + + + +This sample shows how to call GetIndexersAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = await client.GetIndexersAsync(); +]]> + + + +This sample shows how to call GetIndexers. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = client.GetIndexers(); +]]> + + + +This sample shows how to call GetIndexersAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = await client.GetIndexersAsync("*", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("dataSourceName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("targetIndexName").ToString()); +]]> + + + +This sample shows how to call GetIndexers and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = client.GetIndexers("*", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("dataSourceName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("targetIndexName").ToString()); +]]> + + + +This sample shows how to call CreateAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +SearchIndexer indexer = new SearchIndexer("myindexer", "mydatasource", "orders") +{ + Description = "an indexer", + Schedule = new IndexingSchedule(XmlConvert.ToTimeSpan("PT1H")) + { + StartTime = DateTimeOffset.Parse("2015-01-01T00:00:00Z"), + }, + Parameters = new IndexingParameters + { + MaxFailedItems = 10, + MaxFailedItemsPerBatch = 5, + }, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "", + }, + }, +}; +Response response = await client.CreateAsync(indexer); +]]> + + + +This sample shows how to call Create. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +SearchIndexer indexer = new SearchIndexer("myindexer", "mydatasource", "orders") +{ + Description = "an indexer", + Schedule = new IndexingSchedule(XmlConvert.ToTimeSpan("PT1H")) + { + StartTime = DateTimeOffset.Parse("2015-01-01T00:00:00Z"), + }, + Parameters = new IndexingParameters + { + MaxFailedItems = 10, + MaxFailedItemsPerBatch = 5, + }, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "", + }, + }, +}; +Response response = client.Create(indexer); +]]> + + + +This sample shows how to call CreateAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "myindexer", + description = "an indexer", + dataSourceName = "mydatasource", + targetIndexName = "orders", + schedule = new + { + interval = "PT1H", + startTime = "2015-01-01T00:00:00Z", + }, + parameters = new + { + maxFailedItems = 10, + maxFailedItemsPerBatch = 5, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "", + }, + }, +}); +Response response = await client.CreateAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("dataSourceName").ToString()); +Console.WriteLine(result.GetProperty("targetIndexName").ToString()); +]]> + + + +This sample shows how to call Create and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "myindexer", + description = "an indexer", + dataSourceName = "mydatasource", + targetIndexName = "orders", + schedule = new + { + interval = "PT1H", + startTime = "2015-01-01T00:00:00Z", + }, + parameters = new + { + maxFailedItems = 10, + maxFailedItemsPerBatch = 5, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "", + }, + }, +}); +Response response = client.Create(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("dataSourceName").ToString()); +Console.WriteLine(result.GetProperty("targetIndexName").ToString()); +]]> + + + +This sample shows how to call GetStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = await client.GetStatusAsync("myindexer"); +]]> + + + +This sample shows how to call GetStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = client.GetStatus("myindexer"); +]]> + + + +This sample shows how to call GetStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = await client.GetStatusAsync("myindexer", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("errors")[0].GetProperty("errorMessage").ToString()); +Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("errors")[0].GetProperty("statusCode").ToString()); +Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("itemsProcessed").ToString()); +Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("itemsFailed").ToString()); +Console.WriteLine(result.GetProperty("limits").ToString()); +]]> + + + +This sample shows how to call GetStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + +Response response = client.GetStatus("myindexer", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("errors")[0].GetProperty("errorMessage").ToString()); +Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("errors")[0].GetProperty("statusCode").ToString()); +Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("itemsProcessed").ToString()); +Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("itemsFailed").ToString()); +Console.WriteLine(result.GetProperty("limits").ToString()); +]]> + + + \ No newline at end of file diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/Indexes.xml b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/Indexes.xml new file mode 100644 index 000000000000..d66f17b99bed --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/Indexes.xml @@ -0,0 +1,2011 @@ + + + + + +This sample shows how to call CreateAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +SearchIndex index = new SearchIndex("hotels", new SearchField[] +{ + new SearchField("hotelId", SearchFieldDataType.String) + { + Key = true, + Searchable = false, + }, + new SearchField("baseRate", SearchFieldDataType.Double), + new SearchField("description", SearchFieldDataType.String) + { + Filterable = false, + Sortable = false, + Facetable = false, + }, + new SearchField("descriptionEmbedding", new SearchFieldDataType("Collection(Edm.Single)")) + { + Key = false, + Retrievable = true, + Searchable = true, + Filterable = false, + Sortable = false, + Facetable = false, + Dimensions = 1536, + VectorSearchProfile = "myHnswSQProfile", + SynonymMaps = {}, + }, + new SearchField("descriptionEmbedding_notstored", new SearchFieldDataType("Collection(Edm.Single)")) + { + Key = false, + Retrievable = false, + Stored = false, + Searchable = true, + Filterable = false, + Sortable = false, + Facetable = false, + Dimensions = 1536, + VectorSearchProfile = "myHnswSQProfile", + SynonymMaps = {}, + }, + new SearchField("descriptionEmbedding_forBQ", new SearchFieldDataType("Collection(Edm.Single)")) + { + Key = false, + Retrievable = true, + Searchable = true, + Filterable = false, + Sortable = false, + Facetable = false, + Dimensions = 1536, + VectorSearchProfile = "myHnswBQProfile", + SynonymMaps = {}, + }, + new SearchField("description_fr", SearchFieldDataType.String) + { + Filterable = false, + Sortable = false, + Facetable = false, + Analyzer = LexicalAnalyzerName.FrLucene, + }, + new SearchField("hotelName", SearchFieldDataType.String), + new SearchField("nameEmbedding", new SearchFieldDataType("Collection(Edm.Half)")) + { + Key = false, + Retrievable = true, + Searchable = true, + Filterable = false, + Sortable = false, + Facetable = false, + Dimensions = 1536, + VectorSearchProfile = "myHnswProfile", + SynonymMaps = {}, + }, + new SearchField("category", SearchFieldDataType.String), + new SearchField("tags", new SearchFieldDataType("Collection(Edm.String)")) + { + Analyzer = new LexicalAnalyzerName("tagsAnalyzer"), + }, + new SearchField("parkingIncluded", SearchFieldDataType.Boolean), + new SearchField("smokingAllowed", SearchFieldDataType.Boolean), + new SearchField("lastRenovationDate", SearchFieldDataType.DateTimeOffset), + new SearchField("rating", SearchFieldDataType.Int32), + new SearchField("location", SearchFieldDataType.GeographyPoint) +}) +{ + ScoringProfiles = {new ScoringProfile("geo") + { + Text = new TextWeights(new Dictionary + { + ["hotelName"] = 5 + }), + Functions = {new DistanceScoringFunction("location", 5, new DistanceScoringParameters("currentLocation", 10)) + { + Interpolation = ScoringFunctionInterpolation.Logarithmic, + }}, + }}, + DefaultScoringProfile = "geo", + CorsOptions = new CorsOptions(new string[] { "tempuri.org" }) + { + MaxAgeInSeconds = 60L, + }, + Suggesters = { new SearchSuggester("sg", new string[] { "hotelName" }) }, + Analyzers = {new CustomAnalyzer("tagsAnalyzer", LexicalTokenizerName.Standard) + { + CharFilters = {CharFilterName.HtmlStrip}, + }}, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "", + }, + }, + Similarity = new BM25SimilarityAlgorithm + { + K1 = 1.3, + B = 0.5, + }, + Semantic = new SemanticSearch + { + Configurations = {new SemanticConfiguration("semanticHotels", new SemanticPrioritizedFields + { + TitleField = new SemanticField("hotelName"), + PrioritizedContentFields = {new SemanticField("description"), new SemanticField("description_fr")}, + PrioritizedKeywordsFields = {new SemanticField("tags"), new SemanticField("category")}, + })}, + }, + VectorSearch = new VectorSearch + { + Profiles = {new VectorSearchProfile("myHnswProfile", "myHnsw"), new VectorSearchProfile("myHnswSQProfile", "myHnsw") + { + Compression = "mySQ8", + }, new VectorSearchProfile("myHnswBQProfile", "myHnsw") + { + Compression = "myBQ", + }, new VectorSearchProfile("myAlgorithm", "myExhaustive")}, + Algorithms = {new HnswAlgorithmConfiguration("myHnsw") + { + HnswParameters = new HnswParameters + { + M = 4, + Metric = VectorSearchAlgorithmMetric.Cosine, + }, + }, new ExhaustiveKnnAlgorithmConfiguration("myExhaustive") + { + ExhaustiveKnnParameters = new ExhaustiveKnnParameters + { + Metric = VectorSearchAlgorithmMetric.Cosine, + }, + }}, + Compressions = {new ScalarQuantizationCompression("mySQ8") + { + ScalarQuantizationParameters = new ScalarQuantizationParameters + { + QuantizedDataType = VectorSearchCompressionTarget.Int8, + }, + RerankWithOriginalVectors = true, + DefaultOversampling = 10, + }, new BinaryQuantizationCompression("myBQ") + { + RerankWithOriginalVectors = true, + DefaultOversampling = 10, + }}, + }, +}; +Response response = await client.CreateAsync(index); +]]> + + + +This sample shows how to call Create. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +SearchIndex index = new SearchIndex("hotels", new SearchField[] +{ + new SearchField("hotelId", SearchFieldDataType.String) + { + Key = true, + Searchable = false, + }, + new SearchField("baseRate", SearchFieldDataType.Double), + new SearchField("description", SearchFieldDataType.String) + { + Filterable = false, + Sortable = false, + Facetable = false, + }, + new SearchField("descriptionEmbedding", new SearchFieldDataType("Collection(Edm.Single)")) + { + Key = false, + Retrievable = true, + Searchable = true, + Filterable = false, + Sortable = false, + Facetable = false, + Dimensions = 1536, + VectorSearchProfile = "myHnswSQProfile", + SynonymMaps = {}, + }, + new SearchField("descriptionEmbedding_notstored", new SearchFieldDataType("Collection(Edm.Single)")) + { + Key = false, + Retrievable = false, + Stored = false, + Searchable = true, + Filterable = false, + Sortable = false, + Facetable = false, + Dimensions = 1536, + VectorSearchProfile = "myHnswSQProfile", + SynonymMaps = {}, + }, + new SearchField("descriptionEmbedding_forBQ", new SearchFieldDataType("Collection(Edm.Single)")) + { + Key = false, + Retrievable = true, + Searchable = true, + Filterable = false, + Sortable = false, + Facetable = false, + Dimensions = 1536, + VectorSearchProfile = "myHnswBQProfile", + SynonymMaps = {}, + }, + new SearchField("description_fr", SearchFieldDataType.String) + { + Filterable = false, + Sortable = false, + Facetable = false, + Analyzer = LexicalAnalyzerName.FrLucene, + }, + new SearchField("hotelName", SearchFieldDataType.String), + new SearchField("nameEmbedding", new SearchFieldDataType("Collection(Edm.Half)")) + { + Key = false, + Retrievable = true, + Searchable = true, + Filterable = false, + Sortable = false, + Facetable = false, + Dimensions = 1536, + VectorSearchProfile = "myHnswProfile", + SynonymMaps = {}, + }, + new SearchField("category", SearchFieldDataType.String), + new SearchField("tags", new SearchFieldDataType("Collection(Edm.String)")) + { + Analyzer = new LexicalAnalyzerName("tagsAnalyzer"), + }, + new SearchField("parkingIncluded", SearchFieldDataType.Boolean), + new SearchField("smokingAllowed", SearchFieldDataType.Boolean), + new SearchField("lastRenovationDate", SearchFieldDataType.DateTimeOffset), + new SearchField("rating", SearchFieldDataType.Int32), + new SearchField("location", SearchFieldDataType.GeographyPoint) +}) +{ + ScoringProfiles = {new ScoringProfile("geo") + { + Text = new TextWeights(new Dictionary + { + ["hotelName"] = 5 + }), + Functions = {new DistanceScoringFunction("location", 5, new DistanceScoringParameters("currentLocation", 10)) + { + Interpolation = ScoringFunctionInterpolation.Logarithmic, + }}, + }}, + DefaultScoringProfile = "geo", + CorsOptions = new CorsOptions(new string[] { "tempuri.org" }) + { + MaxAgeInSeconds = 60L, + }, + Suggesters = { new SearchSuggester("sg", new string[] { "hotelName" }) }, + Analyzers = {new CustomAnalyzer("tagsAnalyzer", LexicalTokenizerName.Standard) + { + CharFilters = {CharFilterName.HtmlStrip}, + }}, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "", + }, + }, + Similarity = new BM25SimilarityAlgorithm + { + K1 = 1.3, + B = 0.5, + }, + Semantic = new SemanticSearch + { + Configurations = {new SemanticConfiguration("semanticHotels", new SemanticPrioritizedFields + { + TitleField = new SemanticField("hotelName"), + PrioritizedContentFields = {new SemanticField("description"), new SemanticField("description_fr")}, + PrioritizedKeywordsFields = {new SemanticField("tags"), new SemanticField("category")}, + })}, + }, + VectorSearch = new VectorSearch + { + Profiles = {new VectorSearchProfile("myHnswProfile", "myHnsw"), new VectorSearchProfile("myHnswSQProfile", "myHnsw") + { + Compression = "mySQ8", + }, new VectorSearchProfile("myHnswBQProfile", "myHnsw") + { + Compression = "myBQ", + }, new VectorSearchProfile("myAlgorithm", "myExhaustive")}, + Algorithms = {new HnswAlgorithmConfiguration("myHnsw") + { + HnswParameters = new HnswParameters + { + M = 4, + Metric = VectorSearchAlgorithmMetric.Cosine, + }, + }, new ExhaustiveKnnAlgorithmConfiguration("myExhaustive") + { + ExhaustiveKnnParameters = new ExhaustiveKnnParameters + { + Metric = VectorSearchAlgorithmMetric.Cosine, + }, + }}, + Compressions = {new ScalarQuantizationCompression("mySQ8") + { + ScalarQuantizationParameters = new ScalarQuantizationParameters + { + QuantizedDataType = VectorSearchCompressionTarget.Int8, + }, + RerankWithOriginalVectors = true, + DefaultOversampling = 10, + }, new BinaryQuantizationCompression("myBQ") + { + RerankWithOriginalVectors = true, + DefaultOversampling = 10, + }}, + }, +}; +Response response = client.Create(index); +]]> + + + +This sample shows how to call CreateAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "hotels", + fields = new object[] + { + new + { + name = "hotelId", + type = "Edm.String", + key = true, + searchable = false, + }, + new + { + name = "baseRate", + type = "Edm.Double", + }, + new + { + name = "description", + type = "Edm.String", + filterable = false, + sortable = false, + facetable = false, + }, + new + { + name = "descriptionEmbedding", + type = "Collection(Edm.Single)", + searchable = true, + filterable = false, + retrievable = true, + sortable = false, + facetable = false, + key = false, + synonymMaps = Array.Empty(), + dimensions = 1536, + vectorSearchProfile = "myHnswSQProfile", + }, + new + { + name = "descriptionEmbedding_notstored", + type = "Collection(Edm.Single)", + searchable = true, + filterable = false, + retrievable = false, + stored = false, + sortable = false, + facetable = false, + key = false, + synonymMaps = Array.Empty(), + dimensions = 1536, + vectorSearchProfile = "myHnswSQProfile", + }, + new + { + name = "descriptionEmbedding_forBQ", + type = "Collection(Edm.Single)", + searchable = true, + filterable = false, + retrievable = true, + sortable = false, + facetable = false, + key = false, + synonymMaps = Array.Empty(), + dimensions = 1536, + vectorSearchProfile = "myHnswBQProfile", + }, + new + { + name = "description_fr", + type = "Edm.String", + filterable = false, + sortable = false, + facetable = false, + analyzer = "fr.lucene", + }, + new + { + name = "hotelName", + type = "Edm.String", + }, + new + { + name = "nameEmbedding", + type = "Collection(Edm.Half)", + searchable = true, + filterable = false, + retrievable = true, + sortable = false, + facetable = false, + key = false, + synonymMaps = Array.Empty(), + dimensions = 1536, + vectorSearchProfile = "myHnswProfile", + }, + new + { + name = "category", + type = "Edm.String", + }, + new + { + name = "tags", + type = "Collection(Edm.String)", + analyzer = "tagsAnalyzer", + }, + new + { + name = "parkingIncluded", + type = "Edm.Boolean", + }, + new + { + name = "smokingAllowed", + type = "Edm.Boolean", + }, + new + { + name = "lastRenovationDate", + type = "Edm.DateTimeOffset", + }, + new + { + name = "rating", + type = "Edm.Int32", + }, + new + { + name = "location", + type = "Edm.GeographyPoint", + } + }, + scoringProfiles = new object[] + { + new + { + name = "geo", + text = new + { + weights = new + { + hotelName = 5, + }, + }, + functions = new object[] + { + new + { + type = "distance", + boost = 5, + fieldName = "location", + interpolation = "logarithmic", + distance = new + { + referencePointParameter = "currentLocation", + boostingDistance = 10, + }, + } + }, + } + }, + defaultScoringProfile = "geo", + suggesters = new object[] + { + new + { + name = "sg", + searchMode = "analyzingInfixMatching", + sourceFields = new object[] + { + "hotelName" + }, + } + }, + analyzers = new object[] + { + new Dictionary + { + ["name"] = "tagsAnalyzer", + ["@odata.type"] = "#Microsoft.Azure.Search.CustomAnalyzer", + ["charFilters"] = new object[] + { + "html_strip" + }, + ["tokenizer"] = "standard_v2" + } + }, + corsOptions = new + { + allowedOrigins = new object[] + { + "tempuri.org" + }, + maxAgeInSeconds = 60L, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "", + }, + }, + similarity = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.BM25Similarity", + ["b"] = 0.5, + ["k1"] = 1.3 + }, + semantic = new + { + configurations = new object[] + { + new + { + name = "semanticHotels", + prioritizedFields = new + { + titleField = new + { + fieldName = "hotelName", + }, + prioritizedContentFields = new object[] + { + new + { + fieldName = "description", + }, + new + { + fieldName = "description_fr", + } + }, + prioritizedKeywordsFields = new object[] + { + new + { + fieldName = "tags", + }, + new + { + fieldName = "category", + } + }, + }, + } + }, + }, + vectorSearch = new + { + profiles = new object[] + { + new + { + name = "myHnswProfile", + algorithm = "myHnsw", + }, + new + { + name = "myHnswSQProfile", + algorithm = "myHnsw", + compression = "mySQ8", + }, + new + { + name = "myHnswBQProfile", + algorithm = "myHnsw", + compression = "myBQ", + }, + new + { + name = "myAlgorithm", + algorithm = "myExhaustive", + } + }, + algorithms = new object[] + { + new + { + name = "myHnsw", + kind = "hnsw", + hnswParameters = new + { + m = 4, + metric = "cosine", + }, + }, + new + { + name = "myExhaustive", + kind = "exhaustiveKnn", + exhaustiveKnnParameters = new + { + metric = "cosine", + }, + } + }, + compressions = new object[] + { + new + { + name = "mySQ8", + kind = "scalarQuantization", + scalarQuantizationParameters = new + { + quantizedDataType = "int8", + }, + rerankWithOriginalVectors = true, + defaultOversampling = 10, + }, + new + { + name = "myBQ", + kind = "binaryQuantization", + rerankWithOriginalVectors = true, + defaultOversampling = 10, + } + }, + }, +}); +Response response = await client.CreateAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("fields")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("fields")[0].GetProperty("type").ToString()); +]]> + + + +This sample shows how to call Create and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "hotels", + fields = new object[] + { + new + { + name = "hotelId", + type = "Edm.String", + key = true, + searchable = false, + }, + new + { + name = "baseRate", + type = "Edm.Double", + }, + new + { + name = "description", + type = "Edm.String", + filterable = false, + sortable = false, + facetable = false, + }, + new + { + name = "descriptionEmbedding", + type = "Collection(Edm.Single)", + searchable = true, + filterable = false, + retrievable = true, + sortable = false, + facetable = false, + key = false, + synonymMaps = Array.Empty(), + dimensions = 1536, + vectorSearchProfile = "myHnswSQProfile", + }, + new + { + name = "descriptionEmbedding_notstored", + type = "Collection(Edm.Single)", + searchable = true, + filterable = false, + retrievable = false, + stored = false, + sortable = false, + facetable = false, + key = false, + synonymMaps = Array.Empty(), + dimensions = 1536, + vectorSearchProfile = "myHnswSQProfile", + }, + new + { + name = "descriptionEmbedding_forBQ", + type = "Collection(Edm.Single)", + searchable = true, + filterable = false, + retrievable = true, + sortable = false, + facetable = false, + key = false, + synonymMaps = Array.Empty(), + dimensions = 1536, + vectorSearchProfile = "myHnswBQProfile", + }, + new + { + name = "description_fr", + type = "Edm.String", + filterable = false, + sortable = false, + facetable = false, + analyzer = "fr.lucene", + }, + new + { + name = "hotelName", + type = "Edm.String", + }, + new + { + name = "nameEmbedding", + type = "Collection(Edm.Half)", + searchable = true, + filterable = false, + retrievable = true, + sortable = false, + facetable = false, + key = false, + synonymMaps = Array.Empty(), + dimensions = 1536, + vectorSearchProfile = "myHnswProfile", + }, + new + { + name = "category", + type = "Edm.String", + }, + new + { + name = "tags", + type = "Collection(Edm.String)", + analyzer = "tagsAnalyzer", + }, + new + { + name = "parkingIncluded", + type = "Edm.Boolean", + }, + new + { + name = "smokingAllowed", + type = "Edm.Boolean", + }, + new + { + name = "lastRenovationDate", + type = "Edm.DateTimeOffset", + }, + new + { + name = "rating", + type = "Edm.Int32", + }, + new + { + name = "location", + type = "Edm.GeographyPoint", + } + }, + scoringProfiles = new object[] + { + new + { + name = "geo", + text = new + { + weights = new + { + hotelName = 5, + }, + }, + functions = new object[] + { + new + { + type = "distance", + boost = 5, + fieldName = "location", + interpolation = "logarithmic", + distance = new + { + referencePointParameter = "currentLocation", + boostingDistance = 10, + }, + } + }, + } + }, + defaultScoringProfile = "geo", + suggesters = new object[] + { + new + { + name = "sg", + searchMode = "analyzingInfixMatching", + sourceFields = new object[] + { + "hotelName" + }, + } + }, + analyzers = new object[] + { + new Dictionary + { + ["name"] = "tagsAnalyzer", + ["@odata.type"] = "#Microsoft.Azure.Search.CustomAnalyzer", + ["charFilters"] = new object[] + { + "html_strip" + }, + ["tokenizer"] = "standard_v2" + } + }, + corsOptions = new + { + allowedOrigins = new object[] + { + "tempuri.org" + }, + maxAgeInSeconds = 60L, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "", + }, + }, + similarity = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.BM25Similarity", + ["b"] = 0.5, + ["k1"] = 1.3 + }, + semantic = new + { + configurations = new object[] + { + new + { + name = "semanticHotels", + prioritizedFields = new + { + titleField = new + { + fieldName = "hotelName", + }, + prioritizedContentFields = new object[] + { + new + { + fieldName = "description", + }, + new + { + fieldName = "description_fr", + } + }, + prioritizedKeywordsFields = new object[] + { + new + { + fieldName = "tags", + }, + new + { + fieldName = "category", + } + }, + }, + } + }, + }, + vectorSearch = new + { + profiles = new object[] + { + new + { + name = "myHnswProfile", + algorithm = "myHnsw", + }, + new + { + name = "myHnswSQProfile", + algorithm = "myHnsw", + compression = "mySQ8", + }, + new + { + name = "myHnswBQProfile", + algorithm = "myHnsw", + compression = "myBQ", + }, + new + { + name = "myAlgorithm", + algorithm = "myExhaustive", + } + }, + algorithms = new object[] + { + new + { + name = "myHnsw", + kind = "hnsw", + hnswParameters = new + { + m = 4, + metric = "cosine", + }, + }, + new + { + name = "myExhaustive", + kind = "exhaustiveKnn", + exhaustiveKnnParameters = new + { + metric = "cosine", + }, + } + }, + compressions = new object[] + { + new + { + name = "mySQ8", + kind = "scalarQuantization", + scalarQuantizationParameters = new + { + quantizedDataType = "int8", + }, + rerankWithOriginalVectors = true, + defaultOversampling = 10, + }, + new + { + name = "myBQ", + kind = "binaryQuantization", + rerankWithOriginalVectors = true, + defaultOversampling = 10, + } + }, + }, +}); +Response response = client.Create(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("fields")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("fields")[0].GetProperty("type").ToString()); +]]> + + + +This sample shows how to call CreateOrUpdateAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +SearchIndex index = new SearchIndex("hotels", new SearchField[] +{ + new SearchField("hotelId", SearchFieldDataType.String) + { + Key = true, + Searchable = false, + }, + new SearchField("baseRate", SearchFieldDataType.Double), + new SearchField("description", SearchFieldDataType.String) + { + Filterable = false, + Sortable = false, + Facetable = false, + }, + new SearchField("descriptionEmbedding", new SearchFieldDataType("Collection(Edm.Single)")) + { + Retrievable = true, + Searchable = true, + Dimensions = 1536, + VectorSearchProfile = "myHnswProfile", + }, + new SearchField("description_fr", SearchFieldDataType.String) + { + Filterable = false, + Sortable = false, + Facetable = false, + Analyzer = LexicalAnalyzerName.FrLucene, + }, + new SearchField("hotelName", SearchFieldDataType.String), + new SearchField("category", SearchFieldDataType.String), + new SearchField("tags", new SearchFieldDataType("Collection(Edm.String)")) + { + Analyzer = new LexicalAnalyzerName("tagsAnalyzer"), + }, + new SearchField("parkingIncluded", SearchFieldDataType.Boolean), + new SearchField("smokingAllowed", SearchFieldDataType.Boolean), + new SearchField("lastRenovationDate", SearchFieldDataType.DateTimeOffset), + new SearchField("rating", SearchFieldDataType.Int32), + new SearchField("location", SearchFieldDataType.GeographyPoint) +}) +{ + ScoringProfiles = {new ScoringProfile("geo") + { + Text = new TextWeights(new Dictionary + { + ["hotelName"] = 5 + }), + Functions = {new DistanceScoringFunction("location", 5, new DistanceScoringParameters("currentLocation", 10)) + { + Interpolation = ScoringFunctionInterpolation.Logarithmic, + }}, + }}, + DefaultScoringProfile = "geo", + CorsOptions = new CorsOptions(new string[] { "tempuri.org" }) + { + MaxAgeInSeconds = 60L, + }, + Suggesters = { new SearchSuggester("sg", new string[] { "hotelName" }) }, + Analyzers = {new CustomAnalyzer("tagsAnalyzer", LexicalTokenizerName.Standard) + { + CharFilters = {CharFilterName.HtmlStrip}, + }}, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), + Similarity = new ClassicSimilarityAlgorithm(), + Semantic = new SemanticSearch + { + Configurations = {new SemanticConfiguration("semanticHotels", new SemanticPrioritizedFields + { + TitleField = new SemanticField("hotelName"), + PrioritizedContentFields = {new SemanticField("description"), new SemanticField("description_fr")}, + PrioritizedKeywordsFields = {new SemanticField("tags"), new SemanticField("category")}, + })}, + }, + VectorSearch = new VectorSearch + { + Profiles = { new VectorSearchProfile("myHnswProfile", "myHnsw"), new VectorSearchProfile("myAlgorithm", "myExhaustive") }, + Algorithms = {new HnswAlgorithmConfiguration("myHnsw") + { + HnswParameters = new HnswParameters + { + M = 4, + Metric = VectorSearchAlgorithmMetric.Cosine, + }, + }, new ExhaustiveKnnAlgorithmConfiguration("myExhaustive") + { + ExhaustiveKnnParameters = new ExhaustiveKnnParameters + { + Metric = VectorSearchAlgorithmMetric.Cosine, + }, + }}, + }, +}; +Response response = await client.CreateOrUpdateAsync("hotels", index); +]]> + + + +This sample shows how to call CreateOrUpdate. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +SearchIndex index = new SearchIndex("hotels", new SearchField[] +{ + new SearchField("hotelId", SearchFieldDataType.String) + { + Key = true, + Searchable = false, + }, + new SearchField("baseRate", SearchFieldDataType.Double), + new SearchField("description", SearchFieldDataType.String) + { + Filterable = false, + Sortable = false, + Facetable = false, + }, + new SearchField("descriptionEmbedding", new SearchFieldDataType("Collection(Edm.Single)")) + { + Retrievable = true, + Searchable = true, + Dimensions = 1536, + VectorSearchProfile = "myHnswProfile", + }, + new SearchField("description_fr", SearchFieldDataType.String) + { + Filterable = false, + Sortable = false, + Facetable = false, + Analyzer = LexicalAnalyzerName.FrLucene, + }, + new SearchField("hotelName", SearchFieldDataType.String), + new SearchField("category", SearchFieldDataType.String), + new SearchField("tags", new SearchFieldDataType("Collection(Edm.String)")) + { + Analyzer = new LexicalAnalyzerName("tagsAnalyzer"), + }, + new SearchField("parkingIncluded", SearchFieldDataType.Boolean), + new SearchField("smokingAllowed", SearchFieldDataType.Boolean), + new SearchField("lastRenovationDate", SearchFieldDataType.DateTimeOffset), + new SearchField("rating", SearchFieldDataType.Int32), + new SearchField("location", SearchFieldDataType.GeographyPoint) +}) +{ + ScoringProfiles = {new ScoringProfile("geo") + { + Text = new TextWeights(new Dictionary + { + ["hotelName"] = 5 + }), + Functions = {new DistanceScoringFunction("location", 5, new DistanceScoringParameters("currentLocation", 10)) + { + Interpolation = ScoringFunctionInterpolation.Logarithmic, + }}, + }}, + DefaultScoringProfile = "geo", + CorsOptions = new CorsOptions(new string[] { "tempuri.org" }) + { + MaxAgeInSeconds = 60L, + }, + Suggesters = { new SearchSuggester("sg", new string[] { "hotelName" }) }, + Analyzers = {new CustomAnalyzer("tagsAnalyzer", LexicalTokenizerName.Standard) + { + CharFilters = {CharFilterName.HtmlStrip}, + }}, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), + Similarity = new ClassicSimilarityAlgorithm(), + Semantic = new SemanticSearch + { + Configurations = {new SemanticConfiguration("semanticHotels", new SemanticPrioritizedFields + { + TitleField = new SemanticField("hotelName"), + PrioritizedContentFields = {new SemanticField("description"), new SemanticField("description_fr")}, + PrioritizedKeywordsFields = {new SemanticField("tags"), new SemanticField("category")}, + })}, + }, + VectorSearch = new VectorSearch + { + Profiles = { new VectorSearchProfile("myHnswProfile", "myHnsw"), new VectorSearchProfile("myAlgorithm", "myExhaustive") }, + Algorithms = {new HnswAlgorithmConfiguration("myHnsw") + { + HnswParameters = new HnswParameters + { + M = 4, + Metric = VectorSearchAlgorithmMetric.Cosine, + }, + }, new ExhaustiveKnnAlgorithmConfiguration("myExhaustive") + { + ExhaustiveKnnParameters = new ExhaustiveKnnParameters + { + Metric = VectorSearchAlgorithmMetric.Cosine, + }, + }}, + }, +}; +Response response = client.CreateOrUpdate("hotels", index); +]]> + + + +This sample shows how to call CreateOrUpdateAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "hotels", + fields = new object[] + { + new + { + name = "hotelId", + type = "Edm.String", + key = true, + searchable = false, + }, + new + { + name = "baseRate", + type = "Edm.Double", + }, + new + { + name = "description", + type = "Edm.String", + filterable = false, + sortable = false, + facetable = false, + }, + new + { + name = "descriptionEmbedding", + type = "Collection(Edm.Single)", + dimensions = 1536, + vectorSearchProfile = "myHnswProfile", + searchable = true, + retrievable = true, + }, + new + { + name = "description_fr", + type = "Edm.String", + filterable = false, + sortable = false, + facetable = false, + analyzer = "fr.lucene", + }, + new + { + name = "hotelName", + type = "Edm.String", + }, + new + { + name = "category", + type = "Edm.String", + }, + new + { + name = "tags", + type = "Collection(Edm.String)", + analyzer = "tagsAnalyzer", + }, + new + { + name = "parkingIncluded", + type = "Edm.Boolean", + }, + new + { + name = "smokingAllowed", + type = "Edm.Boolean", + }, + new + { + name = "lastRenovationDate", + type = "Edm.DateTimeOffset", + }, + new + { + name = "rating", + type = "Edm.Int32", + }, + new + { + name = "location", + type = "Edm.GeographyPoint", + } + }, + scoringProfiles = new object[] + { + new + { + name = "geo", + text = new + { + weights = new + { + hotelName = 5, + }, + }, + functions = new object[] + { + new + { + type = "distance", + boost = 5, + fieldName = "location", + interpolation = "logarithmic", + distance = new + { + referencePointParameter = "currentLocation", + boostingDistance = 10, + }, + } + }, + } + }, + defaultScoringProfile = "geo", + suggesters = new object[] + { + new + { + name = "sg", + searchMode = "analyzingInfixMatching", + sourceFields = new object[] + { + "hotelName" + }, + } + }, + analyzers = new object[] + { + new Dictionary + { + ["name"] = "tagsAnalyzer", + ["@odata.type"] = "#Microsoft.Azure.Search.CustomAnalyzer", + ["charFilters"] = new object[] + { + "html_strip" + }, + ["tokenizer"] = "standard_v2" + } + }, + corsOptions = new + { + allowedOrigins = new object[] + { + "tempuri.org" + }, + maxAgeInSeconds = 60L, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, + similarity = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.ClassicSimilarity" + }, + semantic = new + { + configurations = new object[] + { + new + { + name = "semanticHotels", + prioritizedFields = new + { + titleField = new + { + fieldName = "hotelName", + }, + prioritizedContentFields = new object[] + { + new + { + fieldName = "description", + }, + new + { + fieldName = "description_fr", + } + }, + prioritizedKeywordsFields = new object[] + { + new + { + fieldName = "tags", + }, + new + { + fieldName = "category", + } + }, + }, + } + }, + }, + vectorSearch = new + { + profiles = new object[] + { + new + { + name = "myHnswProfile", + algorithm = "myHnsw", + }, + new + { + name = "myAlgorithm", + algorithm = "myExhaustive", + } + }, + algorithms = new object[] + { + new + { + name = "myHnsw", + kind = "hnsw", + hnswParameters = new + { + m = 4, + metric = "cosine", + }, + }, + new + { + name = "myExhaustive", + kind = "exhaustiveKnn", + exhaustiveKnnParameters = new + { + metric = "cosine", + }, + } + }, + }, +}); +Response response = await client.CreateOrUpdateAsync("hotels", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("fields")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("fields")[0].GetProperty("type").ToString()); +]]> + + + +This sample shows how to call CreateOrUpdate and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "hotels", + fields = new object[] + { + new + { + name = "hotelId", + type = "Edm.String", + key = true, + searchable = false, + }, + new + { + name = "baseRate", + type = "Edm.Double", + }, + new + { + name = "description", + type = "Edm.String", + filterable = false, + sortable = false, + facetable = false, + }, + new + { + name = "descriptionEmbedding", + type = "Collection(Edm.Single)", + dimensions = 1536, + vectorSearchProfile = "myHnswProfile", + searchable = true, + retrievable = true, + }, + new + { + name = "description_fr", + type = "Edm.String", + filterable = false, + sortable = false, + facetable = false, + analyzer = "fr.lucene", + }, + new + { + name = "hotelName", + type = "Edm.String", + }, + new + { + name = "category", + type = "Edm.String", + }, + new + { + name = "tags", + type = "Collection(Edm.String)", + analyzer = "tagsAnalyzer", + }, + new + { + name = "parkingIncluded", + type = "Edm.Boolean", + }, + new + { + name = "smokingAllowed", + type = "Edm.Boolean", + }, + new + { + name = "lastRenovationDate", + type = "Edm.DateTimeOffset", + }, + new + { + name = "rating", + type = "Edm.Int32", + }, + new + { + name = "location", + type = "Edm.GeographyPoint", + } + }, + scoringProfiles = new object[] + { + new + { + name = "geo", + text = new + { + weights = new + { + hotelName = 5, + }, + }, + functions = new object[] + { + new + { + type = "distance", + boost = 5, + fieldName = "location", + interpolation = "logarithmic", + distance = new + { + referencePointParameter = "currentLocation", + boostingDistance = 10, + }, + } + }, + } + }, + defaultScoringProfile = "geo", + suggesters = new object[] + { + new + { + name = "sg", + searchMode = "analyzingInfixMatching", + sourceFields = new object[] + { + "hotelName" + }, + } + }, + analyzers = new object[] + { + new Dictionary + { + ["name"] = "tagsAnalyzer", + ["@odata.type"] = "#Microsoft.Azure.Search.CustomAnalyzer", + ["charFilters"] = new object[] + { + "html_strip" + }, + ["tokenizer"] = "standard_v2" + } + }, + corsOptions = new + { + allowedOrigins = new object[] + { + "tempuri.org" + }, + maxAgeInSeconds = 60L, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, + similarity = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.ClassicSimilarity" + }, + semantic = new + { + configurations = new object[] + { + new + { + name = "semanticHotels", + prioritizedFields = new + { + titleField = new + { + fieldName = "hotelName", + }, + prioritizedContentFields = new object[] + { + new + { + fieldName = "description", + }, + new + { + fieldName = "description_fr", + } + }, + prioritizedKeywordsFields = new object[] + { + new + { + fieldName = "tags", + }, + new + { + fieldName = "category", + } + }, + }, + } + }, + }, + vectorSearch = new + { + profiles = new object[] + { + new + { + name = "myHnswProfile", + algorithm = "myHnsw", + }, + new + { + name = "myAlgorithm", + algorithm = "myExhaustive", + } + }, + algorithms = new object[] + { + new + { + name = "myHnsw", + kind = "hnsw", + hnswParameters = new + { + m = 4, + metric = "cosine", + }, + }, + new + { + name = "myExhaustive", + kind = "exhaustiveKnn", + exhaustiveKnnParameters = new + { + metric = "cosine", + }, + } + }, + }, +}); +Response response = client.CreateOrUpdate("hotels", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("fields")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("fields")[0].GetProperty("type").ToString()); +]]> + + + +This sample shows how to call DeleteAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +Response response = await client.DeleteAsync("myindex"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call Delete. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +Response response = client.Delete("myindex"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetIndexAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +Response response = await client.GetIndexAsync("hotels"); +]]> + + + +This sample shows how to call GetIndex. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +Response response = client.GetIndex("hotels"); +]]> + + + +This sample shows how to call GetIndexAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +Response response = await client.GetIndexAsync("hotels", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("fields")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("fields")[0].GetProperty("type").ToString()); +]]> + + + +This sample shows how to call GetIndex and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +Response response = client.GetIndex("hotels", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("fields")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("fields")[0].GetProperty("type").ToString()); +]]> + + + +This sample shows how to call GetStatisticsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +Response response = await client.GetStatisticsAsync("hotels"); +]]> + + + +This sample shows how to call GetStatistics. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +Response response = client.GetStatistics("hotels"); +]]> + + + +This sample shows how to call GetStatisticsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +Response response = await client.GetStatisticsAsync("hotels", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("documentCount").ToString()); +Console.WriteLine(result.GetProperty("storageSize").ToString()); +Console.WriteLine(result.GetProperty("vectorIndexSize").ToString()); +]]> + + + +This sample shows how to call GetStatistics and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +Response response = client.GetStatistics("hotels", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("documentCount").ToString()); +Console.WriteLine(result.GetProperty("storageSize").ToString()); +Console.WriteLine(result.GetProperty("vectorIndexSize").ToString()); +]]> + + + +This sample shows how to call AnalyzeAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +AnalyzeRequest request = new AnalyzeRequest("Text to analyze") +{ + Analyzer = LexicalAnalyzerName.StandardLucene, +}; +Response response = await client.AnalyzeAsync("hotels", request); +]]> + + + +This sample shows how to call Analyze. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +AnalyzeRequest request = new AnalyzeRequest("Text to analyze") +{ + Analyzer = LexicalAnalyzerName.StandardLucene, +}; +Response response = client.Analyze("hotels", request); +]]> + + + +This sample shows how to call AnalyzeAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +using RequestContent content = RequestContent.Create(new +{ + text = "Text to analyze", + analyzer = "standard.lucene", +}); +Response response = await client.AnalyzeAsync("hotels", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("tokens")[0].GetProperty("token").ToString()); +Console.WriteLine(result.GetProperty("tokens")[0].GetProperty("startOffset").ToString()); +Console.WriteLine(result.GetProperty("tokens")[0].GetProperty("endOffset").ToString()); +Console.WriteLine(result.GetProperty("tokens")[0].GetProperty("position").ToString()); +]]> + + + +This sample shows how to call Analyze and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +using RequestContent content = RequestContent.Create(new +{ + text = "Text to analyze", + analyzer = "standard.lucene", +}); +Response response = client.Analyze("hotels", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("tokens")[0].GetProperty("token").ToString()); +Console.WriteLine(result.GetProperty("tokens")[0].GetProperty("startOffset").ToString()); +Console.WriteLine(result.GetProperty("tokens")[0].GetProperty("endOffset").ToString()); +Console.WriteLine(result.GetProperty("tokens")[0].GetProperty("position").ToString()); +]]> + + + +This sample shows how to call GetIndexesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +await foreach (SearchIndex item in client.GetIndexesAsync()) +{ +} +]]> + + + +This sample shows how to call GetIndexes. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +foreach (SearchIndex item in client.GetIndexes()) +{ +} +]]> + + + +This sample shows how to call GetIndexesAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +await foreach (BinaryData item in client.GetIndexesAsync("*", null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("type").ToString()); +} +]]> + + + +This sample shows how to call GetIndexes and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + +foreach (BinaryData item in client.GetIndexes("*", null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("type").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/SearchClient.xml b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/SearchClient.xml new file mode 100644 index 000000000000..76da13c4f358 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/SearchClient.xml @@ -0,0 +1,71 @@ + + + + + +This sample shows how to call GetServiceStatisticsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SearchClient client = new SearchClient(endpoint, credential); + +Response response = await client.GetServiceStatisticsAsync(); +]]> + + + +This sample shows how to call GetServiceStatistics. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SearchClient client = new SearchClient(endpoint, credential); + +Response response = client.GetServiceStatistics(); +]]> + + + +This sample shows how to call GetServiceStatisticsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SearchClient client = new SearchClient(endpoint, credential); + +Response response = await client.GetServiceStatisticsAsync(null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("counters").GetProperty("documentCount").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("counters").GetProperty("indexesCount").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("counters").GetProperty("indexersCount").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("counters").GetProperty("dataSourcesCount").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("counters").GetProperty("storageSize").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("counters").GetProperty("synonymMaps").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("counters").GetProperty("skillsetCount").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("counters").GetProperty("vectorIndexSize").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("limits").ToString()); +]]> + + + +This sample shows how to call GetServiceStatistics and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SearchClient client = new SearchClient(endpoint, credential); + +Response response = client.GetServiceStatistics(null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("counters").GetProperty("documentCount").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("counters").GetProperty("indexesCount").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("counters").GetProperty("indexersCount").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("counters").GetProperty("dataSourcesCount").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("counters").GetProperty("storageSize").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("counters").GetProperty("synonymMaps").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("counters").GetProperty("skillsetCount").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("counters").GetProperty("vectorIndexSize").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("limits").ToString()); +]]> + + + \ No newline at end of file diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/Skillsets.xml b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/Skillsets.xml new file mode 100644 index 000000000000..eb16c028545d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/Skillsets.xml @@ -0,0 +1,1441 @@ + + + + + +This sample shows how to call CreateOrUpdateAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +SearchIndexerSkillset skillset = new SearchIndexerSkillset("demoskillset", new SearchIndexerSkill[] +{ + new EntityRecognitionSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/content", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("organizations") + { + TargetName = "organizations", + } + }) + { + Categories = {EntityCategory.Organization}, + DefaultLanguageCode = EntityRecognitionSkillLanguage.En, + MinimumPrecision = 0.7, + }, + new LanguageDetectionSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/content", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("languageCode") + { + TargetName = "languageCode", + } + }), + new SplitSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/content", + }, + new InputFieldMappingEntry("languageCode") + { + Source = "/document/languageCode", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("textItems") + { + TargetName = "pages", + } + }) + { + TextSplitMode = TextSplitMode.Pages, + MaximumPageLength = 4000, + }, + new KeyPhraseExtractionSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/pages/*", + }, + new InputFieldMappingEntry("languageCode") + { + Source = "/document/languageCode", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("keyPhrases") + { + TargetName = "keyPhrases", + } + }) + { + Context = "/document/pages/*", + }, + new WebApiSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/pages/*", + }, + new InputFieldMappingEntry("languageCode") + { + Source = "/document/languageCode", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("customresult") + { + TargetName = "result", + } + }, "https://contoso.example.org") + { + HttpHeaders = {}, + HttpMethod = "POST", + Timeout = XmlConvert.ToTimeSpan("PT30S"), + BatchSize = 1, + Name = "MyCustomWebApiSkill", + } +}) +{ + Description = "Extract entities, detect language and extract key-phrases", + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), +}; +Response response = await client.CreateOrUpdateAsync("demoskillset", skillset); +]]> + + + +This sample shows how to call CreateOrUpdate. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +SearchIndexerSkillset skillset = new SearchIndexerSkillset("demoskillset", new SearchIndexerSkill[] +{ + new EntityRecognitionSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/content", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("organizations") + { + TargetName = "organizations", + } + }) + { + Categories = {EntityCategory.Organization}, + DefaultLanguageCode = EntityRecognitionSkillLanguage.En, + MinimumPrecision = 0.7, + }, + new LanguageDetectionSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/content", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("languageCode") + { + TargetName = "languageCode", + } + }), + new SplitSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/content", + }, + new InputFieldMappingEntry("languageCode") + { + Source = "/document/languageCode", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("textItems") + { + TargetName = "pages", + } + }) + { + TextSplitMode = TextSplitMode.Pages, + MaximumPageLength = 4000, + }, + new KeyPhraseExtractionSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/pages/*", + }, + new InputFieldMappingEntry("languageCode") + { + Source = "/document/languageCode", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("keyPhrases") + { + TargetName = "keyPhrases", + } + }) + { + Context = "/document/pages/*", + }, + new WebApiSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/pages/*", + }, + new InputFieldMappingEntry("languageCode") + { + Source = "/document/languageCode", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("customresult") + { + TargetName = "result", + } + }, "https://contoso.example.org") + { + HttpHeaders = {}, + HttpMethod = "POST", + Timeout = XmlConvert.ToTimeSpan("PT30S"), + BatchSize = 1, + Name = "MyCustomWebApiSkill", + } +}) +{ + Description = "Extract entities, detect language and extract key-phrases", + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), +}; +Response response = client.CreateOrUpdate("demoskillset", skillset); +]]> + + + +This sample shows how to call CreateOrUpdateAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "demoskillset", + description = "Extract entities, detect language and extract key-phrases", + skills = new object[] + { + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Text.EntityRecognitionSkill", + ["categories"] = new object[] + { + "organization" + }, + ["defaultLanguageCode"] = "en", + ["minimumPrecision"] = 0.7, + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/content", + } + }, + ["outputs"] = new object[] + { + new + { + name = "organizations", + targetName = "organizations", + } + } + }, + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Text.LanguageDetectionSkill", + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/content", + } + }, + ["outputs"] = new object[] + { + new + { + name = "languageCode", + targetName = "languageCode", + } + } + }, + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Text.SplitSkill", + ["textSplitMode"] = "pages", + ["maximumPageLength"] = 4000, + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/content", + }, + new + { + name = "languageCode", + source = "/document/languageCode", + } + }, + ["outputs"] = new object[] + { + new + { + name = "textItems", + targetName = "pages", + } + } + }, + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Text.KeyPhraseExtractionSkill", + ["context"] = "/document/pages/*", + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/pages/*", + }, + new + { + name = "languageCode", + source = "/document/languageCode", + } + }, + ["outputs"] = new object[] + { + new + { + name = "keyPhrases", + targetName = "keyPhrases", + } + } + }, + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Custom.WebApiSkill", + ["name"] = "MyCustomWebApiSkill", + ["uri"] = "https://contoso.example.org", + ["httpMethod"] = "POST", + ["timeout"] = "PT30S", + ["batchSize"] = 1, + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/pages/*", + }, + new + { + name = "languageCode", + source = "/document/languageCode", + } + }, + ["outputs"] = new object[] + { + new + { + name = "customresult", + targetName = "result", + } + }, + ["httpHeaders"] = new object() + } + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, +}); +Response response = await client.CreateOrUpdateAsync("demoskillset", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("@odata.type").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("inputs")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("outputs")[0].GetProperty("name").ToString()); +]]> + + + +This sample shows how to call CreateOrUpdate and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "demoskillset", + description = "Extract entities, detect language and extract key-phrases", + skills = new object[] + { + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Text.EntityRecognitionSkill", + ["categories"] = new object[] + { + "organization" + }, + ["defaultLanguageCode"] = "en", + ["minimumPrecision"] = 0.7, + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/content", + } + }, + ["outputs"] = new object[] + { + new + { + name = "organizations", + targetName = "organizations", + } + } + }, + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Text.LanguageDetectionSkill", + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/content", + } + }, + ["outputs"] = new object[] + { + new + { + name = "languageCode", + targetName = "languageCode", + } + } + }, + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Text.SplitSkill", + ["textSplitMode"] = "pages", + ["maximumPageLength"] = 4000, + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/content", + }, + new + { + name = "languageCode", + source = "/document/languageCode", + } + }, + ["outputs"] = new object[] + { + new + { + name = "textItems", + targetName = "pages", + } + } + }, + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Text.KeyPhraseExtractionSkill", + ["context"] = "/document/pages/*", + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/pages/*", + }, + new + { + name = "languageCode", + source = "/document/languageCode", + } + }, + ["outputs"] = new object[] + { + new + { + name = "keyPhrases", + targetName = "keyPhrases", + } + } + }, + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Custom.WebApiSkill", + ["name"] = "MyCustomWebApiSkill", + ["uri"] = "https://contoso.example.org", + ["httpMethod"] = "POST", + ["timeout"] = "PT30S", + ["batchSize"] = 1, + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/pages/*", + }, + new + { + name = "languageCode", + source = "/document/languageCode", + } + }, + ["outputs"] = new object[] + { + new + { + name = "customresult", + targetName = "result", + } + }, + ["httpHeaders"] = new object() + } + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, +}); +Response response = client.CreateOrUpdate("demoskillset", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("@odata.type").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("inputs")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("outputs")[0].GetProperty("name").ToString()); +]]> + + + +This sample shows how to call DeleteAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +Response response = await client.DeleteAsync("demoskillset"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call Delete. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +Response response = client.Delete("demoskillset"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetSkillsetAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +Response response = await client.GetSkillsetAsync("demoskillset"); +]]> + + + +This sample shows how to call GetSkillset. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +Response response = client.GetSkillset("demoskillset"); +]]> + + + +This sample shows how to call GetSkillsetAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +Response response = await client.GetSkillsetAsync("demoskillset", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("@odata.type").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("inputs")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("outputs")[0].GetProperty("name").ToString()); +]]> + + + +This sample shows how to call GetSkillset and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +Response response = client.GetSkillset("demoskillset", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("@odata.type").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("inputs")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("outputs")[0].GetProperty("name").ToString()); +]]> + + + +This sample shows how to call GetSkillsetsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +Response response = await client.GetSkillsetsAsync(); +]]> + + + +This sample shows how to call GetSkillsets. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +Response response = client.GetSkillsets(); +]]> + + + +This sample shows how to call GetSkillsetsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +Response response = await client.GetSkillsetsAsync("*", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("skills")[0].GetProperty("@odata.type").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("skills")[0].GetProperty("inputs")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("skills")[0].GetProperty("outputs")[0].GetProperty("name").ToString()); +]]> + + + +This sample shows how to call GetSkillsets and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +Response response = client.GetSkillsets("*", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("skills")[0].GetProperty("@odata.type").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("skills")[0].GetProperty("inputs")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("skills")[0].GetProperty("outputs")[0].GetProperty("name").ToString()); +]]> + + + +This sample shows how to call CreateAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +SearchIndexerSkillset skillset = new SearchIndexerSkillset("demoskillset", new SearchIndexerSkill[] +{ + new EntityRecognitionSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/content", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("organizations") + { + TargetName = "organizations", + } + }) + { + Categories = {EntityCategory.Organization}, + DefaultLanguageCode = EntityRecognitionSkillLanguage.En, + MinimumPrecision = 0.7, + }, + new LanguageDetectionSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/content", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("languageCode") + { + TargetName = "languageCode", + } + }), + new SplitSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/content", + }, + new InputFieldMappingEntry("languageCode") + { + Source = "/document/languageCode", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("textItems") + { + TargetName = "pages", + } + }) + { + TextSplitMode = TextSplitMode.Pages, + MaximumPageLength = 4000, + }, + new KeyPhraseExtractionSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/pages/*", + }, + new InputFieldMappingEntry("languageCode") + { + Source = "/document/languageCode", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("keyPhrases") + { + TargetName = "keyPhrases", + } + }) + { + Context = "/document/pages/*", + }, + new WebApiSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/pages/*", + }, + new InputFieldMappingEntry("languageCode") + { + Source = "/document/languageCode", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("customresult") + { + TargetName = "result", + } + }, "https://contoso.example.org") + { + HttpHeaders = {}, + HttpMethod = "POST", + Timeout = XmlConvert.ToTimeSpan("PT30S"), + BatchSize = 1, + Name = "MyCustomWebApiSkill", + } +}) +{ + Description = "Extract entities, detect language and extract key-phrases", + KnowledgeStore = new SearchIndexerKnowledgeStore("DefaultEndpointsProtocol=https;AccountName=myStorage;AccountKey=myStorageKey;EndpointSuffix=core.windows.net", new SearchIndexerKnowledgeStoreProjection[] + { + new SearchIndexerKnowledgeStoreProjection + { + Tables = {new SearchIndexerKnowledgeStoreTableProjectionSelector("Reviews") + { + GeneratedKeyName = "ReviewId", + Source = "/document/Review", + Inputs = {}, + }, new SearchIndexerKnowledgeStoreTableProjectionSelector("Sentences") + { + GeneratedKeyName = "SentenceId", + Source = "/document/Review/Sentences/*", + Inputs = {}, + }, new SearchIndexerKnowledgeStoreTableProjectionSelector("KeyPhrases") + { + GeneratedKeyName = "KeyPhraseId", + Source = "/document/Review/Sentences/*/KeyPhrases", + Inputs = {}, + }, new SearchIndexerKnowledgeStoreTableProjectionSelector("Entities") + { + GeneratedKeyName = "EntityId", + Source = "/document/Review/Sentences/*/Entities/*", + Inputs = {}, + }}, + }, + new SearchIndexerKnowledgeStoreProjection + { + Objects = {new SearchIndexerKnowledgeStoreObjectProjectionSelector("Reviews") + { + GeneratedKeyName = "/document/Review/Id", + Source = "/document/Review", + }}, + } + }), + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "", + }, + }, +}; +Response response = await client.CreateAsync(skillset); +]]> + + + +This sample shows how to call Create. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +SearchIndexerSkillset skillset = new SearchIndexerSkillset("demoskillset", new SearchIndexerSkill[] +{ + new EntityRecognitionSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/content", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("organizations") + { + TargetName = "organizations", + } + }) + { + Categories = {EntityCategory.Organization}, + DefaultLanguageCode = EntityRecognitionSkillLanguage.En, + MinimumPrecision = 0.7, + }, + new LanguageDetectionSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/content", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("languageCode") + { + TargetName = "languageCode", + } + }), + new SplitSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/content", + }, + new InputFieldMappingEntry("languageCode") + { + Source = "/document/languageCode", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("textItems") + { + TargetName = "pages", + } + }) + { + TextSplitMode = TextSplitMode.Pages, + MaximumPageLength = 4000, + }, + new KeyPhraseExtractionSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/pages/*", + }, + new InputFieldMappingEntry("languageCode") + { + Source = "/document/languageCode", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("keyPhrases") + { + TargetName = "keyPhrases", + } + }) + { + Context = "/document/pages/*", + }, + new WebApiSkill(new InputFieldMappingEntry[] + { + new InputFieldMappingEntry("text") + { + Source = "/document/pages/*", + }, + new InputFieldMappingEntry("languageCode") + { + Source = "/document/languageCode", + } + }, new OutputFieldMappingEntry[] + { + new OutputFieldMappingEntry("customresult") + { + TargetName = "result", + } + }, "https://contoso.example.org") + { + HttpHeaders = {}, + HttpMethod = "POST", + Timeout = XmlConvert.ToTimeSpan("PT30S"), + BatchSize = 1, + Name = "MyCustomWebApiSkill", + } +}) +{ + Description = "Extract entities, detect language and extract key-phrases", + KnowledgeStore = new SearchIndexerKnowledgeStore("DefaultEndpointsProtocol=https;AccountName=myStorage;AccountKey=myStorageKey;EndpointSuffix=core.windows.net", new SearchIndexerKnowledgeStoreProjection[] + { + new SearchIndexerKnowledgeStoreProjection + { + Tables = {new SearchIndexerKnowledgeStoreTableProjectionSelector("Reviews") + { + GeneratedKeyName = "ReviewId", + Source = "/document/Review", + Inputs = {}, + }, new SearchIndexerKnowledgeStoreTableProjectionSelector("Sentences") + { + GeneratedKeyName = "SentenceId", + Source = "/document/Review/Sentences/*", + Inputs = {}, + }, new SearchIndexerKnowledgeStoreTableProjectionSelector("KeyPhrases") + { + GeneratedKeyName = "KeyPhraseId", + Source = "/document/Review/Sentences/*/KeyPhrases", + Inputs = {}, + }, new SearchIndexerKnowledgeStoreTableProjectionSelector("Entities") + { + GeneratedKeyName = "EntityId", + Source = "/document/Review/Sentences/*/Entities/*", + Inputs = {}, + }}, + }, + new SearchIndexerKnowledgeStoreProjection + { + Objects = {new SearchIndexerKnowledgeStoreObjectProjectionSelector("Reviews") + { + GeneratedKeyName = "/document/Review/Id", + Source = "/document/Review", + }}, + } + }), + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "", + }, + }, +}; +Response response = client.Create(skillset); +]]> + + + +This sample shows how to call CreateAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "demoskillset", + description = "Extract entities, detect language and extract key-phrases", + skills = new object[] + { + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Text.EntityRecognitionSkill", + ["categories"] = new object[] + { + "organization" + }, + ["defaultLanguageCode"] = "en", + ["minimumPrecision"] = 0.7, + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/content", + } + }, + ["outputs"] = new object[] + { + new + { + name = "organizations", + targetName = "organizations", + } + } + }, + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Text.LanguageDetectionSkill", + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/content", + } + }, + ["outputs"] = new object[] + { + new + { + name = "languageCode", + targetName = "languageCode", + } + } + }, + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Text.SplitSkill", + ["textSplitMode"] = "pages", + ["maximumPageLength"] = 4000, + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/content", + }, + new + { + name = "languageCode", + source = "/document/languageCode", + } + }, + ["outputs"] = new object[] + { + new + { + name = "textItems", + targetName = "pages", + } + } + }, + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Text.KeyPhraseExtractionSkill", + ["context"] = "/document/pages/*", + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/pages/*", + }, + new + { + name = "languageCode", + source = "/document/languageCode", + } + }, + ["outputs"] = new object[] + { + new + { + name = "keyPhrases", + targetName = "keyPhrases", + } + } + }, + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Custom.WebApiSkill", + ["name"] = "MyCustomWebApiSkill", + ["uri"] = "https://contoso.example.org", + ["httpMethod"] = "POST", + ["timeout"] = "PT30S", + ["batchSize"] = 1, + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/pages/*", + }, + new + { + name = "languageCode", + source = "/document/languageCode", + } + }, + ["outputs"] = new object[] + { + new + { + name = "customresult", + targetName = "result", + } + }, + ["httpHeaders"] = new object() + } + }, + knowledgeStore = new + { + storageConnectionString = "DefaultEndpointsProtocol=https;AccountName=myStorage;AccountKey=myStorageKey;EndpointSuffix=core.windows.net", + projections = new object[] + { + new + { + tables = new object[] + { + new + { + tableName = "Reviews", + generatedKeyName = "ReviewId", + source = "/document/Review", + inputs = Array.Empty(), + }, + new + { + tableName = "Sentences", + generatedKeyName = "SentenceId", + source = "/document/Review/Sentences/*", + inputs = Array.Empty(), + }, + new + { + tableName = "KeyPhrases", + generatedKeyName = "KeyPhraseId", + source = "/document/Review/Sentences/*/KeyPhrases", + inputs = Array.Empty(), + }, + new + { + tableName = "Entities", + generatedKeyName = "EntityId", + source = "/document/Review/Sentences/*/Entities/*", + inputs = Array.Empty(), + } + }, + }, + new + { + objects = new object[] + { + new + { + storageContainer = "Reviews", + source = "/document/Review", + generatedKeyName = "/document/Review/Id", + } + }, + } + }, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "", + }, + }, +}); +Response response = await client.CreateAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("@odata.type").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("inputs")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("outputs")[0].GetProperty("name").ToString()); +]]> + + + +This sample shows how to call Create and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "demoskillset", + description = "Extract entities, detect language and extract key-phrases", + skills = new object[] + { + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Text.EntityRecognitionSkill", + ["categories"] = new object[] + { + "organization" + }, + ["defaultLanguageCode"] = "en", + ["minimumPrecision"] = 0.7, + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/content", + } + }, + ["outputs"] = new object[] + { + new + { + name = "organizations", + targetName = "organizations", + } + } + }, + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Text.LanguageDetectionSkill", + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/content", + } + }, + ["outputs"] = new object[] + { + new + { + name = "languageCode", + targetName = "languageCode", + } + } + }, + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Text.SplitSkill", + ["textSplitMode"] = "pages", + ["maximumPageLength"] = 4000, + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/content", + }, + new + { + name = "languageCode", + source = "/document/languageCode", + } + }, + ["outputs"] = new object[] + { + new + { + name = "textItems", + targetName = "pages", + } + } + }, + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Text.KeyPhraseExtractionSkill", + ["context"] = "/document/pages/*", + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/pages/*", + }, + new + { + name = "languageCode", + source = "/document/languageCode", + } + }, + ["outputs"] = new object[] + { + new + { + name = "keyPhrases", + targetName = "keyPhrases", + } + } + }, + new Dictionary + { + ["@odata.type"] = "#Microsoft.Skills.Custom.WebApiSkill", + ["name"] = "MyCustomWebApiSkill", + ["uri"] = "https://contoso.example.org", + ["httpMethod"] = "POST", + ["timeout"] = "PT30S", + ["batchSize"] = 1, + ["inputs"] = new object[] + { + new + { + name = "text", + source = "/document/pages/*", + }, + new + { + name = "languageCode", + source = "/document/languageCode", + } + }, + ["outputs"] = new object[] + { + new + { + name = "customresult", + targetName = "result", + } + }, + ["httpHeaders"] = new object() + } + }, + knowledgeStore = new + { + storageConnectionString = "DefaultEndpointsProtocol=https;AccountName=myStorage;AccountKey=myStorageKey;EndpointSuffix=core.windows.net", + projections = new object[] + { + new + { + tables = new object[] + { + new + { + tableName = "Reviews", + generatedKeyName = "ReviewId", + source = "/document/Review", + inputs = Array.Empty(), + }, + new + { + tableName = "Sentences", + generatedKeyName = "SentenceId", + source = "/document/Review/Sentences/*", + inputs = Array.Empty(), + }, + new + { + tableName = "KeyPhrases", + generatedKeyName = "KeyPhraseId", + source = "/document/Review/Sentences/*/KeyPhrases", + inputs = Array.Empty(), + }, + new + { + tableName = "Entities", + generatedKeyName = "EntityId", + source = "/document/Review/Sentences/*/Entities/*", + inputs = Array.Empty(), + } + }, + }, + new + { + objects = new object[] + { + new + { + storageContainer = "Reviews", + source = "/document/Review", + generatedKeyName = "/document/Review/Id", + } + }, + } + }, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "", + }, + }, +}); +Response response = client.Create(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("@odata.type").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("inputs")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("skills")[0].GetProperty("outputs")[0].GetProperty("name").ToString()); +]]> + + + \ No newline at end of file diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/SynonymMaps.xml b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/SynonymMaps.xml new file mode 100644 index 000000000000..e4338868e42d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Docs/SynonymMaps.xml @@ -0,0 +1,333 @@ + + + + + +This sample shows how to call CreateOrUpdateAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +SynonymMap synonymMap = new SynonymMap("mysynonymmap", "United States, United States of America, USA\nWashington, Wash. => WA") +{ + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), +}; +Response response = await client.CreateOrUpdateAsync("mysynonymmap", synonymMap); +]]> + + + +This sample shows how to call CreateOrUpdate. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +SynonymMap synonymMap = new SynonymMap("mysynonymmap", "United States, United States of America, USA\nWashington, Wash. => WA") +{ + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), +}; +Response response = client.CreateOrUpdate("mysynonymmap", synonymMap); +]]> + + + +This sample shows how to call CreateOrUpdateAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "mysynonymmap", + format = "solr", + synonyms = "United States, United States of America, USA\nWashington, Wash. => WA", + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, +}); +Response response = await client.CreateOrUpdateAsync("mysynonymmap", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("format").ToString()); +Console.WriteLine(result.GetProperty("synonyms").ToString()); +]]> + + + +This sample shows how to call CreateOrUpdate and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "mysynonymmap", + format = "solr", + synonyms = "United States, United States of America, USA\nWashington, Wash. => WA", + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, +}); +Response response = client.CreateOrUpdate("mysynonymmap", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("format").ToString()); +Console.WriteLine(result.GetProperty("synonyms").ToString()); +]]> + + + +This sample shows how to call DeleteAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +Response response = await client.DeleteAsync("mysynonymmap"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call Delete. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +Response response = client.Delete("mysynonymmap"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetSynonymMapAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +Response response = await client.GetSynonymMapAsync("mysynonymmap"); +]]> + + + +This sample shows how to call GetSynonymMap. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +Response response = client.GetSynonymMap("mysynonymmap"); +]]> + + + +This sample shows how to call GetSynonymMapAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +Response response = await client.GetSynonymMapAsync("mysynonymmap", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("format").ToString()); +Console.WriteLine(result.GetProperty("synonyms").ToString()); +]]> + + + +This sample shows how to call GetSynonymMap and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +Response response = client.GetSynonymMap("mysynonymmap", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("format").ToString()); +Console.WriteLine(result.GetProperty("synonyms").ToString()); +]]> + + + +This sample shows how to call GetSynonymMapsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +Response response = await client.GetSynonymMapsAsync(); +]]> + + + +This sample shows how to call GetSynonymMaps. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +Response response = client.GetSynonymMaps(); +]]> + + + +This sample shows how to call GetSynonymMapsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +Response response = await client.GetSynonymMapsAsync(null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("format").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("synonyms").ToString()); +]]> + + + +This sample shows how to call GetSynonymMaps and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +Response response = client.GetSynonymMaps(null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("format").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("synonyms").ToString()); +]]> + + + +This sample shows how to call CreateAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +SynonymMap synonymMap = new SynonymMap("mysynonymmap", "United States, United States of America, USA\nWashington, Wash. => WA") +{ + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "myApplicationSecret", + }, + }, +}; +Response response = await client.CreateAsync(synonymMap); +]]> + + + +This sample shows how to call Create. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +SynonymMap synonymMap = new SynonymMap("mysynonymmap", "United States, United States of America, USA\nWashington, Wash. => WA") +{ + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "myApplicationSecret", + }, + }, +}; +Response response = client.Create(synonymMap); +]]> + + + +This sample shows how to call CreateAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "mysynonymmap", + format = "solr", + synonyms = "United States, United States of America, USA\nWashington, Wash. => WA", + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "myApplicationSecret", + }, + }, +}); +Response response = await client.CreateAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("format").ToString()); +Console.WriteLine(result.GetProperty("synonyms").ToString()); +]]> + + + +This sample shows how to call Create and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "mysynonymmap", + format = "solr", + synonyms = "United States, United States of America, USA\nWashington, Wash. => WA", + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "myApplicationSecret", + }, + }, +}); +Response response = client.Create(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("format").ToString()); +Console.WriteLine(result.GetProperty("synonyms").ToString()); +]]> + + + \ No newline at end of file diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DocumentExtractionSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DocumentExtractionSkill.Serialization.cs new file mode 100644 index 000000000000..68847ed9b6d7 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DocumentExtractionSkill.Serialization.cs @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class DocumentExtractionSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentExtractionSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(ParsingMode)) + { + writer.WritePropertyName("parsingMode"u8); + writer.WriteStringValue(ParsingMode); + } + if (Optional.IsDefined(DataToExtract)) + { + writer.WritePropertyName("dataToExtract"u8); + writer.WriteStringValue(DataToExtract); + } + if (Optional.IsCollectionDefined(Configuration)) + { + writer.WritePropertyName("configuration"u8); + writer.WriteStartObject(); + foreach (var item in Configuration) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + } + + DocumentExtractionSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentExtractionSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentExtractionSkill(document.RootElement, options); + } + + internal static DocumentExtractionSkill DeserializeDocumentExtractionSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string parsingMode = default; + string dataToExtract = default; + IDictionary configuration = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("parsingMode"u8)) + { + parsingMode = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataToExtract"u8)) + { + dataToExtract = property.Value.GetString(); + continue; + } + if (property.NameEquals("configuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + } + } + configuration = dictionary; + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentExtractionSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + parsingMode, + dataToExtract, + configuration ?? new ChangeTrackingDictionary()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentExtractionSkill)} does not support writing '{options.Format}' format."); + } + } + + DocumentExtractionSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDocumentExtractionSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentExtractionSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new DocumentExtractionSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDocumentExtractionSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DocumentExtractionSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DocumentExtractionSkill.cs new file mode 100644 index 000000000000..0b47cc58baae --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/DocumentExtractionSkill.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// A skill that extracts content from a file within the enrichment pipeline. + public partial class DocumentExtractionSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public DocumentExtractionSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Util.DocumentExtractionSkill"; + Configuration = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// The parsingMode for the skill. Will be set to 'default' if not defined. + /// + /// The type of data to be extracted for the skill. Will be set to + /// 'contentAndMetadata' if not defined. + /// + /// A dictionary of configurations for the skill. + internal DocumentExtractionSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, string parsingMode, string dataToExtract, IDictionary configuration) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + ParsingMode = parsingMode; + DataToExtract = dataToExtract; + Configuration = configuration; + } + + /// Initializes a new instance of for deserialization. + internal DocumentExtractionSkill() + { + } + + /// The parsingMode for the skill. Will be set to 'default' if not defined. + public string ParsingMode { get; set; } + /// + /// The type of data to be extracted for the skill. Will be set to + /// 'contentAndMetadata' if not defined. + /// + public string DataToExtract { get; set; } + /// + /// A dictionary of configurations for the skill. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary Configuration { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EdgeNGramTokenFilterSide.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EdgeNGramTokenFilterSide.cs new file mode 100644 index 000000000000..8d55de0817e3 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EdgeNGramTokenFilterSide.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 +{ + /// Specifies which side of the input an n-gram should be generated from. + public readonly partial struct EdgeNGramTokenFilterSide : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EdgeNGramTokenFilterSide(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FrontValue = "front"; + private const string BackValue = "back"; + + /// Specifies that the n-gram should be generated from the front of the input. + public static EdgeNGramTokenFilterSide Front { get; } = new EdgeNGramTokenFilterSide(FrontValue); + /// Specifies that the n-gram should be generated from the back of the input. + public static EdgeNGramTokenFilterSide Back { get; } = new EdgeNGramTokenFilterSide(BackValue); + /// Determines if two values are the same. + public static bool operator ==(EdgeNGramTokenFilterSide left, EdgeNGramTokenFilterSide right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EdgeNGramTokenFilterSide left, EdgeNGramTokenFilterSide right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EdgeNGramTokenFilterSide(string value) => new EdgeNGramTokenFilterSide(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EdgeNGramTokenFilterSide other && Equals(other); + /// + public bool Equals(EdgeNGramTokenFilterSide other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EdgeNGramTokenFilterV2.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EdgeNGramTokenFilterV2.Serialization.cs new file mode 100644 index 000000000000..646db64d85f0 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EdgeNGramTokenFilterV2.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class EdgeNGramTokenFilterV2 : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EdgeNGramTokenFilterV2)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(MinGram)) + { + writer.WritePropertyName("minGram"u8); + writer.WriteNumberValue(MinGram.Value); + } + if (Optional.IsDefined(MaxGram)) + { + writer.WritePropertyName("maxGram"u8); + writer.WriteNumberValue(MaxGram.Value); + } + if (Optional.IsDefined(Side)) + { + writer.WritePropertyName("side"u8); + writer.WriteStringValue(Side.Value.ToString()); + } + } + + EdgeNGramTokenFilterV2 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EdgeNGramTokenFilterV2)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEdgeNGramTokenFilterV2(document.RootElement, options); + } + + internal static EdgeNGramTokenFilterV2 DeserializeEdgeNGramTokenFilterV2(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? minGram = default; + int? maxGram = default; + EdgeNGramTokenFilterSide? side = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("minGram"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minGram = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxGram"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxGram = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("side"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + side = new EdgeNGramTokenFilterSide(property.Value.GetString()); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EdgeNGramTokenFilterV2( + odataType, + name, + serializedAdditionalRawData, + minGram, + maxGram, + side); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EdgeNGramTokenFilterV2)} does not support writing '{options.Format}' format."); + } + } + + EdgeNGramTokenFilterV2 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEdgeNGramTokenFilterV2(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EdgeNGramTokenFilterV2)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new EdgeNGramTokenFilterV2 FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEdgeNGramTokenFilterV2(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EdgeNGramTokenFilterV2.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EdgeNGramTokenFilterV2.cs new file mode 100644 index 000000000000..07de74a8ad02 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EdgeNGramTokenFilterV2.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Generates n-grams of the given size(s) starting from the front or the back of + /// an input token. This token filter is implemented using Apache Lucene. + /// + public partial class EdgeNGramTokenFilterV2 : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// is null. + public EdgeNGramTokenFilterV2(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.EdgeNGramTokenFilterV2"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the + /// value of maxGram. + /// + /// The maximum n-gram length. Default is 2. Maximum is 300. + /// + /// Specifies which side of the input the n-gram should be generated from. Default + /// is "front". + /// + internal EdgeNGramTokenFilterV2(string odataType, string name, IDictionary serializedAdditionalRawData, int? minGram, int? maxGram, EdgeNGramTokenFilterSide? side) : base(odataType, name, serializedAdditionalRawData) + { + MinGram = minGram; + MaxGram = maxGram; + Side = side; + } + + /// Initializes a new instance of for deserialization. + internal EdgeNGramTokenFilterV2() + { + } + + /// + /// The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the + /// value of maxGram. + /// + public int? MinGram { get; set; } + /// The maximum n-gram length. Default is 2. Maximum is 300. + public int? MaxGram { get; set; } + /// + /// Specifies which side of the input the n-gram should be generated from. Default + /// is "front". + /// + public EdgeNGramTokenFilterSide? Side { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EdgeNGramTokenizer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EdgeNGramTokenizer.Serialization.cs new file mode 100644 index 000000000000..87a5acaf46d6 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EdgeNGramTokenizer.Serialization.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class EdgeNGramTokenizer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EdgeNGramTokenizer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(MinGram)) + { + writer.WritePropertyName("minGram"u8); + writer.WriteNumberValue(MinGram.Value); + } + if (Optional.IsDefined(MaxGram)) + { + writer.WritePropertyName("maxGram"u8); + writer.WriteNumberValue(MaxGram.Value); + } + if (Optional.IsCollectionDefined(TokenChars)) + { + writer.WritePropertyName("tokenChars"u8); + writer.WriteStartArray(); + foreach (var item in TokenChars) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + } + + EdgeNGramTokenizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EdgeNGramTokenizer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEdgeNGramTokenizer(document.RootElement, options); + } + + internal static EdgeNGramTokenizer DeserializeEdgeNGramTokenizer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? minGram = default; + int? maxGram = default; + IList tokenChars = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("minGram"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minGram = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxGram"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxGram = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("tokenChars"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new TokenCharacterKind(item.GetString())); + } + tokenChars = array; + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EdgeNGramTokenizer( + odataType, + name, + serializedAdditionalRawData, + minGram, + maxGram, + tokenChars ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EdgeNGramTokenizer)} does not support writing '{options.Format}' format."); + } + } + + EdgeNGramTokenizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEdgeNGramTokenizer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EdgeNGramTokenizer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new EdgeNGramTokenizer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEdgeNGramTokenizer(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EdgeNGramTokenizer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EdgeNGramTokenizer.cs new file mode 100644 index 000000000000..9c2b3c6b4526 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EdgeNGramTokenizer.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Tokenizes the input from an edge into n-grams of the given size(s). This + /// tokenizer is implemented using Apache Lucene. + /// + public partial class EdgeNGramTokenizer : LexicalTokenizer + { + /// Initializes a new instance of . + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// is null. + public EdgeNGramTokenizer(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.EdgeNGramTokenizer"; + TokenChars = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the + /// value of maxGram. + /// + /// The maximum n-gram length. Default is 2. Maximum is 300. + /// Character classes to keep in the tokens. + internal EdgeNGramTokenizer(string odataType, string name, IDictionary serializedAdditionalRawData, int? minGram, int? maxGram, IList tokenChars) : base(odataType, name, serializedAdditionalRawData) + { + MinGram = minGram; + MaxGram = maxGram; + TokenChars = tokenChars; + } + + /// Initializes a new instance of for deserialization. + internal EdgeNGramTokenizer() + { + } + + /// + /// The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the + /// value of maxGram. + /// + public int? MinGram { get; set; } + /// The maximum n-gram length. Default is 2. Maximum is 300. + public int? MaxGram { get; set; } + /// Character classes to keep in the tokens. + public IList TokenChars { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ElisionTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ElisionTokenFilter.Serialization.cs new file mode 100644 index 000000000000..2df5770559e1 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ElisionTokenFilter.Serialization.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ElisionTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ElisionTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Articles)) + { + writer.WritePropertyName("articles"u8); + writer.WriteStartArray(); + foreach (var item in Articles) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + ElisionTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ElisionTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeElisionTokenFilter(document.RootElement, options); + } + + internal static ElisionTokenFilter DeserializeElisionTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList articles = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("articles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + articles = array; + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ElisionTokenFilter(odataType, name, serializedAdditionalRawData, articles ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ElisionTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + ElisionTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeElisionTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ElisionTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ElisionTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeElisionTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ElisionTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ElisionTokenFilter.cs new file mode 100644 index 000000000000..64888034257e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ElisionTokenFilter.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Removes elisions. For example, "l'avion" (the plane) will be converted to + /// "avion" (plane). This token filter is implemented using Apache Lucene. + /// + public partial class ElisionTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// is null. + public ElisionTokenFilter(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.ElisionTokenFilter"; + Articles = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// The set of articles to remove. + internal ElisionTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, IList articles) : base(odataType, name, serializedAdditionalRawData) + { + Articles = articles; + } + + /// Initializes a new instance of for deserialization. + internal ElisionTokenFilter() + { + } + + /// The set of articles to remove. + public IList Articles { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityCategory.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityCategory.cs new file mode 100644 index 000000000000..dcc8506854ff --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityCategory.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// A string indicating what entity categories to return. + public readonly partial struct EntityCategory : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EntityCategory(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LocationValue = "location"; + private const string OrganizationValue = "organization"; + private const string PersonValue = "person"; + private const string QuantityValue = "quantity"; + private const string DatetimeValue = "datetime"; + private const string UrlValue = "url"; + private const string EmailValue = "email"; + + /// Entities describing a physical location. + public static EntityCategory Location { get; } = new EntityCategory(LocationValue); + /// Entities describing an organization. + public static EntityCategory Organization { get; } = new EntityCategory(OrganizationValue); + /// Entities describing a person. + public static EntityCategory Person { get; } = new EntityCategory(PersonValue); + /// Entities describing a quantity. + public static EntityCategory Quantity { get; } = new EntityCategory(QuantityValue); + /// Entities describing a date and time. + public static EntityCategory Datetime { get; } = new EntityCategory(DatetimeValue); + /// Entities describing a URL. + public static EntityCategory Url { get; } = new EntityCategory(UrlValue); + /// Entities describing an email address. + public static EntityCategory Email { get; } = new EntityCategory(EmailValue); + /// Determines if two values are the same. + public static bool operator ==(EntityCategory left, EntityCategory right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EntityCategory left, EntityCategory right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EntityCategory(string value) => new EntityCategory(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EntityCategory other && Equals(other); + /// + public bool Equals(EntityCategory other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityLinkingSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityLinkingSkill.Serialization.cs new file mode 100644 index 000000000000..59f3502ad70c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityLinkingSkill.Serialization.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class EntityLinkingSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityLinkingSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(DefaultLanguageCode)) + { + writer.WritePropertyName("defaultLanguageCode"u8); + writer.WriteStringValue(DefaultLanguageCode); + } + if (Optional.IsDefined(MinimumPrecision)) + { + writer.WritePropertyName("minimumPrecision"u8); + writer.WriteNumberValue(MinimumPrecision.Value); + } + if (Optional.IsDefined(ModelVersion)) + { + writer.WritePropertyName("modelVersion"u8); + writer.WriteStringValue(ModelVersion); + } + } + + EntityLinkingSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityLinkingSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEntityLinkingSkill(document.RootElement, options); + } + + internal static EntityLinkingSkill DeserializeEntityLinkingSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string defaultLanguageCode = default; + double? minimumPrecision = default; + string modelVersion = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("defaultLanguageCode"u8)) + { + defaultLanguageCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("minimumPrecision"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minimumPrecision = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("modelVersion"u8)) + { + modelVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EntityLinkingSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + defaultLanguageCode, + minimumPrecision, + modelVersion); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EntityLinkingSkill)} does not support writing '{options.Format}' format."); + } + } + + EntityLinkingSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEntityLinkingSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EntityLinkingSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new EntityLinkingSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEntityLinkingSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityLinkingSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityLinkingSkill.cs new file mode 100644 index 000000000000..a7c442257cdf --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityLinkingSkill.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Using the Text Analytics API, extracts linked entities from text. + public partial class EntityLinkingSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public EntityLinkingSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Text.V3.EntityLinkingSkill"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// A value indicating which language code to use. Default is `en`. + /// + /// A value between 0 and 1 that be used to only include entities whose confidence + /// score is greater than the value specified. If not set (default), or if + /// explicitly set to null, all entities will be included. + /// + /// + /// The version of the model to use when calling the Text Analytics service. It + /// will default to the latest available when not specified. We recommend you do + /// not specify this value unless absolutely necessary. + /// + internal EntityLinkingSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, string defaultLanguageCode, double? minimumPrecision, string modelVersion) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + DefaultLanguageCode = defaultLanguageCode; + MinimumPrecision = minimumPrecision; + ModelVersion = modelVersion; + } + + /// Initializes a new instance of for deserialization. + internal EntityLinkingSkill() + { + } + + /// A value indicating which language code to use. Default is `en`. + public string DefaultLanguageCode { get; set; } + /// + /// A value between 0 and 1 that be used to only include entities whose confidence + /// score is greater than the value specified. If not set (default), or if + /// explicitly set to null, all entities will be included. + /// + public double? MinimumPrecision { get; set; } + /// + /// The version of the model to use when calling the Text Analytics service. It + /// will default to the latest available when not specified. We recommend you do + /// not specify this value unless absolutely necessary. + /// + public string ModelVersion { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityRecognitionSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityRecognitionSkill.Serialization.cs new file mode 100644 index 000000000000..1ab1c9c7753f --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityRecognitionSkill.Serialization.cs @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class EntityRecognitionSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityRecognitionSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Categories)) + { + writer.WritePropertyName("categories"u8); + writer.WriteStartArray(); + foreach (var item in Categories) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DefaultLanguageCode)) + { + writer.WritePropertyName("defaultLanguageCode"u8); + writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + } + if (Optional.IsDefined(IncludeTypelessEntities)) + { + writer.WritePropertyName("includeTypelessEntities"u8); + writer.WriteBooleanValue(IncludeTypelessEntities.Value); + } + if (Optional.IsDefined(MinimumPrecision)) + { + writer.WritePropertyName("minimumPrecision"u8); + writer.WriteNumberValue(MinimumPrecision.Value); + } + } + + EntityRecognitionSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityRecognitionSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEntityRecognitionSkill(document.RootElement, options); + } + + internal static EntityRecognitionSkill DeserializeEntityRecognitionSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList categories = default; + EntityRecognitionSkillLanguage? defaultLanguageCode = default; + bool? includeTypelessEntities = default; + double? minimumPrecision = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("categories"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new EntityCategory(item.GetString())); + } + categories = array; + continue; + } + if (property.NameEquals("defaultLanguageCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultLanguageCode = new EntityRecognitionSkillLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("includeTypelessEntities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + includeTypelessEntities = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("minimumPrecision"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minimumPrecision = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EntityRecognitionSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + categories ?? new ChangeTrackingList(), + defaultLanguageCode, + includeTypelessEntities, + minimumPrecision); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EntityRecognitionSkill)} does not support writing '{options.Format}' format."); + } + } + + EntityRecognitionSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEntityRecognitionSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EntityRecognitionSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new EntityRecognitionSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEntityRecognitionSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityRecognitionSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityRecognitionSkill.cs new file mode 100644 index 000000000000..fe37f3cb7dc2 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityRecognitionSkill.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// This skill is deprecated. Use the V3.EntityRecognitionSkill instead. + public partial class EntityRecognitionSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public EntityRecognitionSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Text.EntityRecognitionSkill"; + Categories = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// A list of entity categories that should be extracted. + /// A value indicating which language code to use. Default is `en`. + /// + /// Determines whether or not to include entities which are well known but don't + /// conform to a pre-defined type. If this configuration is not set (default), set + /// to null or set to false, entities which don't conform to one of the pre-defined + /// types will not be surfaced. + /// + /// + /// A value between 0 and 1 that be used to only include entities whose confidence + /// score is greater than the value specified. If not set (default), or if + /// explicitly set to null, all entities will be included. + /// + internal EntityRecognitionSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, IList categories, EntityRecognitionSkillLanguage? defaultLanguageCode, bool? includeTypelessEntities, double? minimumPrecision) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + Categories = categories; + DefaultLanguageCode = defaultLanguageCode; + IncludeTypelessEntities = includeTypelessEntities; + MinimumPrecision = minimumPrecision; + } + + /// Initializes a new instance of for deserialization. + internal EntityRecognitionSkill() + { + } + + /// A list of entity categories that should be extracted. + public IList Categories { get; } + /// A value indicating which language code to use. Default is `en`. + public EntityRecognitionSkillLanguage? DefaultLanguageCode { get; set; } + /// + /// Determines whether or not to include entities which are well known but don't + /// conform to a pre-defined type. If this configuration is not set (default), set + /// to null or set to false, entities which don't conform to one of the pre-defined + /// types will not be surfaced. + /// + public bool? IncludeTypelessEntities { get; set; } + /// + /// A value between 0 and 1 that be used to only include entities whose confidence + /// score is greater than the value specified. If not set (default), or if + /// explicitly set to null, all entities will be included. + /// + public double? MinimumPrecision { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityRecognitionSkillLanguage.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityRecognitionSkillLanguage.cs new file mode 100644 index 000000000000..c65efc14e354 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityRecognitionSkillLanguage.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Deprecated. The language codes supported for input text by + /// EntityRecognitionSkill. + /// + public readonly partial struct EntityRecognitionSkillLanguage : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EntityRecognitionSkillLanguage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ArValue = "ar"; + private const string CsValue = "cs"; + private const string ZhHansValue = "zh-Hans"; + private const string ZhHantValue = "zh-Hant"; + private const string DaValue = "da"; + private const string NlValue = "nl"; + private const string EnValue = "en"; + private const string FiValue = "fi"; + private const string FrValue = "fr"; + private const string DeValue = "de"; + private const string ElValue = "el"; + private const string HuValue = "hu"; + private const string ItValue = "it"; + private const string JaValue = "ja"; + private const string KoValue = "ko"; + private const string NoValue = "no"; + private const string PlValue = "pl"; + private const string PtPTValue = "pt-PT"; + private const string PtBRValue = "pt-BR"; + private const string RuValue = "ru"; + private const string EsValue = "es"; + private const string SvValue = "sv"; + private const string TrValue = "tr"; + + /// Arabic. + public static EntityRecognitionSkillLanguage Ar { get; } = new EntityRecognitionSkillLanguage(ArValue); + /// Czech. + public static EntityRecognitionSkillLanguage Cs { get; } = new EntityRecognitionSkillLanguage(CsValue); + /// Chinese-Simplified. + public static EntityRecognitionSkillLanguage ZhHans { get; } = new EntityRecognitionSkillLanguage(ZhHansValue); + /// Chinese-Traditional. + public static EntityRecognitionSkillLanguage ZhHant { get; } = new EntityRecognitionSkillLanguage(ZhHantValue); + /// Danish. + public static EntityRecognitionSkillLanguage Da { get; } = new EntityRecognitionSkillLanguage(DaValue); + /// Dutch. + public static EntityRecognitionSkillLanguage Nl { get; } = new EntityRecognitionSkillLanguage(NlValue); + /// English. + public static EntityRecognitionSkillLanguage En { get; } = new EntityRecognitionSkillLanguage(EnValue); + /// Finnish. + public static EntityRecognitionSkillLanguage Fi { get; } = new EntityRecognitionSkillLanguage(FiValue); + /// French. + public static EntityRecognitionSkillLanguage Fr { get; } = new EntityRecognitionSkillLanguage(FrValue); + /// German. + public static EntityRecognitionSkillLanguage De { get; } = new EntityRecognitionSkillLanguage(DeValue); + /// Greek. + public static EntityRecognitionSkillLanguage El { get; } = new EntityRecognitionSkillLanguage(ElValue); + /// Hungarian. + public static EntityRecognitionSkillLanguage Hu { get; } = new EntityRecognitionSkillLanguage(HuValue); + /// Italian. + public static EntityRecognitionSkillLanguage It { get; } = new EntityRecognitionSkillLanguage(ItValue); + /// Japanese. + public static EntityRecognitionSkillLanguage Ja { get; } = new EntityRecognitionSkillLanguage(JaValue); + /// Korean. + public static EntityRecognitionSkillLanguage Ko { get; } = new EntityRecognitionSkillLanguage(KoValue); + /// Norwegian (Bokmaal). + public static EntityRecognitionSkillLanguage No { get; } = new EntityRecognitionSkillLanguage(NoValue); + /// Polish. + public static EntityRecognitionSkillLanguage Pl { get; } = new EntityRecognitionSkillLanguage(PlValue); + /// Portuguese (Portugal). + public static EntityRecognitionSkillLanguage PtPT { get; } = new EntityRecognitionSkillLanguage(PtPTValue); + /// Portuguese (Brazil). + public static EntityRecognitionSkillLanguage PtBR { get; } = new EntityRecognitionSkillLanguage(PtBRValue); + /// Russian. + public static EntityRecognitionSkillLanguage Ru { get; } = new EntityRecognitionSkillLanguage(RuValue); + /// Spanish. + public static EntityRecognitionSkillLanguage Es { get; } = new EntityRecognitionSkillLanguage(EsValue); + /// Swedish. + public static EntityRecognitionSkillLanguage Sv { get; } = new EntityRecognitionSkillLanguage(SvValue); + /// Turkish. + public static EntityRecognitionSkillLanguage Tr { get; } = new EntityRecognitionSkillLanguage(TrValue); + /// Determines if two values are the same. + public static bool operator ==(EntityRecognitionSkillLanguage left, EntityRecognitionSkillLanguage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EntityRecognitionSkillLanguage left, EntityRecognitionSkillLanguage right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EntityRecognitionSkillLanguage(string value) => new EntityRecognitionSkillLanguage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EntityRecognitionSkillLanguage other && Equals(other); + /// + public bool Equals(EntityRecognitionSkillLanguage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityRecognitionSkillV3.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityRecognitionSkillV3.Serialization.cs new file mode 100644 index 000000000000..6f2830b11555 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityRecognitionSkillV3.Serialization.cs @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class EntityRecognitionSkillV3 : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityRecognitionSkillV3)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Categories)) + { + writer.WritePropertyName("categories"u8); + writer.WriteStartArray(); + foreach (var item in Categories) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DefaultLanguageCode)) + { + writer.WritePropertyName("defaultLanguageCode"u8); + writer.WriteStringValue(DefaultLanguageCode); + } + if (Optional.IsDefined(MinimumPrecision)) + { + writer.WritePropertyName("minimumPrecision"u8); + writer.WriteNumberValue(MinimumPrecision.Value); + } + if (Optional.IsDefined(ModelVersion)) + { + writer.WritePropertyName("modelVersion"u8); + writer.WriteStringValue(ModelVersion); + } + } + + EntityRecognitionSkillV3 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityRecognitionSkillV3)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEntityRecognitionSkillV3(document.RootElement, options); + } + + internal static EntityRecognitionSkillV3 DeserializeEntityRecognitionSkillV3(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList categories = default; + string defaultLanguageCode = default; + double? minimumPrecision = default; + string modelVersion = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("categories"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + categories = array; + continue; + } + if (property.NameEquals("defaultLanguageCode"u8)) + { + defaultLanguageCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("minimumPrecision"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minimumPrecision = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("modelVersion"u8)) + { + modelVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EntityRecognitionSkillV3( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + categories ?? new ChangeTrackingList(), + defaultLanguageCode, + minimumPrecision, + modelVersion); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EntityRecognitionSkillV3)} does not support writing '{options.Format}' format."); + } + } + + EntityRecognitionSkillV3 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEntityRecognitionSkillV3(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EntityRecognitionSkillV3)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new EntityRecognitionSkillV3 FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEntityRecognitionSkillV3(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityRecognitionSkillV3.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityRecognitionSkillV3.cs new file mode 100644 index 000000000000..8493caa0e088 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/EntityRecognitionSkillV3.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Using the Text Analytics API, extracts entities of different types from text. + public partial class EntityRecognitionSkillV3 : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public EntityRecognitionSkillV3(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Text.V3.EntityRecognitionSkill"; + Categories = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// A list of entity categories that should be extracted. + /// A value indicating which language code to use. Default is `en`. + /// + /// A value between 0 and 1 that be used to only include entities whose confidence + /// score is greater than the value specified. If not set (default), or if + /// explicitly set to null, all entities will be included. + /// + /// + /// The version of the model to use when calling the Text Analytics API. It will + /// default to the latest available when not specified. We recommend you do not + /// specify this value unless absolutely necessary. + /// + internal EntityRecognitionSkillV3(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, IList categories, string defaultLanguageCode, double? minimumPrecision, string modelVersion) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + Categories = categories; + DefaultLanguageCode = defaultLanguageCode; + MinimumPrecision = minimumPrecision; + ModelVersion = modelVersion; + } + + /// Initializes a new instance of for deserialization. + internal EntityRecognitionSkillV3() + { + } + + /// A list of entity categories that should be extracted. + public IList Categories { get; } + /// A value indicating which language code to use. Default is `en`. + public string DefaultLanguageCode { get; set; } + /// + /// A value between 0 and 1 that be used to only include entities whose confidence + /// score is greater than the value specified. If not set (default), or if + /// explicitly set to null, all entities will be included. + /// + public double? MinimumPrecision { get; set; } + /// + /// The version of the model to use when calling the Text Analytics API. It will + /// default to the latest available when not specified. We recommend you do not + /// specify this value unless absolutely necessary. + /// + public string ModelVersion { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ExhaustiveKnnAlgorithmConfiguration.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ExhaustiveKnnAlgorithmConfiguration.Serialization.cs new file mode 100644 index 000000000000..b58f66c63697 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ExhaustiveKnnAlgorithmConfiguration.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ExhaustiveKnnAlgorithmConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExhaustiveKnnAlgorithmConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(ExhaustiveKnnParameters)) + { + writer.WritePropertyName("exhaustiveKnnParameters"u8); + writer.WriteObjectValue(ExhaustiveKnnParameters, options); + } + } + + ExhaustiveKnnAlgorithmConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExhaustiveKnnAlgorithmConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExhaustiveKnnAlgorithmConfiguration(document.RootElement, options); + } + + internal static ExhaustiveKnnAlgorithmConfiguration DeserializeExhaustiveKnnAlgorithmConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExhaustiveKnnParameters exhaustiveKnnParameters = default; + string name = default; + VectorSearchAlgorithmKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("exhaustiveKnnParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exhaustiveKnnParameters = ExhaustiveKnnParameters.DeserializeExhaustiveKnnParameters(property.Value, options); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new VectorSearchAlgorithmKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExhaustiveKnnAlgorithmConfiguration(name, kind, serializedAdditionalRawData, exhaustiveKnnParameters); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExhaustiveKnnAlgorithmConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ExhaustiveKnnAlgorithmConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExhaustiveKnnAlgorithmConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExhaustiveKnnAlgorithmConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ExhaustiveKnnAlgorithmConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExhaustiveKnnAlgorithmConfiguration(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ExhaustiveKnnAlgorithmConfiguration.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ExhaustiveKnnAlgorithmConfiguration.cs new file mode 100644 index 000000000000..033740910b11 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ExhaustiveKnnAlgorithmConfiguration.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Contains configuration options specific to the exhaustive KNN algorithm used + /// during querying, which will perform brute-force search across the entire vector + /// index. + /// + public partial class ExhaustiveKnnAlgorithmConfiguration : VectorSearchAlgorithmConfiguration + { + /// Initializes a new instance of . + /// The name to associate with this particular configuration. + /// is null. + public ExhaustiveKnnAlgorithmConfiguration(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + Kind = VectorSearchAlgorithmKind.ExhaustiveKnn; + } + + /// Initializes a new instance of . + /// The name to associate with this particular configuration. + /// Type of VectorSearchAlgorithmConfiguration. + /// Keeps track of any properties unknown to the library. + /// Contains the parameters specific to exhaustive KNN algorithm. + internal ExhaustiveKnnAlgorithmConfiguration(string name, VectorSearchAlgorithmKind kind, IDictionary serializedAdditionalRawData, ExhaustiveKnnParameters exhaustiveKnnParameters) : base(name, kind, serializedAdditionalRawData) + { + ExhaustiveKnnParameters = exhaustiveKnnParameters; + } + + /// Initializes a new instance of for deserialization. + internal ExhaustiveKnnAlgorithmConfiguration() + { + } + + /// Contains the parameters specific to exhaustive KNN algorithm. + public ExhaustiveKnnParameters ExhaustiveKnnParameters { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ExhaustiveKnnParameters.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ExhaustiveKnnParameters.Serialization.cs new file mode 100644 index 000000000000..ac1df384ec79 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ExhaustiveKnnParameters.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ExhaustiveKnnParameters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExhaustiveKnnParameters)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Metric)) + { + writer.WritePropertyName("metric"u8); + writer.WriteStringValue(Metric.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExhaustiveKnnParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExhaustiveKnnParameters)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExhaustiveKnnParameters(document.RootElement, options); + } + + internal static ExhaustiveKnnParameters DeserializeExhaustiveKnnParameters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + VectorSearchAlgorithmMetric? metric = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("metric"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metric = new VectorSearchAlgorithmMetric(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExhaustiveKnnParameters(metric, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExhaustiveKnnParameters)} does not support writing '{options.Format}' format."); + } + } + + ExhaustiveKnnParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExhaustiveKnnParameters(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExhaustiveKnnParameters)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExhaustiveKnnParameters FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExhaustiveKnnParameters(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ExhaustiveKnnParameters.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ExhaustiveKnnParameters.cs new file mode 100644 index 000000000000..2df5852e0a8d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ExhaustiveKnnParameters.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Contains the parameters specific to exhaustive KNN algorithm. + public partial class ExhaustiveKnnParameters + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExhaustiveKnnParameters() + { + } + + /// Initializes a new instance of . + /// The similarity metric to use for vector comparisons. + /// Keeps track of any properties unknown to the library. + internal ExhaustiveKnnParameters(VectorSearchAlgorithmMetric? metric, IDictionary serializedAdditionalRawData) + { + Metric = metric; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The similarity metric to use for vector comparisons. + public VectorSearchAlgorithmMetric? Metric { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FieldMapping.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FieldMapping.Serialization.cs new file mode 100644 index 000000000000..97c0d9dca38e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FieldMapping.Serialization.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class FieldMapping : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FieldMapping)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("sourceFieldName"u8); + writer.WriteStringValue(SourceFieldName); + if (Optional.IsDefined(TargetFieldName)) + { + writer.WritePropertyName("targetFieldName"u8); + writer.WriteStringValue(TargetFieldName); + } + if (Optional.IsDefined(MappingFunction)) + { + writer.WritePropertyName("mappingFunction"u8); + writer.WriteObjectValue(MappingFunction, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FieldMapping IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FieldMapping)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFieldMapping(document.RootElement, options); + } + + internal static FieldMapping DeserializeFieldMapping(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string sourceFieldName = default; + string targetFieldName = default; + FieldMappingFunction mappingFunction = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceFieldName"u8)) + { + sourceFieldName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFieldName"u8)) + { + targetFieldName = property.Value.GetString(); + continue; + } + if (property.NameEquals("mappingFunction"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mappingFunction = FieldMappingFunction.DeserializeFieldMappingFunction(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FieldMapping(sourceFieldName, targetFieldName, mappingFunction, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FieldMapping)} does not support writing '{options.Format}' format."); + } + } + + FieldMapping IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFieldMapping(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FieldMapping)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FieldMapping FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFieldMapping(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FieldMapping.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FieldMapping.cs new file mode 100644 index 000000000000..bded5da06f47 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FieldMapping.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Defines a mapping between a field in a data source and a target field in an + /// index. + /// + public partial class FieldMapping + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the field in the data source. + /// is null. + public FieldMapping(string sourceFieldName) + { + Argument.AssertNotNull(sourceFieldName, nameof(sourceFieldName)); + + SourceFieldName = sourceFieldName; + } + + /// Initializes a new instance of . + /// The name of the field in the data source. + /// + /// The name of the target field in the index. Same as the source field name by + /// default. + /// + /// A function to apply to each source field value before indexing. + /// Keeps track of any properties unknown to the library. + internal FieldMapping(string sourceFieldName, string targetFieldName, FieldMappingFunction mappingFunction, IDictionary serializedAdditionalRawData) + { + SourceFieldName = sourceFieldName; + TargetFieldName = targetFieldName; + MappingFunction = mappingFunction; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FieldMapping() + { + } + + /// The name of the field in the data source. + public string SourceFieldName { get; set; } + /// + /// The name of the target field in the index. Same as the source field name by + /// default. + /// + public string TargetFieldName { get; set; } + /// A function to apply to each source field value before indexing. + public FieldMappingFunction MappingFunction { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FieldMappingFunction.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FieldMappingFunction.Serialization.cs new file mode 100644 index 000000000000..6e13a3e7883b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FieldMappingFunction.Serialization.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class FieldMappingFunction : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FieldMappingFunction)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsCollectionDefined(Parameters)) + { + writer.WritePropertyName("parameters"u8); + writer.WriteStartObject(); + foreach (var item in Parameters) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FieldMappingFunction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FieldMappingFunction)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFieldMappingFunction(document.RootElement, options); + } + + internal static FieldMappingFunction DeserializeFieldMappingFunction(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IDictionary parameters = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("parameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + } + } + parameters = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FieldMappingFunction(name, parameters ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FieldMappingFunction)} does not support writing '{options.Format}' format."); + } + } + + FieldMappingFunction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFieldMappingFunction(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FieldMappingFunction)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FieldMappingFunction FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFieldMappingFunction(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FieldMappingFunction.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FieldMappingFunction.cs new file mode 100644 index 000000000000..6d68c9a2faf0 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FieldMappingFunction.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Represents a function that transforms a value from a data source before + /// indexing. + /// + public partial class FieldMappingFunction + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the field mapping function. + /// is null. + public FieldMappingFunction(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + Parameters = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The name of the field mapping function. + /// + /// A dictionary of parameter name/value pairs to pass to the function. Each value + /// must be of a primitive type. + /// + /// Keeps track of any properties unknown to the library. + internal FieldMappingFunction(string name, IDictionary parameters, IDictionary serializedAdditionalRawData) + { + Name = name; + Parameters = parameters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FieldMappingFunction() + { + } + + /// The name of the field mapping function. + public string Name { get; set; } + /// + /// A dictionary of parameter name/value pairs to pass to the function. Each value + /// must be of a primitive type. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary Parameters { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FreshnessScoringFunction.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FreshnessScoringFunction.Serialization.cs new file mode 100644 index 000000000000..dd705625e0fc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FreshnessScoringFunction.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class FreshnessScoringFunction : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FreshnessScoringFunction)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("freshness"u8); + writer.WriteObjectValue(Freshness, options); + } + + FreshnessScoringFunction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FreshnessScoringFunction)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFreshnessScoringFunction(document.RootElement, options); + } + + internal static FreshnessScoringFunction DeserializeFreshnessScoringFunction(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FreshnessScoringParameters freshness = default; + string fieldName = default; + double boost = default; + ScoringFunctionInterpolation? interpolation = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("freshness"u8)) + { + freshness = FreshnessScoringParameters.DeserializeFreshnessScoringParameters(property.Value, options); + continue; + } + if (property.NameEquals("fieldName"u8)) + { + fieldName = property.Value.GetString(); + continue; + } + if (property.NameEquals("boost"u8)) + { + boost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("interpolation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + interpolation = new ScoringFunctionInterpolation(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FreshnessScoringFunction( + fieldName, + boost, + interpolation, + type, + serializedAdditionalRawData, + freshness); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FreshnessScoringFunction)} does not support writing '{options.Format}' format."); + } + } + + FreshnessScoringFunction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFreshnessScoringFunction(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FreshnessScoringFunction)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new FreshnessScoringFunction FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFreshnessScoringFunction(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FreshnessScoringFunction.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FreshnessScoringFunction.cs new file mode 100644 index 000000000000..bd9988bdd81f --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FreshnessScoringFunction.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Defines a function that boosts scores based on the value of a date-time field. + public partial class FreshnessScoringFunction : ScoringFunction + { + /// Initializes a new instance of . + /// The name of the field used as input to the scoring function. + /// A multiplier for the raw score. Must be a positive number not equal to 1.0. + /// Parameter values for the freshness scoring function. + /// or is null. + public FreshnessScoringFunction(string fieldName, double boost, FreshnessScoringParameters freshness) : base(fieldName, boost) + { + Argument.AssertNotNull(fieldName, nameof(fieldName)); + Argument.AssertNotNull(freshness, nameof(freshness)); + + Type = "freshness"; + Freshness = freshness; + } + + /// Initializes a new instance of . + /// The name of the field used as input to the scoring function. + /// A multiplier for the raw score. Must be a positive number not equal to 1.0. + /// + /// A value indicating how boosting will be interpolated across document scores; + /// defaults to "Linear". + /// + /// Type of ScoringFunction. + /// Keeps track of any properties unknown to the library. + /// Parameter values for the freshness scoring function. + internal FreshnessScoringFunction(string fieldName, double boost, ScoringFunctionInterpolation? interpolation, string type, IDictionary serializedAdditionalRawData, FreshnessScoringParameters freshness) : base(fieldName, boost, interpolation, type, serializedAdditionalRawData) + { + Freshness = freshness; + } + + /// Initializes a new instance of for deserialization. + internal FreshnessScoringFunction() + { + } + + /// Parameter values for the freshness scoring function. + public FreshnessScoringParameters Freshness { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FreshnessScoringParameters.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FreshnessScoringParameters.Serialization.cs new file mode 100644 index 000000000000..346da284121b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FreshnessScoringParameters.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class FreshnessScoringParameters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FreshnessScoringParameters)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("boostingDuration"u8); + writer.WriteStringValue(BoostingDuration, "P"); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FreshnessScoringParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FreshnessScoringParameters)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFreshnessScoringParameters(document.RootElement, options); + } + + internal static FreshnessScoringParameters DeserializeFreshnessScoringParameters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TimeSpan boostingDuration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("boostingDuration"u8)) + { + boostingDuration = property.Value.GetTimeSpan("P"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FreshnessScoringParameters(boostingDuration, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FreshnessScoringParameters)} does not support writing '{options.Format}' format."); + } + } + + FreshnessScoringParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFreshnessScoringParameters(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FreshnessScoringParameters)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FreshnessScoringParameters FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFreshnessScoringParameters(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FreshnessScoringParameters.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FreshnessScoringParameters.cs new file mode 100644 index 000000000000..915998750068 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/FreshnessScoringParameters.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Provides parameter values to a freshness scoring function. + public partial class FreshnessScoringParameters + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The expiration period after which boosting will stop for a particular document. + public FreshnessScoringParameters(TimeSpan boostingDuration) + { + BoostingDuration = boostingDuration; + } + + /// Initializes a new instance of . + /// The expiration period after which boosting will stop for a particular document. + /// Keeps track of any properties unknown to the library. + internal FreshnessScoringParameters(TimeSpan boostingDuration, IDictionary serializedAdditionalRawData) + { + BoostingDuration = boostingDuration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FreshnessScoringParameters() + { + } + + /// The expiration period after which boosting will stop for a particular document. + public TimeSpan BoostingDuration { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/GetIndexStatisticsResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/GetIndexStatisticsResult.Serialization.cs new file mode 100644 index 000000000000..0b51869f1cae --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/GetIndexStatisticsResult.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class GetIndexStatisticsResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetIndexStatisticsResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("documentCount"u8); + writer.WriteNumberValue(DocumentCount); + writer.WritePropertyName("storageSize"u8); + writer.WriteNumberValue(StorageSize); + writer.WritePropertyName("vectorIndexSize"u8); + writer.WriteNumberValue(VectorIndexSize); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GetIndexStatisticsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetIndexStatisticsResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetIndexStatisticsResult(document.RootElement, options); + } + + internal static GetIndexStatisticsResult DeserializeGetIndexStatisticsResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long documentCount = default; + long storageSize = default; + long vectorIndexSize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("documentCount"u8)) + { + documentCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("storageSize"u8)) + { + storageSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("vectorIndexSize"u8)) + { + vectorIndexSize = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetIndexStatisticsResult(documentCount, storageSize, vectorIndexSize, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetIndexStatisticsResult)} does not support writing '{options.Format}' format."); + } + } + + GetIndexStatisticsResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGetIndexStatisticsResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetIndexStatisticsResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetIndexStatisticsResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGetIndexStatisticsResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/GetIndexStatisticsResult.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/GetIndexStatisticsResult.cs new file mode 100644 index 000000000000..2fa5ab1600bc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/GetIndexStatisticsResult.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Statistics for a given index. Statistics are collected periodically and are not + /// guaranteed to always be up-to-date. + /// + public partial class GetIndexStatisticsResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The number of documents in the index. + /// The amount of storage in bytes consumed by the index. + /// The amount of memory in bytes consumed by vectors in the index. + internal GetIndexStatisticsResult(long documentCount, long storageSize, long vectorIndexSize) + { + DocumentCount = documentCount; + StorageSize = storageSize; + VectorIndexSize = vectorIndexSize; + } + + /// Initializes a new instance of . + /// The number of documents in the index. + /// The amount of storage in bytes consumed by the index. + /// The amount of memory in bytes consumed by vectors in the index. + /// Keeps track of any properties unknown to the library. + internal GetIndexStatisticsResult(long documentCount, long storageSize, long vectorIndexSize, IDictionary serializedAdditionalRawData) + { + DocumentCount = documentCount; + StorageSize = storageSize; + VectorIndexSize = vectorIndexSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetIndexStatisticsResult() + { + } + + /// The number of documents in the index. + public long DocumentCount { get; } + /// The amount of storage in bytes consumed by the index. + public long StorageSize { get; } + /// The amount of memory in bytes consumed by vectors in the index. + public long VectorIndexSize { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HighWaterMarkChangeDetectionPolicy.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HighWaterMarkChangeDetectionPolicy.Serialization.cs new file mode 100644 index 000000000000..b7d2166975a7 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HighWaterMarkChangeDetectionPolicy.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class HighWaterMarkChangeDetectionPolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HighWaterMarkChangeDetectionPolicy)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("highWaterMarkColumnName"u8); + writer.WriteStringValue(HighWaterMarkColumnName); + } + + HighWaterMarkChangeDetectionPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HighWaterMarkChangeDetectionPolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHighWaterMarkChangeDetectionPolicy(document.RootElement, options); + } + + internal static HighWaterMarkChangeDetectionPolicy DeserializeHighWaterMarkChangeDetectionPolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string highWaterMarkColumnName = default; + string odataType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("highWaterMarkColumnName"u8)) + { + highWaterMarkColumnName = property.Value.GetString(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HighWaterMarkChangeDetectionPolicy(odataType, serializedAdditionalRawData, highWaterMarkColumnName); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HighWaterMarkChangeDetectionPolicy)} does not support writing '{options.Format}' format."); + } + } + + HighWaterMarkChangeDetectionPolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHighWaterMarkChangeDetectionPolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HighWaterMarkChangeDetectionPolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new HighWaterMarkChangeDetectionPolicy FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHighWaterMarkChangeDetectionPolicy(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HighWaterMarkChangeDetectionPolicy.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HighWaterMarkChangeDetectionPolicy.cs new file mode 100644 index 000000000000..93133305498f --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HighWaterMarkChangeDetectionPolicy.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Defines a data change detection policy that captures changes based on the value + /// of a high water mark column. + /// + public partial class HighWaterMarkChangeDetectionPolicy : DataChangeDetectionPolicy + { + /// Initializes a new instance of . + /// The name of the high water mark column. + /// is null. + public HighWaterMarkChangeDetectionPolicy(string highWaterMarkColumnName) + { + Argument.AssertNotNull(highWaterMarkColumnName, nameof(highWaterMarkColumnName)); + + OdataType = "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy"; + HighWaterMarkColumnName = highWaterMarkColumnName; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// Keeps track of any properties unknown to the library. + /// The name of the high water mark column. + internal HighWaterMarkChangeDetectionPolicy(string odataType, IDictionary serializedAdditionalRawData, string highWaterMarkColumnName) : base(odataType, serializedAdditionalRawData) + { + HighWaterMarkColumnName = highWaterMarkColumnName; + } + + /// Initializes a new instance of for deserialization. + internal HighWaterMarkChangeDetectionPolicy() + { + } + + /// The name of the high water mark column. + public string HighWaterMarkColumnName { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HnswAlgorithmConfiguration.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HnswAlgorithmConfiguration.Serialization.cs new file mode 100644 index 000000000000..af158851cd50 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HnswAlgorithmConfiguration.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class HnswAlgorithmConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HnswAlgorithmConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(HnswParameters)) + { + writer.WritePropertyName("hnswParameters"u8); + writer.WriteObjectValue(HnswParameters, options); + } + } + + HnswAlgorithmConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HnswAlgorithmConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHnswAlgorithmConfiguration(document.RootElement, options); + } + + internal static HnswAlgorithmConfiguration DeserializeHnswAlgorithmConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HnswParameters hnswParameters = default; + string name = default; + VectorSearchAlgorithmKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hnswParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hnswParameters = HnswParameters.DeserializeHnswParameters(property.Value, options); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new VectorSearchAlgorithmKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HnswAlgorithmConfiguration(name, kind, serializedAdditionalRawData, hnswParameters); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HnswAlgorithmConfiguration)} does not support writing '{options.Format}' format."); + } + } + + HnswAlgorithmConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHnswAlgorithmConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HnswAlgorithmConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new HnswAlgorithmConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHnswAlgorithmConfiguration(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HnswAlgorithmConfiguration.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HnswAlgorithmConfiguration.cs new file mode 100644 index 000000000000..4279b1071e72 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HnswAlgorithmConfiguration.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Contains configuration options specific to the HNSW approximate nearest + /// neighbors algorithm used during indexing and querying. The HNSW algorithm + /// offers a tunable trade-off between search speed and accuracy. + /// + public partial class HnswAlgorithmConfiguration : VectorSearchAlgorithmConfiguration + { + /// Initializes a new instance of . + /// The name to associate with this particular configuration. + /// is null. + public HnswAlgorithmConfiguration(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + Kind = VectorSearchAlgorithmKind.Hnsw; + } + + /// Initializes a new instance of . + /// The name to associate with this particular configuration. + /// Type of VectorSearchAlgorithmConfiguration. + /// Keeps track of any properties unknown to the library. + /// Contains the parameters specific to HNSW algorithm. + internal HnswAlgorithmConfiguration(string name, VectorSearchAlgorithmKind kind, IDictionary serializedAdditionalRawData, HnswParameters hnswParameters) : base(name, kind, serializedAdditionalRawData) + { + HnswParameters = hnswParameters; + } + + /// Initializes a new instance of for deserialization. + internal HnswAlgorithmConfiguration() + { + } + + /// Contains the parameters specific to HNSW algorithm. + public HnswParameters HnswParameters { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HnswParameters.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HnswParameters.Serialization.cs new file mode 100644 index 000000000000..7c22c079b62e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HnswParameters.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class HnswParameters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HnswParameters)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(M)) + { + writer.WritePropertyName("m"u8); + writer.WriteNumberValue(M.Value); + } + if (Optional.IsDefined(EfConstruction)) + { + writer.WritePropertyName("efConstruction"u8); + writer.WriteNumberValue(EfConstruction.Value); + } + if (Optional.IsDefined(EfSearch)) + { + writer.WritePropertyName("efSearch"u8); + writer.WriteNumberValue(EfSearch.Value); + } + if (Optional.IsDefined(Metric)) + { + writer.WritePropertyName("metric"u8); + writer.WriteStringValue(Metric.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HnswParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HnswParameters)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHnswParameters(document.RootElement, options); + } + + internal static HnswParameters DeserializeHnswParameters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? m = default; + int? efConstruction = default; + int? efSearch = default; + VectorSearchAlgorithmMetric? metric = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("m"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + m = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("efConstruction"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + efConstruction = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("efSearch"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + efSearch = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("metric"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metric = new VectorSearchAlgorithmMetric(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HnswParameters(m, efConstruction, efSearch, metric, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HnswParameters)} does not support writing '{options.Format}' format."); + } + } + + HnswParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHnswParameters(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HnswParameters)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static HnswParameters FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHnswParameters(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HnswParameters.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HnswParameters.cs new file mode 100644 index 000000000000..bfeb5753a9e7 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/HnswParameters.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Contains the parameters specific to the HNSW algorithm. + public partial class HnswParameters + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public HnswParameters() + { + } + + /// Initializes a new instance of . + /// + /// The number of bi-directional links created for every new element during + /// construction. Increasing this parameter value may improve recall and reduce + /// retrieval times for datasets with high intrinsic dimensionality at the expense + /// of increased memory consumption and longer indexing time. + /// + /// + /// The size of the dynamic list containing the nearest neighbors, which is used + /// during index time. Increasing this parameter may improve index quality, at the + /// expense of increased indexing time. At a certain point, increasing this + /// parameter leads to diminishing returns. + /// + /// + /// The size of the dynamic list containing the nearest neighbors, which is used + /// during search time. Increasing this parameter may improve search results, at + /// the expense of slower search. At a certain point, increasing this parameter + /// leads to diminishing returns. + /// + /// The similarity metric to use for vector comparisons. + /// Keeps track of any properties unknown to the library. + internal HnswParameters(int? m, int? efConstruction, int? efSearch, VectorSearchAlgorithmMetric? metric, IDictionary serializedAdditionalRawData) + { + M = m; + EfConstruction = efConstruction; + EfSearch = efSearch; + Metric = metric; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The number of bi-directional links created for every new element during + /// construction. Increasing this parameter value may improve recall and reduce + /// retrieval times for datasets with high intrinsic dimensionality at the expense + /// of increased memory consumption and longer indexing time. + /// + public int? M { get; set; } + /// + /// The size of the dynamic list containing the nearest neighbors, which is used + /// during index time. Increasing this parameter may improve index quality, at the + /// expense of increased indexing time. At a certain point, increasing this + /// parameter leads to diminishing returns. + /// + public int? EfConstruction { get; set; } + /// + /// The size of the dynamic list containing the nearest neighbors, which is used + /// during search time. Increasing this parameter may improve search results, at + /// the expense of slower search. At a certain point, increasing this parameter + /// leads to diminishing returns. + /// + public int? EfSearch { get; set; } + /// The similarity metric to use for vector comparisons. + public VectorSearchAlgorithmMetric? Metric { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ImageAnalysisSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ImageAnalysisSkill.Serialization.cs new file mode 100644 index 000000000000..fee47d10538b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ImageAnalysisSkill.Serialization.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ImageAnalysisSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageAnalysisSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(DefaultLanguageCode)) + { + writer.WritePropertyName("defaultLanguageCode"u8); + writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + } + if (Optional.IsCollectionDefined(VisualFeatures)) + { + writer.WritePropertyName("visualFeatures"u8); + writer.WriteStartArray(); + foreach (var item in VisualFeatures) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteStartArray(); + foreach (var item in Details) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + } + + ImageAnalysisSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageAnalysisSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImageAnalysisSkill(document.RootElement, options); + } + + internal static ImageAnalysisSkill DeserializeImageAnalysisSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ImageAnalysisSkillLanguage? defaultLanguageCode = default; + IList visualFeatures = default; + IList details = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("defaultLanguageCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultLanguageCode = new ImageAnalysisSkillLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("visualFeatures"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new VisualFeature(item.GetString())); + } + visualFeatures = array; + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new ImageDetail(item.GetString())); + } + details = array; + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImageAnalysisSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + defaultLanguageCode, + visualFeatures ?? new ChangeTrackingList(), + details ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImageAnalysisSkill)} does not support writing '{options.Format}' format."); + } + } + + ImageAnalysisSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeImageAnalysisSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImageAnalysisSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ImageAnalysisSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeImageAnalysisSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ImageAnalysisSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ImageAnalysisSkill.cs new file mode 100644 index 000000000000..35e1d4bd8136 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ImageAnalysisSkill.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// A skill that analyzes image files. It extracts a rich set of visual features + /// based on the image content. + /// + public partial class ImageAnalysisSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public ImageAnalysisSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Vision.ImageAnalysisSkill"; + VisualFeatures = new ChangeTrackingList(); + Details = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// A value indicating which language code to use. Default is `en`. + /// A list of visual features. + /// A string indicating which domain-specific details to return. + internal ImageAnalysisSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, ImageAnalysisSkillLanguage? defaultLanguageCode, IList visualFeatures, IList details) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + DefaultLanguageCode = defaultLanguageCode; + VisualFeatures = visualFeatures; + Details = details; + } + + /// Initializes a new instance of for deserialization. + internal ImageAnalysisSkill() + { + } + + /// A value indicating which language code to use. Default is `en`. + public ImageAnalysisSkillLanguage? DefaultLanguageCode { get; set; } + /// A list of visual features. + public IList VisualFeatures { get; } + /// A string indicating which domain-specific details to return. + public IList Details { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ImageAnalysisSkillLanguage.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ImageAnalysisSkillLanguage.cs new file mode 100644 index 000000000000..0a137123b196 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ImageAnalysisSkillLanguage.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// The language codes supported for input by ImageAnalysisSkill. + public readonly partial struct ImageAnalysisSkillLanguage : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ImageAnalysisSkillLanguage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ArValue = "ar"; + private const string AzValue = "az"; + private const string BgValue = "bg"; + private const string BsValue = "bs"; + private const string CaValue = "ca"; + private const string CsValue = "cs"; + private const string CyValue = "cy"; + private const string DaValue = "da"; + private const string DeValue = "de"; + private const string ElValue = "el"; + private const string EnValue = "en"; + private const string EsValue = "es"; + private const string EtValue = "et"; + private const string EuValue = "eu"; + private const string FiValue = "fi"; + private const string FrValue = "fr"; + private const string GaValue = "ga"; + private const string GlValue = "gl"; + private const string HeValue = "he"; + private const string HiValue = "hi"; + private const string HrValue = "hr"; + private const string HuValue = "hu"; + private const string IdValue = "id"; + private const string ItValue = "it"; + private const string JaValue = "ja"; + private const string KkValue = "kk"; + private const string KoValue = "ko"; + private const string LtValue = "lt"; + private const string LvValue = "lv"; + private const string MkValue = "mk"; + private const string MsValue = "ms"; + private const string NbValue = "nb"; + private const string NlValue = "nl"; + private const string PlValue = "pl"; + private const string PrsValue = "prs"; + private const string PtBRValue = "pt-BR"; + private const string PtValue = "pt"; + private const string PtPTValue = "pt-PT"; + private const string RoValue = "ro"; + private const string RuValue = "ru"; + private const string SkValue = "sk"; + private const string SlValue = "sl"; + private const string SrCyrlValue = "sr-Cyrl"; + private const string SrLatnValue = "sr-Latn"; + private const string SvValue = "sv"; + private const string ThValue = "th"; + private const string TrValue = "tr"; + private const string UkValue = "uk"; + private const string ViValue = "vi"; + private const string ZhValue = "zh"; + private const string ZhHansValue = "zh-Hans"; + private const string ZhHantValue = "zh-Hant"; + + /// Arabic. + public static ImageAnalysisSkillLanguage Ar { get; } = new ImageAnalysisSkillLanguage(ArValue); + /// Azerbaijani. + public static ImageAnalysisSkillLanguage Az { get; } = new ImageAnalysisSkillLanguage(AzValue); + /// Bulgarian. + public static ImageAnalysisSkillLanguage Bg { get; } = new ImageAnalysisSkillLanguage(BgValue); + /// Bosnian Latin. + public static ImageAnalysisSkillLanguage Bs { get; } = new ImageAnalysisSkillLanguage(BsValue); + /// Catalan. + public static ImageAnalysisSkillLanguage Ca { get; } = new ImageAnalysisSkillLanguage(CaValue); + /// Czech. + public static ImageAnalysisSkillLanguage Cs { get; } = new ImageAnalysisSkillLanguage(CsValue); + /// Welsh. + public static ImageAnalysisSkillLanguage Cy { get; } = new ImageAnalysisSkillLanguage(CyValue); + /// Danish. + public static ImageAnalysisSkillLanguage Da { get; } = new ImageAnalysisSkillLanguage(DaValue); + /// German. + public static ImageAnalysisSkillLanguage De { get; } = new ImageAnalysisSkillLanguage(DeValue); + /// Greek. + public static ImageAnalysisSkillLanguage El { get; } = new ImageAnalysisSkillLanguage(ElValue); + /// English. + public static ImageAnalysisSkillLanguage En { get; } = new ImageAnalysisSkillLanguage(EnValue); + /// Spanish. + public static ImageAnalysisSkillLanguage Es { get; } = new ImageAnalysisSkillLanguage(EsValue); + /// Estonian. + public static ImageAnalysisSkillLanguage Et { get; } = new ImageAnalysisSkillLanguage(EtValue); + /// Basque. + public static ImageAnalysisSkillLanguage Eu { get; } = new ImageAnalysisSkillLanguage(EuValue); + /// Finnish. + public static ImageAnalysisSkillLanguage Fi { get; } = new ImageAnalysisSkillLanguage(FiValue); + /// French. + public static ImageAnalysisSkillLanguage Fr { get; } = new ImageAnalysisSkillLanguage(FrValue); + /// Irish. + public static ImageAnalysisSkillLanguage Ga { get; } = new ImageAnalysisSkillLanguage(GaValue); + /// Galician. + public static ImageAnalysisSkillLanguage Gl { get; } = new ImageAnalysisSkillLanguage(GlValue); + /// Hebrew. + public static ImageAnalysisSkillLanguage He { get; } = new ImageAnalysisSkillLanguage(HeValue); + /// Hindi. + public static ImageAnalysisSkillLanguage Hi { get; } = new ImageAnalysisSkillLanguage(HiValue); + /// Croatian. + public static ImageAnalysisSkillLanguage Hr { get; } = new ImageAnalysisSkillLanguage(HrValue); + /// Hungarian. + public static ImageAnalysisSkillLanguage Hu { get; } = new ImageAnalysisSkillLanguage(HuValue); + /// Indonesian. + public static ImageAnalysisSkillLanguage Id { get; } = new ImageAnalysisSkillLanguage(IdValue); + /// Italian. + public static ImageAnalysisSkillLanguage It { get; } = new ImageAnalysisSkillLanguage(ItValue); + /// Japanese. + public static ImageAnalysisSkillLanguage Ja { get; } = new ImageAnalysisSkillLanguage(JaValue); + /// Kazakh. + public static ImageAnalysisSkillLanguage Kk { get; } = new ImageAnalysisSkillLanguage(KkValue); + /// Korean. + public static ImageAnalysisSkillLanguage Ko { get; } = new ImageAnalysisSkillLanguage(KoValue); + /// Lithuanian. + public static ImageAnalysisSkillLanguage Lt { get; } = new ImageAnalysisSkillLanguage(LtValue); + /// Latvian. + public static ImageAnalysisSkillLanguage Lv { get; } = new ImageAnalysisSkillLanguage(LvValue); + /// Macedonian. + public static ImageAnalysisSkillLanguage Mk { get; } = new ImageAnalysisSkillLanguage(MkValue); + /// Malay Malaysia. + public static ImageAnalysisSkillLanguage Ms { get; } = new ImageAnalysisSkillLanguage(MsValue); + /// Norwegian (Bokmal). + public static ImageAnalysisSkillLanguage Nb { get; } = new ImageAnalysisSkillLanguage(NbValue); + /// Dutch. + public static ImageAnalysisSkillLanguage Nl { get; } = new ImageAnalysisSkillLanguage(NlValue); + /// Polish. + public static ImageAnalysisSkillLanguage Pl { get; } = new ImageAnalysisSkillLanguage(PlValue); + /// Dari. + public static ImageAnalysisSkillLanguage Prs { get; } = new ImageAnalysisSkillLanguage(PrsValue); + /// Portuguese-Brazil. + public static ImageAnalysisSkillLanguage PtBR { get; } = new ImageAnalysisSkillLanguage(PtBRValue); + /// Portuguese-Portugal. + public static ImageAnalysisSkillLanguage Pt { get; } = new ImageAnalysisSkillLanguage(PtValue); + /// Portuguese-Portugal. + public static ImageAnalysisSkillLanguage PtPT { get; } = new ImageAnalysisSkillLanguage(PtPTValue); + /// Romanian. + public static ImageAnalysisSkillLanguage Ro { get; } = new ImageAnalysisSkillLanguage(RoValue); + /// Russian. + public static ImageAnalysisSkillLanguage Ru { get; } = new ImageAnalysisSkillLanguage(RuValue); + /// Slovak. + public static ImageAnalysisSkillLanguage Sk { get; } = new ImageAnalysisSkillLanguage(SkValue); + /// Slovenian. + public static ImageAnalysisSkillLanguage Sl { get; } = new ImageAnalysisSkillLanguage(SlValue); + /// Serbian - Cyrillic RS. + public static ImageAnalysisSkillLanguage SrCyrl { get; } = new ImageAnalysisSkillLanguage(SrCyrlValue); + /// Serbian - Latin RS. + public static ImageAnalysisSkillLanguage SrLatn { get; } = new ImageAnalysisSkillLanguage(SrLatnValue); + /// Swedish. + public static ImageAnalysisSkillLanguage Sv { get; } = new ImageAnalysisSkillLanguage(SvValue); + /// Thai. + public static ImageAnalysisSkillLanguage Th { get; } = new ImageAnalysisSkillLanguage(ThValue); + /// Turkish. + public static ImageAnalysisSkillLanguage Tr { get; } = new ImageAnalysisSkillLanguage(TrValue); + /// Ukrainian. + public static ImageAnalysisSkillLanguage Uk { get; } = new ImageAnalysisSkillLanguage(UkValue); + /// Vietnamese. + public static ImageAnalysisSkillLanguage Vi { get; } = new ImageAnalysisSkillLanguage(ViValue); + /// Chinese Simplified. + public static ImageAnalysisSkillLanguage Zh { get; } = new ImageAnalysisSkillLanguage(ZhValue); + /// Chinese Simplified. + public static ImageAnalysisSkillLanguage ZhHans { get; } = new ImageAnalysisSkillLanguage(ZhHansValue); + /// Chinese Traditional. + public static ImageAnalysisSkillLanguage ZhHant { get; } = new ImageAnalysisSkillLanguage(ZhHantValue); + /// Determines if two values are the same. + public static bool operator ==(ImageAnalysisSkillLanguage left, ImageAnalysisSkillLanguage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ImageAnalysisSkillLanguage left, ImageAnalysisSkillLanguage right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ImageAnalysisSkillLanguage(string value) => new ImageAnalysisSkillLanguage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ImageAnalysisSkillLanguage other && Equals(other); + /// + public bool Equals(ImageAnalysisSkillLanguage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ImageDetail.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ImageDetail.cs new file mode 100644 index 000000000000..217a876ec0c1 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ImageDetail.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 +{ + /// A string indicating which domain-specific details to return. + public readonly partial struct ImageDetail : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ImageDetail(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CelebritiesValue = "celebrities"; + private const string LandmarksValue = "landmarks"; + + /// Details recognized as celebrities. + public static ImageDetail Celebrities { get; } = new ImageDetail(CelebritiesValue); + /// Details recognized as landmarks. + public static ImageDetail Landmarks { get; } = new ImageDetail(LandmarksValue); + /// Determines if two values are the same. + public static bool operator ==(ImageDetail left, ImageDetail right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ImageDetail left, ImageDetail right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ImageDetail(string value) => new ImageDetail(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ImageDetail other && Equals(other); + /// + public bool Equals(ImageDetail other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexProjectionMode.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexProjectionMode.cs new file mode 100644 index 000000000000..49689bf70436 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexProjectionMode.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Defines behavior of the index projections in relation to the rest of the + /// indexer. + /// + public readonly partial struct IndexProjectionMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IndexProjectionMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SkipIndexingParentDocumentsValue = "skipIndexingParentDocuments"; + private const string IncludeIndexingParentDocumentsValue = "includeIndexingParentDocuments"; + + /// + /// The source document will be skipped from writing into the indexer's target + /// index. + /// + public static IndexProjectionMode SkipIndexingParentDocuments { get; } = new IndexProjectionMode(SkipIndexingParentDocumentsValue); + /// + /// The source document will be written into the indexer's target index. This is + /// the default pattern. + /// + public static IndexProjectionMode IncludeIndexingParentDocuments { get; } = new IndexProjectionMode(IncludeIndexingParentDocumentsValue); + /// Determines if two values are the same. + public static bool operator ==(IndexProjectionMode left, IndexProjectionMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IndexProjectionMode left, IndexProjectionMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IndexProjectionMode(string value) => new IndexProjectionMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IndexProjectionMode other && Equals(other); + /// + public bool Equals(IndexProjectionMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexerExecutionEnvironment.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexerExecutionEnvironment.cs new file mode 100644 index 000000000000..9e0b3d88a60e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexerExecutionEnvironment.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Specifies the environment in which the indexer should execute. + public readonly partial struct IndexerExecutionEnvironment : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IndexerExecutionEnvironment(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StandardValue = "standard"; + private const string PrivateValue = "private"; + + /// + /// Indicates that the search service can determine where the indexer should + /// execute. This is the default environment when nothing is specified and is the + /// recommended value. + /// + public static IndexerExecutionEnvironment Standard { get; } = new IndexerExecutionEnvironment(StandardValue); + /// + /// Indicates that the indexer should run with the environment provisioned + /// specifically for the search service. This should only be specified as the + /// execution environment if the indexer needs to access resources securely over + /// shared private link resources. + /// + public static IndexerExecutionEnvironment Private { get; } = new IndexerExecutionEnvironment(PrivateValue); + /// Determines if two values are the same. + public static bool operator ==(IndexerExecutionEnvironment left, IndexerExecutionEnvironment right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IndexerExecutionEnvironment left, IndexerExecutionEnvironment right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IndexerExecutionEnvironment(string value) => new IndexerExecutionEnvironment(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IndexerExecutionEnvironment other && Equals(other); + /// + public bool Equals(IndexerExecutionEnvironment other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexerExecutionResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexerExecutionResult.Serialization.cs new file mode 100644 index 000000000000..517b0a090f8b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexerExecutionResult.Serialization.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class IndexerExecutionResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IndexerExecutionResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsDefined(ErrorMessage)) + { + writer.WritePropertyName("errorMessage"u8); + writer.WriteStringValue(ErrorMessage); + } + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartTime.Value, "O"); + } + if (Optional.IsDefined(EndTime)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndTime.Value, "O"); + } + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("itemsProcessed"u8); + writer.WriteNumberValue(ItemsProcessed); + writer.WritePropertyName("itemsFailed"u8); + writer.WriteNumberValue(ItemsFailed); + if (Optional.IsDefined(InitialTrackingState)) + { + writer.WritePropertyName("initialTrackingState"u8); + writer.WriteStringValue(InitialTrackingState); + } + if (Optional.IsDefined(FinalTrackingState)) + { + writer.WritePropertyName("finalTrackingState"u8); + writer.WriteStringValue(FinalTrackingState); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IndexerExecutionResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IndexerExecutionResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIndexerExecutionResult(document.RootElement, options); + } + + internal static IndexerExecutionResult DeserializeIndexerExecutionResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IndexerExecutionStatus status = default; + string errorMessage = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + IReadOnlyList errors = default; + IReadOnlyList warnings = default; + int itemsProcessed = default; + int itemsFailed = default; + string initialTrackingState = default; + string finalTrackingState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + status = new IndexerExecutionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("errorMessage"u8)) + { + errorMessage = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("errors"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SearchIndexerError.DeserializeSearchIndexerError(item, options)); + } + errors = array; + continue; + } + if (property.NameEquals("warnings"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SearchIndexerWarning.DeserializeSearchIndexerWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("itemsProcessed"u8)) + { + itemsProcessed = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("itemsFailed"u8)) + { + itemsFailed = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("initialTrackingState"u8)) + { + initialTrackingState = property.Value.GetString(); + continue; + } + if (property.NameEquals("finalTrackingState"u8)) + { + finalTrackingState = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IndexerExecutionResult( + status, + errorMessage, + startTime, + endTime, + errors, + warnings, + itemsProcessed, + itemsFailed, + initialTrackingState, + finalTrackingState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IndexerExecutionResult)} does not support writing '{options.Format}' format."); + } + } + + IndexerExecutionResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIndexerExecutionResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IndexerExecutionResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static IndexerExecutionResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIndexerExecutionResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexerExecutionResult.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexerExecutionResult.cs new file mode 100644 index 000000000000..17c3e54ef05d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexerExecutionResult.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents the result of an individual indexer execution. + public partial class IndexerExecutionResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The outcome of this indexer execution. + /// The item-level indexing errors. + /// The item-level indexing warnings. + /// + /// The number of items that were processed during this indexer execution. This + /// includes both successfully processed items and items where indexing was + /// attempted but failed. + /// + /// The number of items that failed to be indexed during this indexer execution. + /// or is null. + internal IndexerExecutionResult(IndexerExecutionStatus status, IEnumerable errors, IEnumerable warnings, int itemsProcessed, int itemsFailed) + { + Argument.AssertNotNull(errors, nameof(errors)); + Argument.AssertNotNull(warnings, nameof(warnings)); + + Status = status; + Errors = errors.ToList(); + Warnings = warnings.ToList(); + ItemsProcessed = itemsProcessed; + ItemsFailed = itemsFailed; + } + + /// Initializes a new instance of . + /// The outcome of this indexer 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. + /// The item-level indexing errors. + /// The item-level indexing warnings. + /// + /// The number of items that were processed during this indexer execution. This + /// includes both successfully processed items and items where indexing was + /// attempted but failed. + /// + /// 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. + /// Keeps track of any properties unknown to the library. + internal IndexerExecutionResult(IndexerExecutionStatus status, string errorMessage, DateTimeOffset? startTime, DateTimeOffset? endTime, IReadOnlyList errors, IReadOnlyList warnings, int itemsProcessed, int itemsFailed, string initialTrackingState, string finalTrackingState, IDictionary serializedAdditionalRawData) + { + Status = status; + ErrorMessage = errorMessage; + StartTime = startTime; + EndTime = endTime; + Errors = errors; + Warnings = warnings; + ItemsProcessed = itemsProcessed; + ItemsFailed = itemsFailed; + InitialTrackingState = initialTrackingState; + FinalTrackingState = finalTrackingState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IndexerExecutionResult() + { + } + + /// The outcome of this indexer execution. + public IndexerExecutionStatus Status { get; } + /// The error message indicating the top-level error, if any. + public string ErrorMessage { get; } + /// The start time of this indexer execution. + public DateTimeOffset? StartTime { get; } + /// The end time of this indexer execution, if the execution has already completed. + public DateTimeOffset? EndTime { get; } + /// The item-level indexing errors. + public IReadOnlyList Errors { get; } + /// The item-level indexing warnings. + public IReadOnlyList Warnings { get; } + /// + /// The number of items that were processed during this indexer execution. This + /// includes both successfully processed items and items where indexing was + /// attempted but failed. + /// + public int ItemsProcessed { get; } + /// The number of items that failed to be indexed during this indexer execution. + public int ItemsFailed { get; } + /// Change tracking state with which an indexer execution started. + public string InitialTrackingState { get; } + /// Change tracking state with which an indexer execution finished. + public string FinalTrackingState { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexerExecutionStatus.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexerExecutionStatus.cs new file mode 100644 index 000000000000..678cdd86fb50 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexerExecutionStatus.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents the status of an individual indexer execution. + public readonly partial struct IndexerExecutionStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IndexerExecutionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TransientFailureValue = "transientFailure"; + private const string SuccessValue = "success"; + private const string InProgressValue = "inProgress"; + private const string ResetValue = "reset"; + + /// + /// An indexer invocation has failed, but the failure may be transient. Indexer + /// invocations will continue per schedule. + /// + public static IndexerExecutionStatus TransientFailure { get; } = new IndexerExecutionStatus(TransientFailureValue); + /// Indexer execution completed successfully. + public static IndexerExecutionStatus Success { get; } = new IndexerExecutionStatus(SuccessValue); + /// Indexer execution is in progress. + public static IndexerExecutionStatus InProgress { get; } = new IndexerExecutionStatus(InProgressValue); + /// Indexer has been reset. + public static IndexerExecutionStatus Reset { get; } = new IndexerExecutionStatus(ResetValue); + /// Determines if two values are the same. + public static bool operator ==(IndexerExecutionStatus left, IndexerExecutionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IndexerExecutionStatus left, IndexerExecutionStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IndexerExecutionStatus(string value) => new IndexerExecutionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IndexerExecutionStatus other && Equals(other); + /// + public bool Equals(IndexerExecutionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexerStatus.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexerStatus.cs new file mode 100644 index 000000000000..42f541ed0c05 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexerStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents the overall indexer status. + public readonly partial struct IndexerStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IndexerStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "unknown"; + private const string ErrorValue = "error"; + private const string RunningValue = "running"; + + /// Indicates that the indexer is in an unknown state. + public static IndexerStatus Unknown { get; } = new IndexerStatus(UnknownValue); + /// + /// Indicates that the indexer experienced an error that cannot be corrected + /// without human intervention. + /// + public static IndexerStatus Error { get; } = new IndexerStatus(ErrorValue); + /// Indicates that the indexer is running normally. + public static IndexerStatus Running { get; } = new IndexerStatus(RunningValue); + /// Determines if two values are the same. + public static bool operator ==(IndexerStatus left, IndexerStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IndexerStatus left, IndexerStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IndexerStatus(string value) => new IndexerStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IndexerStatus other && Equals(other); + /// + public bool Equals(IndexerStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Indexers.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Indexers.cs new file mode 100644 index 000000000000..4bd85add7b1b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Indexers.cs @@ -0,0 +1,1001 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Search.Documents.Indexes +{ + // Data plane generated sub-client. + /// The Indexers sub-client. + public partial class Indexers + { + private const string AuthorizationHeader = "api-key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://search.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of Indexers for mocking. + protected Indexers() + { + } + + /// Initializes a new instance of Indexers. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The key credential to copy. + /// The token credential to copy. + /// Service host. + /// The API version to use for this operation. + internal Indexers(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _keyCredential = keyCredential; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Resets the change tracking state associated with an indexer. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The name of the indexer. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task ResetAsync(string indexerName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + + using var scope = ClientDiagnostics.CreateScope("Indexers.Reset"); + scope.Start(); + try + { + using HttpMessage message = CreateResetRequest(indexerName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Resets the change tracking state associated with an indexer. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The name of the indexer. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Reset(string indexerName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + + using var scope = ClientDiagnostics.CreateScope("Indexers.Reset"); + scope.Start(); + try + { + using HttpMessage message = CreateResetRequest(indexerName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Runs an indexer on-demand. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The name of the indexer. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task RunAsync(string indexerName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + + using var scope = ClientDiagnostics.CreateScope("Indexers.Run"); + scope.Start(); + try + { + using HttpMessage message = CreateRunRequest(indexerName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Runs an indexer on-demand. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The name of the indexer. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Run(string indexerName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + + using var scope = ClientDiagnostics.CreateScope("Indexers.Run"); + scope.Start(); + try + { + using HttpMessage message = CreateRunRequest(indexerName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a new indexer or updates an indexer if it already exists. + /// The name of the indexer. + /// The definition of the indexer to create or update. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CreateOrUpdateAsync(string indexerName, SearchIndexer indexer, MatchConditions matchConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + Argument.AssertNotNull(indexer, nameof(indexer)); + + using RequestContent content = indexer.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateOrUpdateAsync(indexerName, content, matchConditions, context).ConfigureAwait(false); + return Response.FromValue(SearchIndexer.FromResponse(response), response); + } + + /// Creates a new indexer or updates an indexer if it already exists. + /// The name of the indexer. + /// The definition of the indexer to create or update. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CreateOrUpdate(string indexerName, SearchIndexer indexer, MatchConditions matchConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + Argument.AssertNotNull(indexer, nameof(indexer)); + + using RequestContent content = indexer.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateOrUpdate(indexerName, content, matchConditions, context); + return Response.FromValue(SearchIndexer.FromResponse(response), response); + } + + /// + /// [Protocol Method] Creates a new indexer or updates an indexer if it already exists. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the indexer. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrUpdateAsync(string indexerName, RequestContent content, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Indexers.CreateOrUpdate"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateRequest(indexerName, content, matchConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new indexer or updates an indexer if it already exists. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the indexer. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrUpdate(string indexerName, RequestContent content, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Indexers.CreateOrUpdate"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateRequest(indexerName, content, matchConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes an indexer. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The name of the indexer. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteAsync(string indexerName, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + + using var scope = ClientDiagnostics.CreateScope("Indexers.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(indexerName, matchConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes an indexer. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The name of the indexer. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Delete(string indexerName, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + + using var scope = ClientDiagnostics.CreateScope("Indexers.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(indexerName, matchConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieves an indexer definition. + /// The name of the indexer. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetIndexerAsync(string indexerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetIndexerAsync(indexerName, context).ConfigureAwait(false); + return Response.FromValue(SearchIndexer.FromResponse(response), response); + } + + /// Retrieves an indexer definition. + /// The name of the indexer. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetIndexer(string indexerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetIndexer(indexerName, context); + return Response.FromValue(SearchIndexer.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieves an indexer definition. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the indexer. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetIndexerAsync(string indexerName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + + using var scope = ClientDiagnostics.CreateScope("Indexers.GetIndexer"); + scope.Start(); + try + { + using HttpMessage message = CreateGetIndexerRequest(indexerName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieves an indexer definition. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the indexer. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetIndexer(string indexerName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + + using var scope = ClientDiagnostics.CreateScope("Indexers.GetIndexer"); + scope.Start(); + try + { + using HttpMessage message = CreateGetIndexerRequest(indexerName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists all indexers available for a search service. + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The cancellation token to use. + /// + public virtual async Task> GetIndexersAsync(string select = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetIndexersAsync(select, context).ConfigureAwait(false); + return Response.FromValue(ListIndexersResult.FromResponse(response), response); + } + + /// Lists all indexers available for a search service. + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The cancellation token to use. + /// + public virtual Response GetIndexers(string select = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetIndexers(select, context); + return Response.FromValue(ListIndexersResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Lists all indexers available for a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetIndexersAsync(string select, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("Indexers.GetIndexers"); + scope.Start(); + try + { + using HttpMessage message = CreateGetIndexersRequest(select, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists all indexers available for a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetIndexers(string select, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("Indexers.GetIndexers"); + scope.Start(); + try + { + using HttpMessage message = CreateGetIndexersRequest(select, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a new indexer. + /// The definition of the indexer to create. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> CreateAsync(SearchIndexer indexer, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(indexer, nameof(indexer)); + + using RequestContent content = indexer.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateAsync(content, context).ConfigureAwait(false); + return Response.FromValue(SearchIndexer.FromResponse(response), response); + } + + /// Creates a new indexer. + /// The definition of the indexer to create. + /// The cancellation token to use. + /// is null. + /// + public virtual Response Create(SearchIndexer indexer, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(indexer, nameof(indexer)); + + using RequestContent content = indexer.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Create(content, context); + return Response.FromValue(SearchIndexer.FromResponse(response), response); + } + + /// + /// [Protocol Method] Creates a new indexer. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateAsync(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Indexers.Create"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateRequest(content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new indexer. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Create(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Indexers.Create"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateRequest(content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Returns the current status and execution history of an indexer. + /// The name of the indexer. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetStatusAsync(string indexerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetStatusAsync(indexerName, context).ConfigureAwait(false); + return Response.FromValue(SearchIndexerStatus.FromResponse(response), response); + } + + /// Returns the current status and execution history of an indexer. + /// The name of the indexer. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetStatus(string indexerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetStatus(indexerName, context); + return Response.FromValue(SearchIndexerStatus.FromResponse(response), response); + } + + /// + /// [Protocol Method] Returns the current status and execution history of an indexer. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the indexer. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetStatusAsync(string indexerName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + + using var scope = ClientDiagnostics.CreateScope("Indexers.GetStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetStatusRequest(indexerName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Returns the current status and execution history of an indexer. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the indexer. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetStatus(string indexerName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexerName, nameof(indexerName)); + + using var scope = ClientDiagnostics.CreateScope("Indexers.GetStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetStatusRequest(indexerName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateResetRequest(string indexerName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexers('", false); + uri.AppendPath(indexerName, true); + uri.AppendPath("')/search.reset", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateRunRequest(string indexerName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexers('", false); + uri.AppendPath(indexerName, true); + uri.AppendPath("')/search.run", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string indexerName, RequestContent content, MatchConditions matchConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexers('", false); + uri.AppendPath(indexerName, true); + uri.AppendPath("')", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Prefer", "return=representation"); + request.Headers.Add("Accept", "application/json"); + if (matchConditions != null) + { + request.Headers.Add(matchConditions); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteRequest(string indexerName, MatchConditions matchConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204404); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexers('", false); + uri.AppendPath(indexerName, true); + uri.AppendPath("')", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (matchConditions != null) + { + request.Headers.Add(matchConditions); + } + return message; + } + + internal HttpMessage CreateGetIndexerRequest(string indexerName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexers('", false); + uri.AppendPath(indexerName, true); + uri.AppendPath("')", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetIndexersRequest(string select, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexers", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier201); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetStatusRequest(string indexerName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexers('", false); + uri.AppendPath(indexerName, true); + uri.AppendPath("')/search.status", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier204; + private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + private static ResponseClassifier _responseClassifier204404; + private static ResponseClassifier ResponseClassifier204404 => _responseClassifier204404 ??= new StatusCodeClassifier(stackalloc ushort[] { 204, 404 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier201; + private static ResponseClassifier ResponseClassifier201 => _responseClassifier201 ??= new StatusCodeClassifier(stackalloc ushort[] { 201 }); + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Indexes.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Indexes.cs new file mode 100644 index 000000000000..72c07bdf66af --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Indexes.cs @@ -0,0 +1,986 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Search.Documents.Indexes +{ + // Data plane generated sub-client. + /// The Indexes sub-client. + public partial class Indexes + { + private const string AuthorizationHeader = "api-key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://search.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of Indexes for mocking. + protected Indexes() + { + } + + /// Initializes a new instance of Indexes. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The key credential to copy. + /// The token credential to copy. + /// Service host. + /// The API version to use for this operation. + internal Indexes(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _keyCredential = keyCredential; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Creates a new search index. + /// The definition of the index to create. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> CreateAsync(SearchIndex index, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(index, nameof(index)); + + using RequestContent content = index.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateAsync(content, context).ConfigureAwait(false); + return Response.FromValue(SearchIndex.FromResponse(response), response); + } + + /// Creates a new search index. + /// The definition of the index to create. + /// The cancellation token to use. + /// is null. + /// + public virtual Response Create(SearchIndex index, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(index, nameof(index)); + + using RequestContent content = index.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Create(content, context); + return Response.FromValue(SearchIndex.FromResponse(response), response); + } + + /// + /// [Protocol Method] Creates a new search index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateAsync(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Indexes.Create"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateRequest(content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new search index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Create(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Indexes.Create"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateRequest(content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a new search index or updates an index if it already exists. + /// The name of the index. + /// The definition of the index to create or update. + /// + /// Allows new analyzers, tokenizers, token filters, or char filters to be added to + /// an index by taking the index offline for at least a few seconds. This + /// temporarily causes indexing and query requests to fail. Performance and write + /// availability of the index can be impaired for several minutes after the index + /// is updated, or longer for very large indexes. + /// + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CreateOrUpdateAsync(string indexName, SearchIndex index, bool? allowIndexDowntime = null, MatchConditions matchConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(index, nameof(index)); + + using RequestContent content = index.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateOrUpdateAsync(indexName, content, allowIndexDowntime, matchConditions, context).ConfigureAwait(false); + return Response.FromValue(SearchIndex.FromResponse(response), response); + } + + /// Creates a new search index or updates an index if it already exists. + /// The name of the index. + /// The definition of the index to create or update. + /// + /// Allows new analyzers, tokenizers, token filters, or char filters to be added to + /// an index by taking the index offline for at least a few seconds. This + /// temporarily causes indexing and query requests to fail. Performance and write + /// availability of the index can be impaired for several minutes after the index + /// is updated, or longer for very large indexes. + /// + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CreateOrUpdate(string indexName, SearchIndex index, bool? allowIndexDowntime = null, MatchConditions matchConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(index, nameof(index)); + + using RequestContent content = index.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateOrUpdate(indexName, content, allowIndexDowntime, matchConditions, context); + return Response.FromValue(SearchIndex.FromResponse(response), response); + } + + /// + /// [Protocol Method] Creates a new search index or updates an index if it already exists. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The content to send as the body of the request. + /// + /// Allows new analyzers, tokenizers, token filters, or char filters to be added to + /// an index by taking the index offline for at least a few seconds. This + /// temporarily causes indexing and query requests to fail. Performance and write + /// availability of the index can be impaired for several minutes after the index + /// is updated, or longer for very large indexes. + /// + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrUpdateAsync(string indexName, RequestContent content, bool? allowIndexDowntime = null, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Indexes.CreateOrUpdate"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateRequest(indexName, content, allowIndexDowntime, matchConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new search index or updates an index if it already exists. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The content to send as the body of the request. + /// + /// Allows new analyzers, tokenizers, token filters, or char filters to be added to + /// an index by taking the index offline for at least a few seconds. This + /// temporarily causes indexing and query requests to fail. Performance and write + /// availability of the index can be impaired for several minutes after the index + /// is updated, or longer for very large indexes. + /// + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrUpdate(string indexName, RequestContent content, bool? allowIndexDowntime = null, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Indexes.CreateOrUpdate"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateRequest(indexName, content, allowIndexDowntime, matchConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a search index and all the documents it contains. This operation is + /// permanent, with no recovery option. Make sure you have a master copy of your + /// index definition, data ingestion code, and a backup of the primary data source + /// in case you need to re-build the index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The name of the index. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteAsync(string indexName, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + using var scope = ClientDiagnostics.CreateScope("Indexes.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(indexName, matchConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a search index and all the documents it contains. This operation is + /// permanent, with no recovery option. Make sure you have a master copy of your + /// index definition, data ingestion code, and a backup of the primary data source + /// in case you need to re-build the index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The name of the index. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Delete(string indexName, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + using var scope = ClientDiagnostics.CreateScope("Indexes.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(indexName, matchConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieves an index definition. + /// The name of the index. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetIndexAsync(string indexName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetIndexAsync(indexName, context).ConfigureAwait(false); + return Response.FromValue(SearchIndex.FromResponse(response), response); + } + + /// Retrieves an index definition. + /// The name of the index. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetIndex(string indexName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetIndex(indexName, context); + return Response.FromValue(SearchIndex.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieves an index definition. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetIndexAsync(string indexName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + using var scope = ClientDiagnostics.CreateScope("Indexes.GetIndex"); + scope.Start(); + try + { + using HttpMessage message = CreateGetIndexRequest(indexName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieves an index definition. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetIndex(string indexName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + using var scope = ClientDiagnostics.CreateScope("Indexes.GetIndex"); + scope.Start(); + try + { + using HttpMessage message = CreateGetIndexRequest(indexName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns statistics for the given index, including a document count and storage + /// usage. + /// + /// The name of the index. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetStatisticsAsync(string indexName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetStatisticsAsync(indexName, context).ConfigureAwait(false); + return Response.FromValue(GetIndexStatisticsResult.FromResponse(response), response); + } + + /// + /// Returns statistics for the given index, including a document count and storage + /// usage. + /// + /// The name of the index. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetStatistics(string indexName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetStatistics(indexName, context); + return Response.FromValue(GetIndexStatisticsResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Returns statistics for the given index, including a document count and storage + /// usage. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetStatisticsAsync(string indexName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + using var scope = ClientDiagnostics.CreateScope("Indexes.GetStatistics"); + scope.Start(); + try + { + using HttpMessage message = CreateGetStatisticsRequest(indexName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Returns statistics for the given index, including a document count and storage + /// usage. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetStatistics(string indexName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + using var scope = ClientDiagnostics.CreateScope("Indexes.GetStatistics"); + scope.Start(); + try + { + using HttpMessage message = CreateGetStatisticsRequest(indexName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Shows how an analyzer breaks text into tokens. + /// The name of the index. + /// The text and analyzer or analysis components to test. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> AnalyzeAsync(string indexName, AnalyzeRequest request, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(request, nameof(request)); + + using RequestContent content = request.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await AnalyzeAsync(indexName, content, context).ConfigureAwait(false); + return Response.FromValue(AnalyzeResult.FromResponse(response), response); + } + + /// Shows how an analyzer breaks text into tokens. + /// The name of the index. + /// The text and analyzer or analysis components to test. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response Analyze(string indexName, AnalyzeRequest request, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(request, nameof(request)); + + using RequestContent content = request.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Analyze(indexName, content, context); + return Response.FromValue(AnalyzeResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Shows how an analyzer breaks text into tokens. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task AnalyzeAsync(string indexName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Indexes.Analyze"); + scope.Start(); + try + { + using HttpMessage message = CreateAnalyzeRequest(indexName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Shows how an analyzer breaks text into tokens. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Analyze(string indexName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Indexes.Analyze"); + scope.Start(); + try + { + using HttpMessage message = CreateAnalyzeRequest(indexName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists all indexes available for a search service. + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The cancellation token to use. + /// + public virtual AsyncPageable GetIndexesAsync(string select = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetIndexesRequest(select, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => SearchIndex.DeserializeSearchIndex(e), ClientDiagnostics, _pipeline, "Indexes.GetIndexes", "value", null, context); + } + + /// Lists all indexes available for a search service. + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The cancellation token to use. + /// + public virtual Pageable GetIndexes(string select = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetIndexesRequest(select, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => SearchIndex.DeserializeSearchIndex(e), ClientDiagnostics, _pipeline, "Indexes.GetIndexes", "value", null, context); + } + + /// + /// [Protocol Method] Lists all indexes available for a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetIndexesAsync(string select, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetIndexesRequest(select, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Indexes.GetIndexes", "value", null, context); + } + + /// + /// [Protocol Method] Lists all indexes available for a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetIndexes(string select, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetIndexesRequest(select, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Indexes.GetIndexes", "value", null, context); + } + + internal HttpMessage CreateCreateRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier201); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetIndexesRequest(string select, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string indexName, RequestContent content, bool? allowIndexDowntime, MatchConditions matchConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes('", false); + uri.AppendPath(indexName, true); + uri.AppendPath("')", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (allowIndexDowntime != null) + { + uri.AppendQuery("allowIndexDowntime", allowIndexDowntime.Value, true); + } + request.Uri = uri; + request.Headers.Add("Prefer", "return=representation"); + request.Headers.Add("Accept", "application/json"); + if (matchConditions != null) + { + request.Headers.Add(matchConditions); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteRequest(string indexName, MatchConditions matchConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204404); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes('", false); + uri.AppendPath(indexName, true); + uri.AppendPath("')", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (matchConditions != null) + { + request.Headers.Add(matchConditions); + } + return message; + } + + internal HttpMessage CreateGetIndexRequest(string indexName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes('", false); + uri.AppendPath(indexName, true); + uri.AppendPath("')", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetStatisticsRequest(string indexName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes('", false); + uri.AppendPath(indexName, true); + uri.AppendPath("')/search.stats", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateAnalyzeRequest(string indexName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes('", false); + uri.AppendPath(indexName, true); + uri.AppendPath("')/search.analyze", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier201; + private static ResponseClassifier ResponseClassifier201 => _responseClassifier201 ??= new StatusCodeClassifier(stackalloc ushort[] { 201 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + private static ResponseClassifier _responseClassifier204404; + private static ResponseClassifier ResponseClassifier204404 => _responseClassifier204404 ??= new StatusCodeClassifier(stackalloc ushort[] { 204, 404 }); + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingParameters.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingParameters.Serialization.cs new file mode 100644 index 000000000000..5712014cff04 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingParameters.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class IndexingParameters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IndexingParameters)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(BatchSize)) + { + writer.WritePropertyName("batchSize"u8); + writer.WriteNumberValue(BatchSize.Value); + } + if (Optional.IsDefined(MaxFailedItems)) + { + writer.WritePropertyName("maxFailedItems"u8); + writer.WriteNumberValue(MaxFailedItems.Value); + } + if (Optional.IsDefined(MaxFailedItemsPerBatch)) + { + writer.WritePropertyName("maxFailedItemsPerBatch"u8); + writer.WriteNumberValue(MaxFailedItemsPerBatch.Value); + } + if (Optional.IsDefined(Configuration)) + { + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IndexingParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IndexingParameters)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIndexingParameters(document.RootElement, options); + } + + internal static IndexingParameters DeserializeIndexingParameters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? batchSize = default; + int? maxFailedItems = default; + int? maxFailedItemsPerBatch = default; + IndexingParametersConfiguration configuration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("batchSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + batchSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxFailedItems"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxFailedItems = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxFailedItemsPerBatch"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxFailedItemsPerBatch = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("configuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configuration = IndexingParametersConfiguration.DeserializeIndexingParametersConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IndexingParameters(batchSize, maxFailedItems, maxFailedItemsPerBatch, configuration, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IndexingParameters)} does not support writing '{options.Format}' format."); + } + } + + IndexingParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIndexingParameters(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IndexingParameters)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static IndexingParameters FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIndexingParameters(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingParameters.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingParameters.cs new file mode 100644 index 000000000000..f464b2ede1cc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingParameters.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents parameters for indexer execution. + public partial class IndexingParameters + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public IndexingParameters() + { + } + + /// Initializes a new instance of . + /// + /// The number of items that are read from the data source and indexed as a single + /// batch in order to improve performance. The default depends on the data source + /// type. + /// + /// + /// The maximum number of items that can fail indexing for indexer execution to + /// still be considered successful. -1 means no limit. Default is 0. + /// + /// + /// The maximum number of items in a single batch that can fail indexing for the + /// batch to still be considered successful. -1 means no limit. Default is 0. + /// + /// + /// A dictionary of indexer-specific configuration properties. Each name is the + /// name of a specific property. Each value must be of a primitive type. + /// + /// Keeps track of any properties unknown to the library. + internal IndexingParameters(int? batchSize, int? maxFailedItems, int? maxFailedItemsPerBatch, IndexingParametersConfiguration configuration, IDictionary serializedAdditionalRawData) + { + BatchSize = batchSize; + MaxFailedItems = maxFailedItems; + MaxFailedItemsPerBatch = maxFailedItemsPerBatch; + Configuration = configuration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The number of items that are read from the data source and indexed as a single + /// batch in order to improve performance. The default depends on the data source + /// type. + /// + public int? BatchSize { get; set; } + /// + /// The maximum number of items that can fail indexing for indexer execution to + /// still be considered successful. -1 means no limit. Default is 0. + /// + public int? MaxFailedItems { get; set; } + /// + /// The maximum number of items in a single batch that can fail indexing for the + /// batch to still be considered successful. -1 means no limit. Default is 0. + /// + public int? MaxFailedItemsPerBatch { get; set; } + /// + /// A dictionary of indexer-specific configuration properties. Each name is the + /// name of a specific property. Each value must be of a primitive type. + /// + public IndexingParametersConfiguration Configuration { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingParametersConfiguration.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingParametersConfiguration.Serialization.cs new file mode 100644 index 000000000000..bb7a52a6d214 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingParametersConfiguration.Serialization.cs @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class IndexingParametersConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IndexingParametersConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ParsingMode)) + { + writer.WritePropertyName("parsingMode"u8); + writer.WriteStringValue(ParsingMode.Value.ToString()); + } + if (Optional.IsDefined(ExcludedFileNameExtensions)) + { + writer.WritePropertyName("excludedFileNameExtensions"u8); + writer.WriteStringValue(ExcludedFileNameExtensions); + } + if (Optional.IsDefined(IndexedFileNameExtensions)) + { + writer.WritePropertyName("indexedFileNameExtensions"u8); + writer.WriteStringValue(IndexedFileNameExtensions); + } + if (Optional.IsDefined(FailOnUnsupportedContentType)) + { + writer.WritePropertyName("failOnUnsupportedContentType"u8); + writer.WriteBooleanValue(FailOnUnsupportedContentType.Value); + } + if (Optional.IsDefined(FailOnUnprocessableDocument)) + { + writer.WritePropertyName("failOnUnprocessableDocument"u8); + writer.WriteBooleanValue(FailOnUnprocessableDocument.Value); + } + if (Optional.IsDefined(IndexStorageMetadataOnlyForOversizedDocuments)) + { + writer.WritePropertyName("indexStorageMetadataOnlyForOversizedDocuments"u8); + writer.WriteBooleanValue(IndexStorageMetadataOnlyForOversizedDocuments.Value); + } + if (Optional.IsDefined(DelimitedTextHeaders)) + { + writer.WritePropertyName("delimitedTextHeaders"u8); + writer.WriteStringValue(DelimitedTextHeaders); + } + if (Optional.IsDefined(DelimitedTextDelimiter)) + { + writer.WritePropertyName("delimitedTextDelimiter"u8); + writer.WriteStringValue(DelimitedTextDelimiter); + } + if (Optional.IsDefined(FirstLineContainsHeaders)) + { + writer.WritePropertyName("firstLineContainsHeaders"u8); + writer.WriteBooleanValue(FirstLineContainsHeaders.Value); + } + if (Optional.IsDefined(DocumentRoot)) + { + writer.WritePropertyName("documentRoot"u8); + writer.WriteStringValue(DocumentRoot); + } + if (Optional.IsDefined(DataToExtract)) + { + writer.WritePropertyName("dataToExtract"u8); + writer.WriteStringValue(DataToExtract.Value.ToString()); + } + if (Optional.IsDefined(ImageAction)) + { + writer.WritePropertyName("imageAction"u8); + writer.WriteStringValue(ImageAction.Value.ToString()); + } + if (Optional.IsDefined(AllowSkillsetToReadFileData)) + { + writer.WritePropertyName("allowSkillsetToReadFileData"u8); + writer.WriteBooleanValue(AllowSkillsetToReadFileData.Value); + } + if (Optional.IsDefined(PdfTextRotationAlgorithm)) + { + writer.WritePropertyName("pdfTextRotationAlgorithm"u8); + writer.WriteStringValue(PdfTextRotationAlgorithm.Value.ToString()); + } + if (Optional.IsDefined(ExecutionEnvironment)) + { + writer.WritePropertyName("executionEnvironment"u8); + writer.WriteStringValue(ExecutionEnvironment.Value.ToString()); + } + if (Optional.IsDefined(QueryTimeout)) + { + writer.WritePropertyName("queryTimeout"u8); + writer.WriteStringValue(QueryTimeout); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + IndexingParametersConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IndexingParametersConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIndexingParametersConfiguration(document.RootElement, options); + } + + internal static IndexingParametersConfiguration DeserializeIndexingParametersConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BlobIndexerParsingMode? parsingMode = default; + string excludedFileNameExtensions = default; + string indexedFileNameExtensions = default; + bool? failOnUnsupportedContentType = default; + bool? failOnUnprocessableDocument = default; + bool? indexStorageMetadataOnlyForOversizedDocuments = default; + string delimitedTextHeaders = default; + string delimitedTextDelimiter = default; + bool? firstLineContainsHeaders = default; + string documentRoot = default; + BlobIndexerDataToExtract? dataToExtract = default; + BlobIndexerImageAction? imageAction = default; + bool? allowSkillsetToReadFileData = default; + BlobIndexerPDFTextRotationAlgorithm? pdfTextRotationAlgorithm = default; + IndexerExecutionEnvironment? executionEnvironment = default; + string queryTimeout = default; + IDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("parsingMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + parsingMode = new BlobIndexerParsingMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("excludedFileNameExtensions"u8)) + { + excludedFileNameExtensions = property.Value.GetString(); + continue; + } + if (property.NameEquals("indexedFileNameExtensions"u8)) + { + indexedFileNameExtensions = property.Value.GetString(); + continue; + } + if (property.NameEquals("failOnUnsupportedContentType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failOnUnsupportedContentType = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("failOnUnprocessableDocument"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failOnUnprocessableDocument = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("indexStorageMetadataOnlyForOversizedDocuments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + indexStorageMetadataOnlyForOversizedDocuments = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("delimitedTextHeaders"u8)) + { + delimitedTextHeaders = property.Value.GetString(); + continue; + } + if (property.NameEquals("delimitedTextDelimiter"u8)) + { + delimitedTextDelimiter = property.Value.GetString(); + continue; + } + if (property.NameEquals("firstLineContainsHeaders"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstLineContainsHeaders = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("documentRoot"u8)) + { + documentRoot = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataToExtract"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataToExtract = new BlobIndexerDataToExtract(property.Value.GetString()); + continue; + } + if (property.NameEquals("imageAction"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + imageAction = new BlobIndexerImageAction(property.Value.GetString()); + continue; + } + if (property.NameEquals("allowSkillsetToReadFileData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowSkillsetToReadFileData = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("pdfTextRotationAlgorithm"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pdfTextRotationAlgorithm = new BlobIndexerPDFTextRotationAlgorithm(property.Value.GetString()); + continue; + } + if (property.NameEquals("executionEnvironment"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + executionEnvironment = new IndexerExecutionEnvironment(property.Value.GetString()); + continue; + } + if (property.NameEquals("queryTimeout"u8)) + { + queryTimeout = property.Value.GetString(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new IndexingParametersConfiguration( + parsingMode, + excludedFileNameExtensions, + indexedFileNameExtensions, + failOnUnsupportedContentType, + failOnUnprocessableDocument, + indexStorageMetadataOnlyForOversizedDocuments, + delimitedTextHeaders, + delimitedTextDelimiter, + firstLineContainsHeaders, + documentRoot, + dataToExtract, + imageAction, + allowSkillsetToReadFileData, + pdfTextRotationAlgorithm, + executionEnvironment, + queryTimeout, + additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IndexingParametersConfiguration)} does not support writing '{options.Format}' format."); + } + } + + IndexingParametersConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIndexingParametersConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IndexingParametersConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static IndexingParametersConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIndexingParametersConfiguration(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingParametersConfiguration.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingParametersConfiguration.cs new file mode 100644 index 000000000000..9eb1abbec5be --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingParametersConfiguration.cs @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// A dictionary of indexer-specific configuration properties. Each name is the + /// name of a specific property. Each value must be of a primitive type. + /// + public partial class IndexingParametersConfiguration + { + /// Initializes a new instance of . + public IndexingParametersConfiguration() + { + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Represents the parsing mode for indexing from an Azure blob data source. + /// + /// Comma-delimited list of filename extensions to ignore when processing from + /// Azure blob storage. For example, you could exclude ".png, .mp4" to skip over + /// those files during indexing. + /// + /// + /// Comma-delimited list of filename extensions to select when processing from + /// Azure blob storage. For example, you could focus indexing on specific + /// application files ".docx, .pptx, .msg" to specifically include those file + /// types. + /// + /// + /// For Azure blobs, set to false if you want to continue indexing when an + /// unsupported content type is encountered, and you don't know all the content + /// types (file extensions) in advance. + /// + /// + /// For Azure blobs, set to false if you want to continue indexing if a document + /// fails indexing. + /// + /// + /// For Azure blobs, set this property to true to still index storage metadata for + /// blob content that is too large to process. Oversized blobs are treated as + /// errors by default. For limits on blob size, see + /// https://learn.microsoft.com/azure/search/search-limits-quotas-capacity. + /// + /// + /// For CSV blobs, specifies a comma-delimited list of column headers, useful for + /// mapping source fields to destination fields in an index. + /// + /// + /// For CSV blobs, specifies the end-of-line single-character delimiter for CSV + /// files where each line starts a new document (for example, "|"). + /// + /// + /// For CSV blobs, indicates that the first (non-blank) line of each blob contains + /// headers. + /// + /// + /// For JSON arrays, given a structured or semi-structured document, you can + /// specify a path to the array using this property. + /// + /// + /// Specifies the data to extract from Azure blob storage and tells the indexer + /// which data to extract from image content when "imageAction" is set to a value + /// other than "none". This applies to embedded image content in a .PDF or other + /// application, or image files such as .jpg and .png, in Azure blobs. + /// + /// + /// Determines how to process embedded images and image files in Azure blob + /// storage. Setting the "imageAction" configuration to any value other than + /// "none" requires that a skillset also be attached to that indexer. + /// + /// + /// If true, will create a path //document//file_data that is an object + /// representing the original file data downloaded from your blob data source. + /// This allows you to pass the original file data to a custom skill for processing + /// within the enrichment pipeline, or to the Document Extraction skill. + /// + /// Determines algorithm for text extraction from PDF files in Azure blob storage. + /// Specifies the environment in which the indexer should execute. + /// + /// Increases the timeout beyond the 5-minute default for Azure SQL database data + /// sources, specified in the format "hh:mm:ss". + /// + /// Additional Properties. + internal IndexingParametersConfiguration(BlobIndexerParsingMode? parsingMode, string excludedFileNameExtensions, string indexedFileNameExtensions, bool? failOnUnsupportedContentType, bool? failOnUnprocessableDocument, bool? indexStorageMetadataOnlyForOversizedDocuments, string delimitedTextHeaders, string delimitedTextDelimiter, bool? firstLineContainsHeaders, string documentRoot, BlobIndexerDataToExtract? dataToExtract, BlobIndexerImageAction? imageAction, bool? allowSkillsetToReadFileData, BlobIndexerPDFTextRotationAlgorithm? pdfTextRotationAlgorithm, IndexerExecutionEnvironment? executionEnvironment, string queryTimeout, IDictionary additionalProperties) + { + ParsingMode = parsingMode; + ExcludedFileNameExtensions = excludedFileNameExtensions; + IndexedFileNameExtensions = indexedFileNameExtensions; + FailOnUnsupportedContentType = failOnUnsupportedContentType; + FailOnUnprocessableDocument = failOnUnprocessableDocument; + IndexStorageMetadataOnlyForOversizedDocuments = indexStorageMetadataOnlyForOversizedDocuments; + DelimitedTextHeaders = delimitedTextHeaders; + DelimitedTextDelimiter = delimitedTextDelimiter; + FirstLineContainsHeaders = firstLineContainsHeaders; + DocumentRoot = documentRoot; + DataToExtract = dataToExtract; + ImageAction = imageAction; + AllowSkillsetToReadFileData = allowSkillsetToReadFileData; + PdfTextRotationAlgorithm = pdfTextRotationAlgorithm; + ExecutionEnvironment = executionEnvironment; + QueryTimeout = queryTimeout; + AdditionalProperties = additionalProperties; + } + + /// Represents the parsing mode for indexing from an Azure blob data source. + public BlobIndexerParsingMode? ParsingMode { get; set; } + /// + /// Comma-delimited list of filename extensions to ignore when processing from + /// Azure blob storage. For example, you could exclude ".png, .mp4" to skip over + /// those files during indexing. + /// + public string ExcludedFileNameExtensions { get; set; } + /// + /// Comma-delimited list of filename extensions to select when processing from + /// Azure blob storage. For example, you could focus indexing on specific + /// application files ".docx, .pptx, .msg" to specifically include those file + /// types. + /// + public string IndexedFileNameExtensions { get; set; } + /// + /// For Azure blobs, set to false if you want to continue indexing when an + /// unsupported content type is encountered, and you don't know all the content + /// types (file extensions) in advance. + /// + public bool? FailOnUnsupportedContentType { get; set; } + /// + /// For Azure blobs, set to false if you want to continue indexing if a document + /// fails indexing. + /// + public bool? FailOnUnprocessableDocument { get; set; } + /// + /// For Azure blobs, set this property to true to still index storage metadata for + /// blob content that is too large to process. Oversized blobs are treated as + /// errors by default. For limits on blob size, see + /// https://learn.microsoft.com/azure/search/search-limits-quotas-capacity. + /// + public bool? IndexStorageMetadataOnlyForOversizedDocuments { get; set; } + /// + /// For CSV blobs, specifies a comma-delimited list of column headers, useful for + /// mapping source fields to destination fields in an index. + /// + public string DelimitedTextHeaders { get; set; } + /// + /// For CSV blobs, specifies the end-of-line single-character delimiter for CSV + /// files where each line starts a new document (for example, "|"). + /// + public string DelimitedTextDelimiter { get; set; } + /// + /// For CSV blobs, indicates that the first (non-blank) line of each blob contains + /// headers. + /// + public bool? FirstLineContainsHeaders { get; set; } + /// + /// For JSON arrays, given a structured or semi-structured document, you can + /// specify a path to the array using this property. + /// + public string DocumentRoot { get; set; } + /// + /// Specifies the data to extract from Azure blob storage and tells the indexer + /// which data to extract from image content when "imageAction" is set to a value + /// other than "none". This applies to embedded image content in a .PDF or other + /// application, or image files such as .jpg and .png, in Azure blobs. + /// + public BlobIndexerDataToExtract? DataToExtract { get; set; } + /// + /// Determines how to process embedded images and image files in Azure blob + /// storage. Setting the "imageAction" configuration to any value other than + /// "none" requires that a skillset also be attached to that indexer. + /// + public BlobIndexerImageAction? ImageAction { get; set; } + /// + /// If true, will create a path //document//file_data that is an object + /// representing the original file data downloaded from your blob data source. + /// This allows you to pass the original file data to a custom skill for processing + /// within the enrichment pipeline, or to the Document Extraction skill. + /// + public bool? AllowSkillsetToReadFileData { get; set; } + /// Determines algorithm for text extraction from PDF files in Azure blob storage. + public BlobIndexerPDFTextRotationAlgorithm? PdfTextRotationAlgorithm { get; set; } + /// Specifies the environment in which the indexer should execute. + public IndexerExecutionEnvironment? ExecutionEnvironment { get; set; } + /// + /// Increases the timeout beyond the 5-minute default for Azure SQL database data + /// sources, specified in the format "hh:mm:ss". + /// + public string QueryTimeout { get; set; } + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingSchedule.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingSchedule.Serialization.cs new file mode 100644 index 000000000000..2f06dae5b520 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingSchedule.Serialization.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class IndexingSchedule : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IndexingSchedule)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("interval"u8); + writer.WriteStringValue(Interval, "P"); + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartTime.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IndexingSchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IndexingSchedule)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIndexingSchedule(document.RootElement, options); + } + + internal static IndexingSchedule DeserializeIndexingSchedule(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TimeSpan interval = default; + DateTimeOffset? startTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("interval"u8)) + { + interval = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IndexingSchedule(interval, startTime, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IndexingSchedule)} does not support writing '{options.Format}' format."); + } + } + + IndexingSchedule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIndexingSchedule(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IndexingSchedule)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static IndexingSchedule FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIndexingSchedule(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingSchedule.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingSchedule.cs new file mode 100644 index 000000000000..b30f32dc8dce --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/IndexingSchedule.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents a schedule for indexer execution. + public partial class IndexingSchedule + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The interval of time between indexer executions. + public IndexingSchedule(TimeSpan interval) + { + Interval = interval; + } + + /// Initializes a new instance of . + /// The interval of time between indexer executions. + /// The time when an indexer should start running. + /// Keeps track of any properties unknown to the library. + internal IndexingSchedule(TimeSpan interval, DateTimeOffset? startTime, IDictionary serializedAdditionalRawData) + { + Interval = interval; + StartTime = startTime; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IndexingSchedule() + { + } + + /// The interval of time between indexer executions. + public TimeSpan Interval { get; set; } + /// The time when an indexer should start running. + public DateTimeOffset? StartTime { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/InputFieldMappingEntry.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/InputFieldMappingEntry.Serialization.cs new file mode 100644 index 000000000000..c94767f32ebd --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/InputFieldMappingEntry.Serialization.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class InputFieldMappingEntry : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InputFieldMappingEntry)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + } + if (Optional.IsDefined(SourceContext)) + { + writer.WritePropertyName("sourceContext"u8); + writer.WriteStringValue(SourceContext); + } + if (Optional.IsCollectionDefined(Inputs)) + { + writer.WritePropertyName("inputs"u8); + writer.WriteStartArray(); + foreach (var item in Inputs) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InputFieldMappingEntry IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InputFieldMappingEntry)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInputFieldMappingEntry(document.RootElement, options); + } + + internal static InputFieldMappingEntry DeserializeInputFieldMappingEntry(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string source = default; + string sourceContext = default; + IList inputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceContext"u8)) + { + sourceContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InputFieldMappingEntry(name, source, sourceContext, inputs ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InputFieldMappingEntry)} does not support writing '{options.Format}' format."); + } + } + + InputFieldMappingEntry IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeInputFieldMappingEntry(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InputFieldMappingEntry)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static InputFieldMappingEntry FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeInputFieldMappingEntry(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/InputFieldMappingEntry.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/InputFieldMappingEntry.cs new file mode 100644 index 000000000000..7ff64205e702 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/InputFieldMappingEntry.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Input field mapping for a skill. + public partial class InputFieldMappingEntry + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the input. + /// is null. + public InputFieldMappingEntry(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + Inputs = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The name of the input. + /// The source of the input. + /// The source context used for selecting recursive inputs. + /// The recursive inputs used when creating a complex type. + /// Keeps track of any properties unknown to the library. + internal InputFieldMappingEntry(string name, string source, string sourceContext, IList inputs, IDictionary serializedAdditionalRawData) + { + Name = name; + Source = source; + SourceContext = sourceContext; + Inputs = inputs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InputFieldMappingEntry() + { + } + + /// The name of the input. + public string Name { get; set; } + /// The source of the input. + public string Source { get; set; } + /// The source context used for selecting recursive inputs. + public string SourceContext { get; set; } + /// The recursive inputs used when creating a complex type. + public IList Inputs { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/Argument.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..105a45ef63c1 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..b18e4143a90e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/ChangeTrackingList.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..09857cb32f44 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..21e882f37973 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,399 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + internal static class ModelSerializationExtensions + { + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/Optional.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..a32c6f0d5d97 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Search.Documents.Indexes +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..075dd34a576b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeepTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeepTokenFilter.Serialization.cs new file mode 100644 index 000000000000..28981de382d1 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeepTokenFilter.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class KeepTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeepTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("keepWords"u8); + writer.WriteStartArray(); + foreach (var item in KeepWords) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(KeepWordsCase)) + { + writer.WritePropertyName("keepWordsCase"u8); + writer.WriteBooleanValue(KeepWordsCase.Value); + } + } + + KeepTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeepTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeepTokenFilter(document.RootElement, options); + } + + internal static KeepTokenFilter DeserializeKeepTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList keepWords = default; + bool? keepWordsCase = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keepWords"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + keepWords = array; + continue; + } + if (property.NameEquals("keepWordsCase"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keepWordsCase = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new KeepTokenFilter(odataType, name, serializedAdditionalRawData, keepWords, keepWordsCase); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(KeepTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + KeepTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeKeepTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(KeepTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new KeepTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeKeepTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeepTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeepTokenFilter.cs new file mode 100644 index 000000000000..c9a408c6dcd8 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeepTokenFilter.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// A token filter that only keeps tokens with text contained in a specified list + /// of words. This token filter is implemented using Apache Lucene. + /// + public partial class KeepTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// The list of words to keep. + /// or is null. + public KeepTokenFilter(string name, IEnumerable keepWords) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(keepWords, nameof(keepWords)); + + OdataType = "#Microsoft.Azure.Search.KeepTokenFilter"; + KeepWords = keepWords.ToList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// The list of words to keep. + /// A value indicating whether to lower case all words first. Default is false. + internal KeepTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, IList keepWords, bool? keepWordsCase) : base(odataType, name, serializedAdditionalRawData) + { + KeepWords = keepWords; + KeepWordsCase = keepWordsCase; + } + + /// Initializes a new instance of for deserialization. + internal KeepTokenFilter() + { + } + + /// The list of words to keep. + public IList KeepWords { get; } + /// A value indicating whether to lower case all words first. Default is false. + public bool? KeepWordsCase { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeyPhraseExtractionSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeyPhraseExtractionSkill.Serialization.cs new file mode 100644 index 000000000000..b60ae42fb91f --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeyPhraseExtractionSkill.Serialization.cs @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class KeyPhraseExtractionSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeyPhraseExtractionSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(DefaultLanguageCode)) + { + writer.WritePropertyName("defaultLanguageCode"u8); + writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + } + if (Optional.IsDefined(MaxKeyPhraseCount)) + { + writer.WritePropertyName("maxKeyPhraseCount"u8); + writer.WriteNumberValue(MaxKeyPhraseCount.Value); + } + if (Optional.IsDefined(ModelVersion)) + { + writer.WritePropertyName("modelVersion"u8); + writer.WriteStringValue(ModelVersion); + } + } + + KeyPhraseExtractionSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeyPhraseExtractionSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyPhraseExtractionSkill(document.RootElement, options); + } + + internal static KeyPhraseExtractionSkill DeserializeKeyPhraseExtractionSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + KeyPhraseExtractionSkillLanguage? defaultLanguageCode = default; + int? maxKeyPhraseCount = default; + string modelVersion = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("defaultLanguageCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultLanguageCode = new KeyPhraseExtractionSkillLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("maxKeyPhraseCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxKeyPhraseCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("modelVersion"u8)) + { + modelVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new KeyPhraseExtractionSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + defaultLanguageCode, + maxKeyPhraseCount, + modelVersion); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(KeyPhraseExtractionSkill)} does not support writing '{options.Format}' format."); + } + } + + KeyPhraseExtractionSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeKeyPhraseExtractionSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(KeyPhraseExtractionSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new KeyPhraseExtractionSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeKeyPhraseExtractionSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeyPhraseExtractionSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeyPhraseExtractionSkill.cs new file mode 100644 index 000000000000..d03b9bb7aea5 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeyPhraseExtractionSkill.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// A skill that uses text analytics for key phrase extraction. + public partial class KeyPhraseExtractionSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public KeyPhraseExtractionSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Text.KeyPhraseExtractionSkill"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// A value indicating which language code to use. Default is `en`. + /// + /// A number indicating how many key phrases to return. If absent, all identified + /// key phrases will be returned. + /// + /// + /// The version of the model to use when calling the Text Analytics service. It + /// will default to the latest available when not specified. We recommend you do + /// not specify this value unless absolutely necessary. + /// + internal KeyPhraseExtractionSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, KeyPhraseExtractionSkillLanguage? defaultLanguageCode, int? maxKeyPhraseCount, string modelVersion) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + DefaultLanguageCode = defaultLanguageCode; + MaxKeyPhraseCount = maxKeyPhraseCount; + ModelVersion = modelVersion; + } + + /// Initializes a new instance of for deserialization. + internal KeyPhraseExtractionSkill() + { + } + + /// A value indicating which language code to use. Default is `en`. + public KeyPhraseExtractionSkillLanguage? DefaultLanguageCode { get; set; } + /// + /// A number indicating how many key phrases to return. If absent, all identified + /// key phrases will be returned. + /// + public int? MaxKeyPhraseCount { get; set; } + /// + /// The version of the model to use when calling the Text Analytics service. It + /// will default to the latest available when not specified. We recommend you do + /// not specify this value unless absolutely necessary. + /// + public string ModelVersion { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeyPhraseExtractionSkillLanguage.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeyPhraseExtractionSkillLanguage.cs new file mode 100644 index 000000000000..ba198c03ff6e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeyPhraseExtractionSkillLanguage.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// The language codes supported for input text by KeyPhraseExtractionSkill. + public readonly partial struct KeyPhraseExtractionSkillLanguage : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public KeyPhraseExtractionSkillLanguage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DaValue = "da"; + private const string NlValue = "nl"; + private const string EnValue = "en"; + private const string FiValue = "fi"; + private const string FrValue = "fr"; + private const string DeValue = "de"; + private const string ItValue = "it"; + private const string JaValue = "ja"; + private const string KoValue = "ko"; + private const string NoValue = "no"; + private const string PlValue = "pl"; + private const string PtPTValue = "pt-PT"; + private const string PtBRValue = "pt-BR"; + private const string RuValue = "ru"; + private const string EsValue = "es"; + private const string SvValue = "sv"; + + /// Danish. + public static KeyPhraseExtractionSkillLanguage Da { get; } = new KeyPhraseExtractionSkillLanguage(DaValue); + /// Dutch. + public static KeyPhraseExtractionSkillLanguage Nl { get; } = new KeyPhraseExtractionSkillLanguage(NlValue); + /// English. + public static KeyPhraseExtractionSkillLanguage En { get; } = new KeyPhraseExtractionSkillLanguage(EnValue); + /// Finnish. + public static KeyPhraseExtractionSkillLanguage Fi { get; } = new KeyPhraseExtractionSkillLanguage(FiValue); + /// French. + public static KeyPhraseExtractionSkillLanguage Fr { get; } = new KeyPhraseExtractionSkillLanguage(FrValue); + /// German. + public static KeyPhraseExtractionSkillLanguage De { get; } = new KeyPhraseExtractionSkillLanguage(DeValue); + /// Italian. + public static KeyPhraseExtractionSkillLanguage It { get; } = new KeyPhraseExtractionSkillLanguage(ItValue); + /// Japanese. + public static KeyPhraseExtractionSkillLanguage Ja { get; } = new KeyPhraseExtractionSkillLanguage(JaValue); + /// Korean. + public static KeyPhraseExtractionSkillLanguage Ko { get; } = new KeyPhraseExtractionSkillLanguage(KoValue); + /// Norwegian (Bokmaal). + public static KeyPhraseExtractionSkillLanguage No { get; } = new KeyPhraseExtractionSkillLanguage(NoValue); + /// Polish. + public static KeyPhraseExtractionSkillLanguage Pl { get; } = new KeyPhraseExtractionSkillLanguage(PlValue); + /// Portuguese (Portugal). + public static KeyPhraseExtractionSkillLanguage PtPT { get; } = new KeyPhraseExtractionSkillLanguage(PtPTValue); + /// Portuguese (Brazil). + public static KeyPhraseExtractionSkillLanguage PtBR { get; } = new KeyPhraseExtractionSkillLanguage(PtBRValue); + /// Russian. + public static KeyPhraseExtractionSkillLanguage Ru { get; } = new KeyPhraseExtractionSkillLanguage(RuValue); + /// Spanish. + public static KeyPhraseExtractionSkillLanguage Es { get; } = new KeyPhraseExtractionSkillLanguage(EsValue); + /// Swedish. + public static KeyPhraseExtractionSkillLanguage Sv { get; } = new KeyPhraseExtractionSkillLanguage(SvValue); + /// Determines if two values are the same. + public static bool operator ==(KeyPhraseExtractionSkillLanguage left, KeyPhraseExtractionSkillLanguage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(KeyPhraseExtractionSkillLanguage left, KeyPhraseExtractionSkillLanguage right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator KeyPhraseExtractionSkillLanguage(string value) => new KeyPhraseExtractionSkillLanguage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is KeyPhraseExtractionSkillLanguage other && Equals(other); + /// + public bool Equals(KeyPhraseExtractionSkillLanguage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeywordMarkerTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeywordMarkerTokenFilter.Serialization.cs new file mode 100644 index 000000000000..ec030ad6aac9 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeywordMarkerTokenFilter.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class KeywordMarkerTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeywordMarkerTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("keywords"u8); + writer.WriteStartArray(); + foreach (var item in Keywords) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(IgnoreCase)) + { + writer.WritePropertyName("ignoreCase"u8); + writer.WriteBooleanValue(IgnoreCase.Value); + } + } + + KeywordMarkerTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeywordMarkerTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeywordMarkerTokenFilter(document.RootElement, options); + } + + internal static KeywordMarkerTokenFilter DeserializeKeywordMarkerTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList keywords = default; + bool? ignoreCase = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keywords"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + keywords = array; + continue; + } + if (property.NameEquals("ignoreCase"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ignoreCase = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new KeywordMarkerTokenFilter(odataType, name, serializedAdditionalRawData, keywords, ignoreCase); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(KeywordMarkerTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + KeywordMarkerTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeKeywordMarkerTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(KeywordMarkerTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new KeywordMarkerTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeKeywordMarkerTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeywordMarkerTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeywordMarkerTokenFilter.cs new file mode 100644 index 000000000000..66a520a5f354 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeywordMarkerTokenFilter.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// Marks terms as keywords. This token filter is implemented using Apache Lucene. + public partial class KeywordMarkerTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// A list of words to mark as keywords. + /// or is null. + public KeywordMarkerTokenFilter(string name, IEnumerable keywords) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(keywords, nameof(keywords)); + + OdataType = "#Microsoft.Azure.Search.KeywordMarkerTokenFilter"; + Keywords = keywords.ToList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// A list of words to mark as keywords. + /// + /// A value indicating whether to ignore case. If true, all words are converted to + /// lower case first. Default is false. + /// + internal KeywordMarkerTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, IList keywords, bool? ignoreCase) : base(odataType, name, serializedAdditionalRawData) + { + Keywords = keywords; + IgnoreCase = ignoreCase; + } + + /// Initializes a new instance of for deserialization. + internal KeywordMarkerTokenFilter() + { + } + + /// A list of words to mark as keywords. + public IList Keywords { get; } + /// + /// A value indicating whether to ignore case. If true, all words are converted to + /// lower case first. Default is false. + /// + public bool? IgnoreCase { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeywordTokenizerV2.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeywordTokenizerV2.Serialization.cs new file mode 100644 index 000000000000..35a7fa098e18 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeywordTokenizerV2.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class KeywordTokenizerV2 : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeywordTokenizerV2)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(MaxTokenLength)) + { + writer.WritePropertyName("maxTokenLength"u8); + writer.WriteNumberValue(MaxTokenLength.Value); + } + } + + KeywordTokenizerV2 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeywordTokenizerV2)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeywordTokenizerV2(document.RootElement, options); + } + + internal static KeywordTokenizerV2 DeserializeKeywordTokenizerV2(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxTokenLength = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxTokenLength"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxTokenLength = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new KeywordTokenizerV2(odataType, name, serializedAdditionalRawData, maxTokenLength); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(KeywordTokenizerV2)} does not support writing '{options.Format}' format."); + } + } + + KeywordTokenizerV2 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeKeywordTokenizerV2(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(KeywordTokenizerV2)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new KeywordTokenizerV2 FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeKeywordTokenizerV2(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeywordTokenizerV2.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeywordTokenizerV2.cs new file mode 100644 index 000000000000..64dd757e3b9c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/KeywordTokenizerV2.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Emits the entire input as a single token. This tokenizer is implemented using + /// Apache Lucene. + /// + public partial class KeywordTokenizerV2 : LexicalTokenizer + { + /// Initializes a new instance of . + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// is null. + public KeywordTokenizerV2(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.KeywordTokenizerV2"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// The maximum token length. Default is 256. Tokens longer than the maximum length + /// are split. The maximum token length that can be used is 300 characters. + /// + internal KeywordTokenizerV2(string odataType, string name, IDictionary serializedAdditionalRawData, int? maxTokenLength) : base(odataType, name, serializedAdditionalRawData) + { + MaxTokenLength = maxTokenLength; + } + + /// Initializes a new instance of for deserialization. + internal KeywordTokenizerV2() + { + } + + /// + /// The maximum token length. Default is 256. Tokens longer than the maximum length + /// are split. The maximum token length that can be used is 300 characters. + /// + public int? MaxTokenLength { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LanguageDetectionSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LanguageDetectionSkill.Serialization.cs new file mode 100644 index 000000000000..e8ae1e5986ea --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LanguageDetectionSkill.Serialization.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class LanguageDetectionSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LanguageDetectionSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(DefaultCountryHint)) + { + writer.WritePropertyName("defaultCountryHint"u8); + writer.WriteStringValue(DefaultCountryHint); + } + if (Optional.IsDefined(ModelVersion)) + { + writer.WritePropertyName("modelVersion"u8); + writer.WriteStringValue(ModelVersion); + } + } + + LanguageDetectionSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LanguageDetectionSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLanguageDetectionSkill(document.RootElement, options); + } + + internal static LanguageDetectionSkill DeserializeLanguageDetectionSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string defaultCountryHint = default; + string modelVersion = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("defaultCountryHint"u8)) + { + defaultCountryHint = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelVersion"u8)) + { + modelVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LanguageDetectionSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + defaultCountryHint, + modelVersion); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LanguageDetectionSkill)} does not support writing '{options.Format}' format."); + } + } + + LanguageDetectionSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLanguageDetectionSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LanguageDetectionSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new LanguageDetectionSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLanguageDetectionSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LanguageDetectionSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LanguageDetectionSkill.cs new file mode 100644 index 000000000000..c3183b4a03e5 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LanguageDetectionSkill.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// A skill that detects the language of input text and reports a single language + /// code for every document submitted on the request. The language code is paired + /// with a score indicating the confidence of the analysis. + /// + public partial class LanguageDetectionSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public LanguageDetectionSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Text.LanguageDetectionSkill"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// + /// A country code to use as a hint to the language detection model if it cannot + /// disambiguate the language. + /// + /// + /// The version of the model to use when calling the Text Analytics service. It + /// will default to the latest available when not specified. We recommend you do + /// not specify this value unless absolutely necessary. + /// + internal LanguageDetectionSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, string defaultCountryHint, string modelVersion) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + DefaultCountryHint = defaultCountryHint; + ModelVersion = modelVersion; + } + + /// Initializes a new instance of for deserialization. + internal LanguageDetectionSkill() + { + } + + /// + /// A country code to use as a hint to the language detection model if it cannot + /// disambiguate the language. + /// + public string DefaultCountryHint { get; set; } + /// + /// The version of the model to use when calling the Text Analytics service. It + /// will default to the latest available when not specified. We recommend you do + /// not specify this value unless absolutely necessary. + /// + public string ModelVersion { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LengthTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LengthTokenFilter.Serialization.cs new file mode 100644 index 000000000000..0b213ae1d3c5 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LengthTokenFilter.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class LengthTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LengthTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Min)) + { + writer.WritePropertyName("min"u8); + writer.WriteNumberValue(Min.Value); + } + if (Optional.IsDefined(Max)) + { + writer.WritePropertyName("max"u8); + writer.WriteNumberValue(Max.Value); + } + } + + LengthTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LengthTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLengthTokenFilter(document.RootElement, options); + } + + internal static LengthTokenFilter DeserializeLengthTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? min = default; + int? max = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("min"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + min = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("max"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + max = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LengthTokenFilter(odataType, name, serializedAdditionalRawData, min, max); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LengthTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + LengthTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLengthTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LengthTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new LengthTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLengthTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LengthTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LengthTokenFilter.cs new file mode 100644 index 000000000000..578831bbbf6a --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LengthTokenFilter.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Removes words that are too long or too short. This token filter is implemented + /// using Apache Lucene. + /// + public partial class LengthTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// is null. + public LengthTokenFilter(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.LengthTokenFilter"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// The minimum length in characters. Default is 0. Maximum is 300. Must be less + /// than the value of max. + /// + /// The maximum length in characters. Default and maximum is 300. + internal LengthTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, int? min, int? max) : base(odataType, name, serializedAdditionalRawData) + { + Min = min; + Max = max; + } + + /// Initializes a new instance of for deserialization. + internal LengthTokenFilter() + { + } + + /// + /// The minimum length in characters. Default is 0. Maximum is 300. Must be less + /// than the value of max. + /// + public int? Min { get; set; } + /// The maximum length in characters. Default and maximum is 300. + public int? Max { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalAnalyzer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalAnalyzer.Serialization.cs new file mode 100644 index 000000000000..56eac03c66a6 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalAnalyzer.Serialization.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + [PersistableModelProxy(typeof(UnknownLexicalAnalyzer))] + public partial class LexicalAnalyzer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LexicalAnalyzer)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("@odata.type"u8); + writer.WriteStringValue(OdataType); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LexicalAnalyzer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LexicalAnalyzer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLexicalAnalyzer(document.RootElement, options); + } + + internal static LexicalAnalyzer DeserializeLexicalAnalyzer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("@odata.type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "#Microsoft.Azure.Search.CustomAnalyzer": return CustomAnalyzer.DeserializeCustomAnalyzer(element, options); + case "#Microsoft.Azure.Search.PatternAnalyzer": return PatternAnalyzer.DeserializePatternAnalyzer(element, options); + case "#Microsoft.Azure.Search.StandardAnalyzer": return LuceneStandardAnalyzer.DeserializeLuceneStandardAnalyzer(element, options); + case "#Microsoft.Azure.Search.StopAnalyzer": return StopAnalyzer.DeserializeStopAnalyzer(element, options); + } + } + return UnknownLexicalAnalyzer.DeserializeUnknownLexicalAnalyzer(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LexicalAnalyzer)} does not support writing '{options.Format}' format."); + } + } + + LexicalAnalyzer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLexicalAnalyzer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LexicalAnalyzer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static LexicalAnalyzer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLexicalAnalyzer(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalAnalyzer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalAnalyzer.cs new file mode 100644 index 000000000000..730e51ddc6de --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalAnalyzer.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Base type for analyzers. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + public abstract partial class LexicalAnalyzer + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// The name of the analyzer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// is null. + protected LexicalAnalyzer(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the analyzer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + internal LexicalAnalyzer(string odataType, string name, IDictionary serializedAdditionalRawData) + { + OdataType = odataType; + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal LexicalAnalyzer() + { + } + + /// The discriminator for derived types. + internal string OdataType { get; set; } + /// + /// The name of the analyzer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + public string Name { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalAnalyzerName.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalAnalyzerName.cs new file mode 100644 index 000000000000..cef07bdb8f81 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalAnalyzerName.cs @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Defines the names of all text analyzers supported by the search engine. + public readonly partial struct LexicalAnalyzerName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public LexicalAnalyzerName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ArMicrosoftValue = "ar.microsoft"; + private const string ArLuceneValue = "ar.lucene"; + private const string HyLuceneValue = "hy.lucene"; + private const string BnMicrosoftValue = "bn.microsoft"; + private const string EuLuceneValue = "eu.lucene"; + private const string BgMicrosoftValue = "bg.microsoft"; + private const string BgLuceneValue = "bg.lucene"; + private const string CaMicrosoftValue = "ca.microsoft"; + private const string CaLuceneValue = "ca.lucene"; + private const string ZhHansMicrosoftValue = "zh-Hans.microsoft"; + private const string ZhHansLuceneValue = "zh-Hans.lucene"; + private const string ZhHantMicrosoftValue = "zh-Hant.microsoft"; + private const string ZhHantLuceneValue = "zh-Hant.lucene"; + private const string HrMicrosoftValue = "hr.microsoft"; + private const string CsMicrosoftValue = "cs.microsoft"; + private const string CsLuceneValue = "cs.lucene"; + private const string DaMicrosoftValue = "da.microsoft"; + private const string DaLuceneValue = "da.lucene"; + private const string NlMicrosoftValue = "nl.microsoft"; + private const string NlLuceneValue = "nl.lucene"; + private const string EnMicrosoftValue = "en.microsoft"; + private const string EnLuceneValue = "en.lucene"; + private const string EtMicrosoftValue = "et.microsoft"; + private const string FiMicrosoftValue = "fi.microsoft"; + private const string FiLuceneValue = "fi.lucene"; + private const string FrMicrosoftValue = "fr.microsoft"; + private const string FrLuceneValue = "fr.lucene"; + private const string GlLuceneValue = "gl.lucene"; + private const string DeMicrosoftValue = "de.microsoft"; + private const string DeLuceneValue = "de.lucene"; + private const string ElMicrosoftValue = "el.microsoft"; + private const string ElLuceneValue = "el.lucene"; + private const string GuMicrosoftValue = "gu.microsoft"; + private const string HeMicrosoftValue = "he.microsoft"; + private const string HiMicrosoftValue = "hi.microsoft"; + private const string HiLuceneValue = "hi.lucene"; + private const string HuMicrosoftValue = "hu.microsoft"; + private const string HuLuceneValue = "hu.lucene"; + private const string IsMicrosoftValue = "is.microsoft"; + private const string IdMicrosoftValue = "id.microsoft"; + private const string IdLuceneValue = "id.lucene"; + private const string GaLuceneValue = "ga.lucene"; + private const string ItMicrosoftValue = "it.microsoft"; + private const string ItLuceneValue = "it.lucene"; + private const string JaMicrosoftValue = "ja.microsoft"; + private const string JaLuceneValue = "ja.lucene"; + private const string KnMicrosoftValue = "kn.microsoft"; + private const string KoMicrosoftValue = "ko.microsoft"; + private const string KoLuceneValue = "ko.lucene"; + private const string LvMicrosoftValue = "lv.microsoft"; + private const string LvLuceneValue = "lv.lucene"; + private const string LtMicrosoftValue = "lt.microsoft"; + private const string MlMicrosoftValue = "ml.microsoft"; + private const string MsMicrosoftValue = "ms.microsoft"; + private const string MrMicrosoftValue = "mr.microsoft"; + private const string NbMicrosoftValue = "nb.microsoft"; + private const string NoLuceneValue = "no.lucene"; + private const string FaLuceneValue = "fa.lucene"; + private const string PlMicrosoftValue = "pl.microsoft"; + private const string PlLuceneValue = "pl.lucene"; + private const string PtBrMicrosoftValue = "pt-BR.microsoft"; + private const string PtBrLuceneValue = "pt-BR.lucene"; + private const string PtPtMicrosoftValue = "pt-PT.microsoft"; + private const string PtPtLuceneValue = "pt-PT.lucene"; + private const string PaMicrosoftValue = "pa.microsoft"; + private const string RoMicrosoftValue = "ro.microsoft"; + private const string RoLuceneValue = "ro.lucene"; + private const string RuMicrosoftValue = "ru.microsoft"; + private const string RuLuceneValue = "ru.lucene"; + private const string SrCyrillicMicrosoftValue = "sr-cyrillic.microsoft"; + private const string SrLatinMicrosoftValue = "sr-latin.microsoft"; + private const string SkMicrosoftValue = "sk.microsoft"; + private const string SlMicrosoftValue = "sl.microsoft"; + private const string EsMicrosoftValue = "es.microsoft"; + private const string EsLuceneValue = "es.lucene"; + private const string SvMicrosoftValue = "sv.microsoft"; + private const string SvLuceneValue = "sv.lucene"; + private const string TaMicrosoftValue = "ta.microsoft"; + private const string TeMicrosoftValue = "te.microsoft"; + private const string ThMicrosoftValue = "th.microsoft"; + private const string ThLuceneValue = "th.lucene"; + private const string TrMicrosoftValue = "tr.microsoft"; + private const string TrLuceneValue = "tr.lucene"; + private const string UkMicrosoftValue = "uk.microsoft"; + private const string UrMicrosoftValue = "ur.microsoft"; + private const string ViMicrosoftValue = "vi.microsoft"; + private const string StandardLuceneValue = "standard.lucene"; + private const string StandardAsciiFoldingLuceneValue = "standardasciifolding.lucene"; + private const string KeywordValue = "keyword"; + private const string PatternValue = "pattern"; + private const string SimpleValue = "simple"; + private const string StopValue = "stop"; + private const string WhitespaceValue = "whitespace"; + + /// Microsoft analyzer for Arabic. + public static LexicalAnalyzerName ArMicrosoft { get; } = new LexicalAnalyzerName(ArMicrosoftValue); + /// Lucene analyzer for Arabic. + public static LexicalAnalyzerName ArLucene { get; } = new LexicalAnalyzerName(ArLuceneValue); + /// Lucene analyzer for Armenian. + public static LexicalAnalyzerName HyLucene { get; } = new LexicalAnalyzerName(HyLuceneValue); + /// Microsoft analyzer for Bangla. + public static LexicalAnalyzerName BnMicrosoft { get; } = new LexicalAnalyzerName(BnMicrosoftValue); + /// Lucene analyzer for Basque. + public static LexicalAnalyzerName EuLucene { get; } = new LexicalAnalyzerName(EuLuceneValue); + /// Microsoft analyzer for Bulgarian. + public static LexicalAnalyzerName BgMicrosoft { get; } = new LexicalAnalyzerName(BgMicrosoftValue); + /// Lucene analyzer for Bulgarian. + public static LexicalAnalyzerName BgLucene { get; } = new LexicalAnalyzerName(BgLuceneValue); + /// Microsoft analyzer for Catalan. + public static LexicalAnalyzerName CaMicrosoft { get; } = new LexicalAnalyzerName(CaMicrosoftValue); + /// Lucene analyzer for Catalan. + public static LexicalAnalyzerName CaLucene { get; } = new LexicalAnalyzerName(CaLuceneValue); + /// Microsoft analyzer for Chinese (Simplified). + public static LexicalAnalyzerName ZhHansMicrosoft { get; } = new LexicalAnalyzerName(ZhHansMicrosoftValue); + /// Lucene analyzer for Chinese (Simplified). + public static LexicalAnalyzerName ZhHansLucene { get; } = new LexicalAnalyzerName(ZhHansLuceneValue); + /// Microsoft analyzer for Chinese (Traditional). + public static LexicalAnalyzerName ZhHantMicrosoft { get; } = new LexicalAnalyzerName(ZhHantMicrosoftValue); + /// Lucene analyzer for Chinese (Traditional). + public static LexicalAnalyzerName ZhHantLucene { get; } = new LexicalAnalyzerName(ZhHantLuceneValue); + /// Microsoft analyzer for Croatian. + public static LexicalAnalyzerName HrMicrosoft { get; } = new LexicalAnalyzerName(HrMicrosoftValue); + /// Microsoft analyzer for Czech. + public static LexicalAnalyzerName CsMicrosoft { get; } = new LexicalAnalyzerName(CsMicrosoftValue); + /// Lucene analyzer for Czech. + public static LexicalAnalyzerName CsLucene { get; } = new LexicalAnalyzerName(CsLuceneValue); + /// Microsoft analyzer for Danish. + public static LexicalAnalyzerName DaMicrosoft { get; } = new LexicalAnalyzerName(DaMicrosoftValue); + /// Lucene analyzer for Danish. + public static LexicalAnalyzerName DaLucene { get; } = new LexicalAnalyzerName(DaLuceneValue); + /// Microsoft analyzer for Dutch. + public static LexicalAnalyzerName NlMicrosoft { get; } = new LexicalAnalyzerName(NlMicrosoftValue); + /// Lucene analyzer for Dutch. + public static LexicalAnalyzerName NlLucene { get; } = new LexicalAnalyzerName(NlLuceneValue); + /// Microsoft analyzer for English. + public static LexicalAnalyzerName EnMicrosoft { get; } = new LexicalAnalyzerName(EnMicrosoftValue); + /// Lucene analyzer for English. + public static LexicalAnalyzerName EnLucene { get; } = new LexicalAnalyzerName(EnLuceneValue); + /// Microsoft analyzer for Estonian. + public static LexicalAnalyzerName EtMicrosoft { get; } = new LexicalAnalyzerName(EtMicrosoftValue); + /// Microsoft analyzer for Finnish. + public static LexicalAnalyzerName FiMicrosoft { get; } = new LexicalAnalyzerName(FiMicrosoftValue); + /// Lucene analyzer for Finnish. + public static LexicalAnalyzerName FiLucene { get; } = new LexicalAnalyzerName(FiLuceneValue); + /// Microsoft analyzer for French. + public static LexicalAnalyzerName FrMicrosoft { get; } = new LexicalAnalyzerName(FrMicrosoftValue); + /// Lucene analyzer for French. + public static LexicalAnalyzerName FrLucene { get; } = new LexicalAnalyzerName(FrLuceneValue); + /// Lucene analyzer for Galician. + public static LexicalAnalyzerName GlLucene { get; } = new LexicalAnalyzerName(GlLuceneValue); + /// Microsoft analyzer for German. + public static LexicalAnalyzerName DeMicrosoft { get; } = new LexicalAnalyzerName(DeMicrosoftValue); + /// Lucene analyzer for German. + public static LexicalAnalyzerName DeLucene { get; } = new LexicalAnalyzerName(DeLuceneValue); + /// Microsoft analyzer for Greek. + public static LexicalAnalyzerName ElMicrosoft { get; } = new LexicalAnalyzerName(ElMicrosoftValue); + /// Lucene analyzer for Greek. + public static LexicalAnalyzerName ElLucene { get; } = new LexicalAnalyzerName(ElLuceneValue); + /// Microsoft analyzer for Gujarati. + public static LexicalAnalyzerName GuMicrosoft { get; } = new LexicalAnalyzerName(GuMicrosoftValue); + /// Microsoft analyzer for Hebrew. + public static LexicalAnalyzerName HeMicrosoft { get; } = new LexicalAnalyzerName(HeMicrosoftValue); + /// Microsoft analyzer for Hindi. + public static LexicalAnalyzerName HiMicrosoft { get; } = new LexicalAnalyzerName(HiMicrosoftValue); + /// Lucene analyzer for Hindi. + public static LexicalAnalyzerName HiLucene { get; } = new LexicalAnalyzerName(HiLuceneValue); + /// Microsoft analyzer for Hungarian. + public static LexicalAnalyzerName HuMicrosoft { get; } = new LexicalAnalyzerName(HuMicrosoftValue); + /// Lucene analyzer for Hungarian. + public static LexicalAnalyzerName HuLucene { get; } = new LexicalAnalyzerName(HuLuceneValue); + /// Microsoft analyzer for Icelandic. + public static LexicalAnalyzerName IsMicrosoft { get; } = new LexicalAnalyzerName(IsMicrosoftValue); + /// Microsoft analyzer for Indonesian (Bahasa). + public static LexicalAnalyzerName IdMicrosoft { get; } = new LexicalAnalyzerName(IdMicrosoftValue); + /// Lucene analyzer for Indonesian. + public static LexicalAnalyzerName IdLucene { get; } = new LexicalAnalyzerName(IdLuceneValue); + /// Lucene analyzer for Irish. + public static LexicalAnalyzerName GaLucene { get; } = new LexicalAnalyzerName(GaLuceneValue); + /// Microsoft analyzer for Italian. + public static LexicalAnalyzerName ItMicrosoft { get; } = new LexicalAnalyzerName(ItMicrosoftValue); + /// Lucene analyzer for Italian. + public static LexicalAnalyzerName ItLucene { get; } = new LexicalAnalyzerName(ItLuceneValue); + /// Microsoft analyzer for Japanese. + public static LexicalAnalyzerName JaMicrosoft { get; } = new LexicalAnalyzerName(JaMicrosoftValue); + /// Lucene analyzer for Japanese. + public static LexicalAnalyzerName JaLucene { get; } = new LexicalAnalyzerName(JaLuceneValue); + /// Microsoft analyzer for Kannada. + public static LexicalAnalyzerName KnMicrosoft { get; } = new LexicalAnalyzerName(KnMicrosoftValue); + /// Microsoft analyzer for Korean. + public static LexicalAnalyzerName KoMicrosoft { get; } = new LexicalAnalyzerName(KoMicrosoftValue); + /// Lucene analyzer for Korean. + public static LexicalAnalyzerName KoLucene { get; } = new LexicalAnalyzerName(KoLuceneValue); + /// Microsoft analyzer for Latvian. + public static LexicalAnalyzerName LvMicrosoft { get; } = new LexicalAnalyzerName(LvMicrosoftValue); + /// Lucene analyzer for Latvian. + public static LexicalAnalyzerName LvLucene { get; } = new LexicalAnalyzerName(LvLuceneValue); + /// Microsoft analyzer for Lithuanian. + public static LexicalAnalyzerName LtMicrosoft { get; } = new LexicalAnalyzerName(LtMicrosoftValue); + /// Microsoft analyzer for Malayalam. + public static LexicalAnalyzerName MlMicrosoft { get; } = new LexicalAnalyzerName(MlMicrosoftValue); + /// Microsoft analyzer for Malay (Latin). + public static LexicalAnalyzerName MsMicrosoft { get; } = new LexicalAnalyzerName(MsMicrosoftValue); + /// Microsoft analyzer for Marathi. + public static LexicalAnalyzerName MrMicrosoft { get; } = new LexicalAnalyzerName(MrMicrosoftValue); + /// Microsoft analyzer for Norwegian (Bokmål). + public static LexicalAnalyzerName NbMicrosoft { get; } = new LexicalAnalyzerName(NbMicrosoftValue); + /// Lucene analyzer for Norwegian. + public static LexicalAnalyzerName NoLucene { get; } = new LexicalAnalyzerName(NoLuceneValue); + /// Lucene analyzer for Persian. + public static LexicalAnalyzerName FaLucene { get; } = new LexicalAnalyzerName(FaLuceneValue); + /// Microsoft analyzer for Polish. + public static LexicalAnalyzerName PlMicrosoft { get; } = new LexicalAnalyzerName(PlMicrosoftValue); + /// Lucene analyzer for Polish. + public static LexicalAnalyzerName PlLucene { get; } = new LexicalAnalyzerName(PlLuceneValue); + /// Microsoft analyzer for Portuguese (Brazil). + public static LexicalAnalyzerName PtBrMicrosoft { get; } = new LexicalAnalyzerName(PtBrMicrosoftValue); + /// Lucene analyzer for Portuguese (Brazil). + public static LexicalAnalyzerName PtBrLucene { get; } = new LexicalAnalyzerName(PtBrLuceneValue); + /// Microsoft analyzer for Portuguese (Portugal). + public static LexicalAnalyzerName PtPtMicrosoft { get; } = new LexicalAnalyzerName(PtPtMicrosoftValue); + /// Lucene analyzer for Portuguese (Portugal). + public static LexicalAnalyzerName PtPtLucene { get; } = new LexicalAnalyzerName(PtPtLuceneValue); + /// Microsoft analyzer for Punjabi. + public static LexicalAnalyzerName PaMicrosoft { get; } = new LexicalAnalyzerName(PaMicrosoftValue); + /// Microsoft analyzer for Romanian. + public static LexicalAnalyzerName RoMicrosoft { get; } = new LexicalAnalyzerName(RoMicrosoftValue); + /// Lucene analyzer for Romanian. + public static LexicalAnalyzerName RoLucene { get; } = new LexicalAnalyzerName(RoLuceneValue); + /// Microsoft analyzer for Russian. + public static LexicalAnalyzerName RuMicrosoft { get; } = new LexicalAnalyzerName(RuMicrosoftValue); + /// Lucene analyzer for Russian. + public static LexicalAnalyzerName RuLucene { get; } = new LexicalAnalyzerName(RuLuceneValue); + /// Microsoft analyzer for Serbian (Cyrillic). + public static LexicalAnalyzerName SrCyrillicMicrosoft { get; } = new LexicalAnalyzerName(SrCyrillicMicrosoftValue); + /// Microsoft analyzer for Serbian (Latin). + public static LexicalAnalyzerName SrLatinMicrosoft { get; } = new LexicalAnalyzerName(SrLatinMicrosoftValue); + /// Microsoft analyzer for Slovak. + public static LexicalAnalyzerName SkMicrosoft { get; } = new LexicalAnalyzerName(SkMicrosoftValue); + /// Microsoft analyzer for Slovenian. + public static LexicalAnalyzerName SlMicrosoft { get; } = new LexicalAnalyzerName(SlMicrosoftValue); + /// Microsoft analyzer for Spanish. + public static LexicalAnalyzerName EsMicrosoft { get; } = new LexicalAnalyzerName(EsMicrosoftValue); + /// Lucene analyzer for Spanish. + public static LexicalAnalyzerName EsLucene { get; } = new LexicalAnalyzerName(EsLuceneValue); + /// Microsoft analyzer for Swedish. + public static LexicalAnalyzerName SvMicrosoft { get; } = new LexicalAnalyzerName(SvMicrosoftValue); + /// Lucene analyzer for Swedish. + public static LexicalAnalyzerName SvLucene { get; } = new LexicalAnalyzerName(SvLuceneValue); + /// Microsoft analyzer for Tamil. + public static LexicalAnalyzerName TaMicrosoft { get; } = new LexicalAnalyzerName(TaMicrosoftValue); + /// Microsoft analyzer for Telugu. + public static LexicalAnalyzerName TeMicrosoft { get; } = new LexicalAnalyzerName(TeMicrosoftValue); + /// Microsoft analyzer for Thai. + public static LexicalAnalyzerName ThMicrosoft { get; } = new LexicalAnalyzerName(ThMicrosoftValue); + /// Lucene analyzer for Thai. + public static LexicalAnalyzerName ThLucene { get; } = new LexicalAnalyzerName(ThLuceneValue); + /// Microsoft analyzer for Turkish. + public static LexicalAnalyzerName TrMicrosoft { get; } = new LexicalAnalyzerName(TrMicrosoftValue); + /// Lucene analyzer for Turkish. + public static LexicalAnalyzerName TrLucene { get; } = new LexicalAnalyzerName(TrLuceneValue); + /// Microsoft analyzer for Ukrainian. + public static LexicalAnalyzerName UkMicrosoft { get; } = new LexicalAnalyzerName(UkMicrosoftValue); + /// Microsoft analyzer for Urdu. + public static LexicalAnalyzerName UrMicrosoft { get; } = new LexicalAnalyzerName(UrMicrosoftValue); + /// Microsoft analyzer for Vietnamese. + public static LexicalAnalyzerName ViMicrosoft { get; } = new LexicalAnalyzerName(ViMicrosoftValue); + /// Standard Lucene analyzer. + public static LexicalAnalyzerName StandardLucene { get; } = new LexicalAnalyzerName(StandardLuceneValue); + /// + /// Standard ASCII Folding Lucene analyzer. See + /// https://learn.microsoft.com/rest/api/searchservice/Custom-analyzers-in-Azure-Search#Analyzers + /// + public static LexicalAnalyzerName StandardAsciiFoldingLucene { get; } = new LexicalAnalyzerName(StandardAsciiFoldingLuceneValue); + /// + /// Treats the entire content of a field as a single token. This is useful for data + /// like zip codes, ids, and some product names. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/KeywordAnalyzer.html + /// + public static LexicalAnalyzerName Keyword { get; } = new LexicalAnalyzerName(KeywordValue); + /// + /// Flexibly separates text into terms via a regular expression pattern. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/PatternAnalyzer.html + /// + public static LexicalAnalyzerName Pattern { get; } = new LexicalAnalyzerName(PatternValue); + /// + /// Divides text at non-letters and converts them to lower case. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/SimpleAnalyzer.html + /// + public static LexicalAnalyzerName Simple { get; } = new LexicalAnalyzerName(SimpleValue); + /// + /// Divides text at non-letters; Applies the lowercase and stopword token filters. + /// See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/StopAnalyzer.html + /// + public static LexicalAnalyzerName Stop { get; } = new LexicalAnalyzerName(StopValue); + /// + /// An analyzer that uses the whitespace tokenizer. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/WhitespaceAnalyzer.html + /// + public static LexicalAnalyzerName Whitespace { get; } = new LexicalAnalyzerName(WhitespaceValue); + /// Determines if two values are the same. + public static bool operator ==(LexicalAnalyzerName left, LexicalAnalyzerName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LexicalAnalyzerName left, LexicalAnalyzerName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator LexicalAnalyzerName(string value) => new LexicalAnalyzerName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LexicalAnalyzerName other && Equals(other); + /// + public bool Equals(LexicalAnalyzerName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalTokenizer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalTokenizer.Serialization.cs new file mode 100644 index 000000000000..0b447ee2fea1 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalTokenizer.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + [PersistableModelProxy(typeof(UnknownLexicalTokenizer))] + public partial class LexicalTokenizer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LexicalTokenizer)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("@odata.type"u8); + writer.WriteStringValue(OdataType); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LexicalTokenizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LexicalTokenizer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLexicalTokenizer(document.RootElement, options); + } + + internal static LexicalTokenizer DeserializeLexicalTokenizer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("@odata.type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "#Microsoft.Azure.Search.ClassicTokenizer": return ClassicTokenizer.DeserializeClassicTokenizer(element, options); + case "#Microsoft.Azure.Search.EdgeNGramTokenizer": return EdgeNGramTokenizer.DeserializeEdgeNGramTokenizer(element, options); + case "#Microsoft.Azure.Search.KeywordTokenizerV2": return KeywordTokenizerV2.DeserializeKeywordTokenizerV2(element, options); + case "#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer": return MicrosoftLanguageStemmingTokenizer.DeserializeMicrosoftLanguageStemmingTokenizer(element, options); + case "#Microsoft.Azure.Search.MicrosoftLanguageTokenizer": return MicrosoftLanguageTokenizer.DeserializeMicrosoftLanguageTokenizer(element, options); + case "#Microsoft.Azure.Search.NGramTokenizer": return NGramTokenizer.DeserializeNGramTokenizer(element, options); + case "#Microsoft.Azure.Search.PathHierarchyTokenizerV2": return PathHierarchyTokenizerV2.DeserializePathHierarchyTokenizerV2(element, options); + case "#Microsoft.Azure.Search.PatternTokenizer": return PatternTokenizer.DeserializePatternTokenizer(element, options); + case "#Microsoft.Azure.Search.StandardTokenizerV2": return LuceneStandardTokenizerV2.DeserializeLuceneStandardTokenizerV2(element, options); + case "#Microsoft.Azure.Search.UaxUrlEmailTokenizer": return UaxUrlEmailTokenizer.DeserializeUaxUrlEmailTokenizer(element, options); + } + } + return UnknownLexicalTokenizer.DeserializeUnknownLexicalTokenizer(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LexicalTokenizer)} does not support writing '{options.Format}' format."); + } + } + + LexicalTokenizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLexicalTokenizer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LexicalTokenizer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static LexicalTokenizer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLexicalTokenizer(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalTokenizer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalTokenizer.cs new file mode 100644 index 000000000000..9247edcc6e29 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalTokenizer.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Base type for tokenizers. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , and . + /// + public abstract partial class LexicalTokenizer + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// is null. + protected LexicalTokenizer(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + internal LexicalTokenizer(string odataType, string name, IDictionary serializedAdditionalRawData) + { + OdataType = odataType; + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal LexicalTokenizer() + { + } + + /// The discriminator for derived types. + internal string OdataType { get; set; } + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + public string Name { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalTokenizerName.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalTokenizerName.cs new file mode 100644 index 000000000000..ae71580add96 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LexicalTokenizerName.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Defines the names of all tokenizers supported by the search engine. + public readonly partial struct LexicalTokenizerName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public LexicalTokenizerName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ClassicValue = "classic"; + private const string EdgeNGramValue = "edgeNGram"; + private const string KeywordValue = "keyword_v2"; + private const string LetterValue = "letter"; + private const string LowercaseValue = "lowercase"; + private const string MicrosoftLanguageTokenizerValue = "microsoft_language_tokenizer"; + private const string MicrosoftLanguageStemmingTokenizerValue = "microsoft_language_stemming_tokenizer"; + private const string NGramValue = "nGram"; + private const string PathHierarchyValue = "path_hierarchy_v2"; + private const string PatternValue = "pattern"; + private const string StandardValue = "standard_v2"; + private const string UaxUrlEmailValue = "uax_url_email"; + private const string WhitespaceValue = "whitespace"; + + /// + /// Grammar-based tokenizer that is suitable for processing most European-language + /// documents. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/ClassicTokenizer.html + /// + public static LexicalTokenizerName Classic { get; } = new LexicalTokenizerName(ClassicValue); + /// + /// Tokenizes the input from an edge into n-grams of the given size(s). See + /// https://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/EdgeNGramTokenizer.html + /// + public static LexicalTokenizerName EdgeNGram { get; } = new LexicalTokenizerName(EdgeNGramValue); + /// + /// Emits the entire input as a single token. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/KeywordTokenizer.html + /// + public static LexicalTokenizerName Keyword { get; } = new LexicalTokenizerName(KeywordValue); + /// + /// Divides text at non-letters. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/LetterTokenizer.html + /// + public static LexicalTokenizerName Letter { get; } = new LexicalTokenizerName(LetterValue); + /// + /// Divides text at non-letters and converts them to lower case. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/LowerCaseTokenizer.html + /// + public static LexicalTokenizerName Lowercase { get; } = new LexicalTokenizerName(LowercaseValue); + /// Divides text using language-specific rules. + public static LexicalTokenizerName MicrosoftLanguageTokenizer { get; } = new LexicalTokenizerName(MicrosoftLanguageTokenizerValue); + /// + /// Divides text using language-specific rules and reduces words to their base + /// forms. + /// + public static LexicalTokenizerName MicrosoftLanguageStemmingTokenizer { get; } = new LexicalTokenizerName(MicrosoftLanguageStemmingTokenizerValue); + /// + /// Tokenizes the input into n-grams of the given size(s). See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/NGramTokenizer.html + /// + public static LexicalTokenizerName NGram { get; } = new LexicalTokenizerName(NGramValue); + /// + /// Tokenizer for path-like hierarchies. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/path/PathHierarchyTokenizer.html + /// + public static LexicalTokenizerName PathHierarchy { get; } = new LexicalTokenizerName(PathHierarchyValue); + /// + /// Tokenizer that uses regex pattern matching to construct distinct tokens. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/pattern/PatternTokenizer.html + /// + public static LexicalTokenizerName Pattern { get; } = new LexicalTokenizerName(PatternValue); + /// + /// Standard Lucene analyzer; Composed of the standard tokenizer, lowercase filter + /// and stop filter. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/StandardTokenizer.html + /// + public static LexicalTokenizerName Standard { get; } = new LexicalTokenizerName(StandardValue); + /// + /// Tokenizes urls and emails as one token. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.html + /// + public static LexicalTokenizerName UaxUrlEmail { get; } = new LexicalTokenizerName(UaxUrlEmailValue); + /// + /// Divides text at whitespace. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/WhitespaceTokenizer.html + /// + public static LexicalTokenizerName Whitespace { get; } = new LexicalTokenizerName(WhitespaceValue); + /// Determines if two values are the same. + public static bool operator ==(LexicalTokenizerName left, LexicalTokenizerName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LexicalTokenizerName left, LexicalTokenizerName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator LexicalTokenizerName(string value) => new LexicalTokenizerName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LexicalTokenizerName other && Equals(other); + /// + public bool Equals(LexicalTokenizerName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LimitTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LimitTokenFilter.Serialization.cs new file mode 100644 index 000000000000..4c8d13dce1f7 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LimitTokenFilter.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class LimitTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LimitTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(MaxTokenCount)) + { + writer.WritePropertyName("maxTokenCount"u8); + writer.WriteNumberValue(MaxTokenCount.Value); + } + if (Optional.IsDefined(ConsumeAllTokens)) + { + writer.WritePropertyName("consumeAllTokens"u8); + writer.WriteBooleanValue(ConsumeAllTokens.Value); + } + } + + LimitTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LimitTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLimitTokenFilter(document.RootElement, options); + } + + internal static LimitTokenFilter DeserializeLimitTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxTokenCount = default; + bool? consumeAllTokens = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxTokenCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxTokenCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("consumeAllTokens"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + consumeAllTokens = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LimitTokenFilter(odataType, name, serializedAdditionalRawData, maxTokenCount, consumeAllTokens); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LimitTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + LimitTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLimitTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LimitTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new LimitTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLimitTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LimitTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LimitTokenFilter.cs new file mode 100644 index 000000000000..ec8fb3e5bb05 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LimitTokenFilter.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Limits the number of tokens while indexing. This token filter is implemented + /// using Apache Lucene. + /// + public partial class LimitTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// is null. + public LimitTokenFilter(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.LimitTokenFilter"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// The maximum number of tokens to produce. Default is 1. + /// + /// A value indicating whether all tokens from the input must be consumed even if + /// maxTokenCount is reached. Default is false. + /// + internal LimitTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, int? maxTokenCount, bool? consumeAllTokens) : base(odataType, name, serializedAdditionalRawData) + { + MaxTokenCount = maxTokenCount; + ConsumeAllTokens = consumeAllTokens; + } + + /// Initializes a new instance of for deserialization. + internal LimitTokenFilter() + { + } + + /// The maximum number of tokens to produce. Default is 1. + public int? MaxTokenCount { get; set; } + /// + /// A value indicating whether all tokens from the input must be consumed even if + /// maxTokenCount is reached. Default is false. + /// + public bool? ConsumeAllTokens { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListDataSourcesResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListDataSourcesResult.Serialization.cs new file mode 100644 index 000000000000..a6bc06e0c990 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListDataSourcesResult.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ListDataSourcesResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ListDataSourcesResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ListDataSourcesResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ListDataSourcesResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeListDataSourcesResult(document.RootElement, options); + } + + internal static ListDataSourcesResult DeserializeListDataSourcesResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SearchIndexerDataSource.DeserializeSearchIndexerDataSource(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ListDataSourcesResult(value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ListDataSourcesResult)} does not support writing '{options.Format}' format."); + } + } + + ListDataSourcesResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeListDataSourcesResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ListDataSourcesResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ListDataSourcesResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeListDataSourcesResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListDataSourcesResult.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListDataSourcesResult.cs new file mode 100644 index 000000000000..c0e35d73cf4a --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListDataSourcesResult.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Response from a List Datasources request. If successful, it includes the full + /// definitions of all datasources. + /// + public partial class ListDataSourcesResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The datasources in the Search service. + /// is null. + internal ListDataSourcesResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The datasources in the Search service. + /// Keeps track of any properties unknown to the library. + internal ListDataSourcesResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ListDataSourcesResult() + { + } + + /// The datasources in the Search service. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListIndexersResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListIndexersResult.Serialization.cs new file mode 100644 index 000000000000..8bb4b72d7502 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListIndexersResult.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ListIndexersResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ListIndexersResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ListIndexersResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ListIndexersResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeListIndexersResult(document.RootElement, options); + } + + internal static ListIndexersResult DeserializeListIndexersResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SearchIndexer.DeserializeSearchIndexer(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ListIndexersResult(value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ListIndexersResult)} does not support writing '{options.Format}' format."); + } + } + + ListIndexersResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeListIndexersResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ListIndexersResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ListIndexersResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeListIndexersResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListIndexersResult.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListIndexersResult.cs new file mode 100644 index 000000000000..61f81bf251fa --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListIndexersResult.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Response from a List Indexers request. If successful, it includes the full + /// definitions of all indexers. + /// + public partial class ListIndexersResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The indexers in the Search service. + /// is null. + internal ListIndexersResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The indexers in the Search service. + /// Keeps track of any properties unknown to the library. + internal ListIndexersResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ListIndexersResult() + { + } + + /// The indexers in the Search service. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListSkillsetsResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListSkillsetsResult.Serialization.cs new file mode 100644 index 000000000000..8b296e2f940b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListSkillsetsResult.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ListSkillsetsResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ListSkillsetsResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ListSkillsetsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ListSkillsetsResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeListSkillsetsResult(document.RootElement, options); + } + + internal static ListSkillsetsResult DeserializeListSkillsetsResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SearchIndexerSkillset.DeserializeSearchIndexerSkillset(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ListSkillsetsResult(value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ListSkillsetsResult)} does not support writing '{options.Format}' format."); + } + } + + ListSkillsetsResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeListSkillsetsResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ListSkillsetsResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ListSkillsetsResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeListSkillsetsResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListSkillsetsResult.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListSkillsetsResult.cs new file mode 100644 index 000000000000..251eaaaa4c53 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListSkillsetsResult.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Response from a list skillset request. If successful, it includes the full + /// definitions of all skillsets. + /// + public partial class ListSkillsetsResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The skillsets defined in the Search service. + /// is null. + internal ListSkillsetsResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The skillsets defined in the Search service. + /// Keeps track of any properties unknown to the library. + internal ListSkillsetsResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ListSkillsetsResult() + { + } + + /// The skillsets defined in the Search service. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListSynonymMapsResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListSynonymMapsResult.Serialization.cs new file mode 100644 index 000000000000..e19f7f30e962 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListSynonymMapsResult.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ListSynonymMapsResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ListSynonymMapsResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ListSynonymMapsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ListSynonymMapsResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeListSynonymMapsResult(document.RootElement, options); + } + + internal static ListSynonymMapsResult DeserializeListSynonymMapsResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SynonymMap.DeserializeSynonymMap(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ListSynonymMapsResult(value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ListSynonymMapsResult)} does not support writing '{options.Format}' format."); + } + } + + ListSynonymMapsResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeListSynonymMapsResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ListSynonymMapsResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ListSynonymMapsResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeListSynonymMapsResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListSynonymMapsResult.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListSynonymMapsResult.cs new file mode 100644 index 000000000000..7357b35caf6e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ListSynonymMapsResult.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Response from a List SynonymMaps request. If successful, it includes the full + /// definitions of all synonym maps. + /// + public partial class ListSynonymMapsResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The synonym maps in the Search service. + /// is null. + internal ListSynonymMapsResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The synonym maps in the Search service. + /// Keeps track of any properties unknown to the library. + internal ListSynonymMapsResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ListSynonymMapsResult() + { + } + + /// The synonym maps in the Search service. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LuceneStandardAnalyzer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LuceneStandardAnalyzer.Serialization.cs new file mode 100644 index 000000000000..aa4d707c0007 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LuceneStandardAnalyzer.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class LuceneStandardAnalyzer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LuceneStandardAnalyzer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(MaxTokenLength)) + { + writer.WritePropertyName("maxTokenLength"u8); + writer.WriteNumberValue(MaxTokenLength.Value); + } + if (Optional.IsCollectionDefined(Stopwords)) + { + writer.WritePropertyName("stopwords"u8); + writer.WriteStartArray(); + foreach (var item in Stopwords) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + LuceneStandardAnalyzer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LuceneStandardAnalyzer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLuceneStandardAnalyzer(document.RootElement, options); + } + + internal static LuceneStandardAnalyzer DeserializeLuceneStandardAnalyzer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxTokenLength = default; + IList stopwords = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxTokenLength"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxTokenLength = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("stopwords"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + stopwords = array; + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LuceneStandardAnalyzer(odataType, name, serializedAdditionalRawData, maxTokenLength, stopwords ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LuceneStandardAnalyzer)} does not support writing '{options.Format}' format."); + } + } + + LuceneStandardAnalyzer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLuceneStandardAnalyzer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LuceneStandardAnalyzer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new LuceneStandardAnalyzer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLuceneStandardAnalyzer(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LuceneStandardAnalyzer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LuceneStandardAnalyzer.cs new file mode 100644 index 000000000000..ec234e327145 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LuceneStandardAnalyzer.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Standard Apache Lucene analyzer; Composed of the standard tokenizer, lowercase + /// filter and stop filter. + /// + public partial class LuceneStandardAnalyzer : LexicalAnalyzer + { + /// Initializes a new instance of . + /// + /// The name of the analyzer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// is null. + public LuceneStandardAnalyzer(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.StandardAnalyzer"; + Stopwords = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the analyzer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// The maximum token length. Default is 255. Tokens longer than the maximum length + /// are split. The maximum token length that can be used is 300 characters. + /// + /// A list of stopwords. + internal LuceneStandardAnalyzer(string odataType, string name, IDictionary serializedAdditionalRawData, int? maxTokenLength, IList stopwords) : base(odataType, name, serializedAdditionalRawData) + { + MaxTokenLength = maxTokenLength; + Stopwords = stopwords; + } + + /// Initializes a new instance of for deserialization. + internal LuceneStandardAnalyzer() + { + } + + /// + /// The maximum token length. Default is 255. Tokens longer than the maximum length + /// are split. The maximum token length that can be used is 300 characters. + /// + public int? MaxTokenLength { get; set; } + /// A list of stopwords. + public IList Stopwords { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LuceneStandardTokenizerV2.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LuceneStandardTokenizerV2.Serialization.cs new file mode 100644 index 000000000000..9227ded4f040 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LuceneStandardTokenizerV2.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class LuceneStandardTokenizerV2 : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LuceneStandardTokenizerV2)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(MaxTokenLength)) + { + writer.WritePropertyName("maxTokenLength"u8); + writer.WriteNumberValue(MaxTokenLength.Value); + } + } + + LuceneStandardTokenizerV2 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LuceneStandardTokenizerV2)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLuceneStandardTokenizerV2(document.RootElement, options); + } + + internal static LuceneStandardTokenizerV2 DeserializeLuceneStandardTokenizerV2(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxTokenLength = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxTokenLength"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxTokenLength = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LuceneStandardTokenizerV2(odataType, name, serializedAdditionalRawData, maxTokenLength); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LuceneStandardTokenizerV2)} does not support writing '{options.Format}' format."); + } + } + + LuceneStandardTokenizerV2 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLuceneStandardTokenizerV2(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LuceneStandardTokenizerV2)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new LuceneStandardTokenizerV2 FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLuceneStandardTokenizerV2(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LuceneStandardTokenizerV2.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LuceneStandardTokenizerV2.cs new file mode 100644 index 000000000000..4e2e44dada2f --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/LuceneStandardTokenizerV2.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Breaks text following the Unicode Text Segmentation rules. This tokenizer is + /// implemented using Apache Lucene. + /// + public partial class LuceneStandardTokenizerV2 : LexicalTokenizer + { + /// Initializes a new instance of . + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// is null. + public LuceneStandardTokenizerV2(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.StandardTokenizerV2"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// The maximum token length. Default is 255. Tokens longer than the maximum length + /// are split. The maximum token length that can be used is 300 characters. + /// + internal LuceneStandardTokenizerV2(string odataType, string name, IDictionary serializedAdditionalRawData, int? maxTokenLength) : base(odataType, name, serializedAdditionalRawData) + { + MaxTokenLength = maxTokenLength; + } + + /// Initializes a new instance of for deserialization. + internal LuceneStandardTokenizerV2() + { + } + + /// + /// The maximum token length. Default is 255. Tokens longer than the maximum length + /// are split. The maximum token length that can be used is 300 characters. + /// + public int? MaxTokenLength { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MagnitudeScoringFunction.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MagnitudeScoringFunction.Serialization.cs new file mode 100644 index 000000000000..9bce23cf5481 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MagnitudeScoringFunction.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class MagnitudeScoringFunction : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MagnitudeScoringFunction)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("magnitude"u8); + writer.WriteObjectValue(Magnitude, options); + } + + MagnitudeScoringFunction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MagnitudeScoringFunction)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMagnitudeScoringFunction(document.RootElement, options); + } + + internal static MagnitudeScoringFunction DeserializeMagnitudeScoringFunction(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MagnitudeScoringParameters magnitude = default; + string fieldName = default; + double boost = default; + ScoringFunctionInterpolation? interpolation = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("magnitude"u8)) + { + magnitude = MagnitudeScoringParameters.DeserializeMagnitudeScoringParameters(property.Value, options); + continue; + } + if (property.NameEquals("fieldName"u8)) + { + fieldName = property.Value.GetString(); + continue; + } + if (property.NameEquals("boost"u8)) + { + boost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("interpolation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + interpolation = new ScoringFunctionInterpolation(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MagnitudeScoringFunction( + fieldName, + boost, + interpolation, + type, + serializedAdditionalRawData, + magnitude); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MagnitudeScoringFunction)} does not support writing '{options.Format}' format."); + } + } + + MagnitudeScoringFunction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMagnitudeScoringFunction(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MagnitudeScoringFunction)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new MagnitudeScoringFunction FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMagnitudeScoringFunction(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MagnitudeScoringFunction.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MagnitudeScoringFunction.cs new file mode 100644 index 000000000000..aba69c09dae2 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MagnitudeScoringFunction.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Defines a function that boosts scores based on the magnitude of a numeric field. + public partial class MagnitudeScoringFunction : ScoringFunction + { + /// Initializes a new instance of . + /// The name of the field used as input to the scoring function. + /// A multiplier for the raw score. Must be a positive number not equal to 1.0. + /// Parameter values for the magnitude scoring function. + /// or is null. + public MagnitudeScoringFunction(string fieldName, double boost, MagnitudeScoringParameters magnitude) : base(fieldName, boost) + { + Argument.AssertNotNull(fieldName, nameof(fieldName)); + Argument.AssertNotNull(magnitude, nameof(magnitude)); + + Type = "magnitude"; + Magnitude = magnitude; + } + + /// Initializes a new instance of . + /// The name of the field used as input to the scoring function. + /// A multiplier for the raw score. Must be a positive number not equal to 1.0. + /// + /// A value indicating how boosting will be interpolated across document scores; + /// defaults to "Linear". + /// + /// Type of ScoringFunction. + /// Keeps track of any properties unknown to the library. + /// Parameter values for the magnitude scoring function. + internal MagnitudeScoringFunction(string fieldName, double boost, ScoringFunctionInterpolation? interpolation, string type, IDictionary serializedAdditionalRawData, MagnitudeScoringParameters magnitude) : base(fieldName, boost, interpolation, type, serializedAdditionalRawData) + { + Magnitude = magnitude; + } + + /// Initializes a new instance of for deserialization. + internal MagnitudeScoringFunction() + { + } + + /// Parameter values for the magnitude scoring function. + public MagnitudeScoringParameters Magnitude { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MagnitudeScoringParameters.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MagnitudeScoringParameters.Serialization.cs new file mode 100644 index 000000000000..b463b3c86953 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MagnitudeScoringParameters.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class MagnitudeScoringParameters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MagnitudeScoringParameters)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("boostingRangeStart"u8); + writer.WriteNumberValue(BoostingRangeStart); + writer.WritePropertyName("boostingRangeEnd"u8); + writer.WriteNumberValue(BoostingRangeEnd); + if (Optional.IsDefined(ConstantBoostBeyondRange)) + { + writer.WritePropertyName("constantBoostBeyondRange"u8); + writer.WriteBooleanValue(ConstantBoostBeyondRange.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MagnitudeScoringParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MagnitudeScoringParameters)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMagnitudeScoringParameters(document.RootElement, options); + } + + internal static MagnitudeScoringParameters DeserializeMagnitudeScoringParameters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double boostingRangeStart = default; + double boostingRangeEnd = default; + bool? constantBoostBeyondRange = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("boostingRangeStart"u8)) + { + boostingRangeStart = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("boostingRangeEnd"u8)) + { + boostingRangeEnd = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("constantBoostBeyondRange"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + constantBoostBeyondRange = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MagnitudeScoringParameters(boostingRangeStart, boostingRangeEnd, constantBoostBeyondRange, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MagnitudeScoringParameters)} does not support writing '{options.Format}' format."); + } + } + + MagnitudeScoringParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMagnitudeScoringParameters(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MagnitudeScoringParameters)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static MagnitudeScoringParameters FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMagnitudeScoringParameters(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MagnitudeScoringParameters.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MagnitudeScoringParameters.cs new file mode 100644 index 000000000000..e4e5641e5d36 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MagnitudeScoringParameters.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Provides parameter values to a magnitude scoring function. + public partial class MagnitudeScoringParameters + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The field value at which boosting starts. + /// The field value at which boosting ends. + public MagnitudeScoringParameters(double boostingRangeStart, double boostingRangeEnd) + { + BoostingRangeStart = boostingRangeStart; + BoostingRangeEnd = boostingRangeEnd; + } + + /// Initializes a new instance of . + /// The field value at which boosting starts. + /// The field value at which boosting ends. + /// + /// A value indicating whether to apply a constant boost for field values beyond + /// the range end value; default is false. + /// + /// Keeps track of any properties unknown to the library. + internal MagnitudeScoringParameters(double boostingRangeStart, double boostingRangeEnd, bool? constantBoostBeyondRange, IDictionary serializedAdditionalRawData) + { + BoostingRangeStart = boostingRangeStart; + BoostingRangeEnd = boostingRangeEnd; + ConstantBoostBeyondRange = constantBoostBeyondRange; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MagnitudeScoringParameters() + { + } + + /// The field value at which boosting starts. + public double BoostingRangeStart { get; set; } + /// The field value at which boosting ends. + public double BoostingRangeEnd { get; set; } + /// + /// A value indicating whether to apply a constant boost for field values beyond + /// the range end value; default is false. + /// + public bool? ConstantBoostBeyondRange { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MappingCharFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MappingCharFilter.Serialization.cs new file mode 100644 index 000000000000..7ff0160af880 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MappingCharFilter.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class MappingCharFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MappingCharFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("mappings"u8); + writer.WriteStartArray(); + foreach (var item in Mappings) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + + MappingCharFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MappingCharFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMappingCharFilter(document.RootElement, options); + } + + internal static MappingCharFilter DeserializeMappingCharFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList mappings = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mappings"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + mappings = array; + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MappingCharFilter(odataType, name, serializedAdditionalRawData, mappings); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MappingCharFilter)} does not support writing '{options.Format}' format."); + } + } + + MappingCharFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMappingCharFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MappingCharFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new MappingCharFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMappingCharFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MappingCharFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MappingCharFilter.cs new file mode 100644 index 000000000000..e7344e8d6c00 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MappingCharFilter.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// A character filter that applies mappings defined with the mappings option. + /// Matching is greedy (longest pattern matching at a given point wins). + /// Replacement is allowed to be the empty string. This character filter is + /// implemented using Apache Lucene. + /// + public partial class MappingCharFilter : CharFilter + { + /// Initializes a new instance of . + /// + /// The name of the char filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// + /// A list of mappings of the following format: "a=>b" (all occurrences of the + /// character "a" will be replaced with character "b"). + /// + /// or is null. + public MappingCharFilter(string name, IEnumerable mappings) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(mappings, nameof(mappings)); + + OdataType = "#Microsoft.Azure.Search.MappingCharFilter"; + Mappings = mappings.ToList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the char filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// A list of mappings of the following format: "a=>b" (all occurrences of the + /// character "a" will be replaced with character "b"). + /// + internal MappingCharFilter(string odataType, string name, IDictionary serializedAdditionalRawData, IList mappings) : base(odataType, name, serializedAdditionalRawData) + { + Mappings = mappings; + } + + /// Initializes a new instance of for deserialization. + internal MappingCharFilter() + { + } + + /// + /// A list of mappings of the following format: "a=>b" (all occurrences of the + /// character "a" will be replaced with character "b"). + /// + public IList Mappings { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MergeSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MergeSkill.Serialization.cs new file mode 100644 index 000000000000..561968385f05 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MergeSkill.Serialization.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class MergeSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MergeSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(InsertPreTag)) + { + writer.WritePropertyName("insertPreTag"u8); + writer.WriteStringValue(InsertPreTag); + } + if (Optional.IsDefined(InsertPostTag)) + { + writer.WritePropertyName("insertPostTag"u8); + writer.WriteStringValue(InsertPostTag); + } + } + + MergeSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MergeSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMergeSkill(document.RootElement, options); + } + + internal static MergeSkill DeserializeMergeSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string insertPreTag = default; + string insertPostTag = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("insertPreTag"u8)) + { + insertPreTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("insertPostTag"u8)) + { + insertPostTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MergeSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + insertPreTag, + insertPostTag); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MergeSkill)} does not support writing '{options.Format}' format."); + } + } + + MergeSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMergeSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MergeSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new MergeSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMergeSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MergeSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MergeSkill.cs new file mode 100644 index 000000000000..a27866856bbc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MergeSkill.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// A skill for merging two or more strings into a single unified string, with an + /// optional user-defined delimiter separating each component part. + /// + public partial class MergeSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public MergeSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Text.MergeSkill"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// + /// The tag indicates the start of the merged text. By default, the tag is an empty + /// space. + /// + /// + /// The tag indicates the end of the merged text. By default, the tag is an empty + /// space. + /// + internal MergeSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, string insertPreTag, string insertPostTag) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + InsertPreTag = insertPreTag; + InsertPostTag = insertPostTag; + } + + /// Initializes a new instance of for deserialization. + internal MergeSkill() + { + } + + /// + /// The tag indicates the start of the merged text. By default, the tag is an empty + /// space. + /// + public string InsertPreTag { get; set; } + /// + /// The tag indicates the end of the merged text. By default, the tag is an empty + /// space. + /// + public string InsertPostTag { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftLanguageStemmingTokenizer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftLanguageStemmingTokenizer.Serialization.cs new file mode 100644 index 000000000000..5b8d7b504b5b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftLanguageStemmingTokenizer.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class MicrosoftLanguageStemmingTokenizer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MicrosoftLanguageStemmingTokenizer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(MaxTokenLength)) + { + writer.WritePropertyName("maxTokenLength"u8); + writer.WriteNumberValue(MaxTokenLength.Value); + } + if (Optional.IsDefined(IsSearchTokenizer)) + { + writer.WritePropertyName("isSearchTokenizer"u8); + writer.WriteBooleanValue(IsSearchTokenizer.Value); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language.Value.ToString()); + } + } + + MicrosoftLanguageStemmingTokenizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MicrosoftLanguageStemmingTokenizer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMicrosoftLanguageStemmingTokenizer(document.RootElement, options); + } + + internal static MicrosoftLanguageStemmingTokenizer DeserializeMicrosoftLanguageStemmingTokenizer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxTokenLength = default; + bool? isSearchTokenizer = default; + MicrosoftStemmingTokenizerLanguage? language = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxTokenLength"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxTokenLength = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isSearchTokenizer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSearchTokenizer = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("language"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + language = new MicrosoftStemmingTokenizerLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MicrosoftLanguageStemmingTokenizer( + odataType, + name, + serializedAdditionalRawData, + maxTokenLength, + isSearchTokenizer, + language); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MicrosoftLanguageStemmingTokenizer)} does not support writing '{options.Format}' format."); + } + } + + MicrosoftLanguageStemmingTokenizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMicrosoftLanguageStemmingTokenizer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MicrosoftLanguageStemmingTokenizer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new MicrosoftLanguageStemmingTokenizer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMicrosoftLanguageStemmingTokenizer(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftLanguageStemmingTokenizer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftLanguageStemmingTokenizer.cs new file mode 100644 index 000000000000..10e420b3a724 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftLanguageStemmingTokenizer.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Divides text using language-specific rules and reduces words to their base + /// forms. + /// + public partial class MicrosoftLanguageStemmingTokenizer : LexicalTokenizer + { + /// Initializes a new instance of . + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// is null. + public MicrosoftLanguageStemmingTokenizer(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// The maximum token length. Tokens longer than the maximum length are split. + /// Maximum token length that can be used is 300 characters. Tokens longer than 300 + /// characters are first split into tokens of length 300 and then each of those + /// tokens is split based on the max token length set. Default is 255. + /// + /// + /// A value indicating how the tokenizer is used. Set to true if used as the search + /// tokenizer, set to false if used as the indexing tokenizer. Default is false. + /// + /// The language to use. The default is English. + internal MicrosoftLanguageStemmingTokenizer(string odataType, string name, IDictionary serializedAdditionalRawData, int? maxTokenLength, bool? isSearchTokenizer, MicrosoftStemmingTokenizerLanguage? language) : base(odataType, name, serializedAdditionalRawData) + { + MaxTokenLength = maxTokenLength; + IsSearchTokenizer = isSearchTokenizer; + Language = language; + } + + /// Initializes a new instance of for deserialization. + internal MicrosoftLanguageStemmingTokenizer() + { + } + + /// + /// The maximum token length. Tokens longer than the maximum length are split. + /// Maximum token length that can be used is 300 characters. Tokens longer than 300 + /// characters are first split into tokens of length 300 and then each of those + /// tokens is split based on the max token length set. Default is 255. + /// + public int? MaxTokenLength { get; set; } + /// + /// A value indicating how the tokenizer is used. Set to true if used as the search + /// tokenizer, set to false if used as the indexing tokenizer. Default is false. + /// + public bool? IsSearchTokenizer { get; set; } + /// The language to use. The default is English. + public MicrosoftStemmingTokenizerLanguage? Language { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftLanguageTokenizer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftLanguageTokenizer.Serialization.cs new file mode 100644 index 000000000000..dd003254ccd8 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftLanguageTokenizer.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class MicrosoftLanguageTokenizer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MicrosoftLanguageTokenizer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(MaxTokenLength)) + { + writer.WritePropertyName("maxTokenLength"u8); + writer.WriteNumberValue(MaxTokenLength.Value); + } + if (Optional.IsDefined(IsSearchTokenizer)) + { + writer.WritePropertyName("isSearchTokenizer"u8); + writer.WriteBooleanValue(IsSearchTokenizer.Value); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language.Value.ToString()); + } + } + + MicrosoftLanguageTokenizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MicrosoftLanguageTokenizer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMicrosoftLanguageTokenizer(document.RootElement, options); + } + + internal static MicrosoftLanguageTokenizer DeserializeMicrosoftLanguageTokenizer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxTokenLength = default; + bool? isSearchTokenizer = default; + MicrosoftTokenizerLanguage? language = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxTokenLength"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxTokenLength = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isSearchTokenizer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSearchTokenizer = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("language"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + language = new MicrosoftTokenizerLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MicrosoftLanguageTokenizer( + odataType, + name, + serializedAdditionalRawData, + maxTokenLength, + isSearchTokenizer, + language); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MicrosoftLanguageTokenizer)} does not support writing '{options.Format}' format."); + } + } + + MicrosoftLanguageTokenizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMicrosoftLanguageTokenizer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MicrosoftLanguageTokenizer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new MicrosoftLanguageTokenizer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMicrosoftLanguageTokenizer(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftLanguageTokenizer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftLanguageTokenizer.cs new file mode 100644 index 000000000000..10ac134335c5 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftLanguageTokenizer.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Divides text using language-specific rules. + public partial class MicrosoftLanguageTokenizer : LexicalTokenizer + { + /// Initializes a new instance of . + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// is null. + public MicrosoftLanguageTokenizer(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.MicrosoftLanguageTokenizer"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// The maximum token length. Tokens longer than the maximum length are split. + /// Maximum token length that can be used is 300 characters. Tokens longer than 300 + /// characters are first split into tokens of length 300 and then each of those + /// tokens is split based on the max token length set. Default is 255. + /// + /// + /// A value indicating how the tokenizer is used. Set to true if used as the search + /// tokenizer, set to false if used as the indexing tokenizer. Default is false. + /// + /// The language to use. The default is English. + internal MicrosoftLanguageTokenizer(string odataType, string name, IDictionary serializedAdditionalRawData, int? maxTokenLength, bool? isSearchTokenizer, MicrosoftTokenizerLanguage? language) : base(odataType, name, serializedAdditionalRawData) + { + MaxTokenLength = maxTokenLength; + IsSearchTokenizer = isSearchTokenizer; + Language = language; + } + + /// Initializes a new instance of for deserialization. + internal MicrosoftLanguageTokenizer() + { + } + + /// + /// The maximum token length. Tokens longer than the maximum length are split. + /// Maximum token length that can be used is 300 characters. Tokens longer than 300 + /// characters are first split into tokens of length 300 and then each of those + /// tokens is split based on the max token length set. Default is 255. + /// + public int? MaxTokenLength { get; set; } + /// + /// A value indicating how the tokenizer is used. Set to true if used as the search + /// tokenizer, set to false if used as the indexing tokenizer. Default is false. + /// + public bool? IsSearchTokenizer { get; set; } + /// The language to use. The default is English. + public MicrosoftTokenizerLanguage? Language { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftStemmingTokenizerLanguage.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftStemmingTokenizerLanguage.cs new file mode 100644 index 000000000000..8f0f3731606e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftStemmingTokenizerLanguage.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Lists the languages supported by the Microsoft language stemming tokenizer. + public readonly partial struct MicrosoftStemmingTokenizerLanguage : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MicrosoftStemmingTokenizerLanguage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ArabicValue = "arabic"; + private const string BanglaValue = "bangla"; + private const string BulgarianValue = "bulgarian"; + private const string CatalanValue = "catalan"; + private const string CroatianValue = "croatian"; + private const string CzechValue = "czech"; + private const string DanishValue = "danish"; + private const string DutchValue = "dutch"; + private const string EnglishValue = "english"; + private const string EstonianValue = "estonian"; + private const string FinnishValue = "finnish"; + private const string FrenchValue = "french"; + private const string GermanValue = "german"; + private const string GreekValue = "greek"; + private const string GujaratiValue = "gujarati"; + private const string HebrewValue = "hebrew"; + private const string HindiValue = "hindi"; + private const string HungarianValue = "hungarian"; + private const string IcelandicValue = "icelandic"; + private const string IndonesianValue = "indonesian"; + private const string ItalianValue = "italian"; + private const string KannadaValue = "kannada"; + private const string LatvianValue = "latvian"; + private const string LithuanianValue = "lithuanian"; + private const string MalayValue = "malay"; + private const string MalayalamValue = "malayalam"; + private const string MarathiValue = "marathi"; + private const string NorwegianBokmaalValue = "norwegianBokmaal"; + private const string PolishValue = "polish"; + private const string PortugueseValue = "portuguese"; + private const string PortugueseBrazilianValue = "portugueseBrazilian"; + private const string PunjabiValue = "punjabi"; + private const string RomanianValue = "romanian"; + private const string RussianValue = "russian"; + private const string SerbianCyrillicValue = "serbianCyrillic"; + private const string SerbianLatinValue = "serbianLatin"; + private const string SlovakValue = "slovak"; + private const string SlovenianValue = "slovenian"; + private const string SpanishValue = "spanish"; + private const string SwedishValue = "swedish"; + private const string TamilValue = "tamil"; + private const string TeluguValue = "telugu"; + private const string TurkishValue = "turkish"; + private const string UkrainianValue = "ukrainian"; + private const string UrduValue = "urdu"; + + /// Selects the Microsoft stemming tokenizer for Arabic. + public static MicrosoftStemmingTokenizerLanguage Arabic { get; } = new MicrosoftStemmingTokenizerLanguage(ArabicValue); + /// Selects the Microsoft stemming tokenizer for Bangla. + public static MicrosoftStemmingTokenizerLanguage Bangla { get; } = new MicrosoftStemmingTokenizerLanguage(BanglaValue); + /// Selects the Microsoft stemming tokenizer for Bulgarian. + public static MicrosoftStemmingTokenizerLanguage Bulgarian { get; } = new MicrosoftStemmingTokenizerLanguage(BulgarianValue); + /// Selects the Microsoft stemming tokenizer for Catalan. + public static MicrosoftStemmingTokenizerLanguage Catalan { get; } = new MicrosoftStemmingTokenizerLanguage(CatalanValue); + /// Selects the Microsoft stemming tokenizer for Croatian. + public static MicrosoftStemmingTokenizerLanguage Croatian { get; } = new MicrosoftStemmingTokenizerLanguage(CroatianValue); + /// Selects the Microsoft stemming tokenizer for Czech. + public static MicrosoftStemmingTokenizerLanguage Czech { get; } = new MicrosoftStemmingTokenizerLanguage(CzechValue); + /// Selects the Microsoft stemming tokenizer for Danish. + public static MicrosoftStemmingTokenizerLanguage Danish { get; } = new MicrosoftStemmingTokenizerLanguage(DanishValue); + /// Selects the Microsoft stemming tokenizer for Dutch. + public static MicrosoftStemmingTokenizerLanguage Dutch { get; } = new MicrosoftStemmingTokenizerLanguage(DutchValue); + /// Selects the Microsoft stemming tokenizer for English. + public static MicrosoftStemmingTokenizerLanguage English { get; } = new MicrosoftStemmingTokenizerLanguage(EnglishValue); + /// Selects the Microsoft stemming tokenizer for Estonian. + public static MicrosoftStemmingTokenizerLanguage Estonian { get; } = new MicrosoftStemmingTokenizerLanguage(EstonianValue); + /// Selects the Microsoft stemming tokenizer for Finnish. + public static MicrosoftStemmingTokenizerLanguage Finnish { get; } = new MicrosoftStemmingTokenizerLanguage(FinnishValue); + /// Selects the Microsoft stemming tokenizer for French. + public static MicrosoftStemmingTokenizerLanguage French { get; } = new MicrosoftStemmingTokenizerLanguage(FrenchValue); + /// Selects the Microsoft stemming tokenizer for German. + public static MicrosoftStemmingTokenizerLanguage German { get; } = new MicrosoftStemmingTokenizerLanguage(GermanValue); + /// Selects the Microsoft stemming tokenizer for Greek. + public static MicrosoftStemmingTokenizerLanguage Greek { get; } = new MicrosoftStemmingTokenizerLanguage(GreekValue); + /// Selects the Microsoft stemming tokenizer for Gujarati. + public static MicrosoftStemmingTokenizerLanguage Gujarati { get; } = new MicrosoftStemmingTokenizerLanguage(GujaratiValue); + /// Selects the Microsoft stemming tokenizer for Hebrew. + public static MicrosoftStemmingTokenizerLanguage Hebrew { get; } = new MicrosoftStemmingTokenizerLanguage(HebrewValue); + /// Selects the Microsoft stemming tokenizer for Hindi. + public static MicrosoftStemmingTokenizerLanguage Hindi { get; } = new MicrosoftStemmingTokenizerLanguage(HindiValue); + /// Selects the Microsoft stemming tokenizer for Hungarian. + public static MicrosoftStemmingTokenizerLanguage Hungarian { get; } = new MicrosoftStemmingTokenizerLanguage(HungarianValue); + /// Selects the Microsoft stemming tokenizer for Icelandic. + public static MicrosoftStemmingTokenizerLanguage Icelandic { get; } = new MicrosoftStemmingTokenizerLanguage(IcelandicValue); + /// Selects the Microsoft stemming tokenizer for Indonesian. + public static MicrosoftStemmingTokenizerLanguage Indonesian { get; } = new MicrosoftStemmingTokenizerLanguage(IndonesianValue); + /// Selects the Microsoft stemming tokenizer for Italian. + public static MicrosoftStemmingTokenizerLanguage Italian { get; } = new MicrosoftStemmingTokenizerLanguage(ItalianValue); + /// Selects the Microsoft stemming tokenizer for Kannada. + public static MicrosoftStemmingTokenizerLanguage Kannada { get; } = new MicrosoftStemmingTokenizerLanguage(KannadaValue); + /// Selects the Microsoft stemming tokenizer for Latvian. + public static MicrosoftStemmingTokenizerLanguage Latvian { get; } = new MicrosoftStemmingTokenizerLanguage(LatvianValue); + /// Selects the Microsoft stemming tokenizer for Lithuanian. + public static MicrosoftStemmingTokenizerLanguage Lithuanian { get; } = new MicrosoftStemmingTokenizerLanguage(LithuanianValue); + /// Selects the Microsoft stemming tokenizer for Malay. + public static MicrosoftStemmingTokenizerLanguage Malay { get; } = new MicrosoftStemmingTokenizerLanguage(MalayValue); + /// Selects the Microsoft stemming tokenizer for Malayalam. + public static MicrosoftStemmingTokenizerLanguage Malayalam { get; } = new MicrosoftStemmingTokenizerLanguage(MalayalamValue); + /// Selects the Microsoft stemming tokenizer for Marathi. + public static MicrosoftStemmingTokenizerLanguage Marathi { get; } = new MicrosoftStemmingTokenizerLanguage(MarathiValue); + /// Selects the Microsoft stemming tokenizer for Norwegian (Bokmål). + public static MicrosoftStemmingTokenizerLanguage NorwegianBokmaal { get; } = new MicrosoftStemmingTokenizerLanguage(NorwegianBokmaalValue); + /// Selects the Microsoft stemming tokenizer for Polish. + public static MicrosoftStemmingTokenizerLanguage Polish { get; } = new MicrosoftStemmingTokenizerLanguage(PolishValue); + /// Selects the Microsoft stemming tokenizer for Portuguese. + public static MicrosoftStemmingTokenizerLanguage Portuguese { get; } = new MicrosoftStemmingTokenizerLanguage(PortugueseValue); + /// Selects the Microsoft stemming tokenizer for Portuguese (Brazil). + public static MicrosoftStemmingTokenizerLanguage PortugueseBrazilian { get; } = new MicrosoftStemmingTokenizerLanguage(PortugueseBrazilianValue); + /// Selects the Microsoft stemming tokenizer for Punjabi. + public static MicrosoftStemmingTokenizerLanguage Punjabi { get; } = new MicrosoftStemmingTokenizerLanguage(PunjabiValue); + /// Selects the Microsoft stemming tokenizer for Romanian. + public static MicrosoftStemmingTokenizerLanguage Romanian { get; } = new MicrosoftStemmingTokenizerLanguage(RomanianValue); + /// Selects the Microsoft stemming tokenizer for Russian. + public static MicrosoftStemmingTokenizerLanguage Russian { get; } = new MicrosoftStemmingTokenizerLanguage(RussianValue); + /// Selects the Microsoft stemming tokenizer for Serbian (Cyrillic). + public static MicrosoftStemmingTokenizerLanguage SerbianCyrillic { get; } = new MicrosoftStemmingTokenizerLanguage(SerbianCyrillicValue); + /// Selects the Microsoft stemming tokenizer for Serbian (Latin). + public static MicrosoftStemmingTokenizerLanguage SerbianLatin { get; } = new MicrosoftStemmingTokenizerLanguage(SerbianLatinValue); + /// Selects the Microsoft stemming tokenizer for Slovak. + public static MicrosoftStemmingTokenizerLanguage Slovak { get; } = new MicrosoftStemmingTokenizerLanguage(SlovakValue); + /// Selects the Microsoft stemming tokenizer for Slovenian. + public static MicrosoftStemmingTokenizerLanguage Slovenian { get; } = new MicrosoftStemmingTokenizerLanguage(SlovenianValue); + /// Selects the Microsoft stemming tokenizer for Spanish. + public static MicrosoftStemmingTokenizerLanguage Spanish { get; } = new MicrosoftStemmingTokenizerLanguage(SpanishValue); + /// Selects the Microsoft stemming tokenizer for Swedish. + public static MicrosoftStemmingTokenizerLanguage Swedish { get; } = new MicrosoftStemmingTokenizerLanguage(SwedishValue); + /// Selects the Microsoft stemming tokenizer for Tamil. + public static MicrosoftStemmingTokenizerLanguage Tamil { get; } = new MicrosoftStemmingTokenizerLanguage(TamilValue); + /// Selects the Microsoft stemming tokenizer for Telugu. + public static MicrosoftStemmingTokenizerLanguage Telugu { get; } = new MicrosoftStemmingTokenizerLanguage(TeluguValue); + /// Selects the Microsoft stemming tokenizer for Turkish. + public static MicrosoftStemmingTokenizerLanguage Turkish { get; } = new MicrosoftStemmingTokenizerLanguage(TurkishValue); + /// Selects the Microsoft stemming tokenizer for Ukrainian. + public static MicrosoftStemmingTokenizerLanguage Ukrainian { get; } = new MicrosoftStemmingTokenizerLanguage(UkrainianValue); + /// Selects the Microsoft stemming tokenizer for Urdu. + public static MicrosoftStemmingTokenizerLanguage Urdu { get; } = new MicrosoftStemmingTokenizerLanguage(UrduValue); + /// Determines if two values are the same. + public static bool operator ==(MicrosoftStemmingTokenizerLanguage left, MicrosoftStemmingTokenizerLanguage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MicrosoftStemmingTokenizerLanguage left, MicrosoftStemmingTokenizerLanguage right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MicrosoftStemmingTokenizerLanguage(string value) => new MicrosoftStemmingTokenizerLanguage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MicrosoftStemmingTokenizerLanguage other && Equals(other); + /// + public bool Equals(MicrosoftStemmingTokenizerLanguage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftTokenizerLanguage.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftTokenizerLanguage.cs new file mode 100644 index 000000000000..c37df799e35a --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/MicrosoftTokenizerLanguage.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Lists the languages supported by the Microsoft language tokenizer. + public readonly partial struct MicrosoftTokenizerLanguage : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MicrosoftTokenizerLanguage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BanglaValue = "bangla"; + private const string BulgarianValue = "bulgarian"; + private const string CatalanValue = "catalan"; + private const string ChineseSimplifiedValue = "chineseSimplified"; + private const string ChineseTraditionalValue = "chineseTraditional"; + private const string CroatianValue = "croatian"; + private const string CzechValue = "czech"; + private const string DanishValue = "danish"; + private const string DutchValue = "dutch"; + private const string EnglishValue = "english"; + private const string FrenchValue = "french"; + private const string GermanValue = "german"; + private const string GreekValue = "greek"; + private const string GujaratiValue = "gujarati"; + private const string HindiValue = "hindi"; + private const string IcelandicValue = "icelandic"; + private const string IndonesianValue = "indonesian"; + private const string ItalianValue = "italian"; + private const string JapaneseValue = "japanese"; + private const string KannadaValue = "kannada"; + private const string KoreanValue = "korean"; + private const string MalayValue = "malay"; + private const string MalayalamValue = "malayalam"; + private const string MarathiValue = "marathi"; + private const string NorwegianBokmaalValue = "norwegianBokmaal"; + private const string PolishValue = "polish"; + private const string PortugueseValue = "portuguese"; + private const string PortugueseBrazilianValue = "portugueseBrazilian"; + private const string PunjabiValue = "punjabi"; + private const string RomanianValue = "romanian"; + private const string RussianValue = "russian"; + private const string SerbianCyrillicValue = "serbianCyrillic"; + private const string SerbianLatinValue = "serbianLatin"; + private const string SlovenianValue = "slovenian"; + private const string SpanishValue = "spanish"; + private const string SwedishValue = "swedish"; + private const string TamilValue = "tamil"; + private const string TeluguValue = "telugu"; + private const string ThaiValue = "thai"; + private const string UkrainianValue = "ukrainian"; + private const string UrduValue = "urdu"; + private const string VietnameseValue = "vietnamese"; + + /// Selects the Microsoft tokenizer for Bangla. + public static MicrosoftTokenizerLanguage Bangla { get; } = new MicrosoftTokenizerLanguage(BanglaValue); + /// Selects the Microsoft tokenizer for Bulgarian. + public static MicrosoftTokenizerLanguage Bulgarian { get; } = new MicrosoftTokenizerLanguage(BulgarianValue); + /// Selects the Microsoft tokenizer for Catalan. + public static MicrosoftTokenizerLanguage Catalan { get; } = new MicrosoftTokenizerLanguage(CatalanValue); + /// Selects the Microsoft tokenizer for Chinese (Simplified). + public static MicrosoftTokenizerLanguage ChineseSimplified { get; } = new MicrosoftTokenizerLanguage(ChineseSimplifiedValue); + /// Selects the Microsoft tokenizer for Chinese (Traditional). + public static MicrosoftTokenizerLanguage ChineseTraditional { get; } = new MicrosoftTokenizerLanguage(ChineseTraditionalValue); + /// Selects the Microsoft tokenizer for Croatian. + public static MicrosoftTokenizerLanguage Croatian { get; } = new MicrosoftTokenizerLanguage(CroatianValue); + /// Selects the Microsoft tokenizer for Czech. + public static MicrosoftTokenizerLanguage Czech { get; } = new MicrosoftTokenizerLanguage(CzechValue); + /// Selects the Microsoft tokenizer for Danish. + public static MicrosoftTokenizerLanguage Danish { get; } = new MicrosoftTokenizerLanguage(DanishValue); + /// Selects the Microsoft tokenizer for Dutch. + public static MicrosoftTokenizerLanguage Dutch { get; } = new MicrosoftTokenizerLanguage(DutchValue); + /// Selects the Microsoft tokenizer for English. + public static MicrosoftTokenizerLanguage English { get; } = new MicrosoftTokenizerLanguage(EnglishValue); + /// Selects the Microsoft tokenizer for French. + public static MicrosoftTokenizerLanguage French { get; } = new MicrosoftTokenizerLanguage(FrenchValue); + /// Selects the Microsoft tokenizer for German. + public static MicrosoftTokenizerLanguage German { get; } = new MicrosoftTokenizerLanguage(GermanValue); + /// Selects the Microsoft tokenizer for Greek. + public static MicrosoftTokenizerLanguage Greek { get; } = new MicrosoftTokenizerLanguage(GreekValue); + /// Selects the Microsoft tokenizer for Gujarati. + public static MicrosoftTokenizerLanguage Gujarati { get; } = new MicrosoftTokenizerLanguage(GujaratiValue); + /// Selects the Microsoft tokenizer for Hindi. + public static MicrosoftTokenizerLanguage Hindi { get; } = new MicrosoftTokenizerLanguage(HindiValue); + /// Selects the Microsoft tokenizer for Icelandic. + public static MicrosoftTokenizerLanguage Icelandic { get; } = new MicrosoftTokenizerLanguage(IcelandicValue); + /// Selects the Microsoft tokenizer for Indonesian. + public static MicrosoftTokenizerLanguage Indonesian { get; } = new MicrosoftTokenizerLanguage(IndonesianValue); + /// Selects the Microsoft tokenizer for Italian. + public static MicrosoftTokenizerLanguage Italian { get; } = new MicrosoftTokenizerLanguage(ItalianValue); + /// Selects the Microsoft tokenizer for Japanese. + public static MicrosoftTokenizerLanguage Japanese { get; } = new MicrosoftTokenizerLanguage(JapaneseValue); + /// Selects the Microsoft tokenizer for Kannada. + public static MicrosoftTokenizerLanguage Kannada { get; } = new MicrosoftTokenizerLanguage(KannadaValue); + /// Selects the Microsoft tokenizer for Korean. + public static MicrosoftTokenizerLanguage Korean { get; } = new MicrosoftTokenizerLanguage(KoreanValue); + /// Selects the Microsoft tokenizer for Malay. + public static MicrosoftTokenizerLanguage Malay { get; } = new MicrosoftTokenizerLanguage(MalayValue); + /// Selects the Microsoft tokenizer for Malayalam. + public static MicrosoftTokenizerLanguage Malayalam { get; } = new MicrosoftTokenizerLanguage(MalayalamValue); + /// Selects the Microsoft tokenizer for Marathi. + public static MicrosoftTokenizerLanguage Marathi { get; } = new MicrosoftTokenizerLanguage(MarathiValue); + /// Selects the Microsoft tokenizer for Norwegian (Bokmål). + public static MicrosoftTokenizerLanguage NorwegianBokmaal { get; } = new MicrosoftTokenizerLanguage(NorwegianBokmaalValue); + /// Selects the Microsoft tokenizer for Polish. + public static MicrosoftTokenizerLanguage Polish { get; } = new MicrosoftTokenizerLanguage(PolishValue); + /// Selects the Microsoft tokenizer for Portuguese. + public static MicrosoftTokenizerLanguage Portuguese { get; } = new MicrosoftTokenizerLanguage(PortugueseValue); + /// Selects the Microsoft tokenizer for Portuguese (Brazil). + public static MicrosoftTokenizerLanguage PortugueseBrazilian { get; } = new MicrosoftTokenizerLanguage(PortugueseBrazilianValue); + /// Selects the Microsoft tokenizer for Punjabi. + public static MicrosoftTokenizerLanguage Punjabi { get; } = new MicrosoftTokenizerLanguage(PunjabiValue); + /// Selects the Microsoft tokenizer for Romanian. + public static MicrosoftTokenizerLanguage Romanian { get; } = new MicrosoftTokenizerLanguage(RomanianValue); + /// Selects the Microsoft tokenizer for Russian. + public static MicrosoftTokenizerLanguage Russian { get; } = new MicrosoftTokenizerLanguage(RussianValue); + /// Selects the Microsoft tokenizer for Serbian (Cyrillic). + public static MicrosoftTokenizerLanguage SerbianCyrillic { get; } = new MicrosoftTokenizerLanguage(SerbianCyrillicValue); + /// Selects the Microsoft tokenizer for Serbian (Latin). + public static MicrosoftTokenizerLanguage SerbianLatin { get; } = new MicrosoftTokenizerLanguage(SerbianLatinValue); + /// Selects the Microsoft tokenizer for Slovenian. + public static MicrosoftTokenizerLanguage Slovenian { get; } = new MicrosoftTokenizerLanguage(SlovenianValue); + /// Selects the Microsoft tokenizer for Spanish. + public static MicrosoftTokenizerLanguage Spanish { get; } = new MicrosoftTokenizerLanguage(SpanishValue); + /// Selects the Microsoft tokenizer for Swedish. + public static MicrosoftTokenizerLanguage Swedish { get; } = new MicrosoftTokenizerLanguage(SwedishValue); + /// Selects the Microsoft tokenizer for Tamil. + public static MicrosoftTokenizerLanguage Tamil { get; } = new MicrosoftTokenizerLanguage(TamilValue); + /// Selects the Microsoft tokenizer for Telugu. + public static MicrosoftTokenizerLanguage Telugu { get; } = new MicrosoftTokenizerLanguage(TeluguValue); + /// Selects the Microsoft tokenizer for Thai. + public static MicrosoftTokenizerLanguage Thai { get; } = new MicrosoftTokenizerLanguage(ThaiValue); + /// Selects the Microsoft tokenizer for Ukrainian. + public static MicrosoftTokenizerLanguage Ukrainian { get; } = new MicrosoftTokenizerLanguage(UkrainianValue); + /// Selects the Microsoft tokenizer for Urdu. + public static MicrosoftTokenizerLanguage Urdu { get; } = new MicrosoftTokenizerLanguage(UrduValue); + /// Selects the Microsoft tokenizer for Vietnamese. + public static MicrosoftTokenizerLanguage Vietnamese { get; } = new MicrosoftTokenizerLanguage(VietnameseValue); + /// Determines if two values are the same. + public static bool operator ==(MicrosoftTokenizerLanguage left, MicrosoftTokenizerLanguage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MicrosoftTokenizerLanguage left, MicrosoftTokenizerLanguage right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MicrosoftTokenizerLanguage(string value) => new MicrosoftTokenizerLanguage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MicrosoftTokenizerLanguage other && Equals(other); + /// + public bool Equals(MicrosoftTokenizerLanguage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/NGramTokenFilterV2.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/NGramTokenFilterV2.Serialization.cs new file mode 100644 index 000000000000..712ced72007e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/NGramTokenFilterV2.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class NGramTokenFilterV2 : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NGramTokenFilterV2)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(MinGram)) + { + writer.WritePropertyName("minGram"u8); + writer.WriteNumberValue(MinGram.Value); + } + if (Optional.IsDefined(MaxGram)) + { + writer.WritePropertyName("maxGram"u8); + writer.WriteNumberValue(MaxGram.Value); + } + } + + NGramTokenFilterV2 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NGramTokenFilterV2)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNGramTokenFilterV2(document.RootElement, options); + } + + internal static NGramTokenFilterV2 DeserializeNGramTokenFilterV2(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? minGram = default; + int? maxGram = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("minGram"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minGram = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxGram"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxGram = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NGramTokenFilterV2(odataType, name, serializedAdditionalRawData, minGram, maxGram); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NGramTokenFilterV2)} does not support writing '{options.Format}' format."); + } + } + + NGramTokenFilterV2 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNGramTokenFilterV2(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NGramTokenFilterV2)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new NGramTokenFilterV2 FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNGramTokenFilterV2(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/NGramTokenFilterV2.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/NGramTokenFilterV2.cs new file mode 100644 index 000000000000..8f564968932e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/NGramTokenFilterV2.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Generates n-grams of the given size(s). This token filter is implemented using + /// Apache Lucene. + /// + public partial class NGramTokenFilterV2 : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// is null. + public NGramTokenFilterV2(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.NGramTokenFilterV2"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the + /// value of maxGram. + /// + /// The maximum n-gram length. Default is 2. Maximum is 300. + internal NGramTokenFilterV2(string odataType, string name, IDictionary serializedAdditionalRawData, int? minGram, int? maxGram) : base(odataType, name, serializedAdditionalRawData) + { + MinGram = minGram; + MaxGram = maxGram; + } + + /// Initializes a new instance of for deserialization. + internal NGramTokenFilterV2() + { + } + + /// + /// The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the + /// value of maxGram. + /// + public int? MinGram { get; set; } + /// The maximum n-gram length. Default is 2. Maximum is 300. + public int? MaxGram { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/NGramTokenizer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/NGramTokenizer.Serialization.cs new file mode 100644 index 000000000000..1809ce77c8ee --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/NGramTokenizer.Serialization.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class NGramTokenizer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NGramTokenizer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(MinGram)) + { + writer.WritePropertyName("minGram"u8); + writer.WriteNumberValue(MinGram.Value); + } + if (Optional.IsDefined(MaxGram)) + { + writer.WritePropertyName("maxGram"u8); + writer.WriteNumberValue(MaxGram.Value); + } + if (Optional.IsCollectionDefined(TokenChars)) + { + writer.WritePropertyName("tokenChars"u8); + writer.WriteStartArray(); + foreach (var item in TokenChars) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + } + + NGramTokenizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NGramTokenizer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNGramTokenizer(document.RootElement, options); + } + + internal static NGramTokenizer DeserializeNGramTokenizer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? minGram = default; + int? maxGram = default; + IList tokenChars = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("minGram"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minGram = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxGram"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxGram = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("tokenChars"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new TokenCharacterKind(item.GetString())); + } + tokenChars = array; + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NGramTokenizer( + odataType, + name, + serializedAdditionalRawData, + minGram, + maxGram, + tokenChars ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NGramTokenizer)} does not support writing '{options.Format}' format."); + } + } + + NGramTokenizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNGramTokenizer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NGramTokenizer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new NGramTokenizer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNGramTokenizer(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/NGramTokenizer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/NGramTokenizer.cs new file mode 100644 index 000000000000..01ea970db4b5 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/NGramTokenizer.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Tokenizes the input into n-grams of the given size(s). This tokenizer is + /// implemented using Apache Lucene. + /// + public partial class NGramTokenizer : LexicalTokenizer + { + /// Initializes a new instance of . + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// is null. + public NGramTokenizer(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.NGramTokenizer"; + TokenChars = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the + /// value of maxGram. + /// + /// The maximum n-gram length. Default is 2. Maximum is 300. + /// Character classes to keep in the tokens. + internal NGramTokenizer(string odataType, string name, IDictionary serializedAdditionalRawData, int? minGram, int? maxGram, IList tokenChars) : base(odataType, name, serializedAdditionalRawData) + { + MinGram = minGram; + MaxGram = maxGram; + TokenChars = tokenChars; + } + + /// Initializes a new instance of for deserialization. + internal NGramTokenizer() + { + } + + /// + /// The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the + /// value of maxGram. + /// + public int? MinGram { get; set; } + /// The maximum n-gram length. Default is 2. Maximum is 300. + public int? MaxGram { get; set; } + /// Character classes to keep in the tokens. + public IList TokenChars { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OcrLineEnding.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OcrLineEnding.cs new file mode 100644 index 000000000000..631759da01ee --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OcrLineEnding.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Defines the sequence of characters to use between the lines of text recognized + /// by the OCR skill. The default value is "space". + /// + public readonly partial struct OcrLineEnding : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OcrLineEnding(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SpaceValue = "space"; + private const string CarriageReturnValue = "carriageReturn"; + private const string LineFeedValue = "lineFeed"; + private const string CarriageReturnLineFeedValue = "carriageReturnLineFeed"; + + /// Lines are separated by a single space character. + public static OcrLineEnding Space { get; } = new OcrLineEnding(SpaceValue); + /// Lines are separated by a carriage return ('\r') character. + public static OcrLineEnding CarriageReturn { get; } = new OcrLineEnding(CarriageReturnValue); + /// Lines are separated by a single line feed ('\n') character. + public static OcrLineEnding LineFeed { get; } = new OcrLineEnding(LineFeedValue); + /// Lines are separated by a carriage return and a line feed ('\r\n') character. + public static OcrLineEnding CarriageReturnLineFeed { get; } = new OcrLineEnding(CarriageReturnLineFeedValue); + /// Determines if two values are the same. + public static bool operator ==(OcrLineEnding left, OcrLineEnding right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OcrLineEnding left, OcrLineEnding right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OcrLineEnding(string value) => new OcrLineEnding(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OcrLineEnding other && Equals(other); + /// + public bool Equals(OcrLineEnding other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OcrSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OcrSkill.Serialization.cs new file mode 100644 index 000000000000..8b19139c5ce8 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OcrSkill.Serialization.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class OcrSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OcrSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(DefaultLanguageCode)) + { + writer.WritePropertyName("defaultLanguageCode"u8); + writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + } + if (Optional.IsDefined(DetectOrientation)) + { + writer.WritePropertyName("detectOrientation"u8); + writer.WriteBooleanValue(DetectOrientation.Value); + } + if (Optional.IsDefined(LineEnding)) + { + writer.WritePropertyName("lineEnding"u8); + writer.WriteStringValue(LineEnding.Value.ToString()); + } + } + + OcrSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OcrSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOcrSkill(document.RootElement, options); + } + + internal static OcrSkill DeserializeOcrSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OcrSkillLanguage? defaultLanguageCode = default; + bool? detectOrientation = default; + OcrLineEnding? lineEnding = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("defaultLanguageCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultLanguageCode = new OcrSkillLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("detectOrientation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + detectOrientation = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("lineEnding"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lineEnding = new OcrLineEnding(property.Value.GetString()); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OcrSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + defaultLanguageCode, + detectOrientation, + lineEnding); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OcrSkill)} does not support writing '{options.Format}' format."); + } + } + + OcrSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOcrSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OcrSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OcrSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOcrSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OcrSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OcrSkill.cs new file mode 100644 index 000000000000..542c3a35099d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OcrSkill.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// A skill that extracts text from image files. + public partial class OcrSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public OcrSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Vision.OcrSkill"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// A value indicating which language code to use. Default is `en`. + /// A value indicating to turn orientation detection on or not. Default is false. + /// + /// Defines the sequence of characters to use between the lines of text recognized + /// by the OCR skill. The default value is "space". + /// + internal OcrSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, OcrSkillLanguage? defaultLanguageCode, bool? detectOrientation, OcrLineEnding? lineEnding) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + DefaultLanguageCode = defaultLanguageCode; + DetectOrientation = detectOrientation; + LineEnding = lineEnding; + } + + /// Initializes a new instance of for deserialization. + internal OcrSkill() + { + } + + /// A value indicating which language code to use. Default is `en`. + public OcrSkillLanguage? DefaultLanguageCode { get; set; } + /// A value indicating to turn orientation detection on or not. Default is false. + public bool? DetectOrientation { get; set; } + /// + /// Defines the sequence of characters to use between the lines of text recognized + /// by the OCR skill. The default value is "space". + /// + public OcrLineEnding? LineEnding { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OcrSkillLanguage.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OcrSkillLanguage.cs new file mode 100644 index 000000000000..5a7558dea2a6 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OcrSkillLanguage.cs @@ -0,0 +1,555 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// The language codes supported for input by OcrSkill. + public readonly partial struct OcrSkillLanguage : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OcrSkillLanguage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AfValue = "af"; + private const string SqValue = "sq"; + private const string AnpValue = "anp"; + private const string ArValue = "ar"; + private const string AstValue = "ast"; + private const string AwaValue = "awa"; + private const string AzValue = "az"; + private const string BfyValue = "bfy"; + private const string EuValue = "eu"; + private const string BeValue = "be"; + private const string BeCyrlValue = "be-cyrl"; + private const string BeLatnValue = "be-latn"; + private const string BhoValue = "bho"; + private const string BiValue = "bi"; + private const string BrxValue = "brx"; + private const string BsValue = "bs"; + private const string BraValue = "bra"; + private const string BrValue = "br"; + private const string BgValue = "bg"; + private const string BnsValue = "bns"; + private const string BuaValue = "bua"; + private const string CaValue = "ca"; + private const string CebValue = "ceb"; + private const string RabValue = "rab"; + private const string ChValue = "ch"; + private const string HneValue = "hne"; + private const string ZhHansValue = "zh-Hans"; + private const string ZhHantValue = "zh-Hant"; + private const string KwValue = "kw"; + private const string CoValue = "co"; + private const string CrhValue = "crh"; + private const string HrValue = "hr"; + private const string CsValue = "cs"; + private const string DaValue = "da"; + private const string PrsValue = "prs"; + private const string DhiValue = "dhi"; + private const string DoiValue = "doi"; + private const string NlValue = "nl"; + private const string EnValue = "en"; + private const string MyvValue = "myv"; + private const string EtValue = "et"; + private const string FoValue = "fo"; + private const string FjValue = "fj"; + private const string FilValue = "fil"; + private const string FiValue = "fi"; + private const string FrValue = "fr"; + private const string FurValue = "fur"; + private const string GagValue = "gag"; + private const string GlValue = "gl"; + private const string DeValue = "de"; + private const string GilValue = "gil"; + private const string GonValue = "gon"; + private const string ElValue = "el"; + private const string KlValue = "kl"; + private const string GvrValue = "gvr"; + private const string HtValue = "ht"; + private const string HlbValue = "hlb"; + private const string HniValue = "hni"; + private const string BgcValue = "bgc"; + private const string HawValue = "haw"; + private const string HiValue = "hi"; + private const string MwwValue = "mww"; + private const string HocValue = "hoc"; + private const string HuValue = "hu"; + private const string IsValue = "is"; + private const string SmnValue = "smn"; + private const string IdValue = "id"; + private const string IaValue = "ia"; + private const string IuValue = "iu"; + private const string GaValue = "ga"; + private const string ItValue = "it"; + private const string JaValue = "ja"; + private const string JnsValue = "Jns"; + private const string JvValue = "jv"; + private const string KeaValue = "kea"; + private const string KacValue = "kac"; + private const string XnrValue = "xnr"; + private const string KrcValue = "krc"; + private const string KaaCyrlValue = "kaa-cyrl"; + private const string KaaValue = "kaa"; + private const string CsbValue = "csb"; + private const string KkCyrlValue = "kk-cyrl"; + private const string KkLatnValue = "kk-latn"; + private const string KlrValue = "klr"; + private const string KhaValue = "kha"; + private const string QucValue = "quc"; + private const string KoValue = "ko"; + private const string KfqValue = "kfq"; + private const string KpyValue = "kpy"; + private const string KosValue = "kos"; + private const string KumValue = "kum"; + private const string KuArabValue = "ku-arab"; + private const string KuLatnValue = "ku-latn"; + private const string KruValue = "kru"; + private const string KyValue = "ky"; + private const string LktValue = "lkt"; + private const string LaValue = "la"; + private const string LtValue = "lt"; + private const string DsbValue = "dsb"; + private const string SmjValue = "smj"; + private const string LbValue = "lb"; + private const string BfzValue = "bfz"; + private const string MsValue = "ms"; + private const string MtValue = "mt"; + private const string KmjValue = "kmj"; + private const string GvValue = "gv"; + private const string MiValue = "mi"; + private const string MrValue = "mr"; + private const string MnValue = "mn"; + private const string CnrCyrlValue = "cnr-cyrl"; + private const string CnrLatnValue = "cnr-latn"; + private const string NapValue = "nap"; + private const string NeValue = "ne"; + private const string NiuValue = "niu"; + private const string NogValue = "nog"; + private const string SmeValue = "sme"; + private const string NbValue = "nb"; + private const string NoValue = "no"; + private const string OcValue = "oc"; + private const string OsValue = "os"; + private const string PsValue = "ps"; + private const string FaValue = "fa"; + private const string PlValue = "pl"; + private const string PtValue = "pt"; + private const string PaValue = "pa"; + private const string KshValue = "ksh"; + private const string RoValue = "ro"; + private const string RmValue = "rm"; + private const string RuValue = "ru"; + private const string SckValue = "sck"; + private const string SmValue = "sm"; + private const string SaValue = "sa"; + private const string SatValue = "sat"; + private const string ScoValue = "sco"; + private const string GdValue = "gd"; + private const string SrValue = "sr"; + private const string SrCyrlValue = "sr-Cyrl"; + private const string SrLatnValue = "sr-Latn"; + private const string XsrValue = "xsr"; + private const string SrxValue = "srx"; + private const string SmsValue = "sms"; + private const string SkValue = "sk"; + private const string SlValue = "sl"; + private const string SoValue = "so"; + private const string SmaValue = "sma"; + private const string EsValue = "es"; + private const string SwValue = "sw"; + private const string SvValue = "sv"; + private const string TgValue = "tg"; + private const string TtValue = "tt"; + private const string TetValue = "tet"; + private const string ThfValue = "thf"; + private const string ToValue = "to"; + private const string TrValue = "tr"; + private const string TkValue = "tk"; + private const string TyvValue = "tyv"; + private const string HsbValue = "hsb"; + private const string UrValue = "ur"; + private const string UgValue = "ug"; + private const string UzArabValue = "uz-arab"; + private const string UzCyrlValue = "uz-cyrl"; + private const string UzValue = "uz"; + private const string VoValue = "vo"; + private const string WaeValue = "wae"; + private const string CyValue = "cy"; + private const string FyValue = "fy"; + private const string YuaValue = "yua"; + private const string ZaValue = "za"; + private const string ZuValue = "zu"; + private const string UnkValue = "unk"; + + /// Afrikaans. + public static OcrSkillLanguage Af { get; } = new OcrSkillLanguage(AfValue); + /// Albanian. + public static OcrSkillLanguage Sq { get; } = new OcrSkillLanguage(SqValue); + /// Angika (Devanagiri). + public static OcrSkillLanguage Anp { get; } = new OcrSkillLanguage(AnpValue); + /// Arabic. + public static OcrSkillLanguage Ar { get; } = new OcrSkillLanguage(ArValue); + /// Asturian. + public static OcrSkillLanguage Ast { get; } = new OcrSkillLanguage(AstValue); + /// Awadhi-Hindi (Devanagiri). + public static OcrSkillLanguage Awa { get; } = new OcrSkillLanguage(AwaValue); + /// Azerbaijani (Latin). + public static OcrSkillLanguage Az { get; } = new OcrSkillLanguage(AzValue); + /// Bagheli. + public static OcrSkillLanguage Bfy { get; } = new OcrSkillLanguage(BfyValue); + /// Basque. + public static OcrSkillLanguage Eu { get; } = new OcrSkillLanguage(EuValue); + /// Belarusian (Cyrillic and Latin). + public static OcrSkillLanguage Be { get; } = new OcrSkillLanguage(BeValue); + /// Belarusian (Cyrillic). + public static OcrSkillLanguage BeCyrl { get; } = new OcrSkillLanguage(BeCyrlValue); + /// Belarusian (Latin). + public static OcrSkillLanguage BeLatn { get; } = new OcrSkillLanguage(BeLatnValue); + /// Bhojpuri-Hindi (Devanagiri). + public static OcrSkillLanguage Bho { get; } = new OcrSkillLanguage(BhoValue); + /// Bislama. + public static OcrSkillLanguage Bi { get; } = new OcrSkillLanguage(BiValue); + /// Bodo (Devanagiri). + public static OcrSkillLanguage Brx { get; } = new OcrSkillLanguage(BrxValue); + /// Bosnian Latin. + public static OcrSkillLanguage Bs { get; } = new OcrSkillLanguage(BsValue); + /// Brajbha. + public static OcrSkillLanguage Bra { get; } = new OcrSkillLanguage(BraValue); + /// Breton. + public static OcrSkillLanguage Br { get; } = new OcrSkillLanguage(BrValue); + /// Bulgarian. + public static OcrSkillLanguage Bg { get; } = new OcrSkillLanguage(BgValue); + /// Bundeli. + public static OcrSkillLanguage Bns { get; } = new OcrSkillLanguage(BnsValue); + /// Buryat (Cyrillic). + public static OcrSkillLanguage Bua { get; } = new OcrSkillLanguage(BuaValue); + /// Catalan. + public static OcrSkillLanguage Ca { get; } = new OcrSkillLanguage(CaValue); + /// Cebuano. + public static OcrSkillLanguage Ceb { get; } = new OcrSkillLanguage(CebValue); + /// Chamling. + public static OcrSkillLanguage Rab { get; } = new OcrSkillLanguage(RabValue); + /// Chamorro. + public static OcrSkillLanguage Ch { get; } = new OcrSkillLanguage(ChValue); + /// Chhattisgarhi (Devanagiri). + public static OcrSkillLanguage Hne { get; } = new OcrSkillLanguage(HneValue); + /// Chinese Simplified. + public static OcrSkillLanguage ZhHans { get; } = new OcrSkillLanguage(ZhHansValue); + /// Chinese Traditional. + public static OcrSkillLanguage ZhHant { get; } = new OcrSkillLanguage(ZhHantValue); + /// Cornish. + public static OcrSkillLanguage Kw { get; } = new OcrSkillLanguage(KwValue); + /// Corsican. + public static OcrSkillLanguage Co { get; } = new OcrSkillLanguage(CoValue); + /// Crimean Tatar (Latin). + public static OcrSkillLanguage Crh { get; } = new OcrSkillLanguage(CrhValue); + /// Croatian. + public static OcrSkillLanguage Hr { get; } = new OcrSkillLanguage(HrValue); + /// Czech. + public static OcrSkillLanguage Cs { get; } = new OcrSkillLanguage(CsValue); + /// Danish. + public static OcrSkillLanguage Da { get; } = new OcrSkillLanguage(DaValue); + /// Dari. + public static OcrSkillLanguage Prs { get; } = new OcrSkillLanguage(PrsValue); + /// Dhimal (Devanagiri). + public static OcrSkillLanguage Dhi { get; } = new OcrSkillLanguage(DhiValue); + /// Dogri (Devanagiri). + public static OcrSkillLanguage Doi { get; } = new OcrSkillLanguage(DoiValue); + /// Dutch. + public static OcrSkillLanguage Nl { get; } = new OcrSkillLanguage(NlValue); + /// English. + public static OcrSkillLanguage En { get; } = new OcrSkillLanguage(EnValue); + /// Erzya (Cyrillic). + public static OcrSkillLanguage Myv { get; } = new OcrSkillLanguage(MyvValue); + /// Estonian. + public static OcrSkillLanguage Et { get; } = new OcrSkillLanguage(EtValue); + /// Faroese. + public static OcrSkillLanguage Fo { get; } = new OcrSkillLanguage(FoValue); + /// Fijian. + public static OcrSkillLanguage Fj { get; } = new OcrSkillLanguage(FjValue); + /// Filipino. + public static OcrSkillLanguage Fil { get; } = new OcrSkillLanguage(FilValue); + /// Finnish. + public static OcrSkillLanguage Fi { get; } = new OcrSkillLanguage(FiValue); + /// French. + public static OcrSkillLanguage Fr { get; } = new OcrSkillLanguage(FrValue); + /// Frulian. + public static OcrSkillLanguage Fur { get; } = new OcrSkillLanguage(FurValue); + /// Gagauz (Latin). + public static OcrSkillLanguage Gag { get; } = new OcrSkillLanguage(GagValue); + /// Galician. + public static OcrSkillLanguage Gl { get; } = new OcrSkillLanguage(GlValue); + /// German. + public static OcrSkillLanguage De { get; } = new OcrSkillLanguage(DeValue); + /// Gilbertese. + public static OcrSkillLanguage Gil { get; } = new OcrSkillLanguage(GilValue); + /// Gondi (Devanagiri). + public static OcrSkillLanguage Gon { get; } = new OcrSkillLanguage(GonValue); + /// Greek. + public static OcrSkillLanguage El { get; } = new OcrSkillLanguage(ElValue); + /// Greenlandic. + public static OcrSkillLanguage Kl { get; } = new OcrSkillLanguage(KlValue); + /// Gurung (Devanagiri). + public static OcrSkillLanguage Gvr { get; } = new OcrSkillLanguage(GvrValue); + /// Haitian Creole. + public static OcrSkillLanguage Ht { get; } = new OcrSkillLanguage(HtValue); + /// Halbi (Devanagiri). + public static OcrSkillLanguage Hlb { get; } = new OcrSkillLanguage(HlbValue); + /// Hani. + public static OcrSkillLanguage Hni { get; } = new OcrSkillLanguage(HniValue); + /// Haryanvi. + public static OcrSkillLanguage Bgc { get; } = new OcrSkillLanguage(BgcValue); + /// Hawaiian. + public static OcrSkillLanguage Haw { get; } = new OcrSkillLanguage(HawValue); + /// Hindi. + public static OcrSkillLanguage Hi { get; } = new OcrSkillLanguage(HiValue); + /// Hmong Daw (Latin). + public static OcrSkillLanguage Mww { get; } = new OcrSkillLanguage(MwwValue); + /// Ho (Devanagiri). + public static OcrSkillLanguage Hoc { get; } = new OcrSkillLanguage(HocValue); + /// Hungarian. + public static OcrSkillLanguage Hu { get; } = new OcrSkillLanguage(HuValue); + /// Icelandic. + public static OcrSkillLanguage Is { get; } = new OcrSkillLanguage(IsValue); + /// Inari Sami. + public static OcrSkillLanguage Smn { get; } = new OcrSkillLanguage(SmnValue); + /// Indonesian. + public static OcrSkillLanguage Id { get; } = new OcrSkillLanguage(IdValue); + /// Interlingua. + public static OcrSkillLanguage Ia { get; } = new OcrSkillLanguage(IaValue); + /// Inuktitut (Latin). + public static OcrSkillLanguage Iu { get; } = new OcrSkillLanguage(IuValue); + /// Irish. + public static OcrSkillLanguage Ga { get; } = new OcrSkillLanguage(GaValue); + /// Italian. + public static OcrSkillLanguage It { get; } = new OcrSkillLanguage(ItValue); + /// Japanese. + public static OcrSkillLanguage Ja { get; } = new OcrSkillLanguage(JaValue); + /// Jaunsari (Devanagiri). + public static OcrSkillLanguage Jns { get; } = new OcrSkillLanguage(JnsValue); + /// Javanese. + public static OcrSkillLanguage Jv { get; } = new OcrSkillLanguage(JvValue); + /// Kabuverdianu. + public static OcrSkillLanguage Kea { get; } = new OcrSkillLanguage(KeaValue); + /// Kachin (Latin). + public static OcrSkillLanguage Kac { get; } = new OcrSkillLanguage(KacValue); + /// Kangri (Devanagiri). + public static OcrSkillLanguage Xnr { get; } = new OcrSkillLanguage(XnrValue); + /// Karachay-Balkar. + public static OcrSkillLanguage Krc { get; } = new OcrSkillLanguage(KrcValue); + /// Kara-Kalpak (Cyrillic). + public static OcrSkillLanguage KaaCyrl { get; } = new OcrSkillLanguage(KaaCyrlValue); + /// Kara-Kalpak (Latin). + public static OcrSkillLanguage Kaa { get; } = new OcrSkillLanguage(KaaValue); + /// Kashubian. + public static OcrSkillLanguage Csb { get; } = new OcrSkillLanguage(CsbValue); + /// Kazakh (Cyrillic). + public static OcrSkillLanguage KkCyrl { get; } = new OcrSkillLanguage(KkCyrlValue); + /// Kazakh (Latin). + public static OcrSkillLanguage KkLatn { get; } = new OcrSkillLanguage(KkLatnValue); + /// Khaling. + public static OcrSkillLanguage Klr { get; } = new OcrSkillLanguage(KlrValue); + /// Khasi. + public static OcrSkillLanguage Kha { get; } = new OcrSkillLanguage(KhaValue); + /// K'iche'. + public static OcrSkillLanguage Quc { get; } = new OcrSkillLanguage(QucValue); + /// Korean. + public static OcrSkillLanguage Ko { get; } = new OcrSkillLanguage(KoValue); + /// Korku. + public static OcrSkillLanguage Kfq { get; } = new OcrSkillLanguage(KfqValue); + /// Koryak. + public static OcrSkillLanguage Kpy { get; } = new OcrSkillLanguage(KpyValue); + /// Kosraean. + public static OcrSkillLanguage Kos { get; } = new OcrSkillLanguage(KosValue); + /// Kumyk (Cyrillic). + public static OcrSkillLanguage Kum { get; } = new OcrSkillLanguage(KumValue); + /// Kurdish (Arabic). + public static OcrSkillLanguage KuArab { get; } = new OcrSkillLanguage(KuArabValue); + /// Kurdish (Latin). + public static OcrSkillLanguage KuLatn { get; } = new OcrSkillLanguage(KuLatnValue); + /// Kurukh (Devanagiri). + public static OcrSkillLanguage Kru { get; } = new OcrSkillLanguage(KruValue); + /// Kyrgyz (Cyrillic). + public static OcrSkillLanguage Ky { get; } = new OcrSkillLanguage(KyValue); + /// Lakota. + public static OcrSkillLanguage Lkt { get; } = new OcrSkillLanguage(LktValue); + /// Latin. + public static OcrSkillLanguage La { get; } = new OcrSkillLanguage(LaValue); + /// Lithuanian. + public static OcrSkillLanguage Lt { get; } = new OcrSkillLanguage(LtValue); + /// Lower Sorbian. + public static OcrSkillLanguage Dsb { get; } = new OcrSkillLanguage(DsbValue); + /// Lule Sami. + public static OcrSkillLanguage Smj { get; } = new OcrSkillLanguage(SmjValue); + /// Luxembourgish. + public static OcrSkillLanguage Lb { get; } = new OcrSkillLanguage(LbValue); + /// Mahasu Pahari (Devanagiri). + public static OcrSkillLanguage Bfz { get; } = new OcrSkillLanguage(BfzValue); + /// Malay (Latin). + public static OcrSkillLanguage Ms { get; } = new OcrSkillLanguage(MsValue); + /// Maltese. + public static OcrSkillLanguage Mt { get; } = new OcrSkillLanguage(MtValue); + /// Malto (Devanagiri). + public static OcrSkillLanguage Kmj { get; } = new OcrSkillLanguage(KmjValue); + /// Manx. + public static OcrSkillLanguage Gv { get; } = new OcrSkillLanguage(GvValue); + /// Maori. + public static OcrSkillLanguage Mi { get; } = new OcrSkillLanguage(MiValue); + /// Marathi. + public static OcrSkillLanguage Mr { get; } = new OcrSkillLanguage(MrValue); + /// Mongolian (Cyrillic). + public static OcrSkillLanguage Mn { get; } = new OcrSkillLanguage(MnValue); + /// Montenegrin (Cyrillic). + public static OcrSkillLanguage CnrCyrl { get; } = new OcrSkillLanguage(CnrCyrlValue); + /// Montenegrin (Latin). + public static OcrSkillLanguage CnrLatn { get; } = new OcrSkillLanguage(CnrLatnValue); + /// Neapolitan. + public static OcrSkillLanguage Nap { get; } = new OcrSkillLanguage(NapValue); + /// Nepali. + public static OcrSkillLanguage Ne { get; } = new OcrSkillLanguage(NeValue); + /// Niuean. + public static OcrSkillLanguage Niu { get; } = new OcrSkillLanguage(NiuValue); + /// Nogay. + public static OcrSkillLanguage Nog { get; } = new OcrSkillLanguage(NogValue); + /// Northern Sami (Latin). + public static OcrSkillLanguage Sme { get; } = new OcrSkillLanguage(SmeValue); + /// Norwegian. + public static OcrSkillLanguage Nb { get; } = new OcrSkillLanguage(NbValue); + /// Norwegian. + public static OcrSkillLanguage No { get; } = new OcrSkillLanguage(NoValue); + /// Occitan. + public static OcrSkillLanguage Oc { get; } = new OcrSkillLanguage(OcValue); + /// Ossetic. + public static OcrSkillLanguage Os { get; } = new OcrSkillLanguage(OsValue); + /// Pashto. + public static OcrSkillLanguage Ps { get; } = new OcrSkillLanguage(PsValue); + /// Persian. + public static OcrSkillLanguage Fa { get; } = new OcrSkillLanguage(FaValue); + /// Polish. + public static OcrSkillLanguage Pl { get; } = new OcrSkillLanguage(PlValue); + /// Portuguese. + public static OcrSkillLanguage Pt { get; } = new OcrSkillLanguage(PtValue); + /// Punjabi (Arabic). + public static OcrSkillLanguage Pa { get; } = new OcrSkillLanguage(PaValue); + /// Ripuarian. + public static OcrSkillLanguage Ksh { get; } = new OcrSkillLanguage(KshValue); + /// Romanian. + public static OcrSkillLanguage Ro { get; } = new OcrSkillLanguage(RoValue); + /// Romansh. + public static OcrSkillLanguage Rm { get; } = new OcrSkillLanguage(RmValue); + /// Russian. + public static OcrSkillLanguage Ru { get; } = new OcrSkillLanguage(RuValue); + /// Sadri (Devanagiri). + public static OcrSkillLanguage Sck { get; } = new OcrSkillLanguage(SckValue); + /// Samoan (Latin). + public static OcrSkillLanguage Sm { get; } = new OcrSkillLanguage(SmValue); + /// Sanskrit (Devanagiri). + public static OcrSkillLanguage Sa { get; } = new OcrSkillLanguage(SaValue); + /// Santali (Devanagiri). + public static OcrSkillLanguage Sat { get; } = new OcrSkillLanguage(SatValue); + /// Scots. + public static OcrSkillLanguage Sco { get; } = new OcrSkillLanguage(ScoValue); + /// Scottish Gaelic. + public static OcrSkillLanguage Gd { get; } = new OcrSkillLanguage(GdValue); + /// Serbian (Latin). + public static OcrSkillLanguage Sr { get; } = new OcrSkillLanguage(SrValue); + /// Serbian (Cyrillic). + public static OcrSkillLanguage SrCyrl { get; } = new OcrSkillLanguage(SrCyrlValue); + /// Serbian (Latin). + public static OcrSkillLanguage SrLatn { get; } = new OcrSkillLanguage(SrLatnValue); + /// Sherpa (Devanagiri). + public static OcrSkillLanguage Xsr { get; } = new OcrSkillLanguage(XsrValue); + /// Sirmauri (Devanagiri). + public static OcrSkillLanguage Srx { get; } = new OcrSkillLanguage(SrxValue); + /// Skolt Sami. + public static OcrSkillLanguage Sms { get; } = new OcrSkillLanguage(SmsValue); + /// Slovak. + public static OcrSkillLanguage Sk { get; } = new OcrSkillLanguage(SkValue); + /// Slovenian. + public static OcrSkillLanguage Sl { get; } = new OcrSkillLanguage(SlValue); + /// Somali (Arabic). + public static OcrSkillLanguage So { get; } = new OcrSkillLanguage(SoValue); + /// Southern Sami. + public static OcrSkillLanguage Sma { get; } = new OcrSkillLanguage(SmaValue); + /// Spanish. + public static OcrSkillLanguage Es { get; } = new OcrSkillLanguage(EsValue); + /// Swahili (Latin). + public static OcrSkillLanguage Sw { get; } = new OcrSkillLanguage(SwValue); + /// Swedish. + public static OcrSkillLanguage Sv { get; } = new OcrSkillLanguage(SvValue); + /// Tajik (Cyrillic). + public static OcrSkillLanguage Tg { get; } = new OcrSkillLanguage(TgValue); + /// Tatar (Latin). + public static OcrSkillLanguage Tt { get; } = new OcrSkillLanguage(TtValue); + /// Tetum. + public static OcrSkillLanguage Tet { get; } = new OcrSkillLanguage(TetValue); + /// Thangmi. + public static OcrSkillLanguage Thf { get; } = new OcrSkillLanguage(ThfValue); + /// Tongan. + public static OcrSkillLanguage To { get; } = new OcrSkillLanguage(ToValue); + /// Turkish. + public static OcrSkillLanguage Tr { get; } = new OcrSkillLanguage(TrValue); + /// Turkmen (Latin). + public static OcrSkillLanguage Tk { get; } = new OcrSkillLanguage(TkValue); + /// Tuvan. + public static OcrSkillLanguage Tyv { get; } = new OcrSkillLanguage(TyvValue); + /// Upper Sorbian. + public static OcrSkillLanguage Hsb { get; } = new OcrSkillLanguage(HsbValue); + /// Urdu. + public static OcrSkillLanguage Ur { get; } = new OcrSkillLanguage(UrValue); + /// Uyghur (Arabic). + public static OcrSkillLanguage Ug { get; } = new OcrSkillLanguage(UgValue); + /// Uzbek (Arabic). + public static OcrSkillLanguage UzArab { get; } = new OcrSkillLanguage(UzArabValue); + /// Uzbek (Cyrillic). + public static OcrSkillLanguage UzCyrl { get; } = new OcrSkillLanguage(UzCyrlValue); + /// Uzbek (Latin). + public static OcrSkillLanguage Uz { get; } = new OcrSkillLanguage(UzValue); + /// Volapük. + public static OcrSkillLanguage Vo { get; } = new OcrSkillLanguage(VoValue); + /// Walser. + public static OcrSkillLanguage Wae { get; } = new OcrSkillLanguage(WaeValue); + /// Welsh. + public static OcrSkillLanguage Cy { get; } = new OcrSkillLanguage(CyValue); + /// Western Frisian. + public static OcrSkillLanguage Fy { get; } = new OcrSkillLanguage(FyValue); + /// Yucatec Maya. + public static OcrSkillLanguage Yua { get; } = new OcrSkillLanguage(YuaValue); + /// Zhuang. + public static OcrSkillLanguage Za { get; } = new OcrSkillLanguage(ZaValue); + /// Zulu. + public static OcrSkillLanguage Zu { get; } = new OcrSkillLanguage(ZuValue); + /// Unknown (All). + public static OcrSkillLanguage Unk { get; } = new OcrSkillLanguage(UnkValue); + /// Determines if two values are the same. + public static bool operator ==(OcrSkillLanguage left, OcrSkillLanguage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OcrSkillLanguage left, OcrSkillLanguage right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OcrSkillLanguage(string value) => new OcrSkillLanguage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OcrSkillLanguage other && Equals(other); + /// + public bool Equals(OcrSkillLanguage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OutputFieldMappingEntry.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OutputFieldMappingEntry.Serialization.cs new file mode 100644 index 000000000000..b20162f8b85e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OutputFieldMappingEntry.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class OutputFieldMappingEntry : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OutputFieldMappingEntry)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(TargetName)) + { + writer.WritePropertyName("targetName"u8); + writer.WriteStringValue(TargetName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OutputFieldMappingEntry IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OutputFieldMappingEntry)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOutputFieldMappingEntry(document.RootElement, options); + } + + internal static OutputFieldMappingEntry DeserializeOutputFieldMappingEntry(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string targetName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetName"u8)) + { + targetName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OutputFieldMappingEntry(name, targetName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OutputFieldMappingEntry)} does not support writing '{options.Format}' format."); + } + } + + OutputFieldMappingEntry IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOutputFieldMappingEntry(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OutputFieldMappingEntry)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OutputFieldMappingEntry FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOutputFieldMappingEntry(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OutputFieldMappingEntry.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OutputFieldMappingEntry.cs new file mode 100644 index 000000000000..9f63f77249d8 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/OutputFieldMappingEntry.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Output field mapping for a skill. + public partial class OutputFieldMappingEntry + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the output defined by the skill. + /// is null. + public OutputFieldMappingEntry(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The name of the output defined by the skill. + /// The target name of the output. It is optional and default to name. + /// Keeps track of any properties unknown to the library. + internal OutputFieldMappingEntry(string name, string targetName, IDictionary serializedAdditionalRawData) + { + Name = name; + TargetName = targetName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OutputFieldMappingEntry() + { + } + + /// The name of the output defined by the skill. + public string Name { get; set; } + /// The target name of the output. It is optional and default to name. + public string TargetName { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PIIDetectionSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PIIDetectionSkill.Serialization.cs new file mode 100644 index 000000000000..8c7f71712614 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PIIDetectionSkill.Serialization.cs @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class PIIDetectionSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PIIDetectionSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(DefaultLanguageCode)) + { + writer.WritePropertyName("defaultLanguageCode"u8); + writer.WriteStringValue(DefaultLanguageCode); + } + if (Optional.IsDefined(MinimumPrecision)) + { + writer.WritePropertyName("minimumPrecision"u8); + writer.WriteNumberValue(MinimumPrecision.Value); + } + if (Optional.IsDefined(MaskingMode)) + { + writer.WritePropertyName("maskingMode"u8); + writer.WriteStringValue(MaskingMode.Value.ToString()); + } + if (Optional.IsDefined(MaskingCharacter)) + { + writer.WritePropertyName("maskingCharacter"u8); + writer.WriteStringValue(MaskingCharacter); + } + if (Optional.IsDefined(ModelVersion)) + { + writer.WritePropertyName("modelVersion"u8); + writer.WriteStringValue(ModelVersion); + } + if (Optional.IsCollectionDefined(PiiCategories)) + { + writer.WritePropertyName("piiCategories"u8); + writer.WriteStartArray(); + foreach (var item in PiiCategories) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Domain)) + { + writer.WritePropertyName("domain"u8); + writer.WriteStringValue(Domain); + } + } + + PIIDetectionSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PIIDetectionSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePIIDetectionSkill(document.RootElement, options); + } + + internal static PIIDetectionSkill DeserializePIIDetectionSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string defaultLanguageCode = default; + double? minimumPrecision = default; + PIIDetectionSkillMaskingMode? maskingMode = default; + string maskingCharacter = default; + string modelVersion = default; + IList piiCategories = default; + string domain = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("defaultLanguageCode"u8)) + { + defaultLanguageCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("minimumPrecision"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minimumPrecision = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("maskingMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maskingMode = new PIIDetectionSkillMaskingMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("maskingCharacter"u8)) + { + maskingCharacter = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelVersion"u8)) + { + modelVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("piiCategories"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + piiCategories = array; + continue; + } + if (property.NameEquals("domain"u8)) + { + domain = property.Value.GetString(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PIIDetectionSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + defaultLanguageCode, + minimumPrecision, + maskingMode, + maskingCharacter, + modelVersion, + piiCategories ?? new ChangeTrackingList(), + domain); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PIIDetectionSkill)} does not support writing '{options.Format}' format."); + } + } + + PIIDetectionSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePIIDetectionSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PIIDetectionSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new PIIDetectionSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePIIDetectionSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PIIDetectionSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PIIDetectionSkill.cs new file mode 100644 index 000000000000..121ad0ba4f5d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PIIDetectionSkill.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Using the Text Analytics API, extracts personal information from an input text + /// and gives you the option of masking it. + /// + public partial class PIIDetectionSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public PIIDetectionSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Text.PIIDetectionSkill"; + PiiCategories = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// A value indicating which language code to use. Default is `en`. + /// + /// A value between 0 and 1 that be used to only include entities whose confidence + /// score is greater than the value specified. If not set (default), or if + /// explicitly set to null, all entities will be included. + /// + /// + /// A parameter that provides various ways to mask the personal information + /// detected in the input text. Default is 'none'. + /// + /// + /// The character used to mask the text if the maskingMode parameter is set to + /// replace. Default is '*'. + /// + /// + /// The version of the model to use when calling the Text Analytics service. It + /// will default to the latest available when not specified. We recommend you do + /// not specify this value unless absolutely necessary. + /// + /// A list of PII entity categories that should be extracted and masked. + /// + /// If specified, will set the PII domain to include only a subset of the entity + /// categories. Possible values include: 'phi', 'none'. Default is 'none'. + /// + internal PIIDetectionSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, string defaultLanguageCode, double? minimumPrecision, PIIDetectionSkillMaskingMode? maskingMode, string maskingCharacter, string modelVersion, IList piiCategories, string domain) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + DefaultLanguageCode = defaultLanguageCode; + MinimumPrecision = minimumPrecision; + MaskingMode = maskingMode; + MaskingCharacter = maskingCharacter; + ModelVersion = modelVersion; + PiiCategories = piiCategories; + Domain = domain; + } + + /// Initializes a new instance of for deserialization. + internal PIIDetectionSkill() + { + } + + /// A value indicating which language code to use. Default is `en`. + public string DefaultLanguageCode { get; set; } + /// + /// A value between 0 and 1 that be used to only include entities whose confidence + /// score is greater than the value specified. If not set (default), or if + /// explicitly set to null, all entities will be included. + /// + public double? MinimumPrecision { get; set; } + /// + /// A parameter that provides various ways to mask the personal information + /// detected in the input text. Default is 'none'. + /// + public PIIDetectionSkillMaskingMode? MaskingMode { get; set; } + /// + /// The character used to mask the text if the maskingMode parameter is set to + /// replace. Default is '*'. + /// + public string MaskingCharacter { get; set; } + /// + /// The version of the model to use when calling the Text Analytics service. It + /// will default to the latest available when not specified. We recommend you do + /// not specify this value unless absolutely necessary. + /// + public string ModelVersion { get; set; } + /// A list of PII entity categories that should be extracted and masked. + public IList PiiCategories { get; } + /// + /// If specified, will set the PII domain to include only a subset of the entity + /// categories. Possible values include: 'phi', 'none'. Default is 'none'. + /// + public string Domain { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PIIDetectionSkillMaskingMode.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PIIDetectionSkillMaskingMode.cs new file mode 100644 index 000000000000..32385b6e80cb --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PIIDetectionSkillMaskingMode.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// A string indicating what maskingMode to use to mask the personal information + /// detected in the input text. + /// + public readonly partial struct PIIDetectionSkillMaskingMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PIIDetectionSkillMaskingMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "none"; + private const string ReplaceValue = "replace"; + + /// No masking occurs and the maskedText output will not be returned. + public static PIIDetectionSkillMaskingMode None { get; } = new PIIDetectionSkillMaskingMode(NoneValue); + /// + /// Replaces the detected entities with the character given in the maskingCharacter + /// parameter. The character will be repeated to the length of the detected entity + /// so that the offsets will correctly correspond to both the input text as well as + /// the output maskedText. + /// + public static PIIDetectionSkillMaskingMode Replace { get; } = new PIIDetectionSkillMaskingMode(ReplaceValue); + /// Determines if two values are the same. + public static bool operator ==(PIIDetectionSkillMaskingMode left, PIIDetectionSkillMaskingMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PIIDetectionSkillMaskingMode left, PIIDetectionSkillMaskingMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PIIDetectionSkillMaskingMode(string value) => new PIIDetectionSkillMaskingMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PIIDetectionSkillMaskingMode other && Equals(other); + /// + public bool Equals(PIIDetectionSkillMaskingMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PathHierarchyTokenizerV2.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PathHierarchyTokenizerV2.Serialization.cs new file mode 100644 index 000000000000..67ba8b45ccf9 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PathHierarchyTokenizerV2.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class PathHierarchyTokenizerV2 : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PathHierarchyTokenizerV2)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Delimiter)) + { + writer.WritePropertyName("delimiter"u8); + writer.WriteStringValue(Delimiter); + } + if (Optional.IsDefined(Replacement)) + { + writer.WritePropertyName("replacement"u8); + writer.WriteStringValue(Replacement); + } + if (Optional.IsDefined(MaxTokenLength)) + { + writer.WritePropertyName("maxTokenLength"u8); + writer.WriteNumberValue(MaxTokenLength.Value); + } + if (Optional.IsDefined(Reverse)) + { + writer.WritePropertyName("reverse"u8); + writer.WriteBooleanValue(Reverse.Value); + } + if (Optional.IsDefined(Skip)) + { + writer.WritePropertyName("skip"u8); + writer.WriteNumberValue(Skip.Value); + } + } + + PathHierarchyTokenizerV2 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PathHierarchyTokenizerV2)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePathHierarchyTokenizerV2(document.RootElement, options); + } + + internal static PathHierarchyTokenizerV2 DeserializePathHierarchyTokenizerV2(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string delimiter = default; + string replacement = default; + int? maxTokenLength = default; + bool? reverse = default; + int? skip = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("delimiter"u8)) + { + delimiter = property.Value.GetString(); + continue; + } + if (property.NameEquals("replacement"u8)) + { + replacement = property.Value.GetString(); + continue; + } + if (property.NameEquals("maxTokenLength"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxTokenLength = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("reverse"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reverse = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("skip"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + skip = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PathHierarchyTokenizerV2( + odataType, + name, + serializedAdditionalRawData, + delimiter, + replacement, + maxTokenLength, + reverse, + skip); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PathHierarchyTokenizerV2)} does not support writing '{options.Format}' format."); + } + } + + PathHierarchyTokenizerV2 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePathHierarchyTokenizerV2(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PathHierarchyTokenizerV2)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new PathHierarchyTokenizerV2 FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePathHierarchyTokenizerV2(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PathHierarchyTokenizerV2.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PathHierarchyTokenizerV2.cs new file mode 100644 index 000000000000..db1c889e92e3 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PathHierarchyTokenizerV2.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Tokenizer for path-like hierarchies. This tokenizer is implemented using Apache + /// Lucene. + /// + public partial class PathHierarchyTokenizerV2 : LexicalTokenizer + { + /// Initializes a new instance of . + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// is null. + public PathHierarchyTokenizerV2(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.PathHierarchyTokenizerV2"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// The delimiter character to use. Default is "/". + /// A value that, if set, replaces the delimiter character. Default is "/". + /// The maximum token length. Default and maximum is 300. + /// + /// A value indicating whether to generate tokens in reverse order. Default is + /// false. + /// + /// The number of initial tokens to skip. Default is 0. + internal PathHierarchyTokenizerV2(string odataType, string name, IDictionary serializedAdditionalRawData, string delimiter, string replacement, int? maxTokenLength, bool? reverse, int? skip) : base(odataType, name, serializedAdditionalRawData) + { + Delimiter = delimiter; + Replacement = replacement; + MaxTokenLength = maxTokenLength; + Reverse = reverse; + Skip = skip; + } + + /// Initializes a new instance of for deserialization. + internal PathHierarchyTokenizerV2() + { + } + + /// The delimiter character to use. Default is "/". + public string Delimiter { get; set; } + /// A value that, if set, replaces the delimiter character. Default is "/". + public string Replacement { get; set; } + /// The maximum token length. Default and maximum is 300. + public int? MaxTokenLength { get; set; } + /// + /// A value indicating whether to generate tokens in reverse order. Default is + /// false. + /// + public bool? Reverse { get; set; } + /// The number of initial tokens to skip. Default is 0. + public int? Skip { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternAnalyzer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternAnalyzer.Serialization.cs new file mode 100644 index 000000000000..9c6ee182ce11 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternAnalyzer.Serialization.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class PatternAnalyzer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatternAnalyzer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Lowercase)) + { + writer.WritePropertyName("lowercase"u8); + writer.WriteBooleanValue(Lowercase.Value); + } + if (Optional.IsDefined(Pattern)) + { + writer.WritePropertyName("pattern"u8); + writer.WriteStringValue(Pattern); + } + if (Optional.IsDefined(Flags)) + { + writer.WritePropertyName("flags"u8); + writer.WriteStringValue(Flags.Value.ToString()); + } + if (Optional.IsCollectionDefined(Stopwords)) + { + writer.WritePropertyName("stopwords"u8); + writer.WriteStartArray(); + foreach (var item in Stopwords) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + PatternAnalyzer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatternAnalyzer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatternAnalyzer(document.RootElement, options); + } + + internal static PatternAnalyzer DeserializePatternAnalyzer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? lowercase = default; + string pattern = default; + RegexFlags? flags = default; + IList stopwords = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lowercase"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lowercase = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("pattern"u8)) + { + pattern = property.Value.GetString(); + continue; + } + if (property.NameEquals("flags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + flags = new RegexFlags(property.Value.GetString()); + continue; + } + if (property.NameEquals("stopwords"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + stopwords = array; + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PatternAnalyzer( + odataType, + name, + serializedAdditionalRawData, + lowercase, + pattern, + flags, + stopwords ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PatternAnalyzer)} does not support writing '{options.Format}' format."); + } + } + + PatternAnalyzer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePatternAnalyzer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatternAnalyzer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new PatternAnalyzer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePatternAnalyzer(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternAnalyzer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternAnalyzer.cs new file mode 100644 index 000000000000..65deaf628cbf --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternAnalyzer.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Flexibly separates text into terms via a regular expression pattern. This + /// analyzer is implemented using Apache Lucene. + /// + public partial class PatternAnalyzer : LexicalAnalyzer + { + /// Initializes a new instance of . + /// + /// The name of the analyzer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// is null. + public PatternAnalyzer(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.PatternAnalyzer"; + Stopwords = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the analyzer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// A value indicating whether terms should be lower-cased. Default is true. + /// + /// A regular expression pattern to match token separators. Default is an + /// expression that matches one or more non-word characters. + /// + /// Regular expression flags. + /// A list of stopwords. + internal PatternAnalyzer(string odataType, string name, IDictionary serializedAdditionalRawData, bool? lowercase, string pattern, RegexFlags? flags, IList stopwords) : base(odataType, name, serializedAdditionalRawData) + { + Lowercase = lowercase; + Pattern = pattern; + Flags = flags; + Stopwords = stopwords; + } + + /// Initializes a new instance of for deserialization. + internal PatternAnalyzer() + { + } + + /// A value indicating whether terms should be lower-cased. Default is true. + public bool? Lowercase { get; set; } + /// + /// A regular expression pattern to match token separators. Default is an + /// expression that matches one or more non-word characters. + /// + public string Pattern { get; set; } + /// Regular expression flags. + public RegexFlags? Flags { get; set; } + /// A list of stopwords. + public IList Stopwords { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternCaptureTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternCaptureTokenFilter.Serialization.cs new file mode 100644 index 000000000000..cc2f17c1717e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternCaptureTokenFilter.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class PatternCaptureTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatternCaptureTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("patterns"u8); + writer.WriteStartArray(); + foreach (var item in Patterns) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(PreserveOriginal)) + { + writer.WritePropertyName("preserveOriginal"u8); + writer.WriteBooleanValue(PreserveOriginal.Value); + } + } + + PatternCaptureTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatternCaptureTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatternCaptureTokenFilter(document.RootElement, options); + } + + internal static PatternCaptureTokenFilter DeserializePatternCaptureTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList patterns = default; + bool? preserveOriginal = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patterns"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + patterns = array; + continue; + } + if (property.NameEquals("preserveOriginal"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + preserveOriginal = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PatternCaptureTokenFilter(odataType, name, serializedAdditionalRawData, patterns, preserveOriginal); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PatternCaptureTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + PatternCaptureTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePatternCaptureTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatternCaptureTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new PatternCaptureTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePatternCaptureTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternCaptureTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternCaptureTokenFilter.cs new file mode 100644 index 000000000000..4771c91a1332 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternCaptureTokenFilter.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Uses Java regexes to emit multiple tokens - one for each capture group in one + /// or more patterns. This token filter is implemented using Apache Lucene. + /// + public partial class PatternCaptureTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// A list of patterns to match against each token. + /// or is null. + public PatternCaptureTokenFilter(string name, IEnumerable patterns) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(patterns, nameof(patterns)); + + OdataType = "#Microsoft.Azure.Search.PatternCaptureTokenFilter"; + Patterns = patterns.ToList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// A list of patterns to match against each token. + /// + /// A value indicating whether to return the original token even if one of the + /// patterns matches. Default is true. + /// + internal PatternCaptureTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, IList patterns, bool? preserveOriginal) : base(odataType, name, serializedAdditionalRawData) + { + Patterns = patterns; + PreserveOriginal = preserveOriginal; + } + + /// Initializes a new instance of for deserialization. + internal PatternCaptureTokenFilter() + { + } + + /// A list of patterns to match against each token. + public IList Patterns { get; } + /// + /// A value indicating whether to return the original token even if one of the + /// patterns matches. Default is true. + /// + public bool? PreserveOriginal { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternReplaceCharFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternReplaceCharFilter.Serialization.cs new file mode 100644 index 000000000000..a2248698ef48 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternReplaceCharFilter.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class PatternReplaceCharFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatternReplaceCharFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("pattern"u8); + writer.WriteStringValue(Pattern); + writer.WritePropertyName("replacement"u8); + writer.WriteStringValue(Replacement); + } + + PatternReplaceCharFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatternReplaceCharFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatternReplaceCharFilter(document.RootElement, options); + } + + internal static PatternReplaceCharFilter DeserializePatternReplaceCharFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string pattern = default; + string replacement = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("pattern"u8)) + { + pattern = property.Value.GetString(); + continue; + } + if (property.NameEquals("replacement"u8)) + { + replacement = property.Value.GetString(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PatternReplaceCharFilter(odataType, name, serializedAdditionalRawData, pattern, replacement); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PatternReplaceCharFilter)} does not support writing '{options.Format}' format."); + } + } + + PatternReplaceCharFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePatternReplaceCharFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatternReplaceCharFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new PatternReplaceCharFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePatternReplaceCharFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternReplaceCharFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternReplaceCharFilter.cs new file mode 100644 index 000000000000..96a43da815ad --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternReplaceCharFilter.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// A character filter that replaces characters in the input string. It uses a + /// regular expression to identify character sequences to preserve and a + /// replacement pattern to identify characters to replace. For example, given the + /// input text "aa bb aa bb", pattern "(aa)\s+(bb)", and replacement "$1#$2", the + /// result would be "aa#bb aa#bb". This character filter is implemented using + /// Apache Lucene. + /// + public partial class PatternReplaceCharFilter : CharFilter + { + /// Initializes a new instance of . + /// + /// The name of the char filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// A regular expression pattern. + /// The replacement text. + /// , or is null. + public PatternReplaceCharFilter(string name, string pattern, string replacement) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(pattern, nameof(pattern)); + Argument.AssertNotNull(replacement, nameof(replacement)); + + OdataType = "#Microsoft.Azure.Search.PatternReplaceCharFilter"; + Pattern = pattern; + Replacement = replacement; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the char filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// A regular expression pattern. + /// The replacement text. + internal PatternReplaceCharFilter(string odataType, string name, IDictionary serializedAdditionalRawData, string pattern, string replacement) : base(odataType, name, serializedAdditionalRawData) + { + Pattern = pattern; + Replacement = replacement; + } + + /// Initializes a new instance of for deserialization. + internal PatternReplaceCharFilter() + { + } + + /// A regular expression pattern. + public string Pattern { get; set; } + /// The replacement text. + public string Replacement { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternReplaceTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternReplaceTokenFilter.Serialization.cs new file mode 100644 index 000000000000..3a33bb4314fa --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternReplaceTokenFilter.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class PatternReplaceTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatternReplaceTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("pattern"u8); + writer.WriteStringValue(Pattern); + writer.WritePropertyName("replacement"u8); + writer.WriteStringValue(Replacement); + } + + PatternReplaceTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatternReplaceTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatternReplaceTokenFilter(document.RootElement, options); + } + + internal static PatternReplaceTokenFilter DeserializePatternReplaceTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string pattern = default; + string replacement = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("pattern"u8)) + { + pattern = property.Value.GetString(); + continue; + } + if (property.NameEquals("replacement"u8)) + { + replacement = property.Value.GetString(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PatternReplaceTokenFilter(odataType, name, serializedAdditionalRawData, pattern, replacement); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PatternReplaceTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + PatternReplaceTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePatternReplaceTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatternReplaceTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new PatternReplaceTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePatternReplaceTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternReplaceTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternReplaceTokenFilter.cs new file mode 100644 index 000000000000..d8b1cf932f6b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternReplaceTokenFilter.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// A character filter that replaces characters in the input string. It uses a + /// regular expression to identify character sequences to preserve and a + /// replacement pattern to identify characters to replace. For example, given the + /// input text "aa bb aa bb", pattern "(aa)\s+(bb)", and replacement "$1#$2", the + /// result would be "aa#bb aa#bb". This token filter is implemented using Apache + /// Lucene. + /// + public partial class PatternReplaceTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// A regular expression pattern. + /// The replacement text. + /// , or is null. + public PatternReplaceTokenFilter(string name, string pattern, string replacement) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(pattern, nameof(pattern)); + Argument.AssertNotNull(replacement, nameof(replacement)); + + OdataType = "#Microsoft.Azure.Search.PatternReplaceTokenFilter"; + Pattern = pattern; + Replacement = replacement; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// A regular expression pattern. + /// The replacement text. + internal PatternReplaceTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, string pattern, string replacement) : base(odataType, name, serializedAdditionalRawData) + { + Pattern = pattern; + Replacement = replacement; + } + + /// Initializes a new instance of for deserialization. + internal PatternReplaceTokenFilter() + { + } + + /// A regular expression pattern. + public string Pattern { get; set; } + /// The replacement text. + public string Replacement { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternTokenizer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternTokenizer.Serialization.cs new file mode 100644 index 000000000000..19d18ea3fe4d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternTokenizer.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class PatternTokenizer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatternTokenizer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Pattern)) + { + writer.WritePropertyName("pattern"u8); + writer.WriteStringValue(Pattern); + } + if (Optional.IsDefined(Flags)) + { + writer.WritePropertyName("flags"u8); + writer.WriteStringValue(Flags.Value.ToString()); + } + if (Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteNumberValue(Group.Value); + } + } + + PatternTokenizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatternTokenizer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatternTokenizer(document.RootElement, options); + } + + internal static PatternTokenizer DeserializePatternTokenizer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string pattern = default; + RegexFlags? flags = default; + int? group = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("pattern"u8)) + { + pattern = property.Value.GetString(); + continue; + } + if (property.NameEquals("flags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + flags = new RegexFlags(property.Value.GetString()); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PatternTokenizer( + odataType, + name, + serializedAdditionalRawData, + pattern, + flags, + group); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PatternTokenizer)} does not support writing '{options.Format}' format."); + } + } + + PatternTokenizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePatternTokenizer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatternTokenizer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new PatternTokenizer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePatternTokenizer(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternTokenizer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternTokenizer.cs new file mode 100644 index 000000000000..fd883fc409e7 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PatternTokenizer.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Tokenizer that uses regex pattern matching to construct distinct tokens. This + /// tokenizer is implemented using Apache Lucene. + /// + public partial class PatternTokenizer : LexicalTokenizer + { + /// Initializes a new instance of . + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// is null. + public PatternTokenizer(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.PatternTokenizer"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// A regular expression pattern to match token separators. Default is an + /// expression that matches one or more non-word characters. + /// + /// Regular expression flags. + /// + /// The zero-based ordinal of the matching group in the regular expression pattern + /// to extract into tokens. Use -1 if you want to use the entire pattern to split + /// the input into tokens, irrespective of matching groups. Default is -1. + /// + internal PatternTokenizer(string odataType, string name, IDictionary serializedAdditionalRawData, string pattern, RegexFlags? flags, int? group) : base(odataType, name, serializedAdditionalRawData) + { + Pattern = pattern; + Flags = flags; + Group = group; + } + + /// Initializes a new instance of for deserialization. + internal PatternTokenizer() + { + } + + /// + /// A regular expression pattern to match token separators. Default is an + /// expression that matches one or more non-word characters. + /// + public string Pattern { get; set; } + /// Regular expression flags. + public RegexFlags? Flags { get; set; } + /// + /// The zero-based ordinal of the matching group in the regular expression pattern + /// to extract into tokens. Use -1 if you want to use the entire pattern to split + /// the input into tokens, irrespective of matching groups. Default is -1. + /// + public int? Group { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PhoneticEncoder.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PhoneticEncoder.cs new file mode 100644 index 000000000000..6d4ff3d34e05 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PhoneticEncoder.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Identifies the type of phonetic encoder to use with a PhoneticTokenFilter. + public readonly partial struct PhoneticEncoder : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PhoneticEncoder(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MetaphoneValue = "metaphone"; + private const string DoubleMetaphoneValue = "doubleMetaphone"; + private const string SoundexValue = "soundex"; + private const string RefinedSoundexValue = "refinedSoundex"; + private const string Caverphone1Value = "caverphone1"; + private const string Caverphone2Value = "caverphone2"; + private const string CologneValue = "cologne"; + private const string NysiisValue = "nysiis"; + private const string KoelnerPhonetikValue = "koelnerPhonetik"; + private const string HaasePhonetikValue = "haasePhonetik"; + private const string BeiderMorseValue = "beiderMorse"; + + /// Encodes a token into a Metaphone value. + public static PhoneticEncoder Metaphone { get; } = new PhoneticEncoder(MetaphoneValue); + /// Encodes a token into a double metaphone value. + public static PhoneticEncoder DoubleMetaphone { get; } = new PhoneticEncoder(DoubleMetaphoneValue); + /// Encodes a token into a Soundex value. + public static PhoneticEncoder Soundex { get; } = new PhoneticEncoder(SoundexValue); + /// Encodes a token into a Refined Soundex value. + public static PhoneticEncoder RefinedSoundex { get; } = new PhoneticEncoder(RefinedSoundexValue); + /// Encodes a token into a Caverphone 1.0 value. + public static PhoneticEncoder Caverphone1 { get; } = new PhoneticEncoder(Caverphone1Value); + /// Encodes a token into a Caverphone 2.0 value. + public static PhoneticEncoder Caverphone2 { get; } = new PhoneticEncoder(Caverphone2Value); + /// Encodes a token into a Cologne Phonetic value. + public static PhoneticEncoder Cologne { get; } = new PhoneticEncoder(CologneValue); + /// Encodes a token into a NYSIIS value. + public static PhoneticEncoder Nysiis { get; } = new PhoneticEncoder(NysiisValue); + /// Encodes a token using the Kölner Phonetik algorithm. + public static PhoneticEncoder KoelnerPhonetik { get; } = new PhoneticEncoder(KoelnerPhonetikValue); + /// Encodes a token using the Haase refinement of the Kölner Phonetik algorithm. + public static PhoneticEncoder HaasePhonetik { get; } = new PhoneticEncoder(HaasePhonetikValue); + /// Encodes a token into a Beider-Morse value. + public static PhoneticEncoder BeiderMorse { get; } = new PhoneticEncoder(BeiderMorseValue); + /// Determines if two values are the same. + public static bool operator ==(PhoneticEncoder left, PhoneticEncoder right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PhoneticEncoder left, PhoneticEncoder right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PhoneticEncoder(string value) => new PhoneticEncoder(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PhoneticEncoder other && Equals(other); + /// + public bool Equals(PhoneticEncoder other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PhoneticTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PhoneticTokenFilter.Serialization.cs new file mode 100644 index 000000000000..8158fb410af1 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PhoneticTokenFilter.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class PhoneticTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PhoneticTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Encoder)) + { + writer.WritePropertyName("encoder"u8); + writer.WriteStringValue(Encoder.Value.ToString()); + } + if (Optional.IsDefined(Replace)) + { + writer.WritePropertyName("replace"u8); + writer.WriteBooleanValue(Replace.Value); + } + } + + PhoneticTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PhoneticTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePhoneticTokenFilter(document.RootElement, options); + } + + internal static PhoneticTokenFilter DeserializePhoneticTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PhoneticEncoder? encoder = default; + bool? replace = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("encoder"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encoder = new PhoneticEncoder(property.Value.GetString()); + continue; + } + if (property.NameEquals("replace"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + replace = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PhoneticTokenFilter(odataType, name, serializedAdditionalRawData, encoder, replace); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PhoneticTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + PhoneticTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePhoneticTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PhoneticTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new PhoneticTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePhoneticTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PhoneticTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PhoneticTokenFilter.cs new file mode 100644 index 000000000000..72aa20d6b38b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/PhoneticTokenFilter.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Create tokens for phonetic matches. This token filter is implemented using + /// Apache Lucene. + /// + public partial class PhoneticTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// is null. + public PhoneticTokenFilter(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.PhoneticTokenFilter"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// The phonetic encoder to use. Default is "metaphone". + /// + /// A value indicating whether encoded tokens should replace original tokens. If + /// false, encoded tokens are added as synonyms. Default is true. + /// + internal PhoneticTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, PhoneticEncoder? encoder, bool? replace) : base(odataType, name, serializedAdditionalRawData) + { + Encoder = encoder; + Replace = replace; + } + + /// Initializes a new instance of for deserialization. + internal PhoneticTokenFilter() + { + } + + /// The phonetic encoder to use. Default is "metaphone". + public PhoneticEncoder? Encoder { get; set; } + /// + /// A value indicating whether encoded tokens should replace original tokens. If + /// false, encoded tokens are added as synonyms. Default is true. + /// + public bool? Replace { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/RegexFlags.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/RegexFlags.cs new file mode 100644 index 000000000000..a79102150fca --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/RegexFlags.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Defines flags that can be combined to control how regular expressions are used + /// in the pattern analyzer and pattern tokenizer. + /// + public readonly partial struct RegexFlags : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RegexFlags(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CanonEqValue = "CANON_EQ"; + private const string CaseInsensitiveValue = "CASE_INSENSITIVE"; + private const string CommentsValue = "COMMENTS"; + private const string DotAllValue = "DOTALL"; + private const string LiteralValue = "LITERAL"; + private const string MultilineValue = "MULTILINE"; + private const string UnicodeCaseValue = "UNICODE_CASE"; + private const string UnixLinesValue = "UNIX_LINES"; + + /// Enables canonical equivalence. + public static RegexFlags CanonEq { get; } = new RegexFlags(CanonEqValue); + /// Enables case-insensitive matching. + public static RegexFlags CaseInsensitive { get; } = new RegexFlags(CaseInsensitiveValue); + /// Permits whitespace and comments in the pattern. + public static RegexFlags Comments { get; } = new RegexFlags(CommentsValue); + /// Enables dotall mode. + public static RegexFlags DotAll { get; } = new RegexFlags(DotAllValue); + /// Enables literal parsing of the pattern. + public static RegexFlags Literal { get; } = new RegexFlags(LiteralValue); + /// Enables multiline mode. + public static RegexFlags Multiline { get; } = new RegexFlags(MultilineValue); + /// Enables Unicode-aware case folding. + public static RegexFlags UnicodeCase { get; } = new RegexFlags(UnicodeCaseValue); + /// Enables Unix lines mode. + public static RegexFlags UnixLines { get; } = new RegexFlags(UnixLinesValue); + /// Determines if two values are the same. + public static bool operator ==(RegexFlags left, RegexFlags right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RegexFlags left, RegexFlags right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator RegexFlags(string value) => new RegexFlags(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RegexFlags other && Equals(other); + /// + public bool Equals(RegexFlags other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ResourceCounter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ResourceCounter.Serialization.cs new file mode 100644 index 000000000000..b6c52138896c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ResourceCounter.Serialization.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ResourceCounter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceCounter)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("usage"u8); + writer.WriteNumberValue(Usage); + if (Optional.IsDefined(Quota)) + { + writer.WritePropertyName("quota"u8); + writer.WriteNumberValue(Quota.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ResourceCounter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceCounter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceCounter(document.RootElement, options); + } + + internal static ResourceCounter DeserializeResourceCounter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long usage = default; + long? quota = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("usage"u8)) + { + usage = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("quota"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + quota = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceCounter(usage, quota, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ResourceCounter)} does not support writing '{options.Format}' format."); + } + } + + ResourceCounter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeResourceCounter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceCounter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ResourceCounter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeResourceCounter(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ResourceCounter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ResourceCounter.cs new file mode 100644 index 000000000000..1a1681e3f5bb --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ResourceCounter.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents a resource's usage and quota. + public partial class ResourceCounter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The resource usage amount. + internal ResourceCounter(long usage) + { + Usage = usage; + } + + /// Initializes a new instance of . + /// The resource usage amount. + /// The resource amount quota. + /// Keeps track of any properties unknown to the library. + internal ResourceCounter(long usage, long? quota, IDictionary serializedAdditionalRawData) + { + Usage = usage; + Quota = quota; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ResourceCounter() + { + } + + /// The resource usage amount. + public long Usage { get; } + /// The resource amount quota. + public long? Quota { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScalarQuantizationCompression.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScalarQuantizationCompression.Serialization.cs new file mode 100644 index 000000000000..d8812f4e0864 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScalarQuantizationCompression.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ScalarQuantizationCompression : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ScalarQuantizationCompression)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(ScalarQuantizationParameters)) + { + writer.WritePropertyName("scalarQuantizationParameters"u8); + writer.WriteObjectValue(ScalarQuantizationParameters, options); + } + } + + ScalarQuantizationCompression IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ScalarQuantizationCompression)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeScalarQuantizationCompression(document.RootElement, options); + } + + internal static ScalarQuantizationCompression DeserializeScalarQuantizationCompression(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ScalarQuantizationParameters scalarQuantizationParameters = default; + string name = default; + bool? rerankWithOriginalVectors = default; + double? defaultOversampling = default; + VectorSearchCompressionKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("scalarQuantizationParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scalarQuantizationParameters = ScalarQuantizationParameters.DeserializeScalarQuantizationParameters(property.Value, options); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("rerankWithOriginalVectors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rerankWithOriginalVectors = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("defaultOversampling"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultOversampling = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new VectorSearchCompressionKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ScalarQuantizationCompression( + name, + rerankWithOriginalVectors, + defaultOversampling, + kind, + serializedAdditionalRawData, + scalarQuantizationParameters); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ScalarQuantizationCompression)} does not support writing '{options.Format}' format."); + } + } + + ScalarQuantizationCompression IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeScalarQuantizationCompression(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ScalarQuantizationCompression)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ScalarQuantizationCompression FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeScalarQuantizationCompression(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScalarQuantizationCompression.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScalarQuantizationCompression.cs new file mode 100644 index 000000000000..71fe16ac718e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScalarQuantizationCompression.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Contains configuration options specific to the scalar quantization compression + /// method used during indexing and querying. + /// + public partial class ScalarQuantizationCompression : VectorSearchCompression + { + /// Initializes a new instance of . + /// The name to associate with this particular configuration. + /// is null. + public ScalarQuantizationCompression(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + Kind = VectorSearchCompressionKind.ScalarQuantization; + } + + /// Initializes a new instance of . + /// The name to associate with this particular configuration. + /// + /// If set to true, once the ordered set of results calculated using compressed + /// vectors are obtained, they will be reranked again by recalculating the + /// full-precision similarity scores. This will improve recall at the expense of + /// latency. + /// + /// + /// Default oversampling factor. Oversampling will internally request more + /// documents (specified by this multiplier) in the initial search. This increases + /// the set of results that will be reranked using recomputed similarity scores + /// from full-precision vectors. Minimum value is 1, meaning no oversampling (1x). + /// This parameter can only be set when rerankWithOriginalVectors is true. Higher + /// values improve recall at the expense of latency. + /// + /// Type of VectorSearchCompression. + /// Keeps track of any properties unknown to the library. + /// Contains the parameters specific to Scalar Quantization. + internal ScalarQuantizationCompression(string name, bool? rerankWithOriginalVectors, double? defaultOversampling, VectorSearchCompressionKind kind, IDictionary serializedAdditionalRawData, ScalarQuantizationParameters scalarQuantizationParameters) : base(name, rerankWithOriginalVectors, defaultOversampling, kind, serializedAdditionalRawData) + { + ScalarQuantizationParameters = scalarQuantizationParameters; + } + + /// Initializes a new instance of for deserialization. + internal ScalarQuantizationCompression() + { + } + + /// Contains the parameters specific to Scalar Quantization. + public ScalarQuantizationParameters ScalarQuantizationParameters { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScalarQuantizationParameters.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScalarQuantizationParameters.Serialization.cs new file mode 100644 index 000000000000..631a31893011 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScalarQuantizationParameters.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ScalarQuantizationParameters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ScalarQuantizationParameters)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(QuantizedDataType)) + { + writer.WritePropertyName("quantizedDataType"u8); + writer.WriteStringValue(QuantizedDataType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ScalarQuantizationParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ScalarQuantizationParameters)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeScalarQuantizationParameters(document.RootElement, options); + } + + internal static ScalarQuantizationParameters DeserializeScalarQuantizationParameters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + VectorSearchCompressionTarget? quantizedDataType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("quantizedDataType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + quantizedDataType = new VectorSearchCompressionTarget(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ScalarQuantizationParameters(quantizedDataType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ScalarQuantizationParameters)} does not support writing '{options.Format}' format."); + } + } + + ScalarQuantizationParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeScalarQuantizationParameters(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ScalarQuantizationParameters)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ScalarQuantizationParameters FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeScalarQuantizationParameters(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScalarQuantizationParameters.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScalarQuantizationParameters.cs new file mode 100644 index 000000000000..0382c8cff5d8 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScalarQuantizationParameters.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Contains the parameters specific to Scalar Quantization. + public partial class ScalarQuantizationParameters + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ScalarQuantizationParameters() + { + } + + /// Initializes a new instance of . + /// The quantized data type of compressed vector values. + /// Keeps track of any properties unknown to the library. + internal ScalarQuantizationParameters(VectorSearchCompressionTarget? quantizedDataType, IDictionary serializedAdditionalRawData) + { + QuantizedDataType = quantizedDataType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The quantized data type of compressed vector values. + public VectorSearchCompressionTarget? QuantizedDataType { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringFunction.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringFunction.Serialization.cs new file mode 100644 index 000000000000..7800a2f789fc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringFunction.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + [PersistableModelProxy(typeof(UnknownScoringFunction))] + public partial class ScoringFunction : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ScoringFunction)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("fieldName"u8); + writer.WriteStringValue(FieldName); + writer.WritePropertyName("boost"u8); + writer.WriteNumberValue(Boost); + if (Optional.IsDefined(Interpolation)) + { + writer.WritePropertyName("interpolation"u8); + writer.WriteStringValue(Interpolation.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ScoringFunction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ScoringFunction)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeScoringFunction(document.RootElement, options); + } + + internal static ScoringFunction DeserializeScoringFunction(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "distance": return DistanceScoringFunction.DeserializeDistanceScoringFunction(element, options); + case "freshness": return FreshnessScoringFunction.DeserializeFreshnessScoringFunction(element, options); + case "magnitude": return MagnitudeScoringFunction.DeserializeMagnitudeScoringFunction(element, options); + case "tag": return TagScoringFunction.DeserializeTagScoringFunction(element, options); + } + } + return UnknownScoringFunction.DeserializeUnknownScoringFunction(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ScoringFunction)} does not support writing '{options.Format}' format."); + } + } + + ScoringFunction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeScoringFunction(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ScoringFunction)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ScoringFunction FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeScoringFunction(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringFunction.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringFunction.cs new file mode 100644 index 000000000000..1bbf899182e7 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringFunction.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Base type for functions that can modify document scores during ranking. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + public abstract partial class ScoringFunction + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the field used as input to the scoring function. + /// A multiplier for the raw score. Must be a positive number not equal to 1.0. + /// is null. + protected ScoringFunction(string fieldName, double boost) + { + Argument.AssertNotNull(fieldName, nameof(fieldName)); + + FieldName = fieldName; + Boost = boost; + } + + /// Initializes a new instance of . + /// The name of the field used as input to the scoring function. + /// A multiplier for the raw score. Must be a positive number not equal to 1.0. + /// + /// A value indicating how boosting will be interpolated across document scores; + /// defaults to "Linear". + /// + /// Type of ScoringFunction. + /// Keeps track of any properties unknown to the library. + internal ScoringFunction(string fieldName, double boost, ScoringFunctionInterpolation? interpolation, string type, IDictionary serializedAdditionalRawData) + { + FieldName = fieldName; + Boost = boost; + Interpolation = interpolation; + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ScoringFunction() + { + } + + /// The name of the field used as input to the scoring function. + public string FieldName { get; set; } + /// A multiplier for the raw score. Must be a positive number not equal to 1.0. + public double Boost { get; set; } + /// + /// A value indicating how boosting will be interpolated across document scores; + /// defaults to "Linear". + /// + public ScoringFunctionInterpolation? Interpolation { get; set; } + /// Type of ScoringFunction. + internal string Type { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringFunctionAggregation.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringFunctionAggregation.cs new file mode 100644 index 000000000000..99a133b4dedb --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringFunctionAggregation.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Defines the aggregation function used to combine the results of all the scoring + /// functions in a scoring profile. + /// + public readonly partial struct ScoringFunctionAggregation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ScoringFunctionAggregation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SumValue = "sum"; + private const string AverageValue = "average"; + private const string MinimumValue = "minimum"; + private const string MaximumValue = "maximum"; + private const string FirstMatchingValue = "firstMatching"; + + /// Boost scores by the sum of all scoring function results. + public static ScoringFunctionAggregation Sum { get; } = new ScoringFunctionAggregation(SumValue); + /// Boost scores by the average of all scoring function results. + public static ScoringFunctionAggregation Average { get; } = new ScoringFunctionAggregation(AverageValue); + /// Boost scores by the minimum of all scoring function results. + public static ScoringFunctionAggregation Minimum { get; } = new ScoringFunctionAggregation(MinimumValue); + /// Boost scores by the maximum of all scoring function results. + public static ScoringFunctionAggregation Maximum { get; } = new ScoringFunctionAggregation(MaximumValue); + /// Boost scores using the first applicable scoring function in the scoring profile. + public static ScoringFunctionAggregation FirstMatching { get; } = new ScoringFunctionAggregation(FirstMatchingValue); + /// Determines if two values are the same. + public static bool operator ==(ScoringFunctionAggregation left, ScoringFunctionAggregation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ScoringFunctionAggregation left, ScoringFunctionAggregation right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ScoringFunctionAggregation(string value) => new ScoringFunctionAggregation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ScoringFunctionAggregation other && Equals(other); + /// + public bool Equals(ScoringFunctionAggregation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringFunctionInterpolation.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringFunctionInterpolation.cs new file mode 100644 index 000000000000..93db53518de9 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringFunctionInterpolation.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Defines the function used to interpolate score boosting across a range of + /// documents. + /// + public readonly partial struct ScoringFunctionInterpolation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ScoringFunctionInterpolation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LinearValue = "linear"; + private const string ConstantValue = "constant"; + private const string QuadraticValue = "quadratic"; + private const string LogarithmicValue = "logarithmic"; + + /// + /// Boosts scores by a linearly decreasing amount. This is the default + /// interpolation for scoring functions. + /// + public static ScoringFunctionInterpolation Linear { get; } = new ScoringFunctionInterpolation(LinearValue); + /// Boosts scores by a constant factor. + public static ScoringFunctionInterpolation Constant { get; } = new ScoringFunctionInterpolation(ConstantValue); + /// + /// Boosts scores by an amount that decreases quadratically. Boosts decrease slowly + /// for higher scores, and more quickly as the scores decrease. This interpolation + /// option is not allowed in tag scoring functions. + /// + public static ScoringFunctionInterpolation Quadratic { get; } = new ScoringFunctionInterpolation(QuadraticValue); + /// + /// Boosts scores by an amount that decreases logarithmically. Boosts decrease + /// quickly for higher scores, and more slowly as the scores decrease. This + /// interpolation option is not allowed in tag scoring functions. + /// + public static ScoringFunctionInterpolation Logarithmic { get; } = new ScoringFunctionInterpolation(LogarithmicValue); + /// Determines if two values are the same. + public static bool operator ==(ScoringFunctionInterpolation left, ScoringFunctionInterpolation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ScoringFunctionInterpolation left, ScoringFunctionInterpolation right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ScoringFunctionInterpolation(string value) => new ScoringFunctionInterpolation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ScoringFunctionInterpolation other && Equals(other); + /// + public bool Equals(ScoringFunctionInterpolation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringProfile.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringProfile.Serialization.cs new file mode 100644 index 000000000000..b41f21894828 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringProfile.Serialization.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ScoringProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ScoringProfile)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteObjectValue(Text, options); + } + if (Optional.IsCollectionDefined(Functions)) + { + writer.WritePropertyName("functions"u8); + writer.WriteStartArray(); + foreach (var item in Functions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(FunctionAggregation)) + { + writer.WritePropertyName("functionAggregation"u8); + writer.WriteStringValue(FunctionAggregation.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ScoringProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ScoringProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeScoringProfile(document.RootElement, options); + } + + internal static ScoringProfile DeserializeScoringProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + TextWeights text = default; + IList functions = default; + ScoringFunctionAggregation? functionAggregation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("text"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + text = TextWeights.DeserializeTextWeights(property.Value, options); + continue; + } + if (property.NameEquals("functions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ScoringFunction.DeserializeScoringFunction(item, options)); + } + functions = array; + continue; + } + if (property.NameEquals("functionAggregation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + functionAggregation = new ScoringFunctionAggregation(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ScoringProfile(name, text, functions ?? new ChangeTrackingList(), functionAggregation, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ScoringProfile)} does not support writing '{options.Format}' format."); + } + } + + ScoringProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeScoringProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ScoringProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ScoringProfile FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeScoringProfile(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringProfile.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringProfile.cs new file mode 100644 index 000000000000..5e67ce4e177a --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ScoringProfile.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Defines parameters for a search index that influence scoring in search queries. + public partial class ScoringProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the scoring profile. + /// is null. + public ScoringProfile(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + Functions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The name of the scoring profile. + /// Parameters that boost scoring based on text matches in certain index fields. + /// + /// The collection of functions that influence the scoring of documents. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// + /// A value indicating how the results of individual scoring functions should be + /// combined. Defaults to "Sum". Ignored if there are no scoring functions. + /// + /// Keeps track of any properties unknown to the library. + internal ScoringProfile(string name, TextWeights text, IList functions, ScoringFunctionAggregation? functionAggregation, IDictionary serializedAdditionalRawData) + { + Name = name; + Text = text; + Functions = functions; + FunctionAggregation = functionAggregation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ScoringProfile() + { + } + + /// The name of the scoring profile. + public string Name { get; set; } + /// Parameters that boost scoring based on text matches in certain index fields. + public TextWeights Text { get; set; } + /// + /// The collection of functions that influence the scoring of documents. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + public IList Functions { get; } + /// + /// A value indicating how the results of individual scoring functions should be + /// combined. Defaults to "Sum". Ignored if there are no scoring functions. + /// + public ScoringFunctionAggregation? FunctionAggregation { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchClient.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchClient.cs new file mode 100644 index 000000000000..bbb1d7b8c957 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchClient.cs @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Search.Documents.Indexes +{ + // Data plane generated client. + /// Client that can be used to manage and query indexes and documents, as well as manage other resources, on a search service. + public partial class SearchClient + { + private const string AuthorizationHeader = "api-key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://search.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of SearchClient for mocking. + protected SearchClient() + { + } + + /// Initializes a new instance of SearchClient. + /// Service host. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public SearchClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new SearchClientOptions()) + { + } + + /// Initializes a new instance of SearchClient. + /// Service host. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public SearchClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new SearchClientOptions()) + { + } + + /// Initializes a new instance of SearchClient. + /// Service host. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public SearchClient(Uri endpoint, AzureKeyCredential credential, SearchClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new SearchClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Initializes a new instance of SearchClient. + /// Service host. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public SearchClient(Uri endpoint, TokenCredential credential, SearchClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new SearchClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Gets service level statistics for a search service. + /// The cancellation token to use. + /// + public virtual async Task> GetServiceStatisticsAsync(CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetServiceStatisticsAsync(context).ConfigureAwait(false); + return Response.FromValue(SearchServiceStatistics.FromResponse(response), response); + } + + /// Gets service level statistics for a search service. + /// The cancellation token to use. + /// + public virtual Response GetServiceStatistics(CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetServiceStatistics(context); + return Response.FromValue(SearchServiceStatistics.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets service level statistics for a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetServiceStatisticsAsync(RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("SearchClient.GetServiceStatistics"); + scope.Start(); + try + { + using HttpMessage message = CreateGetServiceStatisticsRequest(context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets service level statistics for a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetServiceStatistics(RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("SearchClient.GetServiceStatistics"); + scope.Start(); + try + { + using HttpMessage message = CreateGetServiceStatisticsRequest(context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + private DataSources _cachedDataSources; + private Indexers _cachedIndexers; + private Skillsets _cachedSkillsets; + private SynonymMaps _cachedSynonymMaps; + private Indexes _cachedIndexes; + + /// Initializes a new instance of DataSources. + public virtual DataSources GetDataSourcesClient() + { + return Volatile.Read(ref _cachedDataSources) ?? Interlocked.CompareExchange(ref _cachedDataSources, new DataSources(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, _apiVersion), null) ?? _cachedDataSources; + } + + /// Initializes a new instance of Indexers. + public virtual Indexers GetIndexersClient() + { + return Volatile.Read(ref _cachedIndexers) ?? Interlocked.CompareExchange(ref _cachedIndexers, new Indexers(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, _apiVersion), null) ?? _cachedIndexers; + } + + /// Initializes a new instance of Skillsets. + public virtual Skillsets GetSkillsetsClient() + { + return Volatile.Read(ref _cachedSkillsets) ?? Interlocked.CompareExchange(ref _cachedSkillsets, new Skillsets(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, _apiVersion), null) ?? _cachedSkillsets; + } + + /// Initializes a new instance of SynonymMaps. + public virtual SynonymMaps GetSynonymMapsClient() + { + return Volatile.Read(ref _cachedSynonymMaps) ?? Interlocked.CompareExchange(ref _cachedSynonymMaps, new SynonymMaps(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, _apiVersion), null) ?? _cachedSynonymMaps; + } + + /// Initializes a new instance of Indexes. + public virtual Indexes GetIndexesClient() + { + return Volatile.Read(ref _cachedIndexes) ?? Interlocked.CompareExchange(ref _cachedIndexes, new Indexes(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, _apiVersion), null) ?? _cachedIndexes; + } + + internal HttpMessage CreateGetServiceStatisticsRequest(RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/servicestats", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchClientOptions.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchClientOptions.cs new file mode 100644 index 000000000000..62a1a431b45b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + /// Client options for SearchClient. + public partial class SearchClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2024_07_01; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2024-07-01". + V2024_07_01 = 1, + } + + internal string Version { get; } + + /// Initializes new instance of SearchClientOptions. + public SearchClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2024_07_01 => "2024-07-01", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchDocumentsIndexesClientBuilderExtensions.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchDocumentsIndexesClientBuilderExtensions.cs new file mode 100644 index 000000000000..69fad303c45c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchDocumentsIndexesClientBuilderExtensions.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core.Extensions; +using Azure.Search.Documents.Indexes; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class SearchDocumentsIndexesClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// Service host. + /// A credential used to authenticate to an Azure Service. + public static IAzureClientBuilder AddSearchClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new SearchClient(endpoint, credential, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// Service host. + public static IAzureClientBuilder AddSearchClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new SearchClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddSearchClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchDocumentsIndexesModelFactory.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchDocumentsIndexesModelFactory.cs new file mode 100644 index 000000000000..c10cfcd371a3 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchDocumentsIndexesModelFactory.cs @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// Model factory for models. + public static partial class SearchDocumentsIndexesModelFactory + { + /// Initializes a new instance of . + /// Service level resource counters. + /// Service level general limits. + /// A new instance for mocking. + public static SearchServiceStatistics SearchServiceStatistics(SearchServiceCounters counters = null, SearchServiceLimits limits = null) + { + return new SearchServiceStatistics(counters, limits, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Total number of documents across all indexes in the service. + /// Total number of indexes. + /// Total number of indexers. + /// Total number of data sources. + /// Total size of used storage in bytes. + /// Total number of synonym maps. + /// Total number of skillsets. + /// Total memory consumption of all vector indexes within the service, in bytes. + /// A new instance for mocking. + public static SearchServiceCounters SearchServiceCounters(ResourceCounter documentCount = null, ResourceCounter indexesCount = null, ResourceCounter indexersCount = null, ResourceCounter dataSourcesCount = null, ResourceCounter storageSize = null, ResourceCounter synonymMaps = null, ResourceCounter skillsetCount = null, ResourceCounter vectorIndexSize = null) + { + return new SearchServiceCounters( + documentCount, + indexesCount, + indexersCount, + dataSourcesCount, + storageSize, + synonymMaps, + skillsetCount, + vectorIndexSize, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The resource usage amount. + /// The resource amount quota. + /// A new instance for mocking. + public static ResourceCounter ResourceCounter(long usage = default, long? quota = null) + { + return new ResourceCounter(usage, quota, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The maximum allowed fields per index. + /// + /// The maximum depth which you can nest sub-fields in an index, including the + /// top-level complex field. For example, a/b/c has a nesting depth of 3. + /// + /// + /// The maximum number of fields of type Collection(Edm.ComplexType) allowed in an + /// index. + /// + /// The maximum number of objects in complex collections allowed per document. + /// The maximum amount of storage in bytes allowed per index. + /// A new instance for mocking. + public static SearchServiceLimits SearchServiceLimits(int? maxFieldsPerIndex = null, int? maxFieldNestingDepthPerIndex = null, int? maxComplexCollectionFieldsPerIndex = null, int? maxComplexObjectsInCollectionsPerDocument = null, long? maxStoragePerIndex = null) + { + return new SearchServiceLimits( + maxFieldsPerIndex, + maxFieldNestingDepthPerIndex, + maxComplexCollectionFieldsPerIndex, + maxComplexObjectsInCollectionsPerDocument, + maxStoragePerIndex, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the suggester. + /// A value indicating the capabilities of the suggester. + /// + /// The list of field names to which the suggester applies. Each field must be + /// searchable. + /// + /// A new instance for mocking. + public static SearchSuggester SearchSuggester(string name = null, SearchSuggesterSearchMode searchMode = default, IEnumerable sourceFields = null) + { + sourceFields ??= new List(); + + return new SearchSuggester(name, searchMode, sourceFields?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The number of documents in the index. + /// The amount of storage in bytes consumed by the index. + /// The amount of memory in bytes consumed by vectors in the index. + /// A new instance for mocking. + public static GetIndexStatisticsResult GetIndexStatisticsResult(long documentCount = default, long storageSize = default, long vectorIndexSize = default) + { + return new GetIndexStatisticsResult(documentCount, storageSize, vectorIndexSize, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The text to break into tokens. + /// + /// The name of the analyzer to use to break the given text. If this parameter is + /// not specified, you must specify a tokenizer instead. The tokenizer and analyzer + /// parameters are mutually exclusive. + /// + /// + /// The name of the tokenizer to use to break the given text. If this parameter is + /// not specified, you must specify an analyzer instead. The tokenizer and analyzer + /// parameters are mutually exclusive. + /// + /// + /// An optional list of token filters to use when breaking the given text. This + /// parameter can only be set when using the tokenizer parameter. + /// + /// + /// An optional list of character filters to use when breaking the given text. This + /// parameter can only be set when using the tokenizer parameter. + /// + /// A new instance for mocking. + public static AnalyzeRequest AnalyzeRequest(string text = null, LexicalAnalyzerName? analyzer = null, LexicalTokenizerName? tokenizer = null, IEnumerable tokenFilters = null, IEnumerable charFilters = null) + { + tokenFilters ??= new List(); + charFilters ??= new List(); + + return new AnalyzeRequest( + text, + analyzer, + tokenizer, + tokenFilters?.ToList(), + charFilters?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The list of tokens returned by the analyzer specified in the request. + /// A new instance for mocking. + public static AnalyzeResult AnalyzeResult(IEnumerable tokens = null) + { + tokens ??= new List(); + + return new AnalyzeResult(tokens?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The token returned by the analyzer. + /// The index of the first character of the token in the input text. + /// The index of the last character of the token in the input text. + /// + /// The position of the token in the input text relative to other tokens. The first + /// token in the input text has position 0, the next has position 1, and so on. + /// Depending on the analyzer used, some tokens might have the same position, for + /// example if they are synonyms of each other. + /// + /// A new instance for mocking. + public static AnalyzedTokenInfo AnalyzedTokenInfo(string token = null, int startOffset = default, int endOffset = default, int position = default) + { + return new AnalyzedTokenInfo(token, startOffset, endOffset, position, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the synonym map. + /// The format of the synonym map. Only the 'solr' format is currently supported. + /// + /// A series of synonym rules in the specified synonym map format. The rules must + /// be separated by newlines. + /// + /// + /// A description of an encryption key that you create in Azure Key Vault. This key + /// is used to provide an additional level of encryption-at-rest for your data when + /// you want full assurance that no one, not even Microsoft, can decrypt your data. + /// Once you have encrypted your data, it will always remain encrypted. The search + /// service will ignore attempts to set this property to null. You can change this + /// property as needed if you want to rotate your encryption key; Your data will be + /// unaffected. Encryption with customer-managed keys is not available for free + /// search services, and is only available for paid services created on or after + /// January 1, 2019. + /// + /// The ETag of the synonym map. + /// A new instance for mocking. + public static SynonymMap SynonymMap(string name = null, SynonymMapFormat format = default, string synonyms = null, SearchResourceEncryptionKey encryptionKey = null, string eTag = null) + { + return new SynonymMap( + name, + format, + synonyms, + encryptionKey, + eTag, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The synonym maps in the Search service. + /// A new instance for mocking. + public static ListSynonymMapsResult ListSynonymMapsResult(IEnumerable value = null) + { + value ??= new List(); + + return new ListSynonymMapsResult(value?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The skillsets defined in the Search service. + /// A new instance for mocking. + public static ListSkillsetsResult ListSkillsetsResult(IEnumerable value = null) + { + value ??= new List(); + + return new ListSkillsetsResult(value?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The indexers in the Search service. + /// A new instance for mocking. + public static ListIndexersResult ListIndexersResult(IEnumerable value = null) + { + value ??= new List(); + + return new ListIndexersResult(value?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Overall indexer status. + /// The result of the most recent or an in-progress indexer execution. + /// History of the recent indexer executions, sorted in reverse chronological order. + /// The execution limits for the indexer. + /// A new instance for mocking. + public static SearchIndexerStatus SearchIndexerStatus(IndexerStatus status = default, IndexerExecutionResult lastResult = null, IEnumerable executionHistory = null, SearchIndexerLimits limits = null) + { + executionHistory ??= new List(); + + return new SearchIndexerStatus(status, lastResult, executionHistory?.ToList(), limits, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The outcome of this indexer 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. + /// The item-level indexing errors. + /// The item-level indexing warnings. + /// + /// The number of items that were processed during this indexer execution. This + /// includes both successfully processed items and items where indexing was + /// attempted but failed. + /// + /// 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. + /// 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 itemsProcessed = default, int itemsFailed = default, string initialTrackingState = null, string finalTrackingState = null) + { + errors ??= new List(); + warnings ??= new List(); + + return new IndexerExecutionResult( + status, + errorMessage, + startTime, + endTime, + errors?.ToList(), + warnings?.ToList(), + itemsProcessed, + itemsFailed, + initialTrackingState, + finalTrackingState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The key of the item for which indexing failed. + /// The message describing the error that occurred while processing the item. + /// + /// The status code indicating why the indexing operation failed. Possible values + /// include: 400 for a malformed input document, 404 for document not found, 409 + /// for a version conflict, 422 when the index is temporarily unavailable, or 503 + /// for when the service is too busy. + /// + /// + /// The name of the source at which the error originated. For example, this could + /// refer to a particular skill in the attached skillset. This may not be always + /// available. + /// + /// + /// Additional, verbose details about the error to assist in debugging the indexer. + /// This may not be always available. + /// + /// + /// A link to a troubleshooting guide for these classes of errors. This may not be + /// always available. + /// + /// A new instance for mocking. + public static SearchIndexerError SearchIndexerError(string key = null, string errorMessage = null, int statusCode = default, string name = null, string details = null, string documentationLink = null) + { + return new SearchIndexerError( + key, + errorMessage, + statusCode, + name, + details, + documentationLink, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The key of the item which generated a warning. + /// The message describing the warning that occurred while processing the item. + /// + /// The name of the source at which the warning originated. For example, this could + /// refer to a particular skill in the attached skillset. This may not be always + /// available. + /// + /// + /// Additional, verbose details about the warning to assist in debugging the + /// indexer. This may not be always available. + /// + /// + /// A link to a troubleshooting guide for these classes of warnings. This may not + /// be always available. + /// + /// A new instance for mocking. + public static SearchIndexerWarning SearchIndexerWarning(string key = null, string message = null, string name = null, string details = null, string documentationLink = null) + { + return new SearchIndexerWarning( + key, + message, + name, + details, + documentationLink, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The maximum duration that the indexer is permitted to run for one execution. + /// + /// The maximum size of a document, in bytes, which will be considered valid for + /// indexing. + /// + /// + /// The maximum number of characters that will be extracted from a document picked + /// up for indexing. + /// + /// A new instance for mocking. + public static SearchIndexerLimits SearchIndexerLimits(TimeSpan? maxRunTime = null, long? maxDocumentExtractionSize = null, long? maxDocumentContentCharactersToExtract = null) + { + return new SearchIndexerLimits(maxRunTime, maxDocumentExtractionSize, maxDocumentContentCharactersToExtract, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The datasources in the Search service. + /// A new instance for mocking. + public static ListDataSourcesResult ListDataSourcesResult(IEnumerable value = null) + { + value ??= new List(); + + return new ListDataSourcesResult(value?.ToList(), serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchField.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchField.Serialization.cs new file mode 100644 index 000000000000..df2ec92c12b2 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchField.Serialization.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchField : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchField)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsDefined(Key)) + { + writer.WritePropertyName("key"u8); + writer.WriteBooleanValue(Key.Value); + } + if (Optional.IsDefined(Retrievable)) + { + writer.WritePropertyName("retrievable"u8); + writer.WriteBooleanValue(Retrievable.Value); + } + if (Optional.IsDefined(Stored)) + { + writer.WritePropertyName("stored"u8); + writer.WriteBooleanValue(Stored.Value); + } + if (Optional.IsDefined(Searchable)) + { + writer.WritePropertyName("searchable"u8); + writer.WriteBooleanValue(Searchable.Value); + } + if (Optional.IsDefined(Filterable)) + { + writer.WritePropertyName("filterable"u8); + writer.WriteBooleanValue(Filterable.Value); + } + if (Optional.IsDefined(Sortable)) + { + writer.WritePropertyName("sortable"u8); + writer.WriteBooleanValue(Sortable.Value); + } + if (Optional.IsDefined(Facetable)) + { + writer.WritePropertyName("facetable"u8); + writer.WriteBooleanValue(Facetable.Value); + } + if (Optional.IsDefined(Analyzer)) + { + writer.WritePropertyName("analyzer"u8); + writer.WriteStringValue(Analyzer.Value.ToString()); + } + if (Optional.IsDefined(SearchAnalyzer)) + { + writer.WritePropertyName("searchAnalyzer"u8); + writer.WriteStringValue(SearchAnalyzer.Value.ToString()); + } + if (Optional.IsDefined(IndexAnalyzer)) + { + writer.WritePropertyName("indexAnalyzer"u8); + writer.WriteStringValue(IndexAnalyzer.Value.ToString()); + } + if (Optional.IsDefined(Dimensions)) + { + writer.WritePropertyName("dimensions"u8); + writer.WriteNumberValue(Dimensions.Value); + } + if (Optional.IsDefined(VectorSearchProfile)) + { + writer.WritePropertyName("vectorSearchProfile"u8); + writer.WriteStringValue(VectorSearchProfile); + } + if (Optional.IsDefined(VectorEncoding)) + { + writer.WritePropertyName("vectorEncoding"u8); + writer.WriteStringValue(VectorEncoding.Value.ToString()); + } + if (Optional.IsCollectionDefined(SynonymMaps)) + { + writer.WritePropertyName("synonymMaps"u8); + writer.WriteStartArray(); + foreach (var item in SynonymMaps) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Fields)) + { + writer.WritePropertyName("fields"u8); + writer.WriteStartArray(); + foreach (var item in Fields) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchField IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchField)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchField(document.RootElement, options); + } + + internal static SearchField DeserializeSearchField(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + SearchFieldDataType type = default; + bool? key = default; + bool? retrievable = default; + bool? stored = default; + bool? searchable = default; + bool? filterable = default; + bool? sortable = default; + bool? facetable = default; + LexicalAnalyzerName? analyzer = default; + LexicalAnalyzerName? searchAnalyzer = default; + LexicalAnalyzerName? indexAnalyzer = default; + int? dimensions = default; + string vectorSearchProfile = default; + VectorEncodingFormat? vectorEncoding = default; + IList synonymMaps = default; + IList fields = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new SearchFieldDataType(property.Value.GetString()); + continue; + } + if (property.NameEquals("key"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + key = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("retrievable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + retrievable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("stored"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stored = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("searchable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + searchable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("filterable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + filterable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("sortable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sortable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("facetable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + facetable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("analyzer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + analyzer = new LexicalAnalyzerName(property.Value.GetString()); + continue; + } + if (property.NameEquals("searchAnalyzer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + searchAnalyzer = new LexicalAnalyzerName(property.Value.GetString()); + continue; + } + if (property.NameEquals("indexAnalyzer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + indexAnalyzer = new LexicalAnalyzerName(property.Value.GetString()); + continue; + } + if (property.NameEquals("dimensions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dimensions = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("vectorSearchProfile"u8)) + { + vectorSearchProfile = property.Value.GetString(); + continue; + } + if (property.NameEquals("vectorEncoding"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vectorEncoding = new VectorEncodingFormat(property.Value.GetString()); + continue; + } + if (property.NameEquals("synonymMaps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + synonymMaps = array; + continue; + } + if (property.NameEquals("fields"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeSearchField(item, options)); + } + fields = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchField( + name, + type, + key, + retrievable, + stored, + searchable, + filterable, + sortable, + facetable, + analyzer, + searchAnalyzer, + indexAnalyzer, + dimensions, + vectorSearchProfile, + vectorEncoding, + synonymMaps ?? new ChangeTrackingList(), + fields ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchField)} does not support writing '{options.Format}' format."); + } + } + + SearchField IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchField(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchField)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchField FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchField(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchField.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchField.cs new file mode 100644 index 000000000000..e30c31fc5590 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchField.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Represents a field in an index definition, which describes the name, data type, + /// and search behavior of a field. + /// + public partial class SearchField + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// The name of the field, which must be unique within the fields collection of the + /// index or parent field. + /// + /// The data type of the field. + /// is null. + public SearchField(string name, SearchFieldDataType type) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + Type = type; + SynonymMaps = new ChangeTrackingList(); + Fields = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The name of the field, which must be unique within the fields collection of the + /// index or parent field. + /// + /// The data type of the field. + /// + /// A value indicating whether the field uniquely identifies documents in the + /// index. Exactly one top-level field in each index must be chosen as the key + /// field and it must be of type Edm.String. Key fields can be used to look up + /// documents directly and update or delete specific documents. Default is false + /// for simple fields and null for complex fields. + /// + /// + /// A value indicating whether the field can be returned in a search result. You + /// can disable this option if you want to use a field (for example, margin) as a + /// filter, sorting, or scoring mechanism but do not want the field to be visible + /// to the end user. This property must be true for key fields, and it must be null + /// for complex fields. This property can be changed on existing fields. Enabling + /// this property does not cause any increase in index storage requirements. + /// Default is true for simple fields, false for vector fields, and null for + /// complex fields. + /// + /// + /// An immutable value indicating whether the field will be persisted separately on + /// disk to be returned in a search result. You can disable this option if you + /// don't plan to return the field contents in a search response to save on storage + /// overhead. This can only be set during index creation and only for vector + /// fields. This property cannot be changed for existing fields or set as false for + /// new fields. If this property is set as false, the property 'retrievable' must + /// also be set to false. This property must be true or unset for key fields, for + /// new fields, and for non-vector fields, and it must be null for complex fields. + /// Disabling this property will reduce index storage requirements. The default is + /// true for vector fields. + /// + /// + /// A value indicating whether the field is full-text searchable. This means it + /// will undergo analysis such as word-breaking during indexing. If you set a + /// searchable field to a value like "sunny day", internally it will be split into + /// the individual tokens "sunny" and "day". This enables full-text searches for + /// these terms. Fields of type Edm.String or Collection(Edm.String) are searchable + /// by default. This property must be false for simple fields of other non-string + /// data types, and it must be null for complex fields. Note: searchable fields + /// consume extra space in your index to accommodate additional tokenized versions + /// of the field value for full-text searches. If you want to save space in your + /// index and you don't need a field to be included in searches, set searchable to + /// false. + /// + /// + /// A value indicating whether to enable the field to be referenced in $filter + /// queries. filterable differs from searchable in how strings are handled. Fields + /// of type Edm.String or Collection(Edm.String) that are filterable do not undergo + /// word-breaking, so comparisons are for exact matches only. For example, if you + /// set such a field f to "sunny day", $filter=f eq 'sunny' will find no matches, + /// but $filter=f eq 'sunny day' will. This property must be null for complex + /// fields. Default is true for simple fields and null for complex fields. + /// + /// + /// A value indicating whether to enable the field to be referenced in $orderby + /// expressions. By default, the search engine sorts results by score, but in many + /// experiences users will want to sort by fields in the documents. A simple field + /// can be sortable only if it is single-valued (it has a single value in the scope + /// of the parent document). Simple collection fields cannot be sortable, since + /// they are multi-valued. Simple sub-fields of complex collections are also + /// multi-valued, and therefore cannot be sortable. This is true whether it's an + /// immediate parent field, or an ancestor field, that's the complex collection. + /// Complex fields cannot be sortable and the sortable property must be null for + /// such fields. The default for sortable is true for single-valued simple fields, + /// false for multi-valued simple fields, and null for complex fields. + /// + /// + /// A value indicating whether to enable the field to be referenced in facet + /// queries. Typically used in a presentation of search results that includes hit + /// count by category (for example, search for digital cameras and see hits by + /// brand, by megapixels, by price, and so on). This property must be null for + /// complex fields. Fields of type Edm.GeographyPoint or + /// Collection(Edm.GeographyPoint) cannot be facetable. Default is true for all + /// other simple fields. + /// + /// + /// The name of the analyzer to use for the field. This option can be used only + /// with searchable fields and it can't be set together with either searchAnalyzer + /// or indexAnalyzer. Once the analyzer is chosen, it cannot be changed for the + /// field. Must be null for complex fields. + /// + /// + /// The name of the analyzer used at search time for the field. This option can be + /// used only with searchable fields. It must be set together with indexAnalyzer + /// and it cannot be set together with the analyzer option. This property cannot be + /// set to the name of a language analyzer; use the analyzer property instead if + /// you need a language analyzer. This analyzer can be updated on an existing + /// field. Must be null for complex fields. + /// + /// + /// The name of the analyzer used at indexing time for the field. This option can + /// be used only with searchable fields. It must be set together with + /// searchAnalyzer and it cannot be set together with the analyzer option. This + /// property cannot be set to the name of a language analyzer; use the analyzer + /// property instead if you need a language analyzer. Once the analyzer is chosen, + /// it cannot be changed for the field. Must be null for complex fields. + /// + /// The dimensionality of the vector field. + /// + /// The name of the vector search profile that specifies the algorithm and + /// vectorizer to use when searching the vector field. + /// + /// The encoding format to interpret the field contents. + /// + /// A list of the names of synonym maps to associate with this field. This option + /// can be used only with searchable fields. Currently only one synonym map per + /// field is supported. Assigning a synonym map to a field ensures that query terms + /// targeting that field are expanded at query-time using the rules in the synonym + /// map. This attribute can be changed on existing fields. Must be null or an empty + /// collection for complex fields. + /// + /// + /// A list of sub-fields if this is a field of type Edm.ComplexType or + /// Collection(Edm.ComplexType). Must be null or empty for simple fields. + /// + /// Keeps track of any properties unknown to the library. + internal SearchField(string name, SearchFieldDataType type, bool? key, bool? retrievable, bool? stored, bool? searchable, bool? filterable, bool? sortable, bool? facetable, LexicalAnalyzerName? analyzer, LexicalAnalyzerName? searchAnalyzer, LexicalAnalyzerName? indexAnalyzer, int? dimensions, string vectorSearchProfile, VectorEncodingFormat? vectorEncoding, IList synonymMaps, IList fields, IDictionary serializedAdditionalRawData) + { + Name = name; + Type = type; + Key = key; + Retrievable = retrievable; + Stored = stored; + Searchable = searchable; + Filterable = filterable; + Sortable = sortable; + Facetable = facetable; + Analyzer = analyzer; + SearchAnalyzer = searchAnalyzer; + IndexAnalyzer = indexAnalyzer; + Dimensions = dimensions; + VectorSearchProfile = vectorSearchProfile; + VectorEncoding = vectorEncoding; + SynonymMaps = synonymMaps; + Fields = fields; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchField() + { + } + + /// + /// The name of the field, which must be unique within the fields collection of the + /// index or parent field. + /// + public string Name { get; set; } + /// The data type of the field. + public SearchFieldDataType Type { get; set; } + /// + /// A value indicating whether the field uniquely identifies documents in the + /// index. Exactly one top-level field in each index must be chosen as the key + /// field and it must be of type Edm.String. Key fields can be used to look up + /// documents directly and update or delete specific documents. Default is false + /// for simple fields and null for complex fields. + /// + public bool? Key { get; set; } + /// + /// A value indicating whether the field can be returned in a search result. You + /// can disable this option if you want to use a field (for example, margin) as a + /// filter, sorting, or scoring mechanism but do not want the field to be visible + /// to the end user. This property must be true for key fields, and it must be null + /// for complex fields. This property can be changed on existing fields. Enabling + /// this property does not cause any increase in index storage requirements. + /// Default is true for simple fields, false for vector fields, and null for + /// complex fields. + /// + public bool? Retrievable { get; set; } + /// + /// An immutable value indicating whether the field will be persisted separately on + /// disk to be returned in a search result. You can disable this option if you + /// don't plan to return the field contents in a search response to save on storage + /// overhead. This can only be set during index creation and only for vector + /// fields. This property cannot be changed for existing fields or set as false for + /// new fields. If this property is set as false, the property 'retrievable' must + /// also be set to false. This property must be true or unset for key fields, for + /// new fields, and for non-vector fields, and it must be null for complex fields. + /// Disabling this property will reduce index storage requirements. The default is + /// true for vector fields. + /// + public bool? Stored { get; set; } + /// + /// A value indicating whether the field is full-text searchable. This means it + /// will undergo analysis such as word-breaking during indexing. If you set a + /// searchable field to a value like "sunny day", internally it will be split into + /// the individual tokens "sunny" and "day". This enables full-text searches for + /// these terms. Fields of type Edm.String or Collection(Edm.String) are searchable + /// by default. This property must be false for simple fields of other non-string + /// data types, and it must be null for complex fields. Note: searchable fields + /// consume extra space in your index to accommodate additional tokenized versions + /// of the field value for full-text searches. If you want to save space in your + /// index and you don't need a field to be included in searches, set searchable to + /// false. + /// + public bool? Searchable { get; set; } + /// + /// A value indicating whether to enable the field to be referenced in $filter + /// queries. filterable differs from searchable in how strings are handled. Fields + /// of type Edm.String or Collection(Edm.String) that are filterable do not undergo + /// word-breaking, so comparisons are for exact matches only. For example, if you + /// set such a field f to "sunny day", $filter=f eq 'sunny' will find no matches, + /// but $filter=f eq 'sunny day' will. This property must be null for complex + /// fields. Default is true for simple fields and null for complex fields. + /// + public bool? Filterable { get; set; } + /// + /// A value indicating whether to enable the field to be referenced in $orderby + /// expressions. By default, the search engine sorts results by score, but in many + /// experiences users will want to sort by fields in the documents. A simple field + /// can be sortable only if it is single-valued (it has a single value in the scope + /// of the parent document). Simple collection fields cannot be sortable, since + /// they are multi-valued. Simple sub-fields of complex collections are also + /// multi-valued, and therefore cannot be sortable. This is true whether it's an + /// immediate parent field, or an ancestor field, that's the complex collection. + /// Complex fields cannot be sortable and the sortable property must be null for + /// such fields. The default for sortable is true for single-valued simple fields, + /// false for multi-valued simple fields, and null for complex fields. + /// + public bool? Sortable { get; set; } + /// + /// A value indicating whether to enable the field to be referenced in facet + /// queries. Typically used in a presentation of search results that includes hit + /// count by category (for example, search for digital cameras and see hits by + /// brand, by megapixels, by price, and so on). This property must be null for + /// complex fields. Fields of type Edm.GeographyPoint or + /// Collection(Edm.GeographyPoint) cannot be facetable. Default is true for all + /// other simple fields. + /// + public bool? Facetable { get; set; } + /// + /// The name of the analyzer to use for the field. This option can be used only + /// with searchable fields and it can't be set together with either searchAnalyzer + /// or indexAnalyzer. Once the analyzer is chosen, it cannot be changed for the + /// field. Must be null for complex fields. + /// + public LexicalAnalyzerName? Analyzer { get; set; } + /// + /// The name of the analyzer used at search time for the field. This option can be + /// used only with searchable fields. It must be set together with indexAnalyzer + /// and it cannot be set together with the analyzer option. This property cannot be + /// set to the name of a language analyzer; use the analyzer property instead if + /// you need a language analyzer. This analyzer can be updated on an existing + /// field. Must be null for complex fields. + /// + public LexicalAnalyzerName? SearchAnalyzer { get; set; } + /// + /// The name of the analyzer used at indexing time for the field. This option can + /// be used only with searchable fields. It must be set together with + /// searchAnalyzer and it cannot be set together with the analyzer option. This + /// property cannot be set to the name of a language analyzer; use the analyzer + /// property instead if you need a language analyzer. Once the analyzer is chosen, + /// it cannot be changed for the field. Must be null for complex fields. + /// + public LexicalAnalyzerName? IndexAnalyzer { get; set; } + /// The dimensionality of the vector field. + public int? Dimensions { get; set; } + /// + /// The name of the vector search profile that specifies the algorithm and + /// vectorizer to use when searching the vector field. + /// + public string VectorSearchProfile { get; set; } + /// The encoding format to interpret the field contents. + public VectorEncodingFormat? VectorEncoding { get; set; } + /// + /// A list of the names of synonym maps to associate with this field. This option + /// can be used only with searchable fields. Currently only one synonym map per + /// field is supported. Assigning a synonym map to a field ensures that query terms + /// targeting that field are expanded at query-time using the rules in the synonym + /// map. This attribute can be changed on existing fields. Must be null or an empty + /// collection for complex fields. + /// + public IList SynonymMaps { get; } + /// + /// A list of sub-fields if this is a field of type Edm.ComplexType or + /// Collection(Edm.ComplexType). Must be null or empty for simple fields. + /// + public IList Fields { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchFieldDataType.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchFieldDataType.cs new file mode 100644 index 000000000000..d2b04f17d8bc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchFieldDataType.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Defines the data type of a field in a search index. + public readonly partial struct SearchFieldDataType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SearchFieldDataType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StringValue = "Edm.String"; + private const string Int32Value = "Edm.Int32"; + private const string Int64Value = "Edm.Int64"; + private const string DoubleValue = "Edm.Double"; + private const string BooleanValue = "Edm.Boolean"; + private const string DateTimeOffsetValue = "Edm.DateTimeOffset"; + private const string GeographyPointValue = "Edm.GeographyPoint"; + private const string ComplexValue = "Edm.ComplexType"; + private const string SingleValue = "Edm.Single"; + private const string HalfValue = "Edm.Half"; + private const string Int16Value = "Edm.Int16"; + private const string SByteValue = "Edm.SByte"; + private const string ByteValue = "Edm.Byte"; + + /// Indicates that a field contains a string. + public static SearchFieldDataType String { get; } = new SearchFieldDataType(StringValue); + /// Indicates that a field contains a 32-bit signed integer. + public static SearchFieldDataType Int32 { get; } = new SearchFieldDataType(Int32Value); + /// Indicates that a field contains a 64-bit signed integer. + public static SearchFieldDataType Int64 { get; } = new SearchFieldDataType(Int64Value); + /// Indicates that a field contains an IEEE double-precision floating point number. + public static SearchFieldDataType Double { get; } = new SearchFieldDataType(DoubleValue); + /// Indicates that a field contains a Boolean value (true or false). + public static SearchFieldDataType Boolean { get; } = new SearchFieldDataType(BooleanValue); + /// + /// Indicates that a field contains a date/time value, including timezone + /// information. + /// + public static SearchFieldDataType DateTimeOffset { get; } = new SearchFieldDataType(DateTimeOffsetValue); + /// + /// Indicates that a field contains a geo-location in terms of longitude and + /// latitude. + /// + public static SearchFieldDataType GeographyPoint { get; } = new SearchFieldDataType(GeographyPointValue); + /// + /// Indicates that a field contains one or more complex objects that in turn have + /// sub-fields of other types. + /// + public static SearchFieldDataType Complex { get; } = new SearchFieldDataType(ComplexValue); + /// + /// Indicates that a field contains a single-precision floating point number. This + /// is only valid when used with Collection(Edm.Single). + /// + public static SearchFieldDataType Single { get; } = new SearchFieldDataType(SingleValue); + /// + /// Indicates that a field contains a half-precision floating point number. This is + /// only valid when used with Collection(Edm.Half). + /// + public static SearchFieldDataType Half { get; } = new SearchFieldDataType(HalfValue); + /// + /// Indicates that a field contains a 16-bit signed integer. This is only valid + /// when used with Collection(Edm.Int16). + /// + public static SearchFieldDataType Int16 { get; } = new SearchFieldDataType(Int16Value); + /// + /// Indicates that a field contains a 8-bit signed integer. This is only valid when + /// used with Collection(Edm.SByte). + /// + public static SearchFieldDataType SByte { get; } = new SearchFieldDataType(SByteValue); + /// + /// Indicates that a field contains a 8-bit unsigned integer. This is only valid + /// when used with Collection(Edm.Byte). + /// + public static SearchFieldDataType Byte { get; } = new SearchFieldDataType(ByteValue); + /// Determines if two values are the same. + public static bool operator ==(SearchFieldDataType left, SearchFieldDataType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SearchFieldDataType left, SearchFieldDataType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SearchFieldDataType(string value) => new SearchFieldDataType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SearchFieldDataType other && Equals(other); + /// + public bool Equals(SearchFieldDataType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndex.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndex.Serialization.cs new file mode 100644 index 000000000000..ded0dc2a1529 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndex.Serialization.cs @@ -0,0 +1,423 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndex : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndex)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("fields"u8); + writer.WriteStartArray(); + foreach (var item in Fields) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsCollectionDefined(ScoringProfiles)) + { + writer.WritePropertyName("scoringProfiles"u8); + writer.WriteStartArray(); + foreach (var item in ScoringProfiles) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DefaultScoringProfile)) + { + writer.WritePropertyName("defaultScoringProfile"u8); + writer.WriteStringValue(DefaultScoringProfile); + } + if (Optional.IsDefined(CorsOptions)) + { + writer.WritePropertyName("corsOptions"u8); + writer.WriteObjectValue(CorsOptions, options); + } + if (Optional.IsCollectionDefined(Suggesters)) + { + writer.WritePropertyName("suggesters"u8); + writer.WriteStartArray(); + foreach (var item in Suggesters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Analyzers)) + { + writer.WritePropertyName("analyzers"u8); + writer.WriteStartArray(); + foreach (var item in Analyzers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Tokenizers)) + { + writer.WritePropertyName("tokenizers"u8); + writer.WriteStartArray(); + foreach (var item in Tokenizers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(TokenFilters)) + { + writer.WritePropertyName("tokenFilters"u8); + writer.WriteStartArray(); + foreach (var item in TokenFilters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(CharFilters)) + { + writer.WritePropertyName("charFilters"u8); + writer.WriteStartArray(); + foreach (var item in CharFilters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(EncryptionKey)) + { + writer.WritePropertyName("encryptionKey"u8); + writer.WriteObjectValue(EncryptionKey, options); + } + if (Optional.IsDefined(Similarity)) + { + writer.WritePropertyName("similarity"u8); + writer.WriteObjectValue(Similarity, options); + } + if (Optional.IsDefined(Semantic)) + { + writer.WritePropertyName("semantic"u8); + writer.WriteObjectValue(Semantic, options); + } + if (Optional.IsDefined(VectorSearch)) + { + writer.WritePropertyName("vectorSearch"u8); + writer.WriteObjectValue(VectorSearch, options); + } + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("@odata.etag"u8); + writer.WriteStringValue(ETag); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchIndex IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndex)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndex(document.RootElement, options); + } + + internal static SearchIndex DeserializeSearchIndex(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IList fields = default; + IList scoringProfiles = default; + string defaultScoringProfile = default; + CorsOptions corsOptions = default; + IList suggesters = default; + IList analyzers = default; + IList tokenizers = default; + IList tokenFilters = default; + IList charFilters = default; + SearchResourceEncryptionKey encryptionKey = default; + SimilarityAlgorithm similarity = default; + SemanticSearch semantic = default; + VectorSearch vectorSearch = default; + string odataEtag = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("fields"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SearchField.DeserializeSearchField(item, options)); + } + fields = array; + continue; + } + if (property.NameEquals("scoringProfiles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ScoringProfile.DeserializeScoringProfile(item, options)); + } + scoringProfiles = array; + continue; + } + if (property.NameEquals("defaultScoringProfile"u8)) + { + defaultScoringProfile = property.Value.GetString(); + continue; + } + if (property.NameEquals("corsOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + corsOptions = CorsOptions.DeserializeCorsOptions(property.Value, options); + continue; + } + if (property.NameEquals("suggesters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SearchSuggester.DeserializeSearchSuggester(item, options)); + } + suggesters = array; + continue; + } + if (property.NameEquals("analyzers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(LexicalAnalyzer.DeserializeLexicalAnalyzer(item, options)); + } + analyzers = array; + continue; + } + if (property.NameEquals("tokenizers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(LexicalTokenizer.DeserializeLexicalTokenizer(item, options)); + } + tokenizers = array; + continue; + } + if (property.NameEquals("tokenFilters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TokenFilter.DeserializeTokenFilter(item, options)); + } + tokenFilters = array; + continue; + } + if (property.NameEquals("charFilters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CharFilter.DeserializeCharFilter(item, options)); + } + charFilters = array; + continue; + } + if (property.NameEquals("encryptionKey"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryptionKey = SearchResourceEncryptionKey.DeserializeSearchResourceEncryptionKey(property.Value, options); + continue; + } + if (property.NameEquals("similarity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + similarity = SimilarityAlgorithm.DeserializeSimilarityAlgorithm(property.Value, options); + continue; + } + if (property.NameEquals("semantic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + semantic = SemanticSearch.DeserializeSemanticSearch(property.Value, options); + continue; + } + if (property.NameEquals("vectorSearch"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vectorSearch = VectorSearch.DeserializeVectorSearch(property.Value, options); + continue; + } + if (property.NameEquals("@odata.etag"u8)) + { + odataEtag = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndex( + name, + fields, + scoringProfiles ?? new ChangeTrackingList(), + defaultScoringProfile, + corsOptions, + suggesters ?? new ChangeTrackingList(), + analyzers ?? new ChangeTrackingList(), + tokenizers ?? new ChangeTrackingList(), + tokenFilters ?? new ChangeTrackingList(), + charFilters ?? new ChangeTrackingList(), + encryptionKey, + similarity, + semantic, + vectorSearch, + odataEtag, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndex)} does not support writing '{options.Format}' format."); + } + } + + SearchIndex IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndex(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndex)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndex FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndex(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndex.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndex.cs new file mode 100644 index 000000000000..72c256e36568 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndex.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Represents a search index definition, which describes the fields and search + /// behavior of an index. + /// + public partial class SearchIndex + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the index. + /// The fields of the index. + /// or is null. + public SearchIndex(string name, IEnumerable fields) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(fields, nameof(fields)); + + Name = name; + Fields = fields.ToList(); + ScoringProfiles = new ChangeTrackingList(); + Suggesters = new ChangeTrackingList(); + Analyzers = new ChangeTrackingList(); + Tokenizers = new ChangeTrackingList(); + TokenFilters = new ChangeTrackingList(); + CharFilters = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The name of the index. + /// The fields of the index. + /// The scoring profiles for the index. + /// + /// The name of the scoring profile to use if none is specified in the query. If + /// this property is not set and no scoring profile is specified in the query, then + /// default scoring (tf-idf) will be used. + /// + /// Options to control Cross-Origin Resource Sharing (CORS) for the index. + /// The suggesters for the index. + /// + /// The analyzers for the index. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// + /// The tokenizers for the index. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , and . + /// + /// + /// The token filters for the index. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , , , , , , , , , , , , , , and . + /// + /// + /// The character filters for the index. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// + /// A description of an encryption key that you create in Azure Key Vault. This key + /// is used to provide an additional level of encryption-at-rest for your data when + /// you want full assurance that no one, not even Microsoft, can decrypt your data. + /// Once you have encrypted your data, it will always remain encrypted. The search + /// service will ignore attempts to set this property to null. You can change this + /// property as needed if you want to rotate your encryption key; Your data will be + /// unaffected. Encryption with customer-managed keys is not available for free + /// search services, and is only available for paid services created on or after + /// January 1, 2019. + /// + /// + /// The type of similarity algorithm to be used when scoring and ranking the + /// documents matching a search query. The similarity algorithm can only be defined + /// at index creation time and cannot be modified on existing indexes. If null, the + /// ClassicSimilarity algorithm is used. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Defines parameters for a search index that influence semantic capabilities. + /// Contains configuration options related to vector search. + /// The ETag of the index. + /// Keeps track of any properties unknown to the library. + internal SearchIndex(string name, IList fields, IList scoringProfiles, string defaultScoringProfile, CorsOptions corsOptions, IList suggesters, IList analyzers, IList tokenizers, IList tokenFilters, IList charFilters, SearchResourceEncryptionKey encryptionKey, SimilarityAlgorithm similarity, SemanticSearch semantic, VectorSearch vectorSearch, string eTag, IDictionary serializedAdditionalRawData) + { + Name = name; + Fields = fields; + ScoringProfiles = scoringProfiles; + DefaultScoringProfile = defaultScoringProfile; + CorsOptions = corsOptions; + Suggesters = suggesters; + Analyzers = analyzers; + Tokenizers = tokenizers; + TokenFilters = tokenFilters; + CharFilters = charFilters; + EncryptionKey = encryptionKey; + Similarity = similarity; + Semantic = semantic; + VectorSearch = vectorSearch; + ETag = eTag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchIndex() + { + } + + /// The name of the index. + public string Name { get; set; } + /// The fields of the index. + public IList Fields { get; } + /// The scoring profiles for the index. + public IList ScoringProfiles { get; } + /// + /// The name of the scoring profile to use if none is specified in the query. If + /// this property is not set and no scoring profile is specified in the query, then + /// default scoring (tf-idf) will be used. + /// + public string DefaultScoringProfile { get; set; } + /// Options to control Cross-Origin Resource Sharing (CORS) for the index. + public CorsOptions CorsOptions { get; set; } + /// The suggesters for the index. + public IList Suggesters { get; } + /// + /// The analyzers for the index. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + public IList Analyzers { get; } + /// + /// The tokenizers for the index. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , and . + /// + public IList Tokenizers { get; } + /// + /// The token filters for the index. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , , , , , , , , , , , , , , and . + /// + public IList TokenFilters { get; } + /// + /// The character filters for the index. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public IList CharFilters { get; } + /// + /// A description of an encryption key that you create in Azure Key Vault. This key + /// is used to provide an additional level of encryption-at-rest for your data when + /// you want full assurance that no one, not even Microsoft, can decrypt your data. + /// Once you have encrypted your data, it will always remain encrypted. The search + /// service will ignore attempts to set this property to null. You can change this + /// property as needed if you want to rotate your encryption key; Your data will be + /// unaffected. Encryption with customer-managed keys is not available for free + /// search services, and is only available for paid services created on or after + /// January 1, 2019. + /// + public SearchResourceEncryptionKey EncryptionKey { get; set; } + /// + /// The type of similarity algorithm to be used when scoring and ranking the + /// documents matching a search query. The similarity algorithm can only be defined + /// at index creation time and cannot be modified on existing indexes. If null, the + /// ClassicSimilarity algorithm is used. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public SimilarityAlgorithm Similarity { get; set; } + /// Defines parameters for a search index that influence semantic capabilities. + public SemanticSearch Semantic { get; set; } + /// Contains configuration options related to vector search. + public VectorSearch VectorSearch { get; set; } + /// The ETag of the index. + public string ETag { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexer.Serialization.cs new file mode 100644 index 000000000000..7efca1daa3f7 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexer.Serialization.cs @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexer)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("dataSourceName"u8); + writer.WriteStringValue(DataSourceName); + if (Optional.IsDefined(SkillsetName)) + { + writer.WritePropertyName("skillsetName"u8); + writer.WriteStringValue(SkillsetName); + } + writer.WritePropertyName("targetIndexName"u8); + writer.WriteStringValue(TargetIndexName); + if (Optional.IsDefined(Schedule)) + { + writer.WritePropertyName("schedule"u8); + writer.WriteObjectValue(Schedule, options); + } + if (Optional.IsDefined(Parameters)) + { + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(Parameters, options); + } + if (Optional.IsCollectionDefined(FieldMappings)) + { + writer.WritePropertyName("fieldMappings"u8); + writer.WriteStartArray(); + foreach (var item in FieldMappings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(OutputFieldMappings)) + { + writer.WritePropertyName("outputFieldMappings"u8); + writer.WriteStartArray(); + foreach (var item in OutputFieldMappings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Disabled)) + { + writer.WritePropertyName("disabled"u8); + writer.WriteBooleanValue(Disabled.Value); + } + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("@odata.etag"u8); + writer.WriteStringValue(ETag); + } + if (Optional.IsDefined(EncryptionKey)) + { + writer.WritePropertyName("encryptionKey"u8); + writer.WriteObjectValue(EncryptionKey, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchIndexer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexer(document.RootElement, options); + } + + internal static SearchIndexer DeserializeSearchIndexer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string description = default; + string dataSourceName = default; + string skillsetName = default; + string targetIndexName = default; + IndexingSchedule schedule = default; + IndexingParameters parameters = default; + IList fieldMappings = default; + IList outputFieldMappings = default; + bool? disabled = default; + string odataEtag = default; + SearchResourceEncryptionKey encryptionKey = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataSourceName"u8)) + { + dataSourceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("skillsetName"u8)) + { + skillsetName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetIndexName"u8)) + { + targetIndexName = property.Value.GetString(); + continue; + } + if (property.NameEquals("schedule"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + schedule = IndexingSchedule.DeserializeIndexingSchedule(property.Value, options); + continue; + } + if (property.NameEquals("parameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + parameters = IndexingParameters.DeserializeIndexingParameters(property.Value, options); + continue; + } + if (property.NameEquals("fieldMappings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FieldMapping.DeserializeFieldMapping(item, options)); + } + fieldMappings = array; + continue; + } + if (property.NameEquals("outputFieldMappings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FieldMapping.DeserializeFieldMapping(item, options)); + } + outputFieldMappings = array; + continue; + } + if (property.NameEquals("disabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("@odata.etag"u8)) + { + odataEtag = property.Value.GetString(); + continue; + } + if (property.NameEquals("encryptionKey"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryptionKey = SearchResourceEncryptionKey.DeserializeSearchResourceEncryptionKey(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexer( + name, + description, + dataSourceName, + skillsetName, + targetIndexName, + schedule, + parameters, + fieldMappings ?? new ChangeTrackingList(), + outputFieldMappings ?? new ChangeTrackingList(), + disabled, + odataEtag, + encryptionKey, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexer)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndexer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexer(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexer.cs new file mode 100644 index 000000000000..01f5235cc4b4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexer.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents an indexer. + public partial class SearchIndexer + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the indexer. + /// The name of the datasource from which this indexer reads data. + /// The name of the index to which this indexer writes data. + /// , or is null. + public SearchIndexer(string name, string dataSourceName, string targetIndexName) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(dataSourceName, nameof(dataSourceName)); + Argument.AssertNotNull(targetIndexName, nameof(targetIndexName)); + + Name = name; + DataSourceName = dataSourceName; + TargetIndexName = targetIndexName; + FieldMappings = new ChangeTrackingList(); + OutputFieldMappings = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The name of the indexer. + /// The description of the indexer. + /// The name of the datasource from which this indexer reads data. + /// The name of the skillset executing with this indexer. + /// The name of the index to which this indexer writes data. + /// The schedule for this indexer. + /// Parameters for indexer execution. + /// + /// Defines mappings between fields in the data source and corresponding target + /// fields in the index. + /// + /// + /// Output field mappings are applied after enrichment and immediately before + /// indexing. + /// + /// A value indicating whether the indexer is disabled. Default is false. + /// The ETag of the indexer. + /// + /// A description of an encryption key that you create in Azure Key Vault. This key + /// is used to provide an additional level of encryption-at-rest for your indexer + /// definition (as well as indexer execution status) when you want full assurance + /// that no one, not even Microsoft, can decrypt them. Once you have encrypted your + /// indexer definition, it will always remain encrypted. The search service will + /// ignore attempts to set this property to null. You can change this property as + /// needed if you want to rotate your encryption key; Your indexer definition (and + /// indexer execution status) will be unaffected. Encryption with customer-managed + /// keys is not available for free search services, and is only available for paid + /// services created on or after January 1, 2019. + /// + /// Keeps track of any properties unknown to the library. + internal SearchIndexer(string name, string description, string dataSourceName, string skillsetName, string targetIndexName, IndexingSchedule schedule, IndexingParameters parameters, IList fieldMappings, IList outputFieldMappings, bool? disabled, string eTag, SearchResourceEncryptionKey encryptionKey, IDictionary serializedAdditionalRawData) + { + Name = name; + Description = description; + DataSourceName = dataSourceName; + SkillsetName = skillsetName; + TargetIndexName = targetIndexName; + Schedule = schedule; + Parameters = parameters; + FieldMappings = fieldMappings; + OutputFieldMappings = outputFieldMappings; + Disabled = disabled; + ETag = eTag; + EncryptionKey = encryptionKey; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchIndexer() + { + } + + /// The name of the indexer. + public string Name { get; set; } + /// The description of the indexer. + public string Description { get; set; } + /// The name of the datasource from which this indexer reads data. + public string DataSourceName { get; set; } + /// The name of the skillset executing with this indexer. + public string SkillsetName { get; set; } + /// The name of the index to which this indexer writes data. + public string TargetIndexName { get; set; } + /// The schedule for this indexer. + public IndexingSchedule Schedule { get; set; } + /// Parameters for indexer execution. + public IndexingParameters Parameters { get; set; } + /// + /// Defines mappings between fields in the data source and corresponding target + /// fields in the index. + /// + public IList FieldMappings { get; } + /// + /// Output field mappings are applied after enrichment and immediately before + /// indexing. + /// + public IList OutputFieldMappings { get; } + /// A value indicating whether the indexer is disabled. Default is false. + public bool? Disabled { get; set; } + /// The ETag of the indexer. + public string ETag { get; set; } + /// + /// A description of an encryption key that you create in Azure Key Vault. This key + /// is used to provide an additional level of encryption-at-rest for your indexer + /// definition (as well as indexer execution status) when you want full assurance + /// that no one, not even Microsoft, can decrypt them. Once you have encrypted your + /// indexer definition, it will always remain encrypted. The search service will + /// ignore attempts to set this property to null. You can change this property as + /// needed if you want to rotate your encryption key; Your indexer definition (and + /// indexer execution status) will be unaffected. Encryption with customer-managed + /// keys is not available for free search services, and is only available for paid + /// services created on or after January 1, 2019. + /// + public SearchResourceEncryptionKey EncryptionKey { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataContainer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataContainer.Serialization.cs new file mode 100644 index 000000000000..3bbb74d757b4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataContainer.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerDataContainer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerDataContainer)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Query)) + { + writer.WritePropertyName("query"u8); + writer.WriteStringValue(Query); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchIndexerDataContainer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerDataContainer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerDataContainer(document.RootElement, options); + } + + internal static SearchIndexerDataContainer DeserializeSearchIndexerDataContainer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string query = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("query"u8)) + { + query = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerDataContainer(name, query, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerDataContainer)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerDataContainer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerDataContainer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerDataContainer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndexerDataContainer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerDataContainer(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataContainer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataContainer.cs new file mode 100644 index 000000000000..96f48c62f244 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataContainer.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Represents information about the entity (such as Azure SQL table or CosmosDB + /// collection) that will be indexed. + /// + public partial class SearchIndexerDataContainer + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// The name of the table or view (for Azure SQL data source) or collection (for + /// CosmosDB data source) that will be indexed. + /// + /// is null. + public SearchIndexerDataContainer(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// + /// The name of the table or view (for Azure SQL data source) or collection (for + /// CosmosDB data source) that will be indexed. + /// + /// + /// A query that is applied to this data container. The syntax and meaning of this + /// parameter is datasource-specific. Not supported by Azure SQL datasources. + /// + /// Keeps track of any properties unknown to the library. + internal SearchIndexerDataContainer(string name, string query, IDictionary serializedAdditionalRawData) + { + Name = name; + Query = query; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchIndexerDataContainer() + { + } + + /// + /// The name of the table or view (for Azure SQL data source) or collection (for + /// CosmosDB data source) that will be indexed. + /// + public string Name { get; set; } + /// + /// A query that is applied to this data container. The syntax and meaning of this + /// parameter is datasource-specific. Not supported by Azure SQL datasources. + /// + public string Query { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataIdentity.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataIdentity.Serialization.cs new file mode 100644 index 000000000000..f8c346596889 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataIdentity.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + [PersistableModelProxy(typeof(UnknownSearchIndexerDataIdentity))] + public partial class SearchIndexerDataIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerDataIdentity)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("@odata.type"u8); + writer.WriteStringValue(OdataType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchIndexerDataIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerDataIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerDataIdentity(document.RootElement, options); + } + + internal static SearchIndexerDataIdentity DeserializeSearchIndexerDataIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("@odata.type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "#Microsoft.Azure.Search.DataNoneIdentity": return SearchIndexerDataNoneIdentity.DeserializeSearchIndexerDataNoneIdentity(element, options); + case "#Microsoft.Azure.Search.DataUserAssignedIdentity": return SearchIndexerDataUserAssignedIdentity.DeserializeSearchIndexerDataUserAssignedIdentity(element, options); + } + } + return UnknownSearchIndexerDataIdentity.DeserializeUnknownSearchIndexerDataIdentity(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerDataIdentity)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerDataIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerDataIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerDataIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndexerDataIdentity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerDataIdentity(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataIdentity.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataIdentity.cs new file mode 100644 index 000000000000..fd71d05a7221 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataIdentity.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Abstract base type for data identities. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class SearchIndexerDataIdentity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected SearchIndexerDataIdentity() + { + } + + /// Initializes a new instance of . + /// A URI fragment specifying the type of identity. + /// Keeps track of any properties unknown to the library. + internal SearchIndexerDataIdentity(string odataType, IDictionary serializedAdditionalRawData) + { + OdataType = odataType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A URI fragment specifying the type of identity. + internal string OdataType { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataNoneIdentity.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataNoneIdentity.Serialization.cs new file mode 100644 index 000000000000..4e232af6d3df --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataNoneIdentity.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerDataNoneIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerDataNoneIdentity)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SearchIndexerDataNoneIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerDataNoneIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerDataNoneIdentity(document.RootElement, options); + } + + internal static SearchIndexerDataNoneIdentity DeserializeSearchIndexerDataNoneIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string odataType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerDataNoneIdentity(odataType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerDataNoneIdentity)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerDataNoneIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerDataNoneIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerDataNoneIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new SearchIndexerDataNoneIdentity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerDataNoneIdentity(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataNoneIdentity.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataNoneIdentity.cs new file mode 100644 index 000000000000..47c740c48341 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataNoneIdentity.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Clears the identity property of a datasource. + public partial class SearchIndexerDataNoneIdentity : SearchIndexerDataIdentity + { + /// Initializes a new instance of . + public SearchIndexerDataNoneIdentity() + { + OdataType = "#Microsoft.Azure.Search.DataNoneIdentity"; + } + + /// Initializes a new instance of . + /// A URI fragment specifying the type of identity. + /// Keeps track of any properties unknown to the library. + internal SearchIndexerDataNoneIdentity(string odataType, IDictionary serializedAdditionalRawData) : base(odataType, serializedAdditionalRawData) + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataSource.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataSource.Serialization.cs new file mode 100644 index 000000000000..0c4b5534881b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataSource.Serialization.cs @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerDataSource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerDataSource)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); + writer.WritePropertyName("container"u8); + writer.WriteObjectValue(Container, options); + if (Optional.IsDefined(DataChangeDetectionPolicy)) + { + writer.WritePropertyName("dataChangeDetectionPolicy"u8); + writer.WriteObjectValue(DataChangeDetectionPolicy, options); + } + if (Optional.IsDefined(DataDeletionDetectionPolicy)) + { + writer.WritePropertyName("dataDeletionDetectionPolicy"u8); + writer.WriteObjectValue(DataDeletionDetectionPolicy, options); + } + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("@odata.etag"u8); + writer.WriteStringValue(ETag); + } + if (Optional.IsDefined(EncryptionKey)) + { + writer.WritePropertyName("encryptionKey"u8); + writer.WriteObjectValue(EncryptionKey, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchIndexerDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerDataSource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerDataSource(document.RootElement, options); + } + + internal static SearchIndexerDataSource DeserializeSearchIndexerDataSource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string description = default; + SearchIndexerDataSourceType type = default; + DataSourceCredentials credentials = default; + SearchIndexerDataContainer container = default; + DataChangeDetectionPolicy dataChangeDetectionPolicy = default; + DataDeletionDetectionPolicy dataDeletionDetectionPolicy = default; + string odataEtag = default; + SearchResourceEncryptionKey encryptionKey = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new SearchIndexerDataSourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("credentials"u8)) + { + credentials = DataSourceCredentials.DeserializeDataSourceCredentials(property.Value, options); + continue; + } + if (property.NameEquals("container"u8)) + { + container = SearchIndexerDataContainer.DeserializeSearchIndexerDataContainer(property.Value, options); + continue; + } + if (property.NameEquals("dataChangeDetectionPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataChangeDetectionPolicy = DataChangeDetectionPolicy.DeserializeDataChangeDetectionPolicy(property.Value, options); + continue; + } + if (property.NameEquals("dataDeletionDetectionPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataDeletionDetectionPolicy = DataDeletionDetectionPolicy.DeserializeDataDeletionDetectionPolicy(property.Value, options); + continue; + } + if (property.NameEquals("@odata.etag"u8)) + { + odataEtag = property.Value.GetString(); + continue; + } + if (property.NameEquals("encryptionKey"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryptionKey = SearchResourceEncryptionKey.DeserializeSearchResourceEncryptionKey(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerDataSource( + name, + description, + type, + credentials, + container, + dataChangeDetectionPolicy, + dataDeletionDetectionPolicy, + odataEtag, + encryptionKey, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerDataSource)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerDataSource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerDataSource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndexerDataSource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerDataSource(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataSource.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataSource.cs new file mode 100644 index 000000000000..d7893a91eeaf --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataSource.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents a datasource definition, which can be used to configure an indexer. + public partial class SearchIndexerDataSource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the datasource. + /// The type of the datasource. + /// Credentials for the datasource. + /// The data container for the datasource. + /// , or is null. + public SearchIndexerDataSource(string name, SearchIndexerDataSourceType type, DataSourceCredentials credentials, SearchIndexerDataContainer container) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(credentials, nameof(credentials)); + Argument.AssertNotNull(container, nameof(container)); + + Name = name; + Type = type; + Credentials = credentials; + Container = container; + } + + /// Initializes a new instance of . + /// The name of the datasource. + /// The description of the datasource. + /// The type of the datasource. + /// Credentials for the datasource. + /// The data container for the datasource. + /// + /// The data change detection policy for the datasource. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// + /// The data deletion detection policy for the datasource. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// The ETag of the data source. + /// + /// A description of an encryption key that you create in Azure Key Vault. This key + /// is used to provide an additional level of encryption-at-rest for your + /// datasource definition when you want full assurance that no one, not even + /// Microsoft, can decrypt your data source definition. Once you have encrypted + /// your data source definition, it will always remain encrypted. The search + /// service will ignore attempts to set this property to null. You can change this + /// property as needed if you want to rotate your encryption key; Your datasource + /// definition will be unaffected. Encryption with customer-managed keys is not + /// available for free search services, and is only available for paid services + /// created on or after January 1, 2019. + /// + /// Keeps track of any properties unknown to the library. + internal SearchIndexerDataSource(string name, string description, SearchIndexerDataSourceType type, DataSourceCredentials credentials, SearchIndexerDataContainer container, DataChangeDetectionPolicy dataChangeDetectionPolicy, DataDeletionDetectionPolicy dataDeletionDetectionPolicy, string eTag, SearchResourceEncryptionKey encryptionKey, IDictionary serializedAdditionalRawData) + { + Name = name; + Description = description; + Type = type; + Credentials = credentials; + Container = container; + DataChangeDetectionPolicy = dataChangeDetectionPolicy; + DataDeletionDetectionPolicy = dataDeletionDetectionPolicy; + ETag = eTag; + EncryptionKey = encryptionKey; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchIndexerDataSource() + { + } + + /// The name of the datasource. + public string Name { get; set; } + /// The description of the datasource. + public string Description { get; set; } + /// The type of the datasource. + public SearchIndexerDataSourceType Type { get; set; } + /// Credentials for the datasource. + public DataSourceCredentials Credentials { get; set; } + /// The data container for the datasource. + public SearchIndexerDataContainer Container { get; set; } + /// + /// The data change detection policy for the datasource. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public DataChangeDetectionPolicy DataChangeDetectionPolicy { get; set; } + /// + /// The data deletion detection policy for the datasource. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public DataDeletionDetectionPolicy DataDeletionDetectionPolicy { get; set; } + /// The ETag of the data source. + public string ETag { get; set; } + /// + /// A description of an encryption key that you create in Azure Key Vault. This key + /// is used to provide an additional level of encryption-at-rest for your + /// datasource definition when you want full assurance that no one, not even + /// Microsoft, can decrypt your data source definition. Once you have encrypted + /// your data source definition, it will always remain encrypted. The search + /// service will ignore attempts to set this property to null. You can change this + /// property as needed if you want to rotate your encryption key; Your datasource + /// definition will be unaffected. Encryption with customer-managed keys is not + /// available for free search services, and is only available for paid services + /// created on or after January 1, 2019. + /// + public SearchResourceEncryptionKey EncryptionKey { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataSourceType.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataSourceType.cs new file mode 100644 index 000000000000..ee854d276e68 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataSourceType.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Defines the type of a datasource. + public readonly partial struct SearchIndexerDataSourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SearchIndexerDataSourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureSqlValue = "azuresql"; + private const string CosmosDbValue = "cosmosdb"; + private const string AzureBlobValue = "azureblob"; + private const string AzureTableValue = "azuretable"; + private const string MySqlValue = "mysql"; + private const string AdlsGen2Value = "adlsgen2"; + + /// Indicates an Azure SQL datasource. + public static SearchIndexerDataSourceType AzureSql { get; } = new SearchIndexerDataSourceType(AzureSqlValue); + /// Indicates a CosmosDB datasource. + public static SearchIndexerDataSourceType CosmosDb { get; } = new SearchIndexerDataSourceType(CosmosDbValue); + /// Indicates an Azure Blob datasource. + public static SearchIndexerDataSourceType AzureBlob { get; } = new SearchIndexerDataSourceType(AzureBlobValue); + /// Indicates an Azure Table datasource. + public static SearchIndexerDataSourceType AzureTable { get; } = new SearchIndexerDataSourceType(AzureTableValue); + /// Indicates a MySql datasource. + public static SearchIndexerDataSourceType MySql { get; } = new SearchIndexerDataSourceType(MySqlValue); + /// Indicates an ADLS Gen2 datasource. + public static SearchIndexerDataSourceType AdlsGen2 { get; } = new SearchIndexerDataSourceType(AdlsGen2Value); + /// Determines if two values are the same. + public static bool operator ==(SearchIndexerDataSourceType left, SearchIndexerDataSourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SearchIndexerDataSourceType left, SearchIndexerDataSourceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SearchIndexerDataSourceType(string value) => new SearchIndexerDataSourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SearchIndexerDataSourceType other && Equals(other); + /// + public bool Equals(SearchIndexerDataSourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataUserAssignedIdentity.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataUserAssignedIdentity.Serialization.cs new file mode 100644 index 000000000000..5f443d80106f --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataUserAssignedIdentity.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerDataUserAssignedIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerDataUserAssignedIdentity)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("userAssignedIdentity"u8); + writer.WriteStringValue(UserAssignedIdentity); + } + + SearchIndexerDataUserAssignedIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerDataUserAssignedIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerDataUserAssignedIdentity(document.RootElement, options); + } + + internal static SearchIndexerDataUserAssignedIdentity DeserializeSearchIndexerDataUserAssignedIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string userAssignedIdentity = default; + string odataType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("userAssignedIdentity"u8)) + { + userAssignedIdentity = property.Value.GetString(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerDataUserAssignedIdentity(odataType, serializedAdditionalRawData, userAssignedIdentity); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerDataUserAssignedIdentity)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerDataUserAssignedIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerDataUserAssignedIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerDataUserAssignedIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new SearchIndexerDataUserAssignedIdentity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerDataUserAssignedIdentity(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataUserAssignedIdentity.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataUserAssignedIdentity.cs new file mode 100644 index 000000000000..e2f64ca085b2 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerDataUserAssignedIdentity.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Specifies the identity for a datasource to use. + public partial class SearchIndexerDataUserAssignedIdentity : SearchIndexerDataIdentity + { + /// Initializes a new instance of . + /// + /// The fully qualified Azure resource Id of a user assigned managed identity + /// typically in the form + /// "/subscriptions/12345678-1234-1234-1234-1234567890ab/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId" + /// that should have been assigned to the search service. + /// + /// is null. + public SearchIndexerDataUserAssignedIdentity(string userAssignedIdentity) + { + Argument.AssertNotNull(userAssignedIdentity, nameof(userAssignedIdentity)); + + OdataType = "#Microsoft.Azure.Search.DataUserAssignedIdentity"; + UserAssignedIdentity = userAssignedIdentity; + } + + /// Initializes a new instance of . + /// A URI fragment specifying the type of identity. + /// Keeps track of any properties unknown to the library. + /// + /// The fully qualified Azure resource Id of a user assigned managed identity + /// typically in the form + /// "/subscriptions/12345678-1234-1234-1234-1234567890ab/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId" + /// that should have been assigned to the search service. + /// + internal SearchIndexerDataUserAssignedIdentity(string odataType, IDictionary serializedAdditionalRawData, string userAssignedIdentity) : base(odataType, serializedAdditionalRawData) + { + UserAssignedIdentity = userAssignedIdentity; + } + + /// Initializes a new instance of for deserialization. + internal SearchIndexerDataUserAssignedIdentity() + { + } + + /// + /// The fully qualified Azure resource Id of a user assigned managed identity + /// typically in the form + /// "/subscriptions/12345678-1234-1234-1234-1234567890ab/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId" + /// that should have been assigned to the search service. + /// + public string UserAssignedIdentity { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerError.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerError.Serialization.cs new file mode 100644 index 000000000000..63aaff753510 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerError.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerError : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerError)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Key)) + { + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + writer.WritePropertyName("errorMessage"u8); + writer.WriteStringValue(ErrorMessage); + writer.WritePropertyName("statusCode"u8); + writer.WriteNumberValue(StatusCode); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteStringValue(Details); + } + if (Optional.IsDefined(DocumentationLink)) + { + writer.WritePropertyName("documentationLink"u8); + writer.WriteStringValue(DocumentationLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchIndexerError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerError(document.RootElement, options); + } + + internal static SearchIndexerError DeserializeSearchIndexerError(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + string errorMessage = default; + int statusCode = default; + string name = default; + string details = default; + string documentationLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("errorMessage"u8)) + { + errorMessage = property.Value.GetString(); + continue; + } + if (property.NameEquals("statusCode"u8)) + { + statusCode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + details = property.Value.GetString(); + continue; + } + if (property.NameEquals("documentationLink"u8)) + { + documentationLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerError( + key, + errorMessage, + statusCode, + name, + details, + documentationLink, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerError)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerError)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndexerError FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerError(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerError.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerError.cs new file mode 100644 index 000000000000..7bbd3393f854 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerError.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents an item- or document-level indexing error. + public partial class SearchIndexerError + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The message describing the error that occurred while processing the item. + /// + /// The status code indicating why the indexing operation failed. Possible values + /// include: 400 for a malformed input document, 404 for document not found, 409 + /// for a version conflict, 422 when the index is temporarily unavailable, or 503 + /// for when the service is too busy. + /// + /// is null. + internal SearchIndexerError(string errorMessage, int statusCode) + { + Argument.AssertNotNull(errorMessage, nameof(errorMessage)); + + ErrorMessage = errorMessage; + StatusCode = statusCode; + } + + /// Initializes a new instance of . + /// The key of the item for which indexing failed. + /// The message describing the error that occurred while processing the item. + /// + /// The status code indicating why the indexing operation failed. Possible values + /// include: 400 for a malformed input document, 404 for document not found, 409 + /// for a version conflict, 422 when the index is temporarily unavailable, or 503 + /// for when the service is too busy. + /// + /// + /// The name of the source at which the error originated. For example, this could + /// refer to a particular skill in the attached skillset. This may not be always + /// available. + /// + /// + /// Additional, verbose details about the error to assist in debugging the indexer. + /// This may not be always available. + /// + /// + /// A link to a troubleshooting guide for these classes of errors. This may not be + /// always available. + /// + /// Keeps track of any properties unknown to the library. + internal SearchIndexerError(string key, string errorMessage, int statusCode, string name, string details, string documentationLink, IDictionary serializedAdditionalRawData) + { + Key = key; + ErrorMessage = errorMessage; + StatusCode = statusCode; + Name = name; + Details = details; + DocumentationLink = documentationLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchIndexerError() + { + } + + /// The key of the item for which indexing failed. + public string Key { get; } + /// The message describing the error that occurred while processing the item. + public string ErrorMessage { get; } + /// + /// The status code indicating why the indexing operation failed. Possible values + /// include: 400 for a malformed input document, 404 for document not found, 409 + /// for a version conflict, 422 when the index is temporarily unavailable, or 503 + /// for when the service is too busy. + /// + public int StatusCode { get; } + /// + /// The name of the source at which the error originated. For example, this could + /// refer to a particular skill in the attached skillset. This may not be always + /// available. + /// + public string Name { get; } + /// + /// Additional, verbose details about the error to assist in debugging the indexer. + /// This may not be always available. + /// + public string Details { get; } + /// + /// A link to a troubleshooting guide for these classes of errors. This may not be + /// always available. + /// + public string DocumentationLink { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjection.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjection.Serialization.cs new file mode 100644 index 000000000000..7930d1e54df2 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjection.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerIndexProjection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerIndexProjection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("selectors"u8); + writer.WriteStartArray(); + foreach (var item in Selectors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(Parameters)) + { + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(Parameters, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchIndexerIndexProjection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerIndexProjection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerIndexProjection(document.RootElement, options); + } + + internal static SearchIndexerIndexProjection DeserializeSearchIndexerIndexProjection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList selectors = default; + SearchIndexerIndexProjectionsParameters parameters = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("selectors"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SearchIndexerIndexProjectionSelector.DeserializeSearchIndexerIndexProjectionSelector(item, options)); + } + selectors = array; + continue; + } + if (property.NameEquals("parameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + parameters = SearchIndexerIndexProjectionsParameters.DeserializeSearchIndexerIndexProjectionsParameters(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerIndexProjection(selectors, parameters, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerIndexProjection)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerIndexProjection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerIndexProjection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerIndexProjection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndexerIndexProjection FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerIndexProjection(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjection.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjection.cs new file mode 100644 index 000000000000..9e13404e9ccb --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjection.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// Definition of additional projections to secondary search indexes. + public partial class SearchIndexerIndexProjection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// A list of projections to be performed to secondary search indexes. + /// is null. + public SearchIndexerIndexProjection(IEnumerable selectors) + { + Argument.AssertNotNull(selectors, nameof(selectors)); + + Selectors = selectors.ToList(); + } + + /// Initializes a new instance of . + /// A list of projections to be performed to secondary search indexes. + /// + /// A dictionary of index projection-specific configuration properties. Each name + /// is the name of a specific property. Each value must be of a primitive type. + /// + /// Keeps track of any properties unknown to the library. + internal SearchIndexerIndexProjection(IList selectors, SearchIndexerIndexProjectionsParameters parameters, IDictionary serializedAdditionalRawData) + { + Selectors = selectors; + Parameters = parameters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchIndexerIndexProjection() + { + } + + /// A list of projections to be performed to secondary search indexes. + public IList Selectors { get; } + /// + /// A dictionary of index projection-specific configuration properties. Each name + /// is the name of a specific property. Each value must be of a primitive type. + /// + public SearchIndexerIndexProjectionsParameters Parameters { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjectionSelector.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjectionSelector.Serialization.cs new file mode 100644 index 000000000000..88e11c0d00ac --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjectionSelector.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerIndexProjectionSelector : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerIndexProjectionSelector)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("targetIndexName"u8); + writer.WriteStringValue(TargetIndexName); + writer.WritePropertyName("parentKeyFieldName"u8); + writer.WriteStringValue(ParentKeyFieldName); + writer.WritePropertyName("sourceContext"u8); + writer.WriteStringValue(SourceContext); + writer.WritePropertyName("mappings"u8); + writer.WriteStartArray(); + foreach (var item in Mappings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchIndexerIndexProjectionSelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerIndexProjectionSelector)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerIndexProjectionSelector(document.RootElement, options); + } + + internal static SearchIndexerIndexProjectionSelector DeserializeSearchIndexerIndexProjectionSelector(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string targetIndexName = default; + string parentKeyFieldName = default; + string sourceContext = default; + IList mappings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetIndexName"u8)) + { + targetIndexName = property.Value.GetString(); + continue; + } + if (property.NameEquals("parentKeyFieldName"u8)) + { + parentKeyFieldName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceContext"u8)) + { + sourceContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("mappings"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + mappings = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerIndexProjectionSelector(targetIndexName, parentKeyFieldName, sourceContext, mappings, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerIndexProjectionSelector)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerIndexProjectionSelector IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerIndexProjectionSelector(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerIndexProjectionSelector)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndexerIndexProjectionSelector FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerIndexProjectionSelector(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjectionSelector.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjectionSelector.cs new file mode 100644 index 000000000000..665bdbad0cd4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjectionSelector.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// Description for what data to store in the designated search index. + public partial class SearchIndexerIndexProjectionSelector + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Name of the search index to project to. Must have a key field with the 'keyword' analyzer set. + /// + /// Name of the field in the search index to map the parent document's key value + /// to. Must be a string field that is filterable and not the key field. + /// + /// + /// Source context for the projections. Represents the cardinality at which the + /// document will be split into multiple sub documents. + /// + /// + /// Mappings for the projection, or which source should be mapped to which field in + /// the target index. + /// + /// , , or is null. + public SearchIndexerIndexProjectionSelector(string targetIndexName, string parentKeyFieldName, string sourceContext, IEnumerable mappings) + { + Argument.AssertNotNull(targetIndexName, nameof(targetIndexName)); + Argument.AssertNotNull(parentKeyFieldName, nameof(parentKeyFieldName)); + Argument.AssertNotNull(sourceContext, nameof(sourceContext)); + Argument.AssertNotNull(mappings, nameof(mappings)); + + TargetIndexName = targetIndexName; + ParentKeyFieldName = parentKeyFieldName; + SourceContext = sourceContext; + Mappings = mappings.ToList(); + } + + /// Initializes a new instance of . + /// Name of the search index to project to. Must have a key field with the 'keyword' analyzer set. + /// + /// Name of the field in the search index to map the parent document's key value + /// to. Must be a string field that is filterable and not the key field. + /// + /// + /// Source context for the projections. Represents the cardinality at which the + /// document will be split into multiple sub documents. + /// + /// + /// Mappings for the projection, or which source should be mapped to which field in + /// the target index. + /// + /// Keeps track of any properties unknown to the library. + internal SearchIndexerIndexProjectionSelector(string targetIndexName, string parentKeyFieldName, string sourceContext, IList mappings, IDictionary serializedAdditionalRawData) + { + TargetIndexName = targetIndexName; + ParentKeyFieldName = parentKeyFieldName; + SourceContext = sourceContext; + Mappings = mappings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchIndexerIndexProjectionSelector() + { + } + + /// Name of the search index to project to. Must have a key field with the 'keyword' analyzer set. + public string TargetIndexName { get; set; } + /// + /// Name of the field in the search index to map the parent document's key value + /// to. Must be a string field that is filterable and not the key field. + /// + public string ParentKeyFieldName { get; set; } + /// + /// Source context for the projections. Represents the cardinality at which the + /// document will be split into multiple sub documents. + /// + public string SourceContext { get; set; } + /// + /// Mappings for the projection, or which source should be mapped to which field in + /// the target index. + /// + public IList Mappings { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjectionsParameters.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjectionsParameters.Serialization.cs new file mode 100644 index 000000000000..f328f94ac458 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjectionsParameters.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerIndexProjectionsParameters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerIndexProjectionsParameters)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ProjectionMode)) + { + writer.WritePropertyName("projectionMode"u8); + writer.WriteStringValue(ProjectionMode.Value.ToString()); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + SearchIndexerIndexProjectionsParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerIndexProjectionsParameters)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerIndexProjectionsParameters(document.RootElement, options); + } + + internal static SearchIndexerIndexProjectionsParameters DeserializeSearchIndexerIndexProjectionsParameters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IndexProjectionMode? projectionMode = default; + IDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectionMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + projectionMode = new IndexProjectionMode(property.Value.GetString()); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new SearchIndexerIndexProjectionsParameters(projectionMode, additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerIndexProjectionsParameters)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerIndexProjectionsParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerIndexProjectionsParameters(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerIndexProjectionsParameters)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndexerIndexProjectionsParameters FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerIndexProjectionsParameters(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjectionsParameters.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjectionsParameters.cs new file mode 100644 index 000000000000..e3b750009515 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerIndexProjectionsParameters.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// A dictionary of index projection-specific configuration properties. Each name + /// is the name of a specific property. Each value must be of a primitive type. + /// + public partial class SearchIndexerIndexProjectionsParameters + { + /// Initializes a new instance of . + public SearchIndexerIndexProjectionsParameters() + { + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// + /// Defines behavior of the index projections in relation to the rest of the + /// indexer. + /// + /// Additional Properties. + internal SearchIndexerIndexProjectionsParameters(IndexProjectionMode? projectionMode, IDictionary additionalProperties) + { + ProjectionMode = projectionMode; + AdditionalProperties = additionalProperties; + } + + /// + /// Defines behavior of the index projections in relation to the rest of the + /// indexer. + /// + public IndexProjectionMode? ProjectionMode { get; set; } + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStore.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStore.Serialization.cs new file mode 100644 index 000000000000..4e8a905c2fa7 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStore.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerKnowledgeStore : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStore)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("storageConnectionString"u8); + writer.WriteStringValue(StorageConnectionString); + writer.WritePropertyName("projections"u8); + writer.WriteStartArray(); + foreach (var item in Projections) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchIndexerKnowledgeStore IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStore)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerKnowledgeStore(document.RootElement, options); + } + + internal static SearchIndexerKnowledgeStore DeserializeSearchIndexerKnowledgeStore(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string storageConnectionString = default; + IList projections = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageConnectionString"u8)) + { + storageConnectionString = property.Value.GetString(); + continue; + } + if (property.NameEquals("projections"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SearchIndexerKnowledgeStoreProjection.DeserializeSearchIndexerKnowledgeStoreProjection(item, options)); + } + projections = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerKnowledgeStore(storageConnectionString, projections, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStore)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerKnowledgeStore IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerKnowledgeStore(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStore)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndexerKnowledgeStore FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerKnowledgeStore(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStore.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStore.cs new file mode 100644 index 000000000000..9a035257fcbf --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStore.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Definition of additional projections to azure blob, table, or files, of + /// enriched data. + /// + public partial class SearchIndexerKnowledgeStore + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The connection string to the storage account projections will be stored in. + /// A list of additional projections to perform during indexing. + /// or is null. + public SearchIndexerKnowledgeStore(string storageConnectionString, IEnumerable projections) + { + Argument.AssertNotNull(storageConnectionString, nameof(storageConnectionString)); + Argument.AssertNotNull(projections, nameof(projections)); + + StorageConnectionString = storageConnectionString; + Projections = projections.ToList(); + } + + /// Initializes a new instance of . + /// The connection string to the storage account projections will be stored in. + /// A list of additional projections to perform during indexing. + /// Keeps track of any properties unknown to the library. + internal SearchIndexerKnowledgeStore(string storageConnectionString, IList projections, IDictionary serializedAdditionalRawData) + { + StorageConnectionString = storageConnectionString; + Projections = projections; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchIndexerKnowledgeStore() + { + } + + /// The connection string to the storage account projections will be stored in. + public string StorageConnectionString { get; set; } + /// A list of additional projections to perform during indexing. + public IList Projections { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreBlobProjectionSelector.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreBlobProjectionSelector.Serialization.cs new file mode 100644 index 000000000000..2d881bdf895d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreBlobProjectionSelector.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerKnowledgeStoreBlobProjectionSelector : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreBlobProjectionSelector)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("storageContainer"u8); + writer.WriteStringValue(StorageContainer); + } + + SearchIndexerKnowledgeStoreBlobProjectionSelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreBlobProjectionSelector)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerKnowledgeStoreBlobProjectionSelector(document.RootElement, options); + } + + internal static SearchIndexerKnowledgeStoreBlobProjectionSelector DeserializeSearchIndexerKnowledgeStoreBlobProjectionSelector(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string storageContainer = default; + string referenceKeyName = default; + string generatedKeyName = default; + string source = default; + string sourceContext = default; + IList inputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageContainer"u8)) + { + storageContainer = property.Value.GetString(); + continue; + } + if (property.NameEquals("referenceKeyName"u8)) + { + referenceKeyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("generatedKeyName"u8)) + { + generatedKeyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceContext"u8)) + { + sourceContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerKnowledgeStoreBlobProjectionSelector( + referenceKeyName, + generatedKeyName, + source, + sourceContext, + inputs ?? new ChangeTrackingList(), + serializedAdditionalRawData, + storageContainer); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreBlobProjectionSelector)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerKnowledgeStoreBlobProjectionSelector IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerKnowledgeStoreBlobProjectionSelector(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreBlobProjectionSelector)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new SearchIndexerKnowledgeStoreBlobProjectionSelector FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerKnowledgeStoreBlobProjectionSelector(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreBlobProjectionSelector.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreBlobProjectionSelector.cs new file mode 100644 index 000000000000..9469affe9adc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreBlobProjectionSelector.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Abstract class to share properties between concrete selectors. + public partial class SearchIndexerKnowledgeStoreBlobProjectionSelector : SearchIndexerKnowledgeStoreProjectionSelector + { + /// Initializes a new instance of . + /// Blob container to store projections in. + /// is null. + public SearchIndexerKnowledgeStoreBlobProjectionSelector(string storageContainer) + { + Argument.AssertNotNull(storageContainer, nameof(storageContainer)); + + StorageContainer = storageContainer; + } + + /// Initializes a new instance of . + /// Name of reference key to different projection. + /// Name of generated key to store projection under. + /// Source data to project. + /// Source context for complex projections. + /// Nested inputs for complex projections. + /// Keeps track of any properties unknown to the library. + /// Blob container to store projections in. + internal SearchIndexerKnowledgeStoreBlobProjectionSelector(string referenceKeyName, string generatedKeyName, string source, string sourceContext, IList inputs, IDictionary serializedAdditionalRawData, string storageContainer) : base(referenceKeyName, generatedKeyName, source, sourceContext, inputs, serializedAdditionalRawData) + { + StorageContainer = storageContainer; + } + + /// Initializes a new instance of for deserialization. + internal SearchIndexerKnowledgeStoreBlobProjectionSelector() + { + } + + /// Blob container to store projections in. + public string StorageContainer { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreFileProjectionSelector.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreFileProjectionSelector.Serialization.cs new file mode 100644 index 000000000000..069606079ec1 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreFileProjectionSelector.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerKnowledgeStoreFileProjectionSelector : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreFileProjectionSelector)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SearchIndexerKnowledgeStoreFileProjectionSelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreFileProjectionSelector)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerKnowledgeStoreFileProjectionSelector(document.RootElement, options); + } + + internal static SearchIndexerKnowledgeStoreFileProjectionSelector DeserializeSearchIndexerKnowledgeStoreFileProjectionSelector(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string storageContainer = default; + string referenceKeyName = default; + string generatedKeyName = default; + string source = default; + string sourceContext = default; + IList inputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageContainer"u8)) + { + storageContainer = property.Value.GetString(); + continue; + } + if (property.NameEquals("referenceKeyName"u8)) + { + referenceKeyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("generatedKeyName"u8)) + { + generatedKeyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceContext"u8)) + { + sourceContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerKnowledgeStoreFileProjectionSelector( + referenceKeyName, + generatedKeyName, + source, + sourceContext, + inputs ?? new ChangeTrackingList(), + serializedAdditionalRawData, + storageContainer); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreFileProjectionSelector)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerKnowledgeStoreFileProjectionSelector IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerKnowledgeStoreFileProjectionSelector(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreFileProjectionSelector)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new SearchIndexerKnowledgeStoreFileProjectionSelector FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerKnowledgeStoreFileProjectionSelector(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreFileProjectionSelector.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreFileProjectionSelector.cs new file mode 100644 index 000000000000..da8d8db948bc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreFileProjectionSelector.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Projection definition for what data to store in Azure Files. + public partial class SearchIndexerKnowledgeStoreFileProjectionSelector : SearchIndexerKnowledgeStoreBlobProjectionSelector + { + /// Initializes a new instance of . + /// Blob container to store projections in. + /// is null. + public SearchIndexerKnowledgeStoreFileProjectionSelector(string storageContainer) : base(storageContainer) + { + Argument.AssertNotNull(storageContainer, nameof(storageContainer)); + } + + /// Initializes a new instance of . + /// Name of reference key to different projection. + /// Name of generated key to store projection under. + /// Source data to project. + /// Source context for complex projections. + /// Nested inputs for complex projections. + /// Keeps track of any properties unknown to the library. + /// Blob container to store projections in. + internal SearchIndexerKnowledgeStoreFileProjectionSelector(string referenceKeyName, string generatedKeyName, string source, string sourceContext, IList inputs, IDictionary serializedAdditionalRawData, string storageContainer) : base(referenceKeyName, generatedKeyName, source, sourceContext, inputs, serializedAdditionalRawData, storageContainer) + { + } + + /// Initializes a new instance of for deserialization. + internal SearchIndexerKnowledgeStoreFileProjectionSelector() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreObjectProjectionSelector.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreObjectProjectionSelector.Serialization.cs new file mode 100644 index 000000000000..2883bb3b9562 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreObjectProjectionSelector.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerKnowledgeStoreObjectProjectionSelector : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreObjectProjectionSelector)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SearchIndexerKnowledgeStoreObjectProjectionSelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreObjectProjectionSelector)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerKnowledgeStoreObjectProjectionSelector(document.RootElement, options); + } + + internal static SearchIndexerKnowledgeStoreObjectProjectionSelector DeserializeSearchIndexerKnowledgeStoreObjectProjectionSelector(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string storageContainer = default; + string referenceKeyName = default; + string generatedKeyName = default; + string source = default; + string sourceContext = default; + IList inputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageContainer"u8)) + { + storageContainer = property.Value.GetString(); + continue; + } + if (property.NameEquals("referenceKeyName"u8)) + { + referenceKeyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("generatedKeyName"u8)) + { + generatedKeyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceContext"u8)) + { + sourceContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerKnowledgeStoreObjectProjectionSelector( + referenceKeyName, + generatedKeyName, + source, + sourceContext, + inputs ?? new ChangeTrackingList(), + serializedAdditionalRawData, + storageContainer); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreObjectProjectionSelector)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerKnowledgeStoreObjectProjectionSelector IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerKnowledgeStoreObjectProjectionSelector(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreObjectProjectionSelector)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new SearchIndexerKnowledgeStoreObjectProjectionSelector FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerKnowledgeStoreObjectProjectionSelector(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreObjectProjectionSelector.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreObjectProjectionSelector.cs new file mode 100644 index 000000000000..4448d180f062 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreObjectProjectionSelector.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Projection definition for what data to store in Azure Blob. + public partial class SearchIndexerKnowledgeStoreObjectProjectionSelector : SearchIndexerKnowledgeStoreBlobProjectionSelector + { + /// Initializes a new instance of . + /// Blob container to store projections in. + /// is null. + public SearchIndexerKnowledgeStoreObjectProjectionSelector(string storageContainer) : base(storageContainer) + { + Argument.AssertNotNull(storageContainer, nameof(storageContainer)); + } + + /// Initializes a new instance of . + /// Name of reference key to different projection. + /// Name of generated key to store projection under. + /// Source data to project. + /// Source context for complex projections. + /// Nested inputs for complex projections. + /// Keeps track of any properties unknown to the library. + /// Blob container to store projections in. + internal SearchIndexerKnowledgeStoreObjectProjectionSelector(string referenceKeyName, string generatedKeyName, string source, string sourceContext, IList inputs, IDictionary serializedAdditionalRawData, string storageContainer) : base(referenceKeyName, generatedKeyName, source, sourceContext, inputs, serializedAdditionalRawData, storageContainer) + { + } + + /// Initializes a new instance of for deserialization. + internal SearchIndexerKnowledgeStoreObjectProjectionSelector() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreProjection.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreProjection.Serialization.cs new file mode 100644 index 000000000000..d0be9d6e5ef2 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreProjection.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerKnowledgeStoreProjection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreProjection)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tables)) + { + writer.WritePropertyName("tables"u8); + writer.WriteStartArray(); + foreach (var item in Tables) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Objects)) + { + writer.WritePropertyName("objects"u8); + writer.WriteStartArray(); + foreach (var item in Objects) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Files)) + { + writer.WritePropertyName("files"u8); + writer.WriteStartArray(); + foreach (var item in Files) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchIndexerKnowledgeStoreProjection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreProjection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerKnowledgeStoreProjection(document.RootElement, options); + } + + internal static SearchIndexerKnowledgeStoreProjection DeserializeSearchIndexerKnowledgeStoreProjection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList tables = default; + IList objects = default; + IList files = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tables"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SearchIndexerKnowledgeStoreTableProjectionSelector.DeserializeSearchIndexerKnowledgeStoreTableProjectionSelector(item, options)); + } + tables = array; + continue; + } + if (property.NameEquals("objects"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SearchIndexerKnowledgeStoreObjectProjectionSelector.DeserializeSearchIndexerKnowledgeStoreObjectProjectionSelector(item, options)); + } + objects = array; + continue; + } + if (property.NameEquals("files"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SearchIndexerKnowledgeStoreFileProjectionSelector.DeserializeSearchIndexerKnowledgeStoreFileProjectionSelector(item, options)); + } + files = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerKnowledgeStoreProjection(tables ?? new ChangeTrackingList(), objects ?? new ChangeTrackingList(), files ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreProjection)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerKnowledgeStoreProjection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerKnowledgeStoreProjection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreProjection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndexerKnowledgeStoreProjection FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerKnowledgeStoreProjection(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreProjection.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreProjection.cs new file mode 100644 index 000000000000..8356de32f018 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreProjection.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Container object for various projection selectors. + public partial class SearchIndexerKnowledgeStoreProjection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SearchIndexerKnowledgeStoreProjection() + { + Tables = new ChangeTrackingList(); + Objects = new ChangeTrackingList(); + Files = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Projections to Azure Table storage. + /// Projections to Azure Blob storage. + /// Projections to Azure File storage. + /// Keeps track of any properties unknown to the library. + internal SearchIndexerKnowledgeStoreProjection(IList tables, IList objects, IList files, IDictionary serializedAdditionalRawData) + { + Tables = tables; + Objects = objects; + Files = files; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Projections to Azure Table storage. + public IList Tables { get; } + /// Projections to Azure Blob storage. + public IList Objects { get; } + /// Projections to Azure File storage. + public IList Files { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreProjectionSelector.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreProjectionSelector.Serialization.cs new file mode 100644 index 000000000000..2eee1a29871e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreProjectionSelector.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerKnowledgeStoreProjectionSelector : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreProjectionSelector)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ReferenceKeyName)) + { + writer.WritePropertyName("referenceKeyName"u8); + writer.WriteStringValue(ReferenceKeyName); + } + if (Optional.IsDefined(GeneratedKeyName)) + { + writer.WritePropertyName("generatedKeyName"u8); + writer.WriteStringValue(GeneratedKeyName); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + } + if (Optional.IsDefined(SourceContext)) + { + writer.WritePropertyName("sourceContext"u8); + writer.WriteStringValue(SourceContext); + } + if (Optional.IsCollectionDefined(Inputs)) + { + writer.WritePropertyName("inputs"u8); + writer.WriteStartArray(); + foreach (var item in Inputs) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchIndexerKnowledgeStoreProjectionSelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreProjectionSelector)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerKnowledgeStoreProjectionSelector(document.RootElement, options); + } + + internal static SearchIndexerKnowledgeStoreProjectionSelector DeserializeSearchIndexerKnowledgeStoreProjectionSelector(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string referenceKeyName = default; + string generatedKeyName = default; + string source = default; + string sourceContext = default; + IList inputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("referenceKeyName"u8)) + { + referenceKeyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("generatedKeyName"u8)) + { + generatedKeyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceContext"u8)) + { + sourceContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerKnowledgeStoreProjectionSelector( + referenceKeyName, + generatedKeyName, + source, + sourceContext, + inputs ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreProjectionSelector)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerKnowledgeStoreProjectionSelector IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerKnowledgeStoreProjectionSelector(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreProjectionSelector)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndexerKnowledgeStoreProjectionSelector FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerKnowledgeStoreProjectionSelector(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreProjectionSelector.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreProjectionSelector.cs new file mode 100644 index 000000000000..a8ff35e57050 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreProjectionSelector.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Abstract class to share properties between concrete selectors. + public partial class SearchIndexerKnowledgeStoreProjectionSelector + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SearchIndexerKnowledgeStoreProjectionSelector() + { + Inputs = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Name of reference key to different projection. + /// Name of generated key to store projection under. + /// Source data to project. + /// Source context for complex projections. + /// Nested inputs for complex projections. + /// Keeps track of any properties unknown to the library. + internal SearchIndexerKnowledgeStoreProjectionSelector(string referenceKeyName, string generatedKeyName, string source, string sourceContext, IList inputs, IDictionary serializedAdditionalRawData) + { + ReferenceKeyName = referenceKeyName; + GeneratedKeyName = generatedKeyName; + Source = source; + SourceContext = sourceContext; + Inputs = inputs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of reference key to different projection. + public string ReferenceKeyName { get; set; } + /// Name of generated key to store projection under. + public string GeneratedKeyName { get; set; } + /// Source data to project. + public string Source { get; set; } + /// Source context for complex projections. + public string SourceContext { get; set; } + /// Nested inputs for complex projections. + public IList Inputs { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreTableProjectionSelector.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreTableProjectionSelector.Serialization.cs new file mode 100644 index 000000000000..e5e42c1bb84e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreTableProjectionSelector.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerKnowledgeStoreTableProjectionSelector : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreTableProjectionSelector)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("tableName"u8); + writer.WriteStringValue(TableName); + } + + SearchIndexerKnowledgeStoreTableProjectionSelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreTableProjectionSelector)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerKnowledgeStoreTableProjectionSelector(document.RootElement, options); + } + + internal static SearchIndexerKnowledgeStoreTableProjectionSelector DeserializeSearchIndexerKnowledgeStoreTableProjectionSelector(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string tableName = default; + string referenceKeyName = default; + string generatedKeyName = default; + string source = default; + string sourceContext = default; + IList inputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tableName"u8)) + { + tableName = property.Value.GetString(); + continue; + } + if (property.NameEquals("referenceKeyName"u8)) + { + referenceKeyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("generatedKeyName"u8)) + { + generatedKeyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceContext"u8)) + { + sourceContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerKnowledgeStoreTableProjectionSelector( + referenceKeyName, + generatedKeyName, + source, + sourceContext, + inputs ?? new ChangeTrackingList(), + serializedAdditionalRawData, + tableName); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreTableProjectionSelector)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerKnowledgeStoreTableProjectionSelector IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerKnowledgeStoreTableProjectionSelector(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerKnowledgeStoreTableProjectionSelector)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new SearchIndexerKnowledgeStoreTableProjectionSelector FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerKnowledgeStoreTableProjectionSelector(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreTableProjectionSelector.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreTableProjectionSelector.cs new file mode 100644 index 000000000000..0aed056e8809 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerKnowledgeStoreTableProjectionSelector.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Description for what data to store in Azure Tables. + public partial class SearchIndexerKnowledgeStoreTableProjectionSelector : SearchIndexerKnowledgeStoreProjectionSelector + { + /// Initializes a new instance of . + /// Name of the Azure table to store projected data in. + /// is null. + public SearchIndexerKnowledgeStoreTableProjectionSelector(string tableName) + { + Argument.AssertNotNull(tableName, nameof(tableName)); + + TableName = tableName; + } + + /// Initializes a new instance of . + /// Name of reference key to different projection. + /// Name of generated key to store projection under. + /// Source data to project. + /// Source context for complex projections. + /// Nested inputs for complex projections. + /// Keeps track of any properties unknown to the library. + /// Name of the Azure table to store projected data in. + internal SearchIndexerKnowledgeStoreTableProjectionSelector(string referenceKeyName, string generatedKeyName, string source, string sourceContext, IList inputs, IDictionary serializedAdditionalRawData, string tableName) : base(referenceKeyName, generatedKeyName, source, sourceContext, inputs, serializedAdditionalRawData) + { + TableName = tableName; + } + + /// Initializes a new instance of for deserialization. + internal SearchIndexerKnowledgeStoreTableProjectionSelector() + { + } + + /// Name of the Azure table to store projected data in. + public string TableName { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerLimits.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerLimits.Serialization.cs new file mode 100644 index 000000000000..2c4d50e4f2ff --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerLimits.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerLimits : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerLimits)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MaxRunTime)) + { + writer.WritePropertyName("maxRunTime"u8); + writer.WriteStringValue(MaxRunTime.Value, "P"); + } + if (Optional.IsDefined(MaxDocumentExtractionSize)) + { + writer.WritePropertyName("maxDocumentExtractionSize"u8); + writer.WriteNumberValue(MaxDocumentExtractionSize.Value); + } + if (Optional.IsDefined(MaxDocumentContentCharactersToExtract)) + { + writer.WritePropertyName("maxDocumentContentCharactersToExtract"u8); + writer.WriteNumberValue(MaxDocumentContentCharactersToExtract.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchIndexerLimits IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerLimits)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerLimits(document.RootElement, options); + } + + internal static SearchIndexerLimits DeserializeSearchIndexerLimits(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TimeSpan? maxRunTime = default; + long? maxDocumentExtractionSize = default; + long? maxDocumentContentCharactersToExtract = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxRunTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxRunTime = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("maxDocumentExtractionSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxDocumentExtractionSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("maxDocumentContentCharactersToExtract"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxDocumentContentCharactersToExtract = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerLimits(maxRunTime, maxDocumentExtractionSize, maxDocumentContentCharactersToExtract, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerLimits)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerLimits IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerLimits(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerLimits)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndexerLimits FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerLimits(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerLimits.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerLimits.cs new file mode 100644 index 000000000000..7972cfa23f7f --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerLimits.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents the limits that can be applied to an indexer. + public partial class SearchIndexerLimits + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SearchIndexerLimits() + { + } + + /// Initializes a new instance of . + /// The maximum duration that the indexer is permitted to run for one execution. + /// + /// The maximum size of a document, in bytes, which will be considered valid for + /// indexing. + /// + /// + /// The maximum number of characters that will be extracted from a document picked + /// up for indexing. + /// + /// Keeps track of any properties unknown to the library. + internal SearchIndexerLimits(TimeSpan? maxRunTime, long? maxDocumentExtractionSize, long? maxDocumentContentCharactersToExtract, IDictionary serializedAdditionalRawData) + { + MaxRunTime = maxRunTime; + MaxDocumentExtractionSize = maxDocumentExtractionSize; + MaxDocumentContentCharactersToExtract = maxDocumentContentCharactersToExtract; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The maximum duration that the indexer is permitted to run for one execution. + public TimeSpan? MaxRunTime { get; } + /// + /// The maximum size of a document, in bytes, which will be considered valid for + /// indexing. + /// + public long? MaxDocumentExtractionSize { get; } + /// + /// The maximum number of characters that will be extracted from a document picked + /// up for indexing. + /// + public long? MaxDocumentContentCharactersToExtract { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerSkill.Serialization.cs new file mode 100644 index 000000000000..b16b2222503e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerSkill.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + [PersistableModelProxy(typeof(UnknownSearchIndexerSkill))] + public partial class SearchIndexerSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerSkill)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("@odata.type"u8); + writer.WriteStringValue(OdataType); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Context)) + { + writer.WritePropertyName("context"u8); + writer.WriteStringValue(Context); + } + writer.WritePropertyName("inputs"u8); + writer.WriteStartArray(); + foreach (var item in Inputs) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("outputs"u8); + writer.WriteStartArray(); + foreach (var item in Outputs) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchIndexerSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerSkill(document.RootElement, options); + } + + internal static SearchIndexerSkill DeserializeSearchIndexerSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("@odata.type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "#Microsoft.Skills.Custom.WebApiSkill": return WebApiSkill.DeserializeWebApiSkill(element, options); + case "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill": return AzureOpenAIEmbeddingSkill.DeserializeAzureOpenAIEmbeddingSkill(element, options); + case "#Microsoft.Skills.Text.CustomEntityLookupSkill": return CustomEntityLookupSkill.DeserializeCustomEntityLookupSkill(element, options); + case "#Microsoft.Skills.Text.EntityRecognitionSkill": return EntityRecognitionSkill.DeserializeEntityRecognitionSkill(element, options); + case "#Microsoft.Skills.Text.KeyPhraseExtractionSkill": return KeyPhraseExtractionSkill.DeserializeKeyPhraseExtractionSkill(element, options); + case "#Microsoft.Skills.Text.LanguageDetectionSkill": return LanguageDetectionSkill.DeserializeLanguageDetectionSkill(element, options); + case "#Microsoft.Skills.Text.MergeSkill": return MergeSkill.DeserializeMergeSkill(element, options); + case "#Microsoft.Skills.Text.PIIDetectionSkill": return PIIDetectionSkill.DeserializePIIDetectionSkill(element, options); + case "#Microsoft.Skills.Text.SentimentSkill": return SentimentSkill.DeserializeSentimentSkill(element, options); + case "#Microsoft.Skills.Text.SplitSkill": return SplitSkill.DeserializeSplitSkill(element, options); + case "#Microsoft.Skills.Text.TranslationSkill": return TextTranslationSkill.DeserializeTextTranslationSkill(element, options); + case "#Microsoft.Skills.Text.V3.EntityLinkingSkill": return EntityLinkingSkill.DeserializeEntityLinkingSkill(element, options); + case "#Microsoft.Skills.Text.V3.EntityRecognitionSkill": return EntityRecognitionSkillV3.DeserializeEntityRecognitionSkillV3(element, options); + case "#Microsoft.Skills.Text.V3.SentimentSkill": return SentimentSkillV3.DeserializeSentimentSkillV3(element, options); + case "#Microsoft.Skills.Util.ConditionalSkill": return ConditionalSkill.DeserializeConditionalSkill(element, options); + case "#Microsoft.Skills.Util.DocumentExtractionSkill": return DocumentExtractionSkill.DeserializeDocumentExtractionSkill(element, options); + case "#Microsoft.Skills.Util.ShaperSkill": return ShaperSkill.DeserializeShaperSkill(element, options); + case "#Microsoft.Skills.Vision.ImageAnalysisSkill": return ImageAnalysisSkill.DeserializeImageAnalysisSkill(element, options); + case "#Microsoft.Skills.Vision.OcrSkill": return OcrSkill.DeserializeOcrSkill(element, options); + } + } + return UnknownSearchIndexerSkill.DeserializeUnknownSearchIndexerSkill(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerSkill)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndexerSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerSkill(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerSkill.cs new file mode 100644 index 000000000000..4609500c8026 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerSkill.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Base type for skills. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , , , , , , , , , , and . + /// + public abstract partial class SearchIndexerSkill + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + protected SearchIndexerSkill(IEnumerable inputs, IEnumerable outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + Inputs = inputs.ToList(); + Outputs = outputs.ToList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + internal SearchIndexerSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData) + { + OdataType = odataType; + Name = name; + Description = description; + Context = context; + Inputs = inputs; + Outputs = outputs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchIndexerSkill() + { + } + + /// The discriminator for derived types. + internal string OdataType { get; set; } + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + public string Name { get; set; } + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + public string Description { get; set; } + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + public string Context { get; set; } + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + public IList Inputs { get; } + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + public IList Outputs { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerSkillset.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerSkillset.Serialization.cs new file mode 100644 index 000000000000..2309916730de --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerSkillset.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerSkillset : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerSkillset)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("skills"u8); + writer.WriteStartArray(); + foreach (var item in Skills) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(CognitiveServices)) + { + writer.WritePropertyName("cognitiveServices"u8); + writer.WriteObjectValue(CognitiveServices, options); + } + if (Optional.IsDefined(KnowledgeStore)) + { + writer.WritePropertyName("knowledgeStore"u8); + writer.WriteObjectValue(KnowledgeStore, options); + } + if (Optional.IsDefined(IndexProjections)) + { + writer.WritePropertyName("indexProjections"u8); + writer.WriteObjectValue(IndexProjections, options); + } + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("@odata.etag"u8); + writer.WriteStringValue(ETag); + } + if (Optional.IsDefined(EncryptionKey)) + { + writer.WritePropertyName("encryptionKey"u8); + writer.WriteObjectValue(EncryptionKey, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchIndexerSkillset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerSkillset)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerSkillset(document.RootElement, options); + } + + internal static SearchIndexerSkillset DeserializeSearchIndexerSkillset(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string description = default; + IList skills = default; + CognitiveServicesAccount cognitiveServices = default; + SearchIndexerKnowledgeStore knowledgeStore = default; + SearchIndexerIndexProjection indexProjections = default; + string odataEtag = default; + SearchResourceEncryptionKey encryptionKey = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("skills"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SearchIndexerSkill.DeserializeSearchIndexerSkill(item, options)); + } + skills = array; + continue; + } + if (property.NameEquals("cognitiveServices"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cognitiveServices = CognitiveServicesAccount.DeserializeCognitiveServicesAccount(property.Value, options); + continue; + } + if (property.NameEquals("knowledgeStore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + knowledgeStore = SearchIndexerKnowledgeStore.DeserializeSearchIndexerKnowledgeStore(property.Value, options); + continue; + } + if (property.NameEquals("indexProjections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + indexProjections = SearchIndexerIndexProjection.DeserializeSearchIndexerIndexProjection(property.Value, options); + continue; + } + if (property.NameEquals("@odata.etag"u8)) + { + odataEtag = property.Value.GetString(); + continue; + } + if (property.NameEquals("encryptionKey"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryptionKey = SearchResourceEncryptionKey.DeserializeSearchResourceEncryptionKey(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerSkillset( + name, + description, + skills, + cognitiveServices, + knowledgeStore, + indexProjections, + odataEtag, + encryptionKey, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerSkillset)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerSkillset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerSkillset(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerSkillset)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndexerSkillset FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerSkillset(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerSkillset.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerSkillset.cs new file mode 100644 index 000000000000..cce14d0cf22c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerSkillset.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// A list of skills. + public partial class SearchIndexerSkillset + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the skillset. + /// + /// A list of skills in the skillset. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , , , , , , , , , , and . + /// + /// or is null. + public SearchIndexerSkillset(string name, IEnumerable skills) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(skills, nameof(skills)); + + Name = name; + Skills = skills.ToList(); + } + + /// Initializes a new instance of . + /// The name of the skillset. + /// The description of the skillset. + /// + /// A list of skills in the skillset. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , , , , , , , , , , and . + /// + /// + /// Details about the Azure AI service to be used when running skills. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// + /// Definition of additional projections to Azure blob, table, or files, of + /// enriched data. + /// + /// Definition of additional projections to secondary search index(es). + /// The ETag of the skillset. + /// + /// A description of an encryption key that you create in Azure Key Vault. This key + /// is used to provide an additional level of encryption-at-rest for your skillset + /// definition when you want full assurance that no one, not even Microsoft, can + /// decrypt your skillset definition. Once you have encrypted your skillset + /// definition, it will always remain encrypted. The search service will ignore + /// attempts to set this property to null. You can change this property as needed + /// if you want to rotate your encryption key; Your skillset definition will be + /// unaffected. Encryption with customer-managed keys is not available for free + /// search services, and is only available for paid services created on or after + /// January 1, 2019. + /// + /// Keeps track of any properties unknown to the library. + internal SearchIndexerSkillset(string name, string description, IList skills, CognitiveServicesAccount cognitiveServices, SearchIndexerKnowledgeStore knowledgeStore, SearchIndexerIndexProjection indexProjections, string eTag, SearchResourceEncryptionKey encryptionKey, IDictionary serializedAdditionalRawData) + { + Name = name; + Description = description; + Skills = skills; + CognitiveServices = cognitiveServices; + KnowledgeStore = knowledgeStore; + IndexProjections = indexProjections; + ETag = eTag; + EncryptionKey = encryptionKey; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchIndexerSkillset() + { + } + + /// The name of the skillset. + public string Name { get; set; } + /// The description of the skillset. + public string Description { get; set; } + /// + /// A list of skills in the skillset. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , , , , , , , , , , and . + /// + public IList Skills { get; } + /// + /// Details about the Azure AI service to be used when running skills. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public CognitiveServicesAccount CognitiveServices { get; set; } + /// + /// Definition of additional projections to Azure blob, table, or files, of + /// enriched data. + /// + public SearchIndexerKnowledgeStore KnowledgeStore { get; set; } + /// Definition of additional projections to secondary search index(es). + public SearchIndexerIndexProjection IndexProjections { get; set; } + /// The ETag of the skillset. + public string ETag { get; set; } + /// + /// A description of an encryption key that you create in Azure Key Vault. This key + /// is used to provide an additional level of encryption-at-rest for your skillset + /// definition when you want full assurance that no one, not even Microsoft, can + /// decrypt your skillset definition. Once you have encrypted your skillset + /// definition, it will always remain encrypted. The search service will ignore + /// attempts to set this property to null. You can change this property as needed + /// if you want to rotate your encryption key; Your skillset definition will be + /// unaffected. Encryption with customer-managed keys is not available for free + /// search services, and is only available for paid services created on or after + /// January 1, 2019. + /// + public SearchResourceEncryptionKey EncryptionKey { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerStatus.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerStatus.Serialization.cs new file mode 100644 index 000000000000..14a0c5007de1 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerStatus.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerStatus)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsDefined(LastResult)) + { + writer.WritePropertyName("lastResult"u8); + writer.WriteObjectValue(LastResult, options); + } + writer.WritePropertyName("executionHistory"u8); + writer.WriteStartArray(); + foreach (var item in ExecutionHistory) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("limits"u8); + writer.WriteObjectValue(Limits, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchIndexerStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerStatus(document.RootElement, options); + } + + internal static SearchIndexerStatus DeserializeSearchIndexerStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IndexerStatus status = default; + IndexerExecutionResult lastResult = default; + IReadOnlyList executionHistory = default; + SearchIndexerLimits limits = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + status = new IndexerStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("lastResult"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastResult = IndexerExecutionResult.DeserializeIndexerExecutionResult(property.Value, options); + continue; + } + if (property.NameEquals("executionHistory"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IndexerExecutionResult.DeserializeIndexerExecutionResult(item, options)); + } + executionHistory = array; + continue; + } + if (property.NameEquals("limits"u8)) + { + limits = SearchIndexerLimits.DeserializeSearchIndexerLimits(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerStatus(status, lastResult, executionHistory, limits, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerStatus)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndexerStatus FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerStatus(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerStatus.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerStatus.cs new file mode 100644 index 000000000000..42c757cb61c2 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerStatus.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents the current status and execution history of an indexer. + public partial class SearchIndexerStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Overall indexer status. + /// History of the recent indexer executions, sorted in reverse chronological order. + /// The execution limits for the indexer. + /// or is null. + internal SearchIndexerStatus(IndexerStatus status, IEnumerable executionHistory, SearchIndexerLimits limits) + { + Argument.AssertNotNull(executionHistory, nameof(executionHistory)); + Argument.AssertNotNull(limits, nameof(limits)); + + Status = status; + ExecutionHistory = executionHistory.ToList(); + Limits = limits; + } + + /// Initializes a new instance of . + /// Overall indexer status. + /// The result of the most recent or an in-progress indexer execution. + /// History of the recent indexer executions, sorted in reverse chronological order. + /// The execution limits for the indexer. + /// Keeps track of any properties unknown to the library. + internal SearchIndexerStatus(IndexerStatus status, IndexerExecutionResult lastResult, IReadOnlyList executionHistory, SearchIndexerLimits limits, IDictionary serializedAdditionalRawData) + { + Status = status; + LastResult = lastResult; + ExecutionHistory = executionHistory; + Limits = limits; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchIndexerStatus() + { + } + + /// Overall indexer status. + public IndexerStatus Status { get; } + /// The result of the most recent or an in-progress indexer execution. + public IndexerExecutionResult LastResult { get; } + /// History of the recent indexer executions, sorted in reverse chronological order. + public IReadOnlyList ExecutionHistory { get; } + /// The execution limits for the indexer. + public SearchIndexerLimits Limits { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerWarning.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerWarning.Serialization.cs new file mode 100644 index 000000000000..ef234178421b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerWarning.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchIndexerWarning : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerWarning)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Key)) + { + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteStringValue(Details); + } + if (Optional.IsDefined(DocumentationLink)) + { + writer.WritePropertyName("documentationLink"u8); + writer.WriteStringValue(DocumentationLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchIndexerWarning IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerWarning)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerWarning(document.RootElement, options); + } + + internal static SearchIndexerWarning DeserializeSearchIndexerWarning(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + string message = default; + string name = default; + string details = default; + string documentationLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + details = property.Value.GetString(); + continue; + } + if (property.NameEquals("documentationLink"u8)) + { + documentationLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchIndexerWarning( + key, + message, + name, + details, + documentationLink, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerWarning)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerWarning IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerWarning(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerWarning)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchIndexerWarning FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerWarning(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerWarning.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerWarning.cs new file mode 100644 index 000000000000..aae1794c0a49 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchIndexerWarning.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents an item-level warning. + public partial class SearchIndexerWarning + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The message describing the warning that occurred while processing the item. + /// is null. + internal SearchIndexerWarning(string message) + { + Argument.AssertNotNull(message, nameof(message)); + + Message = message; + } + + /// Initializes a new instance of . + /// The key of the item which generated a warning. + /// The message describing the warning that occurred while processing the item. + /// + /// The name of the source at which the warning originated. For example, this could + /// refer to a particular skill in the attached skillset. This may not be always + /// available. + /// + /// + /// Additional, verbose details about the warning to assist in debugging the + /// indexer. This may not be always available. + /// + /// + /// A link to a troubleshooting guide for these classes of warnings. This may not + /// be always available. + /// + /// Keeps track of any properties unknown to the library. + internal SearchIndexerWarning(string key, string message, string name, string details, string documentationLink, IDictionary serializedAdditionalRawData) + { + Key = key; + Message = message; + Name = name; + Details = details; + DocumentationLink = documentationLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchIndexerWarning() + { + } + + /// The key of the item which generated a warning. + public string Key { get; } + /// The message describing the warning that occurred while processing the item. + public string Message { get; } + /// + /// The name of the source at which the warning originated. For example, this could + /// refer to a particular skill in the attached skillset. This may not be always + /// available. + /// + public string Name { get; } + /// + /// Additional, verbose details about the warning to assist in debugging the + /// indexer. This may not be always available. + /// + public string Details { get; } + /// + /// A link to a troubleshooting guide for these classes of warnings. This may not + /// be always available. + /// + public string DocumentationLink { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchResourceEncryptionKey.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchResourceEncryptionKey.Serialization.cs new file mode 100644 index 000000000000..57b8363dacc8 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchResourceEncryptionKey.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchResourceEncryptionKey : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchResourceEncryptionKey)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("keyVaultKeyName"u8); + writer.WriteStringValue(KeyVaultKeyName); + writer.WritePropertyName("keyVaultKeyVersion"u8); + writer.WriteStringValue(KeyVaultKeyVersion); + writer.WritePropertyName("keyVaultUri"u8); + writer.WriteStringValue(KeyVaultUri); + if (Optional.IsDefined(AccessCredentials)) + { + writer.WritePropertyName("accessCredentials"u8); + writer.WriteObjectValue(AccessCredentials, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchResourceEncryptionKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchResourceEncryptionKey)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchResourceEncryptionKey(document.RootElement, options); + } + + internal static SearchResourceEncryptionKey DeserializeSearchResourceEncryptionKey(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string keyVaultKeyName = default; + string keyVaultKeyVersion = default; + string keyVaultUri = default; + AzureActiveDirectoryApplicationCredentials accessCredentials = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyVaultKeyName"u8)) + { + keyVaultKeyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("keyVaultKeyVersion"u8)) + { + keyVaultKeyVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("keyVaultUri"u8)) + { + keyVaultUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("accessCredentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + accessCredentials = AzureActiveDirectoryApplicationCredentials.DeserializeAzureActiveDirectoryApplicationCredentials(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchResourceEncryptionKey(keyVaultKeyName, keyVaultKeyVersion, keyVaultUri, accessCredentials, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchResourceEncryptionKey)} does not support writing '{options.Format}' format."); + } + } + + SearchResourceEncryptionKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchResourceEncryptionKey(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchResourceEncryptionKey)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchResourceEncryptionKey FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchResourceEncryptionKey(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchResourceEncryptionKey.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchResourceEncryptionKey.cs new file mode 100644 index 000000000000..78ef9e110bc6 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchResourceEncryptionKey.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// A customer-managed encryption key in Azure Key Vault. Keys that you create and + /// manage can be used to encrypt or decrypt data-at-rest, such as indexes and + /// synonym maps. + /// + public partial class SearchResourceEncryptionKey + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of your Azure Key Vault key to be used to encrypt your data at rest. + /// The version of your Azure Key Vault key to be used to encrypt your data at rest. + /// + /// The URI of your Azure Key Vault, also referred to as DNS name, that contains + /// the key to be used to encrypt your data at rest. An example URI might be + /// `https://my-keyvault-name.vault.azure.net`. + /// + /// , or is null. + public SearchResourceEncryptionKey(string keyVaultKeyName, string keyVaultKeyVersion, string keyVaultUri) + { + Argument.AssertNotNull(keyVaultKeyName, nameof(keyVaultKeyName)); + Argument.AssertNotNull(keyVaultKeyVersion, nameof(keyVaultKeyVersion)); + Argument.AssertNotNull(keyVaultUri, nameof(keyVaultUri)); + + KeyVaultKeyName = keyVaultKeyName; + KeyVaultKeyVersion = keyVaultKeyVersion; + KeyVaultUri = keyVaultUri; + } + + /// Initializes a new instance of . + /// The name of your Azure Key Vault key to be used to encrypt your data at rest. + /// The version of your Azure Key Vault key to be used to encrypt your data at rest. + /// + /// The URI of your Azure Key Vault, also referred to as DNS name, that contains + /// the key to be used to encrypt your data at rest. An example URI might be + /// `https://my-keyvault-name.vault.azure.net`. + /// + /// + /// Optional Azure Active Directory credentials used for accessing your Azure Key + /// Vault. Not required if using managed identity instead. + /// + /// Keeps track of any properties unknown to the library. + internal SearchResourceEncryptionKey(string keyVaultKeyName, string keyVaultKeyVersion, string keyVaultUri, AzureActiveDirectoryApplicationCredentials accessCredentials, IDictionary serializedAdditionalRawData) + { + KeyVaultKeyName = keyVaultKeyName; + KeyVaultKeyVersion = keyVaultKeyVersion; + KeyVaultUri = keyVaultUri; + AccessCredentials = accessCredentials; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchResourceEncryptionKey() + { + } + + /// The name of your Azure Key Vault key to be used to encrypt your data at rest. + public string KeyVaultKeyName { get; set; } + /// The version of your Azure Key Vault key to be used to encrypt your data at rest. + public string KeyVaultKeyVersion { get; set; } + /// + /// The URI of your Azure Key Vault, also referred to as DNS name, that contains + /// the key to be used to encrypt your data at rest. An example URI might be + /// `https://my-keyvault-name.vault.azure.net`. + /// + public string KeyVaultUri { get; set; } + /// + /// Optional Azure Active Directory credentials used for accessing your Azure Key + /// Vault. Not required if using managed identity instead. + /// + public AzureActiveDirectoryApplicationCredentials AccessCredentials { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceCounters.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceCounters.Serialization.cs new file mode 100644 index 000000000000..7025985341c9 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceCounters.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchServiceCounters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchServiceCounters)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("documentCount"u8); + writer.WriteObjectValue(DocumentCount, options); + writer.WritePropertyName("indexesCount"u8); + writer.WriteObjectValue(IndexesCount, options); + writer.WritePropertyName("indexersCount"u8); + writer.WriteObjectValue(IndexersCount, options); + writer.WritePropertyName("dataSourcesCount"u8); + writer.WriteObjectValue(DataSourcesCount, options); + writer.WritePropertyName("storageSize"u8); + writer.WriteObjectValue(StorageSize, options); + writer.WritePropertyName("synonymMaps"u8); + writer.WriteObjectValue(SynonymMaps, options); + writer.WritePropertyName("skillsetCount"u8); + writer.WriteObjectValue(SkillsetCount, options); + writer.WritePropertyName("vectorIndexSize"u8); + writer.WriteObjectValue(VectorIndexSize, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchServiceCounters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchServiceCounters)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchServiceCounters(document.RootElement, options); + } + + internal static SearchServiceCounters DeserializeSearchServiceCounters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceCounter documentCount = default; + ResourceCounter indexesCount = default; + ResourceCounter indexersCount = default; + ResourceCounter dataSourcesCount = default; + ResourceCounter storageSize = default; + ResourceCounter synonymMaps = default; + ResourceCounter skillsetCount = default; + ResourceCounter vectorIndexSize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("documentCount"u8)) + { + documentCount = ResourceCounter.DeserializeResourceCounter(property.Value, options); + continue; + } + if (property.NameEquals("indexesCount"u8)) + { + indexesCount = ResourceCounter.DeserializeResourceCounter(property.Value, options); + continue; + } + if (property.NameEquals("indexersCount"u8)) + { + indexersCount = ResourceCounter.DeserializeResourceCounter(property.Value, options); + continue; + } + if (property.NameEquals("dataSourcesCount"u8)) + { + dataSourcesCount = ResourceCounter.DeserializeResourceCounter(property.Value, options); + continue; + } + if (property.NameEquals("storageSize"u8)) + { + storageSize = ResourceCounter.DeserializeResourceCounter(property.Value, options); + continue; + } + if (property.NameEquals("synonymMaps"u8)) + { + synonymMaps = ResourceCounter.DeserializeResourceCounter(property.Value, options); + continue; + } + if (property.NameEquals("skillsetCount"u8)) + { + skillsetCount = ResourceCounter.DeserializeResourceCounter(property.Value, options); + continue; + } + if (property.NameEquals("vectorIndexSize"u8)) + { + vectorIndexSize = ResourceCounter.DeserializeResourceCounter(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchServiceCounters( + documentCount, + indexesCount, + indexersCount, + dataSourcesCount, + storageSize, + synonymMaps, + skillsetCount, + vectorIndexSize, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchServiceCounters)} does not support writing '{options.Format}' format."); + } + } + + SearchServiceCounters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchServiceCounters(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchServiceCounters)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchServiceCounters FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchServiceCounters(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceCounters.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceCounters.cs new file mode 100644 index 000000000000..36790fb3ab81 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceCounters.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents service-level resource counters and quotas. + public partial class SearchServiceCounters + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Total number of documents across all indexes in the service. + /// Total number of indexes. + /// Total number of indexers. + /// Total number of data sources. + /// Total size of used storage in bytes. + /// Total number of synonym maps. + /// Total number of skillsets. + /// Total memory consumption of all vector indexes within the service, in bytes. + /// , , , , , , or is null. + internal SearchServiceCounters(ResourceCounter documentCount, ResourceCounter indexesCount, ResourceCounter indexersCount, ResourceCounter dataSourcesCount, ResourceCounter storageSize, ResourceCounter synonymMaps, ResourceCounter skillsetCount, ResourceCounter vectorIndexSize) + { + Argument.AssertNotNull(documentCount, nameof(documentCount)); + Argument.AssertNotNull(indexesCount, nameof(indexesCount)); + Argument.AssertNotNull(indexersCount, nameof(indexersCount)); + Argument.AssertNotNull(dataSourcesCount, nameof(dataSourcesCount)); + Argument.AssertNotNull(storageSize, nameof(storageSize)); + Argument.AssertNotNull(synonymMaps, nameof(synonymMaps)); + Argument.AssertNotNull(skillsetCount, nameof(skillsetCount)); + Argument.AssertNotNull(vectorIndexSize, nameof(vectorIndexSize)); + + DocumentCount = documentCount; + IndexesCount = indexesCount; + IndexersCount = indexersCount; + DataSourcesCount = dataSourcesCount; + StorageSize = storageSize; + SynonymMaps = synonymMaps; + SkillsetCount = skillsetCount; + VectorIndexSize = vectorIndexSize; + } + + /// Initializes a new instance of . + /// Total number of documents across all indexes in the service. + /// Total number of indexes. + /// Total number of indexers. + /// Total number of data sources. + /// Total size of used storage in bytes. + /// Total number of synonym maps. + /// Total number of skillsets. + /// Total memory consumption of all vector indexes within the service, in bytes. + /// Keeps track of any properties unknown to the library. + internal SearchServiceCounters(ResourceCounter documentCount, ResourceCounter indexesCount, ResourceCounter indexersCount, ResourceCounter dataSourcesCount, ResourceCounter storageSize, ResourceCounter synonymMaps, ResourceCounter skillsetCount, ResourceCounter vectorIndexSize, IDictionary serializedAdditionalRawData) + { + DocumentCount = documentCount; + IndexesCount = indexesCount; + IndexersCount = indexersCount; + DataSourcesCount = dataSourcesCount; + StorageSize = storageSize; + SynonymMaps = synonymMaps; + SkillsetCount = skillsetCount; + VectorIndexSize = vectorIndexSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchServiceCounters() + { + } + + /// Total number of documents across all indexes in the service. + public ResourceCounter DocumentCount { get; } + /// Total number of indexes. + public ResourceCounter IndexesCount { get; } + /// Total number of indexers. + public ResourceCounter IndexersCount { get; } + /// Total number of data sources. + public ResourceCounter DataSourcesCount { get; } + /// Total size of used storage in bytes. + public ResourceCounter StorageSize { get; } + /// Total number of synonym maps. + public ResourceCounter SynonymMaps { get; } + /// Total number of skillsets. + public ResourceCounter SkillsetCount { get; } + /// Total memory consumption of all vector indexes within the service, in bytes. + public ResourceCounter VectorIndexSize { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceLimits.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceLimits.Serialization.cs new file mode 100644 index 000000000000..ebf9ce865e4c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceLimits.Serialization.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchServiceLimits : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchServiceLimits)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MaxFieldsPerIndex)) + { + writer.WritePropertyName("maxFieldsPerIndex"u8); + writer.WriteNumberValue(MaxFieldsPerIndex.Value); + } + if (Optional.IsDefined(MaxFieldNestingDepthPerIndex)) + { + writer.WritePropertyName("maxFieldNestingDepthPerIndex"u8); + writer.WriteNumberValue(MaxFieldNestingDepthPerIndex.Value); + } + if (Optional.IsDefined(MaxComplexCollectionFieldsPerIndex)) + { + writer.WritePropertyName("maxComplexCollectionFieldsPerIndex"u8); + writer.WriteNumberValue(MaxComplexCollectionFieldsPerIndex.Value); + } + if (Optional.IsDefined(MaxComplexObjectsInCollectionsPerDocument)) + { + writer.WritePropertyName("maxComplexObjectsInCollectionsPerDocument"u8); + writer.WriteNumberValue(MaxComplexObjectsInCollectionsPerDocument.Value); + } + if (Optional.IsDefined(MaxStoragePerIndex)) + { + writer.WritePropertyName("maxStoragePerIndex"u8); + writer.WriteNumberValue(MaxStoragePerIndex.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchServiceLimits IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchServiceLimits)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchServiceLimits(document.RootElement, options); + } + + internal static SearchServiceLimits DeserializeSearchServiceLimits(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxFieldsPerIndex = default; + int? maxFieldNestingDepthPerIndex = default; + int? maxComplexCollectionFieldsPerIndex = default; + int? maxComplexObjectsInCollectionsPerDocument = default; + long? maxStoragePerIndex = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxFieldsPerIndex"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxFieldsPerIndex = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxFieldNestingDepthPerIndex"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxFieldNestingDepthPerIndex = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxComplexCollectionFieldsPerIndex"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxComplexCollectionFieldsPerIndex = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxComplexObjectsInCollectionsPerDocument"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxComplexObjectsInCollectionsPerDocument = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxStoragePerIndex"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxStoragePerIndex = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchServiceLimits( + maxFieldsPerIndex, + maxFieldNestingDepthPerIndex, + maxComplexCollectionFieldsPerIndex, + maxComplexObjectsInCollectionsPerDocument, + maxStoragePerIndex, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchServiceLimits)} does not support writing '{options.Format}' format."); + } + } + + SearchServiceLimits IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchServiceLimits(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchServiceLimits)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchServiceLimits FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchServiceLimits(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceLimits.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceLimits.cs new file mode 100644 index 000000000000..2862da463701 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceLimits.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents various service level limits. + public partial class SearchServiceLimits + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SearchServiceLimits() + { + } + + /// Initializes a new instance of . + /// The maximum allowed fields per index. + /// + /// The maximum depth which you can nest sub-fields in an index, including the + /// top-level complex field. For example, a/b/c has a nesting depth of 3. + /// + /// + /// The maximum number of fields of type Collection(Edm.ComplexType) allowed in an + /// index. + /// + /// The maximum number of objects in complex collections allowed per document. + /// The maximum amount of storage in bytes allowed per index. + /// Keeps track of any properties unknown to the library. + internal SearchServiceLimits(int? maxFieldsPerIndex, int? maxFieldNestingDepthPerIndex, int? maxComplexCollectionFieldsPerIndex, int? maxComplexObjectsInCollectionsPerDocument, long? maxStoragePerIndex, IDictionary serializedAdditionalRawData) + { + MaxFieldsPerIndex = maxFieldsPerIndex; + MaxFieldNestingDepthPerIndex = maxFieldNestingDepthPerIndex; + MaxComplexCollectionFieldsPerIndex = maxComplexCollectionFieldsPerIndex; + MaxComplexObjectsInCollectionsPerDocument = maxComplexObjectsInCollectionsPerDocument; + MaxStoragePerIndex = maxStoragePerIndex; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The maximum allowed fields per index. + public int? MaxFieldsPerIndex { get; } + /// + /// The maximum depth which you can nest sub-fields in an index, including the + /// top-level complex field. For example, a/b/c has a nesting depth of 3. + /// + public int? MaxFieldNestingDepthPerIndex { get; } + /// + /// The maximum number of fields of type Collection(Edm.ComplexType) allowed in an + /// index. + /// + public int? MaxComplexCollectionFieldsPerIndex { get; } + /// The maximum number of objects in complex collections allowed per document. + public int? MaxComplexObjectsInCollectionsPerDocument { get; } + /// The maximum amount of storage in bytes allowed per index. + public long? MaxStoragePerIndex { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceStatistics.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceStatistics.Serialization.cs new file mode 100644 index 000000000000..3b372eafe880 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceStatistics.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchServiceStatistics : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchServiceStatistics)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("counters"u8); + writer.WriteObjectValue(Counters, options); + writer.WritePropertyName("limits"u8); + writer.WriteObjectValue(Limits, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchServiceStatistics IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchServiceStatistics)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchServiceStatistics(document.RootElement, options); + } + + internal static SearchServiceStatistics DeserializeSearchServiceStatistics(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SearchServiceCounters counters = default; + SearchServiceLimits limits = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("counters"u8)) + { + counters = SearchServiceCounters.DeserializeSearchServiceCounters(property.Value, options); + continue; + } + if (property.NameEquals("limits"u8)) + { + limits = SearchServiceLimits.DeserializeSearchServiceLimits(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchServiceStatistics(counters, limits, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchServiceStatistics)} does not support writing '{options.Format}' format."); + } + } + + SearchServiceStatistics IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchServiceStatistics(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchServiceStatistics)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchServiceStatistics FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchServiceStatistics(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceStatistics.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceStatistics.cs new file mode 100644 index 000000000000..e3ef180fc73e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchServiceStatistics.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Response from a get service statistics request. If successful, it includes + /// service level counters and limits. + /// + public partial class SearchServiceStatistics + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Service level resource counters. + /// Service level general limits. + /// or is null. + internal SearchServiceStatistics(SearchServiceCounters counters, SearchServiceLimits limits) + { + Argument.AssertNotNull(counters, nameof(counters)); + Argument.AssertNotNull(limits, nameof(limits)); + + Counters = counters; + Limits = limits; + } + + /// Initializes a new instance of . + /// Service level resource counters. + /// Service level general limits. + /// Keeps track of any properties unknown to the library. + internal SearchServiceStatistics(SearchServiceCounters counters, SearchServiceLimits limits, IDictionary serializedAdditionalRawData) + { + Counters = counters; + Limits = limits; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchServiceStatistics() + { + } + + /// Service level resource counters. + public SearchServiceCounters Counters { get; } + /// Service level general limits. + public SearchServiceLimits Limits { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchSuggester.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchSuggester.Serialization.cs new file mode 100644 index 000000000000..e4f30739e1c4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchSuggester.Serialization.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SearchSuggester : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchSuggester)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("searchMode"u8); + writer.WriteStringValue(SearchMode.ToString()); + writer.WritePropertyName("sourceFields"u8); + writer.WriteStartArray(); + foreach (var item in SourceFields) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchSuggester IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchSuggester)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchSuggester(document.RootElement, options); + } + + internal static SearchSuggester DeserializeSearchSuggester(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + SearchSuggesterSearchMode searchMode = default; + IList sourceFields = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("searchMode"u8)) + { + searchMode = new SearchSuggesterSearchMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceFields"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sourceFields = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchSuggester(name, searchMode, sourceFields, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchSuggester)} does not support writing '{options.Format}' format."); + } + } + + SearchSuggester IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchSuggester(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchSuggester)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchSuggester FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchSuggester(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchSuggester.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchSuggester.cs new file mode 100644 index 000000000000..1cb070671e31 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchSuggester.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// Defines how the Suggest API should apply to a group of fields in the index. + public partial class SearchSuggester + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the suggester. + /// + /// The list of field names to which the suggester applies. Each field must be + /// searchable. + /// + /// or is null. + public SearchSuggester(string name, IEnumerable sourceFields) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(sourceFields, nameof(sourceFields)); + + Name = name; + SourceFields = sourceFields.ToList(); + } + + /// Initializes a new instance of . + /// The name of the suggester. + /// A value indicating the capabilities of the suggester. + /// + /// The list of field names to which the suggester applies. Each field must be + /// searchable. + /// + /// Keeps track of any properties unknown to the library. + internal SearchSuggester(string name, SearchSuggesterSearchMode searchMode, IList sourceFields, IDictionary serializedAdditionalRawData) + { + Name = name; + SearchMode = searchMode; + SourceFields = sourceFields; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchSuggester() + { + } + + /// The name of the suggester. + public string Name { get; set; } + /// A value indicating the capabilities of the suggester. + public SearchSuggesterSearchMode SearchMode { get; } = SearchSuggesterSearchMode.AnalyzingInfixMatching; + + /// + /// The list of field names to which the suggester applies. Each field must be + /// searchable. + /// + public IList SourceFields { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchSuggesterSearchMode.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchSuggesterSearchMode.cs new file mode 100644 index 000000000000..59beb0769cba --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SearchSuggesterSearchMode.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 +{ + /// The SearchSuggester_searchMode. + public readonly partial struct SearchSuggesterSearchMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SearchSuggesterSearchMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AnalyzingInfixMatchingValue = "analyzingInfixMatching"; + + /// analyzingInfixMatching. + public static SearchSuggesterSearchMode AnalyzingInfixMatching { get; } = new SearchSuggesterSearchMode(AnalyzingInfixMatchingValue); + /// Determines if two values are the same. + public static bool operator ==(SearchSuggesterSearchMode left, SearchSuggesterSearchMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SearchSuggesterSearchMode left, SearchSuggesterSearchMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SearchSuggesterSearchMode(string value) => new SearchSuggesterSearchMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SearchSuggesterSearchMode other && Equals(other); + /// + public bool Equals(SearchSuggesterSearchMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticConfiguration.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticConfiguration.Serialization.cs new file mode 100644 index 000000000000..5348e4542b64 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticConfiguration.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SemanticConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SemanticConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("prioritizedFields"u8); + writer.WriteObjectValue(PrioritizedFields, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SemanticConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SemanticConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSemanticConfiguration(document.RootElement, options); + } + + internal static SemanticConfiguration DeserializeSemanticConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + SemanticPrioritizedFields prioritizedFields = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("prioritizedFields"u8)) + { + prioritizedFields = SemanticPrioritizedFields.DeserializeSemanticPrioritizedFields(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SemanticConfiguration(name, prioritizedFields, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SemanticConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SemanticConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSemanticConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SemanticConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SemanticConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSemanticConfiguration(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticConfiguration.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticConfiguration.cs new file mode 100644 index 000000000000..7d81cb17f9c8 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticConfiguration.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Defines a specific configuration to be used in the context of semantic + /// capabilities. + /// + public partial class SemanticConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the semantic configuration. + /// + /// Describes the title, content, and keyword fields to be used for semantic + /// ranking, captions, highlights, and answers. At least one of the three sub + /// properties (titleField, prioritizedKeywordsFields and prioritizedContentFields) + /// need to be set. + /// + /// or is null. + public SemanticConfiguration(string name, SemanticPrioritizedFields prioritizedFields) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(prioritizedFields, nameof(prioritizedFields)); + + Name = name; + PrioritizedFields = prioritizedFields; + } + + /// Initializes a new instance of . + /// The name of the semantic configuration. + /// + /// Describes the title, content, and keyword fields to be used for semantic + /// ranking, captions, highlights, and answers. At least one of the three sub + /// properties (titleField, prioritizedKeywordsFields and prioritizedContentFields) + /// need to be set. + /// + /// Keeps track of any properties unknown to the library. + internal SemanticConfiguration(string name, SemanticPrioritizedFields prioritizedFields, IDictionary serializedAdditionalRawData) + { + Name = name; + PrioritizedFields = prioritizedFields; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SemanticConfiguration() + { + } + + /// The name of the semantic configuration. + public string Name { get; set; } + /// + /// Describes the title, content, and keyword fields to be used for semantic + /// ranking, captions, highlights, and answers. At least one of the three sub + /// properties (titleField, prioritizedKeywordsFields and prioritizedContentFields) + /// need to be set. + /// + public SemanticPrioritizedFields PrioritizedFields { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticField.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticField.Serialization.cs new file mode 100644 index 000000000000..f0333e37753b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticField.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SemanticField : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SemanticField)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("fieldName"u8); + writer.WriteStringValue(FieldName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SemanticField IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SemanticField)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSemanticField(document.RootElement, options); + } + + internal static SemanticField DeserializeSemanticField(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string fieldName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("fieldName"u8)) + { + fieldName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SemanticField(fieldName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SemanticField)} does not support writing '{options.Format}' format."); + } + } + + SemanticField IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSemanticField(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SemanticField)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SemanticField FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSemanticField(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticField.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticField.cs new file mode 100644 index 000000000000..c84f954a2713 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticField.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// A field that is used as part of the semantic configuration. + public partial class SemanticField + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// File name. + /// is null. + public SemanticField(string fieldName) + { + Argument.AssertNotNull(fieldName, nameof(fieldName)); + + FieldName = fieldName; + } + + /// Initializes a new instance of . + /// File name. + /// Keeps track of any properties unknown to the library. + internal SemanticField(string fieldName, IDictionary serializedAdditionalRawData) + { + FieldName = fieldName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SemanticField() + { + } + + /// File name. + public string FieldName { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticPrioritizedFields.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticPrioritizedFields.Serialization.cs new file mode 100644 index 000000000000..3df2f15622f3 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticPrioritizedFields.Serialization.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SemanticPrioritizedFields : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SemanticPrioritizedFields)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TitleField)) + { + writer.WritePropertyName("titleField"u8); + writer.WriteObjectValue(TitleField, options); + } + if (Optional.IsCollectionDefined(PrioritizedContentFields)) + { + writer.WritePropertyName("prioritizedContentFields"u8); + writer.WriteStartArray(); + foreach (var item in PrioritizedContentFields) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PrioritizedKeywordsFields)) + { + writer.WritePropertyName("prioritizedKeywordsFields"u8); + writer.WriteStartArray(); + foreach (var item in PrioritizedKeywordsFields) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SemanticPrioritizedFields IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SemanticPrioritizedFields)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSemanticPrioritizedFields(document.RootElement, options); + } + + internal static SemanticPrioritizedFields DeserializeSemanticPrioritizedFields(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SemanticField titleField = default; + IList prioritizedContentFields = default; + IList prioritizedKeywordsFields = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("titleField"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + titleField = SemanticField.DeserializeSemanticField(property.Value, options); + continue; + } + if (property.NameEquals("prioritizedContentFields"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SemanticField.DeserializeSemanticField(item, options)); + } + prioritizedContentFields = array; + continue; + } + if (property.NameEquals("prioritizedKeywordsFields"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SemanticField.DeserializeSemanticField(item, options)); + } + prioritizedKeywordsFields = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SemanticPrioritizedFields(titleField, prioritizedContentFields ?? new ChangeTrackingList(), prioritizedKeywordsFields ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SemanticPrioritizedFields)} does not support writing '{options.Format}' format."); + } + } + + SemanticPrioritizedFields IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSemanticPrioritizedFields(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SemanticPrioritizedFields)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SemanticPrioritizedFields FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSemanticPrioritizedFields(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticPrioritizedFields.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticPrioritizedFields.cs new file mode 100644 index 000000000000..26f7c7fb8895 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticPrioritizedFields.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Describes the title, content, and keywords fields to be used for semantic + /// ranking, captions, highlights, and answers. + /// + public partial class SemanticPrioritizedFields + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SemanticPrioritizedFields() + { + PrioritizedContentFields = new ChangeTrackingList(); + PrioritizedKeywordsFields = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Defines the title field to be used for semantic ranking, captions, highlights, + /// and answers. If you don't have a title field in your index, leave this blank. + /// + /// + /// Defines the content fields to be used for semantic ranking, captions, + /// highlights, and answers. For the best result, the selected fields should + /// contain text in natural language form. The order of the fields in the array + /// represents their priority. Fields with lower priority may get truncated if the + /// content is long. + /// + /// + /// Defines the keyword fields to be used for semantic ranking, captions, + /// highlights, and answers. For the best result, the selected fields should + /// contain a list of keywords. The order of the fields in the array represents + /// their priority. Fields with lower priority may get truncated if the content is + /// long. + /// + /// Keeps track of any properties unknown to the library. + internal SemanticPrioritizedFields(SemanticField titleField, IList prioritizedContentFields, IList prioritizedKeywordsFields, IDictionary serializedAdditionalRawData) + { + TitleField = titleField; + PrioritizedContentFields = prioritizedContentFields; + PrioritizedKeywordsFields = prioritizedKeywordsFields; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Defines the title field to be used for semantic ranking, captions, highlights, + /// and answers. If you don't have a title field in your index, leave this blank. + /// + public SemanticField TitleField { get; set; } + /// + /// Defines the content fields to be used for semantic ranking, captions, + /// highlights, and answers. For the best result, the selected fields should + /// contain text in natural language form. The order of the fields in the array + /// represents their priority. Fields with lower priority may get truncated if the + /// content is long. + /// + public IList PrioritizedContentFields { get; } + /// + /// Defines the keyword fields to be used for semantic ranking, captions, + /// highlights, and answers. For the best result, the selected fields should + /// contain a list of keywords. The order of the fields in the array represents + /// their priority. Fields with lower priority may get truncated if the content is + /// long. + /// + public IList PrioritizedKeywordsFields { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticSearch.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticSearch.Serialization.cs new file mode 100644 index 000000000000..0aff8e8bb5f4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticSearch.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SemanticSearch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SemanticSearch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DefaultConfiguration)) + { + writer.WritePropertyName("defaultConfiguration"u8); + writer.WriteStringValue(DefaultConfiguration); + } + if (Optional.IsCollectionDefined(Configurations)) + { + writer.WritePropertyName("configurations"u8); + writer.WriteStartArray(); + foreach (var item in Configurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SemanticSearch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SemanticSearch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSemanticSearch(document.RootElement, options); + } + + internal static SemanticSearch DeserializeSemanticSearch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string defaultConfiguration = default; + IList configurations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("defaultConfiguration"u8)) + { + defaultConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("configurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SemanticConfiguration.DeserializeSemanticConfiguration(item, options)); + } + configurations = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SemanticSearch(defaultConfiguration, configurations ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SemanticSearch)} does not support writing '{options.Format}' format."); + } + } + + SemanticSearch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSemanticSearch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SemanticSearch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SemanticSearch FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSemanticSearch(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticSearch.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticSearch.cs new file mode 100644 index 000000000000..3e06ef4827fb --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SemanticSearch.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Defines parameters for a search index that influence semantic capabilities. + public partial class SemanticSearch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SemanticSearch() + { + Configurations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Allows you to set the name of a default semantic configuration in your index, + /// making it optional to pass it on as a query parameter every time. + /// + /// The semantic configurations for the index. + /// Keeps track of any properties unknown to the library. + internal SemanticSearch(string defaultConfiguration, IList configurations, IDictionary serializedAdditionalRawData) + { + DefaultConfiguration = defaultConfiguration; + Configurations = configurations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Allows you to set the name of a default semantic configuration in your index, + /// making it optional to pass it on as a query parameter every time. + /// + public string DefaultConfiguration { get; set; } + /// The semantic configurations for the index. + public IList Configurations { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SentimentSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SentimentSkill.Serialization.cs new file mode 100644 index 000000000000..d2150c7ec858 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SentimentSkill.Serialization.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SentimentSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SentimentSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(DefaultLanguageCode)) + { + writer.WritePropertyName("defaultLanguageCode"u8); + writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + } + } + + SentimentSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SentimentSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSentimentSkill(document.RootElement, options); + } + + internal static SentimentSkill DeserializeSentimentSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SentimentSkillLanguage? defaultLanguageCode = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("defaultLanguageCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultLanguageCode = new SentimentSkillLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SentimentSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + defaultLanguageCode); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SentimentSkill)} does not support writing '{options.Format}' format."); + } + } + + SentimentSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSentimentSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SentimentSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new SentimentSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSentimentSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SentimentSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SentimentSkill.cs new file mode 100644 index 000000000000..1c2ef1eabb96 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SentimentSkill.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// This skill is deprecated. Use the V3.SentimentSkill instead. + public partial class SentimentSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public SentimentSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Text.SentimentSkill"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// A value indicating which language code to use. Default is `en`. + internal SentimentSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, SentimentSkillLanguage? defaultLanguageCode) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + DefaultLanguageCode = defaultLanguageCode; + } + + /// Initializes a new instance of for deserialization. + internal SentimentSkill() + { + } + + /// A value indicating which language code to use. Default is `en`. + public SentimentSkillLanguage? DefaultLanguageCode { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SentimentSkillLanguage.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SentimentSkillLanguage.cs new file mode 100644 index 000000000000..2b7a0b42381c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SentimentSkillLanguage.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Deprecated. The language codes supported for input text by SentimentSkill. + public readonly partial struct SentimentSkillLanguage : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SentimentSkillLanguage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DaValue = "da"; + private const string NlValue = "nl"; + private const string EnValue = "en"; + private const string FiValue = "fi"; + private const string FrValue = "fr"; + private const string DeValue = "de"; + private const string ElValue = "el"; + private const string ItValue = "it"; + private const string NoValue = "no"; + private const string PlValue = "pl"; + private const string PtPTValue = "pt-PT"; + private const string RuValue = "ru"; + private const string EsValue = "es"; + private const string SvValue = "sv"; + private const string TrValue = "tr"; + + /// Danish. + public static SentimentSkillLanguage Da { get; } = new SentimentSkillLanguage(DaValue); + /// Dutch. + public static SentimentSkillLanguage Nl { get; } = new SentimentSkillLanguage(NlValue); + /// English. + public static SentimentSkillLanguage En { get; } = new SentimentSkillLanguage(EnValue); + /// Finnish. + public static SentimentSkillLanguage Fi { get; } = new SentimentSkillLanguage(FiValue); + /// French. + public static SentimentSkillLanguage Fr { get; } = new SentimentSkillLanguage(FrValue); + /// German. + public static SentimentSkillLanguage De { get; } = new SentimentSkillLanguage(DeValue); + /// Greek. + public static SentimentSkillLanguage El { get; } = new SentimentSkillLanguage(ElValue); + /// Italian. + public static SentimentSkillLanguage It { get; } = new SentimentSkillLanguage(ItValue); + /// Norwegian (Bokmaal). + public static SentimentSkillLanguage No { get; } = new SentimentSkillLanguage(NoValue); + /// Polish. + public static SentimentSkillLanguage Pl { get; } = new SentimentSkillLanguage(PlValue); + /// Portuguese (Portugal). + public static SentimentSkillLanguage PtPT { get; } = new SentimentSkillLanguage(PtPTValue); + /// Russian. + public static SentimentSkillLanguage Ru { get; } = new SentimentSkillLanguage(RuValue); + /// Spanish. + public static SentimentSkillLanguage Es { get; } = new SentimentSkillLanguage(EsValue); + /// Swedish. + public static SentimentSkillLanguage Sv { get; } = new SentimentSkillLanguage(SvValue); + /// Turkish. + public static SentimentSkillLanguage Tr { get; } = new SentimentSkillLanguage(TrValue); + /// Determines if two values are the same. + public static bool operator ==(SentimentSkillLanguage left, SentimentSkillLanguage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SentimentSkillLanguage left, SentimentSkillLanguage right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SentimentSkillLanguage(string value) => new SentimentSkillLanguage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SentimentSkillLanguage other && Equals(other); + /// + public bool Equals(SentimentSkillLanguage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SentimentSkillV3.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SentimentSkillV3.Serialization.cs new file mode 100644 index 000000000000..2249411fb4fb --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SentimentSkillV3.Serialization.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SentimentSkillV3 : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SentimentSkillV3)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(DefaultLanguageCode)) + { + writer.WritePropertyName("defaultLanguageCode"u8); + writer.WriteStringValue(DefaultLanguageCode); + } + if (Optional.IsDefined(IncludeOpinionMining)) + { + writer.WritePropertyName("includeOpinionMining"u8); + writer.WriteBooleanValue(IncludeOpinionMining.Value); + } + if (Optional.IsDefined(ModelVersion)) + { + writer.WritePropertyName("modelVersion"u8); + writer.WriteStringValue(ModelVersion); + } + } + + SentimentSkillV3 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SentimentSkillV3)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSentimentSkillV3(document.RootElement, options); + } + + internal static SentimentSkillV3 DeserializeSentimentSkillV3(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string defaultLanguageCode = default; + bool? includeOpinionMining = default; + string modelVersion = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("defaultLanguageCode"u8)) + { + defaultLanguageCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("includeOpinionMining"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + includeOpinionMining = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("modelVersion"u8)) + { + modelVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SentimentSkillV3( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + defaultLanguageCode, + includeOpinionMining, + modelVersion); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SentimentSkillV3)} does not support writing '{options.Format}' format."); + } + } + + SentimentSkillV3 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSentimentSkillV3(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SentimentSkillV3)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new SentimentSkillV3 FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSentimentSkillV3(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SentimentSkillV3.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SentimentSkillV3.cs new file mode 100644 index 000000000000..a9ef7340fe0e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SentimentSkillV3.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Using the Text Analytics API, evaluates unstructured text and for each record, + /// provides sentiment labels (such as "negative", "neutral" and "positive") based + /// on the highest confidence score found by the service at a sentence and + /// document-level. + /// + public partial class SentimentSkillV3 : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public SentimentSkillV3(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Text.V3.SentimentSkill"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// A value indicating which language code to use. Default is `en`. + /// + /// If set to true, the skill output will include information from Text Analytics + /// for opinion mining, namely targets (nouns or verbs) and their associated + /// assessment (adjective) in the text. Default is false. + /// + /// + /// The version of the model to use when calling the Text Analytics service. It + /// will default to the latest available when not specified. We recommend you do + /// not specify this value unless absolutely necessary. + /// + internal SentimentSkillV3(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, string defaultLanguageCode, bool? includeOpinionMining, string modelVersion) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + DefaultLanguageCode = defaultLanguageCode; + IncludeOpinionMining = includeOpinionMining; + ModelVersion = modelVersion; + } + + /// Initializes a new instance of for deserialization. + internal SentimentSkillV3() + { + } + + /// A value indicating which language code to use. Default is `en`. + public string DefaultLanguageCode { get; set; } + /// + /// If set to true, the skill output will include information from Text Analytics + /// for opinion mining, namely targets (nouns or verbs) and their associated + /// assessment (adjective) in the text. Default is false. + /// + public bool? IncludeOpinionMining { get; set; } + /// + /// The version of the model to use when calling the Text Analytics service. It + /// will default to the latest available when not specified. We recommend you do + /// not specify this value unless absolutely necessary. + /// + public string ModelVersion { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ShaperSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ShaperSkill.Serialization.cs new file mode 100644 index 000000000000..a49007bb73f4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ShaperSkill.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ShaperSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ShaperSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ShaperSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ShaperSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeShaperSkill(document.RootElement, options); + } + + internal static ShaperSkill DeserializeShaperSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ShaperSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ShaperSkill)} does not support writing '{options.Format}' format."); + } + } + + ShaperSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeShaperSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ShaperSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ShaperSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeShaperSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ShaperSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ShaperSkill.cs new file mode 100644 index 000000000000..4f1147f93fe6 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ShaperSkill.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// A skill for reshaping the outputs. It creates a complex type to support + /// composite fields (also known as multipart fields). + /// + public partial class ShaperSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public ShaperSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Util.ShaperSkill"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + internal ShaperSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal ShaperSkill() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ShingleTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ShingleTokenFilter.Serialization.cs new file mode 100644 index 000000000000..fb86113f7dc0 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ShingleTokenFilter.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class ShingleTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ShingleTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(MaxShingleSize)) + { + writer.WritePropertyName("maxShingleSize"u8); + writer.WriteNumberValue(MaxShingleSize.Value); + } + if (Optional.IsDefined(MinShingleSize)) + { + writer.WritePropertyName("minShingleSize"u8); + writer.WriteNumberValue(MinShingleSize.Value); + } + if (Optional.IsDefined(OutputUnigrams)) + { + writer.WritePropertyName("outputUnigrams"u8); + writer.WriteBooleanValue(OutputUnigrams.Value); + } + if (Optional.IsDefined(OutputUnigramsIfNoShingles)) + { + writer.WritePropertyName("outputUnigramsIfNoShingles"u8); + writer.WriteBooleanValue(OutputUnigramsIfNoShingles.Value); + } + if (Optional.IsDefined(TokenSeparator)) + { + writer.WritePropertyName("tokenSeparator"u8); + writer.WriteStringValue(TokenSeparator); + } + if (Optional.IsDefined(FilterToken)) + { + writer.WritePropertyName("filterToken"u8); + writer.WriteStringValue(FilterToken); + } + } + + ShingleTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ShingleTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeShingleTokenFilter(document.RootElement, options); + } + + internal static ShingleTokenFilter DeserializeShingleTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxShingleSize = default; + int? minShingleSize = default; + bool? outputUnigrams = default; + bool? outputUnigramsIfNoShingles = default; + string tokenSeparator = default; + string filterToken = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxShingleSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxShingleSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("minShingleSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minShingleSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("outputUnigrams"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + outputUnigrams = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("outputUnigramsIfNoShingles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + outputUnigramsIfNoShingles = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("tokenSeparator"u8)) + { + tokenSeparator = property.Value.GetString(); + continue; + } + if (property.NameEquals("filterToken"u8)) + { + filterToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ShingleTokenFilter( + odataType, + name, + serializedAdditionalRawData, + maxShingleSize, + minShingleSize, + outputUnigrams, + outputUnigramsIfNoShingles, + tokenSeparator, + filterToken); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ShingleTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + ShingleTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeShingleTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ShingleTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ShingleTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeShingleTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ShingleTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ShingleTokenFilter.cs new file mode 100644 index 000000000000..75723b300c0e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/ShingleTokenFilter.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Creates combinations of tokens as a single token. This token filter is + /// implemented using Apache Lucene. + /// + public partial class ShingleTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// is null. + public ShingleTokenFilter(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.ShingleTokenFilter"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// The maximum shingle size. Default and minimum value is 2. + /// + /// The minimum shingle size. Default and minimum value is 2. Must be less than the + /// value of maxShingleSize. + /// + /// + /// A value indicating whether the output stream will contain the input tokens + /// (unigrams) as well as shingles. Default is true. + /// + /// + /// A value indicating whether to output unigrams for those times when no shingles + /// are available. This property takes precedence when outputUnigrams is set to + /// false. Default is false. + /// + /// + /// The string to use when joining adjacent tokens to form a shingle. Default is a + /// single space (" "). + /// + /// + /// The string to insert for each position at which there is no token. Default is + /// an underscore ("_"). + /// + internal ShingleTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, int? maxShingleSize, int? minShingleSize, bool? outputUnigrams, bool? outputUnigramsIfNoShingles, string tokenSeparator, string filterToken) : base(odataType, name, serializedAdditionalRawData) + { + MaxShingleSize = maxShingleSize; + MinShingleSize = minShingleSize; + OutputUnigrams = outputUnigrams; + OutputUnigramsIfNoShingles = outputUnigramsIfNoShingles; + TokenSeparator = tokenSeparator; + FilterToken = filterToken; + } + + /// Initializes a new instance of for deserialization. + internal ShingleTokenFilter() + { + } + + /// The maximum shingle size. Default and minimum value is 2. + public int? MaxShingleSize { get; set; } + /// + /// The minimum shingle size. Default and minimum value is 2. Must be less than the + /// value of maxShingleSize. + /// + public int? MinShingleSize { get; set; } + /// + /// A value indicating whether the output stream will contain the input tokens + /// (unigrams) as well as shingles. Default is true. + /// + public bool? OutputUnigrams { get; set; } + /// + /// A value indicating whether to output unigrams for those times when no shingles + /// are available. This property takes precedence when outputUnigrams is set to + /// false. Default is false. + /// + public bool? OutputUnigramsIfNoShingles { get; set; } + /// + /// The string to use when joining adjacent tokens to form a shingle. Default is a + /// single space (" "). + /// + public string TokenSeparator { get; set; } + /// + /// The string to insert for each position at which there is no token. Default is + /// an underscore ("_"). + /// + public string FilterToken { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SimilarityAlgorithm.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SimilarityAlgorithm.Serialization.cs new file mode 100644 index 000000000000..5f4120ec5a89 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SimilarityAlgorithm.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + [PersistableModelProxy(typeof(UnknownSimilarityAlgorithm))] + public partial class SimilarityAlgorithm : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SimilarityAlgorithm)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("@odata.type"u8); + writer.WriteStringValue(OdataType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SimilarityAlgorithm IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SimilarityAlgorithm)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSimilarityAlgorithm(document.RootElement, options); + } + + internal static SimilarityAlgorithm DeserializeSimilarityAlgorithm(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("@odata.type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "#Microsoft.Azure.Search.BM25Similarity": return BM25SimilarityAlgorithm.DeserializeBM25SimilarityAlgorithm(element, options); + case "#Microsoft.Azure.Search.ClassicSimilarity": return ClassicSimilarityAlgorithm.DeserializeClassicSimilarityAlgorithm(element, options); + } + } + return UnknownSimilarityAlgorithm.DeserializeUnknownSimilarityAlgorithm(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SimilarityAlgorithm)} does not support writing '{options.Format}' format."); + } + } + + SimilarityAlgorithm IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSimilarityAlgorithm(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SimilarityAlgorithm)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SimilarityAlgorithm FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSimilarityAlgorithm(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SimilarityAlgorithm.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SimilarityAlgorithm.cs new file mode 100644 index 000000000000..33c0fa6c3a02 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SimilarityAlgorithm.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Base type for similarity algorithms. Similarity algorithms are used to + /// calculate scores that tie queries to documents. The higher the score, the more + /// relevant the document is to that specific query. Those scores are used to rank + /// the search results. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class SimilarityAlgorithm + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected SimilarityAlgorithm() + { + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// Keeps track of any properties unknown to the library. + internal SimilarityAlgorithm(string odataType, IDictionary serializedAdditionalRawData) + { + OdataType = odataType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The discriminator for derived types. + internal string OdataType { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Skillsets.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Skillsets.cs new file mode 100644 index 000000000000..fe6b5d2216e6 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/Skillsets.cs @@ -0,0 +1,709 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Search.Documents.Indexes +{ + // Data plane generated sub-client. + /// The Skillsets sub-client. + public partial class Skillsets + { + private const string AuthorizationHeader = "api-key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://search.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of Skillsets for mocking. + protected Skillsets() + { + } + + /// Initializes a new instance of Skillsets. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The key credential to copy. + /// The token credential to copy. + /// Service host. + /// The API version to use for this operation. + internal Skillsets(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _keyCredential = keyCredential; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// + /// Creates a new skillset in a search service or updates the skillset if it + /// already exists. + /// + /// The name of the skillset. + /// + /// The skillset containing one or more skills to create or update in a search + /// service. + /// + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CreateOrUpdateAsync(string skillsetName, SearchIndexerSkillset skillset, MatchConditions matchConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(skillsetName, nameof(skillsetName)); + Argument.AssertNotNull(skillset, nameof(skillset)); + + using RequestContent content = skillset.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateOrUpdateAsync(skillsetName, content, matchConditions, context).ConfigureAwait(false); + return Response.FromValue(SearchIndexerSkillset.FromResponse(response), response); + } + + /// + /// Creates a new skillset in a search service or updates the skillset if it + /// already exists. + /// + /// The name of the skillset. + /// + /// The skillset containing one or more skills to create or update in a search + /// service. + /// + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CreateOrUpdate(string skillsetName, SearchIndexerSkillset skillset, MatchConditions matchConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(skillsetName, nameof(skillsetName)); + Argument.AssertNotNull(skillset, nameof(skillset)); + + using RequestContent content = skillset.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateOrUpdate(skillsetName, content, matchConditions, context); + return Response.FromValue(SearchIndexerSkillset.FromResponse(response), response); + } + + /// + /// [Protocol Method] Creates a new skillset in a search service or updates the skillset if it + /// already exists. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the skillset. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrUpdateAsync(string skillsetName, RequestContent content, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(skillsetName, nameof(skillsetName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Skillsets.CreateOrUpdate"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateRequest(skillsetName, content, matchConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new skillset in a search service or updates the skillset if it + /// already exists. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the skillset. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrUpdate(string skillsetName, RequestContent content, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(skillsetName, nameof(skillsetName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Skillsets.CreateOrUpdate"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateRequest(skillsetName, content, matchConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a skillset in a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The name of the skillset. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteAsync(string skillsetName, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(skillsetName, nameof(skillsetName)); + + using var scope = ClientDiagnostics.CreateScope("Skillsets.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(skillsetName, matchConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a skillset in a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The name of the skillset. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Delete(string skillsetName, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(skillsetName, nameof(skillsetName)); + + using var scope = ClientDiagnostics.CreateScope("Skillsets.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(skillsetName, matchConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieves a skillset in a search service. + /// The name of the skillset. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetSkillsetAsync(string skillsetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(skillsetName, nameof(skillsetName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSkillsetAsync(skillsetName, context).ConfigureAwait(false); + return Response.FromValue(SearchIndexerSkillset.FromResponse(response), response); + } + + /// Retrieves a skillset in a search service. + /// The name of the skillset. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetSkillset(string skillsetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(skillsetName, nameof(skillsetName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSkillset(skillsetName, context); + return Response.FromValue(SearchIndexerSkillset.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieves a skillset in a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the skillset. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetSkillsetAsync(string skillsetName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(skillsetName, nameof(skillsetName)); + + using var scope = ClientDiagnostics.CreateScope("Skillsets.GetSkillset"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSkillsetRequest(skillsetName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieves a skillset in a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the skillset. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetSkillset(string skillsetName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(skillsetName, nameof(skillsetName)); + + using var scope = ClientDiagnostics.CreateScope("Skillsets.GetSkillset"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSkillsetRequest(skillsetName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// List all skillsets in a search service. + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The cancellation token to use. + /// + public virtual async Task> GetSkillsetsAsync(string select = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSkillsetsAsync(select, context).ConfigureAwait(false); + return Response.FromValue(ListSkillsetsResult.FromResponse(response), response); + } + + /// List all skillsets in a search service. + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The cancellation token to use. + /// + public virtual Response GetSkillsets(string select = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSkillsets(select, context); + return Response.FromValue(ListSkillsetsResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] List all skillsets in a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetSkillsetsAsync(string select, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("Skillsets.GetSkillsets"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSkillsetsRequest(select, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] List all skillsets in a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetSkillsets(string select, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("Skillsets.GetSkillsets"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSkillsetsRequest(select, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a new skillset in a search service. + /// The skillset containing one or more skills to create in a search service. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> CreateAsync(SearchIndexerSkillset skillset, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(skillset, nameof(skillset)); + + using RequestContent content = skillset.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateAsync(content, context).ConfigureAwait(false); + return Response.FromValue(SearchIndexerSkillset.FromResponse(response), response); + } + + /// Creates a new skillset in a search service. + /// The skillset containing one or more skills to create in a search service. + /// The cancellation token to use. + /// is null. + /// + public virtual Response Create(SearchIndexerSkillset skillset, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(skillset, nameof(skillset)); + + using RequestContent content = skillset.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Create(content, context); + return Response.FromValue(SearchIndexerSkillset.FromResponse(response), response); + } + + /// + /// [Protocol Method] Creates a new skillset in a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateAsync(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Skillsets.Create"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateRequest(content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new skillset in a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Create(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Skillsets.Create"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateRequest(content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string skillsetName, RequestContent content, MatchConditions matchConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/skillsets('", false); + uri.AppendPath(skillsetName, true); + uri.AppendPath("')", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Prefer", "return=representation"); + request.Headers.Add("Accept", "application/json"); + if (matchConditions != null) + { + request.Headers.Add(matchConditions); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteRequest(string skillsetName, MatchConditions matchConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204404); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/skillsets('", false); + uri.AppendPath(skillsetName, true); + uri.AppendPath("')", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (matchConditions != null) + { + request.Headers.Add(matchConditions); + } + return message; + } + + internal HttpMessage CreateGetSkillsetRequest(string skillsetName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/skillsets('", false); + uri.AppendPath(skillsetName, true); + uri.AppendPath("')", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSkillsetsRequest(string select, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/skillsets", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier201); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/skillsets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + private static ResponseClassifier _responseClassifier204404; + private static ResponseClassifier ResponseClassifier204404 => _responseClassifier204404 ??= new StatusCodeClassifier(stackalloc ushort[] { 204, 404 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier201; + private static ResponseClassifier ResponseClassifier201 => _responseClassifier201 ??= new StatusCodeClassifier(stackalloc ushort[] { 201 }); + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SnowballTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SnowballTokenFilter.Serialization.cs new file mode 100644 index 000000000000..313bc81f7f21 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SnowballTokenFilter.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SnowballTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SnowballTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language.ToString()); + } + + SnowballTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SnowballTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSnowballTokenFilter(document.RootElement, options); + } + + internal static SnowballTokenFilter DeserializeSnowballTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SnowballTokenFilterLanguage language = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("language"u8)) + { + language = new SnowballTokenFilterLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SnowballTokenFilter(odataType, name, serializedAdditionalRawData, language); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SnowballTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + SnowballTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSnowballTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SnowballTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new SnowballTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSnowballTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SnowballTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SnowballTokenFilter.cs new file mode 100644 index 000000000000..63954f304a83 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SnowballTokenFilter.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// A filter that stems words using a Snowball-generated stemmer. This token filter + /// is implemented using Apache Lucene. + /// + public partial class SnowballTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// The language to use. + /// is null. + public SnowballTokenFilter(string name, SnowballTokenFilterLanguage language) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.SnowballTokenFilter"; + Language = language; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// The language to use. + internal SnowballTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, SnowballTokenFilterLanguage language) : base(odataType, name, serializedAdditionalRawData) + { + Language = language; + } + + /// Initializes a new instance of for deserialization. + internal SnowballTokenFilter() + { + } + + /// The language to use. + public SnowballTokenFilterLanguage Language { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SnowballTokenFilterLanguage.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SnowballTokenFilterLanguage.cs new file mode 100644 index 000000000000..c3bab7343a4e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SnowballTokenFilterLanguage.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// The language to use for a Snowball token filter. + public readonly partial struct SnowballTokenFilterLanguage : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SnowballTokenFilterLanguage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ArmenianValue = "armenian"; + private const string BasqueValue = "basque"; + private const string CatalanValue = "catalan"; + private const string DanishValue = "danish"; + private const string DutchValue = "dutch"; + private const string EnglishValue = "english"; + private const string FinnishValue = "finnish"; + private const string FrenchValue = "french"; + private const string GermanValue = "german"; + private const string German2Value = "german2"; + private const string HungarianValue = "hungarian"; + private const string ItalianValue = "italian"; + private const string KpValue = "kp"; + private const string LovinsValue = "lovins"; + private const string NorwegianValue = "norwegian"; + private const string PorterValue = "porter"; + private const string PortugueseValue = "portuguese"; + private const string RomanianValue = "romanian"; + private const string RussianValue = "russian"; + private const string SpanishValue = "spanish"; + private const string SwedishValue = "swedish"; + private const string TurkishValue = "turkish"; + + /// Selects the Lucene Snowball stemming tokenizer for Armenian. + public static SnowballTokenFilterLanguage Armenian { get; } = new SnowballTokenFilterLanguage(ArmenianValue); + /// Selects the Lucene Snowball stemming tokenizer for Basque. + public static SnowballTokenFilterLanguage Basque { get; } = new SnowballTokenFilterLanguage(BasqueValue); + /// Selects the Lucene Snowball stemming tokenizer for Catalan. + public static SnowballTokenFilterLanguage Catalan { get; } = new SnowballTokenFilterLanguage(CatalanValue); + /// Selects the Lucene Snowball stemming tokenizer for Danish. + public static SnowballTokenFilterLanguage Danish { get; } = new SnowballTokenFilterLanguage(DanishValue); + /// Selects the Lucene Snowball stemming tokenizer for Dutch. + public static SnowballTokenFilterLanguage Dutch { get; } = new SnowballTokenFilterLanguage(DutchValue); + /// Selects the Lucene Snowball stemming tokenizer for English. + public static SnowballTokenFilterLanguage English { get; } = new SnowballTokenFilterLanguage(EnglishValue); + /// Selects the Lucene Snowball stemming tokenizer for Finnish. + public static SnowballTokenFilterLanguage Finnish { get; } = new SnowballTokenFilterLanguage(FinnishValue); + /// Selects the Lucene Snowball stemming tokenizer for French. + public static SnowballTokenFilterLanguage French { get; } = new SnowballTokenFilterLanguage(FrenchValue); + /// Selects the Lucene Snowball stemming tokenizer for German. + public static SnowballTokenFilterLanguage German { get; } = new SnowballTokenFilterLanguage(GermanValue); + /// + /// Selects the Lucene Snowball stemming tokenizer that uses the German variant + /// algorithm. + /// + public static SnowballTokenFilterLanguage German2 { get; } = new SnowballTokenFilterLanguage(German2Value); + /// Selects the Lucene Snowball stemming tokenizer for Hungarian. + public static SnowballTokenFilterLanguage Hungarian { get; } = new SnowballTokenFilterLanguage(HungarianValue); + /// Selects the Lucene Snowball stemming tokenizer for Italian. + public static SnowballTokenFilterLanguage Italian { get; } = new SnowballTokenFilterLanguage(ItalianValue); + /// + /// Selects the Lucene Snowball stemming tokenizer for Dutch that uses the + /// Kraaij-Pohlmann stemming algorithm. + /// + public static SnowballTokenFilterLanguage Kp { get; } = new SnowballTokenFilterLanguage(KpValue); + /// + /// Selects the Lucene Snowball stemming tokenizer for English that uses the Lovins + /// stemming algorithm. + /// + public static SnowballTokenFilterLanguage Lovins { get; } = new SnowballTokenFilterLanguage(LovinsValue); + /// Selects the Lucene Snowball stemming tokenizer for Norwegian. + public static SnowballTokenFilterLanguage Norwegian { get; } = new SnowballTokenFilterLanguage(NorwegianValue); + /// + /// Selects the Lucene Snowball stemming tokenizer for English that uses the Porter + /// stemming algorithm. + /// + public static SnowballTokenFilterLanguage Porter { get; } = new SnowballTokenFilterLanguage(PorterValue); + /// Selects the Lucene Snowball stemming tokenizer for Portuguese. + public static SnowballTokenFilterLanguage Portuguese { get; } = new SnowballTokenFilterLanguage(PortugueseValue); + /// Selects the Lucene Snowball stemming tokenizer for Romanian. + public static SnowballTokenFilterLanguage Romanian { get; } = new SnowballTokenFilterLanguage(RomanianValue); + /// Selects the Lucene Snowball stemming tokenizer for Russian. + public static SnowballTokenFilterLanguage Russian { get; } = new SnowballTokenFilterLanguage(RussianValue); + /// Selects the Lucene Snowball stemming tokenizer for Spanish. + public static SnowballTokenFilterLanguage Spanish { get; } = new SnowballTokenFilterLanguage(SpanishValue); + /// Selects the Lucene Snowball stemming tokenizer for Swedish. + public static SnowballTokenFilterLanguage Swedish { get; } = new SnowballTokenFilterLanguage(SwedishValue); + /// Selects the Lucene Snowball stemming tokenizer for Turkish. + public static SnowballTokenFilterLanguage Turkish { get; } = new SnowballTokenFilterLanguage(TurkishValue); + /// Determines if two values are the same. + public static bool operator ==(SnowballTokenFilterLanguage left, SnowballTokenFilterLanguage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SnowballTokenFilterLanguage left, SnowballTokenFilterLanguage right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SnowballTokenFilterLanguage(string value) => new SnowballTokenFilterLanguage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SnowballTokenFilterLanguage other && Equals(other); + /// + public bool Equals(SnowballTokenFilterLanguage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SoftDeleteColumnDeletionDetectionPolicy.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SoftDeleteColumnDeletionDetectionPolicy.Serialization.cs new file mode 100644 index 000000000000..431a5c8bfa05 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SoftDeleteColumnDeletionDetectionPolicy.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SoftDeleteColumnDeletionDetectionPolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SoftDeleteColumnDeletionDetectionPolicy)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(SoftDeleteColumnName)) + { + writer.WritePropertyName("softDeleteColumnName"u8); + writer.WriteStringValue(SoftDeleteColumnName); + } + if (Optional.IsDefined(SoftDeleteMarkerValue)) + { + writer.WritePropertyName("softDeleteMarkerValue"u8); + writer.WriteStringValue(SoftDeleteMarkerValue); + } + } + + SoftDeleteColumnDeletionDetectionPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SoftDeleteColumnDeletionDetectionPolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSoftDeleteColumnDeletionDetectionPolicy(document.RootElement, options); + } + + internal static SoftDeleteColumnDeletionDetectionPolicy DeserializeSoftDeleteColumnDeletionDetectionPolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string softDeleteColumnName = default; + string softDeleteMarkerValue = default; + string odataType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("softDeleteColumnName"u8)) + { + softDeleteColumnName = property.Value.GetString(); + continue; + } + if (property.NameEquals("softDeleteMarkerValue"u8)) + { + softDeleteMarkerValue = property.Value.GetString(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SoftDeleteColumnDeletionDetectionPolicy(odataType, serializedAdditionalRawData, softDeleteColumnName, softDeleteMarkerValue); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SoftDeleteColumnDeletionDetectionPolicy)} does not support writing '{options.Format}' format."); + } + } + + SoftDeleteColumnDeletionDetectionPolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSoftDeleteColumnDeletionDetectionPolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SoftDeleteColumnDeletionDetectionPolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new SoftDeleteColumnDeletionDetectionPolicy FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSoftDeleteColumnDeletionDetectionPolicy(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SoftDeleteColumnDeletionDetectionPolicy.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SoftDeleteColumnDeletionDetectionPolicy.cs new file mode 100644 index 000000000000..2adfaa1b93df --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SoftDeleteColumnDeletionDetectionPolicy.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Defines a data deletion detection policy that implements a soft-deletion + /// strategy. It determines whether an item should be deleted based on the value of + /// a designated 'soft delete' column. + /// + public partial class SoftDeleteColumnDeletionDetectionPolicy : DataDeletionDetectionPolicy + { + /// Initializes a new instance of . + public SoftDeleteColumnDeletionDetectionPolicy() + { + OdataType = "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// Keeps track of any properties unknown to the library. + /// The name of the column to use for soft-deletion detection. + /// The marker value that identifies an item as deleted. + internal SoftDeleteColumnDeletionDetectionPolicy(string odataType, IDictionary serializedAdditionalRawData, string softDeleteColumnName, string softDeleteMarkerValue) : base(odataType, serializedAdditionalRawData) + { + SoftDeleteColumnName = softDeleteColumnName; + SoftDeleteMarkerValue = softDeleteMarkerValue; + } + + /// The name of the column to use for soft-deletion detection. + public string SoftDeleteColumnName { get; set; } + /// The marker value that identifies an item as deleted. + public string SoftDeleteMarkerValue { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SplitSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SplitSkill.Serialization.cs new file mode 100644 index 000000000000..16a7d3d9120c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SplitSkill.Serialization.cs @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SplitSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SplitSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(DefaultLanguageCode)) + { + writer.WritePropertyName("defaultLanguageCode"u8); + writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + } + if (Optional.IsDefined(TextSplitMode)) + { + writer.WritePropertyName("textSplitMode"u8); + writer.WriteStringValue(TextSplitMode.Value.ToString()); + } + if (Optional.IsDefined(MaximumPageLength)) + { + writer.WritePropertyName("maximumPageLength"u8); + writer.WriteNumberValue(MaximumPageLength.Value); + } + if (Optional.IsDefined(PageOverlapLength)) + { + writer.WritePropertyName("pageOverlapLength"u8); + writer.WriteNumberValue(PageOverlapLength.Value); + } + if (Optional.IsDefined(MaximumPagesToTake)) + { + writer.WritePropertyName("maximumPagesToTake"u8); + writer.WriteNumberValue(MaximumPagesToTake.Value); + } + } + + SplitSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SplitSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSplitSkill(document.RootElement, options); + } + + internal static SplitSkill DeserializeSplitSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SplitSkillLanguage? defaultLanguageCode = default; + TextSplitMode? textSplitMode = default; + int? maximumPageLength = default; + int? pageOverlapLength = default; + int? maximumPagesToTake = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("defaultLanguageCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultLanguageCode = new SplitSkillLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("textSplitMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + textSplitMode = new TextSplitMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("maximumPageLength"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maximumPageLength = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("pageOverlapLength"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pageOverlapLength = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maximumPagesToTake"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maximumPagesToTake = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SplitSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + defaultLanguageCode, + textSplitMode, + maximumPageLength, + pageOverlapLength, + maximumPagesToTake); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SplitSkill)} does not support writing '{options.Format}' format."); + } + } + + SplitSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSplitSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SplitSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new SplitSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSplitSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SplitSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SplitSkill.cs new file mode 100644 index 000000000000..d40e5e4eace6 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SplitSkill.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// A skill to split a string into chunks of text. + public partial class SplitSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// or is null. + public SplitSkill(IEnumerable inputs, IEnumerable outputs) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Text.SplitSkill"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// A value indicating which language code to use. Default is `en`. + /// A value indicating which split mode to perform. + /// The desired maximum page length. Default is 10000. + /// + /// Only applicable when textSplitMode is set to 'pages'. If specified, n+1th chunk + /// will start with this number of characters/tokens from the end of the nth chunk. + /// + /// + /// Only applicable when textSplitMode is set to 'pages'. If specified, the + /// SplitSkill will discontinue splitting after processing the first + /// 'maximumPagesToTake' pages, in order to improve performance when only a few + /// initial pages are needed from each document. + /// + internal SplitSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, SplitSkillLanguage? defaultLanguageCode, TextSplitMode? textSplitMode, int? maximumPageLength, int? pageOverlapLength, int? maximumPagesToTake) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + DefaultLanguageCode = defaultLanguageCode; + TextSplitMode = textSplitMode; + MaximumPageLength = maximumPageLength; + PageOverlapLength = pageOverlapLength; + MaximumPagesToTake = maximumPagesToTake; + } + + /// Initializes a new instance of for deserialization. + internal SplitSkill() + { + } + + /// A value indicating which language code to use. Default is `en`. + public SplitSkillLanguage? DefaultLanguageCode { get; set; } + /// A value indicating which split mode to perform. + public TextSplitMode? TextSplitMode { get; set; } + /// The desired maximum page length. Default is 10000. + public int? MaximumPageLength { get; set; } + /// + /// Only applicable when textSplitMode is set to 'pages'. If specified, n+1th chunk + /// will start with this number of characters/tokens from the end of the nth chunk. + /// + public int? PageOverlapLength { get; set; } + /// + /// Only applicable when textSplitMode is set to 'pages'. If specified, the + /// SplitSkill will discontinue splitting after processing the first + /// 'maximumPagesToTake' pages, in order to improve performance when only a few + /// initial pages are needed from each document. + /// + public int? MaximumPagesToTake { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SplitSkillLanguage.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SplitSkillLanguage.cs new file mode 100644 index 000000000000..2dd4ae27b1ba --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SplitSkillLanguage.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// The language codes supported for input text by SplitSkill. + public readonly partial struct SplitSkillLanguage : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SplitSkillLanguage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AmValue = "am"; + private const string BsValue = "bs"; + private const string CsValue = "cs"; + private const string DaValue = "da"; + private const string DeValue = "de"; + private const string EnValue = "en"; + private const string EsValue = "es"; + private const string EtValue = "et"; + private const string FiValue = "fi"; + private const string FrValue = "fr"; + private const string HeValue = "he"; + private const string HiValue = "hi"; + private const string HrValue = "hr"; + private const string HuValue = "hu"; + private const string IdValue = "id"; + private const string IsValue = "is"; + private const string ItValue = "it"; + private const string JaValue = "ja"; + private const string KoValue = "ko"; + private const string LvValue = "lv"; + private const string NbValue = "nb"; + private const string NlValue = "nl"; + private const string PlValue = "pl"; + private const string PtValue = "pt"; + private const string PtBrValue = "pt-br"; + private const string RuValue = "ru"; + private const string SkValue = "sk"; + private const string SlValue = "sl"; + private const string SrValue = "sr"; + private const string SvValue = "sv"; + private const string TrValue = "tr"; + private const string UrValue = "ur"; + private const string ZhValue = "zh"; + + /// Amharic. + public static SplitSkillLanguage Am { get; } = new SplitSkillLanguage(AmValue); + /// Bosnian. + public static SplitSkillLanguage Bs { get; } = new SplitSkillLanguage(BsValue); + /// Czech. + public static SplitSkillLanguage Cs { get; } = new SplitSkillLanguage(CsValue); + /// Danish. + public static SplitSkillLanguage Da { get; } = new SplitSkillLanguage(DaValue); + /// German. + public static SplitSkillLanguage De { get; } = new SplitSkillLanguage(DeValue); + /// English. + public static SplitSkillLanguage En { get; } = new SplitSkillLanguage(EnValue); + /// Spanish. + public static SplitSkillLanguage Es { get; } = new SplitSkillLanguage(EsValue); + /// Estonian. + public static SplitSkillLanguage Et { get; } = new SplitSkillLanguage(EtValue); + /// Finnish. + public static SplitSkillLanguage Fi { get; } = new SplitSkillLanguage(FiValue); + /// French. + public static SplitSkillLanguage Fr { get; } = new SplitSkillLanguage(FrValue); + /// Hebrew. + public static SplitSkillLanguage He { get; } = new SplitSkillLanguage(HeValue); + /// Hindi. + public static SplitSkillLanguage Hi { get; } = new SplitSkillLanguage(HiValue); + /// Croatian. + public static SplitSkillLanguage Hr { get; } = new SplitSkillLanguage(HrValue); + /// Hungarian. + public static SplitSkillLanguage Hu { get; } = new SplitSkillLanguage(HuValue); + /// Indonesian. + public static SplitSkillLanguage Id { get; } = new SplitSkillLanguage(IdValue); + /// Icelandic. + public static SplitSkillLanguage Is { get; } = new SplitSkillLanguage(IsValue); + /// Italian. + public static SplitSkillLanguage It { get; } = new SplitSkillLanguage(ItValue); + /// Japanese. + public static SplitSkillLanguage Ja { get; } = new SplitSkillLanguage(JaValue); + /// Korean. + public static SplitSkillLanguage Ko { get; } = new SplitSkillLanguage(KoValue); + /// Latvian. + public static SplitSkillLanguage Lv { get; } = new SplitSkillLanguage(LvValue); + /// Norwegian. + public static SplitSkillLanguage Nb { get; } = new SplitSkillLanguage(NbValue); + /// Dutch. + public static SplitSkillLanguage Nl { get; } = new SplitSkillLanguage(NlValue); + /// Polish. + public static SplitSkillLanguage Pl { get; } = new SplitSkillLanguage(PlValue); + /// Portuguese (Portugal). + public static SplitSkillLanguage Pt { get; } = new SplitSkillLanguage(PtValue); + /// Portuguese (Brazil). + public static SplitSkillLanguage PtBr { get; } = new SplitSkillLanguage(PtBrValue); + /// Russian. + public static SplitSkillLanguage Ru { get; } = new SplitSkillLanguage(RuValue); + /// Slovak. + public static SplitSkillLanguage Sk { get; } = new SplitSkillLanguage(SkValue); + /// Slovenian. + public static SplitSkillLanguage Sl { get; } = new SplitSkillLanguage(SlValue); + /// Serbian. + public static SplitSkillLanguage Sr { get; } = new SplitSkillLanguage(SrValue); + /// Swedish. + public static SplitSkillLanguage Sv { get; } = new SplitSkillLanguage(SvValue); + /// Turkish. + public static SplitSkillLanguage Tr { get; } = new SplitSkillLanguage(TrValue); + /// Urdu. + public static SplitSkillLanguage Ur { get; } = new SplitSkillLanguage(UrValue); + /// Chinese (Simplified). + public static SplitSkillLanguage Zh { get; } = new SplitSkillLanguage(ZhValue); + /// Determines if two values are the same. + public static bool operator ==(SplitSkillLanguage left, SplitSkillLanguage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SplitSkillLanguage left, SplitSkillLanguage right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SplitSkillLanguage(string value) => new SplitSkillLanguage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SplitSkillLanguage other && Equals(other); + /// + public bool Equals(SplitSkillLanguage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SqlIntegratedChangeTrackingPolicy.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SqlIntegratedChangeTrackingPolicy.Serialization.cs new file mode 100644 index 000000000000..516676e46597 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SqlIntegratedChangeTrackingPolicy.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SqlIntegratedChangeTrackingPolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlIntegratedChangeTrackingPolicy)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SqlIntegratedChangeTrackingPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlIntegratedChangeTrackingPolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlIntegratedChangeTrackingPolicy(document.RootElement, options); + } + + internal static SqlIntegratedChangeTrackingPolicy DeserializeSqlIntegratedChangeTrackingPolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string odataType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlIntegratedChangeTrackingPolicy(odataType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlIntegratedChangeTrackingPolicy)} does not support writing '{options.Format}' format."); + } + } + + SqlIntegratedChangeTrackingPolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSqlIntegratedChangeTrackingPolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlIntegratedChangeTrackingPolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new SqlIntegratedChangeTrackingPolicy FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSqlIntegratedChangeTrackingPolicy(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SqlIntegratedChangeTrackingPolicy.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SqlIntegratedChangeTrackingPolicy.cs new file mode 100644 index 000000000000..57dfe3fbab11 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SqlIntegratedChangeTrackingPolicy.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Defines a data change detection policy that captures changes using the + /// Integrated Change Tracking feature of Azure SQL Database. + /// + public partial class SqlIntegratedChangeTrackingPolicy : DataChangeDetectionPolicy + { + /// Initializes a new instance of . + public SqlIntegratedChangeTrackingPolicy() + { + OdataType = "#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// Keeps track of any properties unknown to the library. + internal SqlIntegratedChangeTrackingPolicy(string odataType, IDictionary serializedAdditionalRawData) : base(odataType, serializedAdditionalRawData) + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StemmerOverrideTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StemmerOverrideTokenFilter.Serialization.cs new file mode 100644 index 000000000000..5f3e80c9296b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StemmerOverrideTokenFilter.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class StemmerOverrideTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StemmerOverrideTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("rules"u8); + writer.WriteStartArray(); + foreach (var item in Rules) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + + StemmerOverrideTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StemmerOverrideTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStemmerOverrideTokenFilter(document.RootElement, options); + } + + internal static StemmerOverrideTokenFilter DeserializeStemmerOverrideTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList rules = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("rules"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + rules = array; + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StemmerOverrideTokenFilter(odataType, name, serializedAdditionalRawData, rules); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(StemmerOverrideTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + StemmerOverrideTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStemmerOverrideTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StemmerOverrideTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new StemmerOverrideTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStemmerOverrideTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StemmerOverrideTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StemmerOverrideTokenFilter.cs new file mode 100644 index 000000000000..8feace4c05d9 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StemmerOverrideTokenFilter.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Provides the ability to override other stemming filters with custom + /// dictionary-based stemming. Any dictionary-stemmed terms will be marked as + /// keywords so that they will not be stemmed with stemmers down the chain. Must be + /// placed before any stemming filters. This token filter is implemented using + /// Apache Lucene. + /// + public partial class StemmerOverrideTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// + /// A list of stemming rules in the following format: "word => stem", for example: + /// "ran => run". + /// + /// or is null. + public StemmerOverrideTokenFilter(string name, IEnumerable rules) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(rules, nameof(rules)); + + OdataType = "#Microsoft.Azure.Search.StemmerOverrideTokenFilter"; + Rules = rules.ToList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// A list of stemming rules in the following format: "word => stem", for example: + /// "ran => run". + /// + internal StemmerOverrideTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, IList rules) : base(odataType, name, serializedAdditionalRawData) + { + Rules = rules; + } + + /// Initializes a new instance of for deserialization. + internal StemmerOverrideTokenFilter() + { + } + + /// + /// A list of stemming rules in the following format: "word => stem", for example: + /// "ran => run". + /// + public IList Rules { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StemmerTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StemmerTokenFilter.Serialization.cs new file mode 100644 index 000000000000..a1735113b80d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StemmerTokenFilter.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class StemmerTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StemmerTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language.ToString()); + } + + StemmerTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StemmerTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStemmerTokenFilter(document.RootElement, options); + } + + internal static StemmerTokenFilter DeserializeStemmerTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + StemmerTokenFilterLanguage language = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("language"u8)) + { + language = new StemmerTokenFilterLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StemmerTokenFilter(odataType, name, serializedAdditionalRawData, language); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(StemmerTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + StemmerTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStemmerTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StemmerTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new StemmerTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStemmerTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StemmerTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StemmerTokenFilter.cs new file mode 100644 index 000000000000..8def47503f6f --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StemmerTokenFilter.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Language specific stemming filter. This token filter is implemented using + /// Apache Lucene. + /// + public partial class StemmerTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// The language to use. + /// is null. + public StemmerTokenFilter(string name, StemmerTokenFilterLanguage language) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.StemmerTokenFilter"; + Language = language; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// The language to use. + internal StemmerTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, StemmerTokenFilterLanguage language) : base(odataType, name, serializedAdditionalRawData) + { + Language = language; + } + + /// Initializes a new instance of for deserialization. + internal StemmerTokenFilter() + { + } + + /// The language to use. + public StemmerTokenFilterLanguage Language { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StemmerTokenFilterLanguage.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StemmerTokenFilterLanguage.cs new file mode 100644 index 000000000000..5b31a5cef613 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StemmerTokenFilterLanguage.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// The language to use for a stemmer token filter. + public readonly partial struct StemmerTokenFilterLanguage : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StemmerTokenFilterLanguage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ArabicValue = "arabic"; + private const string ArmenianValue = "armenian"; + private const string BasqueValue = "basque"; + private const string BrazilianValue = "brazilian"; + private const string BulgarianValue = "bulgarian"; + private const string CatalanValue = "catalan"; + private const string CzechValue = "czech"; + private const string DanishValue = "danish"; + private const string DutchValue = "dutch"; + private const string DutchKpValue = "dutchKp"; + private const string EnglishValue = "english"; + private const string LightEnglishValue = "lightEnglish"; + private const string MinimalEnglishValue = "minimalEnglish"; + private const string PossessiveEnglishValue = "possessiveEnglish"; + private const string Porter2Value = "porter2"; + private const string LovinsValue = "lovins"; + private const string FinnishValue = "finnish"; + private const string LightFinnishValue = "lightFinnish"; + private const string FrenchValue = "french"; + private const string LightFrenchValue = "lightFrench"; + private const string MinimalFrenchValue = "minimalFrench"; + private const string GalicianValue = "galician"; + private const string MinimalGalicianValue = "minimalGalician"; + private const string GermanValue = "german"; + private const string German2Value = "german2"; + private const string LightGermanValue = "lightGerman"; + private const string MinimalGermanValue = "minimalGerman"; + private const string GreekValue = "greek"; + private const string HindiValue = "hindi"; + private const string HungarianValue = "hungarian"; + private const string LightHungarianValue = "lightHungarian"; + private const string IndonesianValue = "indonesian"; + private const string IrishValue = "irish"; + private const string ItalianValue = "italian"; + private const string LightItalianValue = "lightItalian"; + private const string SoraniValue = "sorani"; + private const string LatvianValue = "latvian"; + private const string NorwegianValue = "norwegian"; + private const string LightNorwegianValue = "lightNorwegian"; + private const string MinimalNorwegianValue = "minimalNorwegian"; + private const string LightNynorskValue = "lightNynorsk"; + private const string MinimalNynorskValue = "minimalNynorsk"; + private const string PortugueseValue = "portuguese"; + private const string LightPortugueseValue = "lightPortuguese"; + private const string MinimalPortugueseValue = "minimalPortuguese"; + private const string PortugueseRslpValue = "portugueseRslp"; + private const string RomanianValue = "romanian"; + private const string RussianValue = "russian"; + private const string LightRussianValue = "lightRussian"; + private const string SpanishValue = "spanish"; + private const string LightSpanishValue = "lightSpanish"; + private const string SwedishValue = "swedish"; + private const string LightSwedishValue = "lightSwedish"; + private const string TurkishValue = "turkish"; + + /// Selects the Lucene stemming tokenizer for Arabic. + public static StemmerTokenFilterLanguage Arabic { get; } = new StemmerTokenFilterLanguage(ArabicValue); + /// Selects the Lucene stemming tokenizer for Armenian. + public static StemmerTokenFilterLanguage Armenian { get; } = new StemmerTokenFilterLanguage(ArmenianValue); + /// Selects the Lucene stemming tokenizer for Basque. + public static StemmerTokenFilterLanguage Basque { get; } = new StemmerTokenFilterLanguage(BasqueValue); + /// Selects the Lucene stemming tokenizer for Portuguese (Brazil). + public static StemmerTokenFilterLanguage Brazilian { get; } = new StemmerTokenFilterLanguage(BrazilianValue); + /// Selects the Lucene stemming tokenizer for Bulgarian. + public static StemmerTokenFilterLanguage Bulgarian { get; } = new StemmerTokenFilterLanguage(BulgarianValue); + /// Selects the Lucene stemming tokenizer for Catalan. + public static StemmerTokenFilterLanguage Catalan { get; } = new StemmerTokenFilterLanguage(CatalanValue); + /// Selects the Lucene stemming tokenizer for Czech. + public static StemmerTokenFilterLanguage Czech { get; } = new StemmerTokenFilterLanguage(CzechValue); + /// Selects the Lucene stemming tokenizer for Danish. + public static StemmerTokenFilterLanguage Danish { get; } = new StemmerTokenFilterLanguage(DanishValue); + /// Selects the Lucene stemming tokenizer for Dutch. + public static StemmerTokenFilterLanguage Dutch { get; } = new StemmerTokenFilterLanguage(DutchValue); + /// + /// Selects the Lucene stemming tokenizer for Dutch that uses the Kraaij-Pohlmann + /// stemming algorithm. + /// + public static StemmerTokenFilterLanguage DutchKp { get; } = new StemmerTokenFilterLanguage(DutchKpValue); + /// Selects the Lucene stemming tokenizer for English. + public static StemmerTokenFilterLanguage English { get; } = new StemmerTokenFilterLanguage(EnglishValue); + /// Selects the Lucene stemming tokenizer for English that does light stemming. + public static StemmerTokenFilterLanguage LightEnglish { get; } = new StemmerTokenFilterLanguage(LightEnglishValue); + /// Selects the Lucene stemming tokenizer for English that does minimal stemming. + public static StemmerTokenFilterLanguage MinimalEnglish { get; } = new StemmerTokenFilterLanguage(MinimalEnglishValue); + /// + /// Selects the Lucene stemming tokenizer for English that removes trailing + /// possessives from words. + /// + public static StemmerTokenFilterLanguage PossessiveEnglish { get; } = new StemmerTokenFilterLanguage(PossessiveEnglishValue); + /// + /// Selects the Lucene stemming tokenizer for English that uses the Porter2 + /// stemming algorithm. + /// + public static StemmerTokenFilterLanguage Porter2 { get; } = new StemmerTokenFilterLanguage(Porter2Value); + /// + /// Selects the Lucene stemming tokenizer for English that uses the Lovins stemming + /// algorithm. + /// + public static StemmerTokenFilterLanguage Lovins { get; } = new StemmerTokenFilterLanguage(LovinsValue); + /// Selects the Lucene stemming tokenizer for Finnish. + public static StemmerTokenFilterLanguage Finnish { get; } = new StemmerTokenFilterLanguage(FinnishValue); + /// Selects the Lucene stemming tokenizer for Finnish that does light stemming. + public static StemmerTokenFilterLanguage LightFinnish { get; } = new StemmerTokenFilterLanguage(LightFinnishValue); + /// Selects the Lucene stemming tokenizer for French. + public static StemmerTokenFilterLanguage French { get; } = new StemmerTokenFilterLanguage(FrenchValue); + /// Selects the Lucene stemming tokenizer for French that does light stemming. + public static StemmerTokenFilterLanguage LightFrench { get; } = new StemmerTokenFilterLanguage(LightFrenchValue); + /// Selects the Lucene stemming tokenizer for French that does minimal stemming. + public static StemmerTokenFilterLanguage MinimalFrench { get; } = new StemmerTokenFilterLanguage(MinimalFrenchValue); + /// Selects the Lucene stemming tokenizer for Galician. + public static StemmerTokenFilterLanguage Galician { get; } = new StemmerTokenFilterLanguage(GalicianValue); + /// Selects the Lucene stemming tokenizer for Galician that does minimal stemming. + public static StemmerTokenFilterLanguage MinimalGalician { get; } = new StemmerTokenFilterLanguage(MinimalGalicianValue); + /// Selects the Lucene stemming tokenizer for German. + public static StemmerTokenFilterLanguage German { get; } = new StemmerTokenFilterLanguage(GermanValue); + /// Selects the Lucene stemming tokenizer that uses the German variant algorithm. + public static StemmerTokenFilterLanguage German2 { get; } = new StemmerTokenFilterLanguage(German2Value); + /// Selects the Lucene stemming tokenizer for German that does light stemming. + public static StemmerTokenFilterLanguage LightGerman { get; } = new StemmerTokenFilterLanguage(LightGermanValue); + /// Selects the Lucene stemming tokenizer for German that does minimal stemming. + public static StemmerTokenFilterLanguage MinimalGerman { get; } = new StemmerTokenFilterLanguage(MinimalGermanValue); + /// Selects the Lucene stemming tokenizer for Greek. + public static StemmerTokenFilterLanguage Greek { get; } = new StemmerTokenFilterLanguage(GreekValue); + /// Selects the Lucene stemming tokenizer for Hindi. + public static StemmerTokenFilterLanguage Hindi { get; } = new StemmerTokenFilterLanguage(HindiValue); + /// Selects the Lucene stemming tokenizer for Hungarian. + public static StemmerTokenFilterLanguage Hungarian { get; } = new StemmerTokenFilterLanguage(HungarianValue); + /// Selects the Lucene stemming tokenizer for Hungarian that does light stemming. + public static StemmerTokenFilterLanguage LightHungarian { get; } = new StemmerTokenFilterLanguage(LightHungarianValue); + /// Selects the Lucene stemming tokenizer for Indonesian. + public static StemmerTokenFilterLanguage Indonesian { get; } = new StemmerTokenFilterLanguage(IndonesianValue); + /// Selects the Lucene stemming tokenizer for Irish. + public static StemmerTokenFilterLanguage Irish { get; } = new StemmerTokenFilterLanguage(IrishValue); + /// Selects the Lucene stemming tokenizer for Italian. + public static StemmerTokenFilterLanguage Italian { get; } = new StemmerTokenFilterLanguage(ItalianValue); + /// Selects the Lucene stemming tokenizer for Italian that does light stemming. + public static StemmerTokenFilterLanguage LightItalian { get; } = new StemmerTokenFilterLanguage(LightItalianValue); + /// Selects the Lucene stemming tokenizer for Sorani. + public static StemmerTokenFilterLanguage Sorani { get; } = new StemmerTokenFilterLanguage(SoraniValue); + /// Selects the Lucene stemming tokenizer for Latvian. + public static StemmerTokenFilterLanguage Latvian { get; } = new StemmerTokenFilterLanguage(LatvianValue); + /// Selects the Lucene stemming tokenizer for Norwegian (Bokmål). + public static StemmerTokenFilterLanguage Norwegian { get; } = new StemmerTokenFilterLanguage(NorwegianValue); + /// + /// Selects the Lucene stemming tokenizer for Norwegian (Bokmål) that does light + /// stemming. + /// + public static StemmerTokenFilterLanguage LightNorwegian { get; } = new StemmerTokenFilterLanguage(LightNorwegianValue); + /// + /// Selects the Lucene stemming tokenizer for Norwegian (Bokmål) that does minimal + /// stemming. + /// + public static StemmerTokenFilterLanguage MinimalNorwegian { get; } = new StemmerTokenFilterLanguage(MinimalNorwegianValue); + /// + /// Selects the Lucene stemming tokenizer for Norwegian (Nynorsk) that does light + /// stemming. + /// + public static StemmerTokenFilterLanguage LightNynorsk { get; } = new StemmerTokenFilterLanguage(LightNynorskValue); + /// + /// Selects the Lucene stemming tokenizer for Norwegian (Nynorsk) that does minimal + /// stemming. + /// + public static StemmerTokenFilterLanguage MinimalNynorsk { get; } = new StemmerTokenFilterLanguage(MinimalNynorskValue); + /// Selects the Lucene stemming tokenizer for Portuguese. + public static StemmerTokenFilterLanguage Portuguese { get; } = new StemmerTokenFilterLanguage(PortugueseValue); + /// Selects the Lucene stemming tokenizer for Portuguese that does light stemming. + public static StemmerTokenFilterLanguage LightPortuguese { get; } = new StemmerTokenFilterLanguage(LightPortugueseValue); + /// Selects the Lucene stemming tokenizer for Portuguese that does minimal stemming. + public static StemmerTokenFilterLanguage MinimalPortuguese { get; } = new StemmerTokenFilterLanguage(MinimalPortugueseValue); + /// + /// Selects the Lucene stemming tokenizer for Portuguese that uses the RSLP + /// stemming algorithm. + /// + public static StemmerTokenFilterLanguage PortugueseRslp { get; } = new StemmerTokenFilterLanguage(PortugueseRslpValue); + /// Selects the Lucene stemming tokenizer for Romanian. + public static StemmerTokenFilterLanguage Romanian { get; } = new StemmerTokenFilterLanguage(RomanianValue); + /// Selects the Lucene stemming tokenizer for Russian. + public static StemmerTokenFilterLanguage Russian { get; } = new StemmerTokenFilterLanguage(RussianValue); + /// Selects the Lucene stemming tokenizer for Russian that does light stemming. + public static StemmerTokenFilterLanguage LightRussian { get; } = new StemmerTokenFilterLanguage(LightRussianValue); + /// Selects the Lucene stemming tokenizer for Spanish. + public static StemmerTokenFilterLanguage Spanish { get; } = new StemmerTokenFilterLanguage(SpanishValue); + /// Selects the Lucene stemming tokenizer for Spanish that does light stemming. + public static StemmerTokenFilterLanguage LightSpanish { get; } = new StemmerTokenFilterLanguage(LightSpanishValue); + /// Selects the Lucene stemming tokenizer for Swedish. + public static StemmerTokenFilterLanguage Swedish { get; } = new StemmerTokenFilterLanguage(SwedishValue); + /// Selects the Lucene stemming tokenizer for Swedish that does light stemming. + public static StemmerTokenFilterLanguage LightSwedish { get; } = new StemmerTokenFilterLanguage(LightSwedishValue); + /// Selects the Lucene stemming tokenizer for Turkish. + public static StemmerTokenFilterLanguage Turkish { get; } = new StemmerTokenFilterLanguage(TurkishValue); + /// Determines if two values are the same. + public static bool operator ==(StemmerTokenFilterLanguage left, StemmerTokenFilterLanguage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StemmerTokenFilterLanguage left, StemmerTokenFilterLanguage right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator StemmerTokenFilterLanguage(string value) => new StemmerTokenFilterLanguage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StemmerTokenFilterLanguage other && Equals(other); + /// + public bool Equals(StemmerTokenFilterLanguage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StopAnalyzer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StopAnalyzer.Serialization.cs new file mode 100644 index 000000000000..892d07c2c99d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StopAnalyzer.Serialization.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class StopAnalyzer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StopAnalyzer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Stopwords)) + { + writer.WritePropertyName("stopwords"u8); + writer.WriteStartArray(); + foreach (var item in Stopwords) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + StopAnalyzer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StopAnalyzer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStopAnalyzer(document.RootElement, options); + } + + internal static StopAnalyzer DeserializeStopAnalyzer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList stopwords = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("stopwords"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + stopwords = array; + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StopAnalyzer(odataType, name, serializedAdditionalRawData, stopwords ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(StopAnalyzer)} does not support writing '{options.Format}' format."); + } + } + + StopAnalyzer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStopAnalyzer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StopAnalyzer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new StopAnalyzer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStopAnalyzer(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StopAnalyzer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StopAnalyzer.cs new file mode 100644 index 000000000000..8e287143ae2e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StopAnalyzer.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Divides text at non-letters; Applies the lowercase and stopword token filters. + /// This analyzer is implemented using Apache Lucene. + /// + public partial class StopAnalyzer : LexicalAnalyzer + { + /// Initializes a new instance of . + /// + /// The name of the analyzer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// is null. + public StopAnalyzer(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.StopAnalyzer"; + Stopwords = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the analyzer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// A list of stopwords. + internal StopAnalyzer(string odataType, string name, IDictionary serializedAdditionalRawData, IList stopwords) : base(odataType, name, serializedAdditionalRawData) + { + Stopwords = stopwords; + } + + /// Initializes a new instance of for deserialization. + internal StopAnalyzer() + { + } + + /// A list of stopwords. + public IList Stopwords { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StopwordsList.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StopwordsList.cs new file mode 100644 index 000000000000..dab53ddbb3b5 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StopwordsList.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Identifies a predefined list of language-specific stopwords. + public readonly partial struct StopwordsList : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StopwordsList(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ArabicValue = "arabic"; + private const string ArmenianValue = "armenian"; + private const string BasqueValue = "basque"; + private const string BrazilianValue = "brazilian"; + private const string BulgarianValue = "bulgarian"; + private const string CatalanValue = "catalan"; + private const string CzechValue = "czech"; + private const string DanishValue = "danish"; + private const string DutchValue = "dutch"; + private const string EnglishValue = "english"; + private const string FinnishValue = "finnish"; + private const string FrenchValue = "french"; + private const string GalicianValue = "galician"; + private const string GermanValue = "german"; + private const string GreekValue = "greek"; + private const string HindiValue = "hindi"; + private const string HungarianValue = "hungarian"; + private const string IndonesianValue = "indonesian"; + private const string IrishValue = "irish"; + private const string ItalianValue = "italian"; + private const string LatvianValue = "latvian"; + private const string NorwegianValue = "norwegian"; + private const string PersianValue = "persian"; + private const string PortugueseValue = "portuguese"; + private const string RomanianValue = "romanian"; + private const string RussianValue = "russian"; + private const string SoraniValue = "sorani"; + private const string SpanishValue = "spanish"; + private const string SwedishValue = "swedish"; + private const string ThaiValue = "thai"; + private const string TurkishValue = "turkish"; + + /// Selects the stopword list for Arabic. + public static StopwordsList Arabic { get; } = new StopwordsList(ArabicValue); + /// Selects the stopword list for Armenian. + public static StopwordsList Armenian { get; } = new StopwordsList(ArmenianValue); + /// Selects the stopword list for Basque. + public static StopwordsList Basque { get; } = new StopwordsList(BasqueValue); + /// Selects the stopword list for Portuguese (Brazil). + public static StopwordsList Brazilian { get; } = new StopwordsList(BrazilianValue); + /// Selects the stopword list for Bulgarian. + public static StopwordsList Bulgarian { get; } = new StopwordsList(BulgarianValue); + /// Selects the stopword list for Catalan. + public static StopwordsList Catalan { get; } = new StopwordsList(CatalanValue); + /// Selects the stopword list for Czech. + public static StopwordsList Czech { get; } = new StopwordsList(CzechValue); + /// Selects the stopword list for Danish. + public static StopwordsList Danish { get; } = new StopwordsList(DanishValue); + /// Selects the stopword list for Dutch. + public static StopwordsList Dutch { get; } = new StopwordsList(DutchValue); + /// Selects the stopword list for English. + public static StopwordsList English { get; } = new StopwordsList(EnglishValue); + /// Selects the stopword list for Finnish. + public static StopwordsList Finnish { get; } = new StopwordsList(FinnishValue); + /// Selects the stopword list for French. + public static StopwordsList French { get; } = new StopwordsList(FrenchValue); + /// Selects the stopword list for Galician. + public static StopwordsList Galician { get; } = new StopwordsList(GalicianValue); + /// Selects the stopword list for German. + public static StopwordsList German { get; } = new StopwordsList(GermanValue); + /// Selects the stopword list for Greek. + public static StopwordsList Greek { get; } = new StopwordsList(GreekValue); + /// Selects the stopword list for Hindi. + public static StopwordsList Hindi { get; } = new StopwordsList(HindiValue); + /// Selects the stopword list for Hungarian. + public static StopwordsList Hungarian { get; } = new StopwordsList(HungarianValue); + /// Selects the stopword list for Indonesian. + public static StopwordsList Indonesian { get; } = new StopwordsList(IndonesianValue); + /// Selects the stopword list for Irish. + public static StopwordsList Irish { get; } = new StopwordsList(IrishValue); + /// Selects the stopword list for Italian. + public static StopwordsList Italian { get; } = new StopwordsList(ItalianValue); + /// Selects the stopword list for Latvian. + public static StopwordsList Latvian { get; } = new StopwordsList(LatvianValue); + /// Selects the stopword list for Norwegian. + public static StopwordsList Norwegian { get; } = new StopwordsList(NorwegianValue); + /// Selects the stopword list for Persian. + public static StopwordsList Persian { get; } = new StopwordsList(PersianValue); + /// Selects the stopword list for Portuguese. + public static StopwordsList Portuguese { get; } = new StopwordsList(PortugueseValue); + /// Selects the stopword list for Romanian. + public static StopwordsList Romanian { get; } = new StopwordsList(RomanianValue); + /// Selects the stopword list for Russian. + public static StopwordsList Russian { get; } = new StopwordsList(RussianValue); + /// Selects the stopword list for Sorani. + public static StopwordsList Sorani { get; } = new StopwordsList(SoraniValue); + /// Selects the stopword list for Spanish. + public static StopwordsList Spanish { get; } = new StopwordsList(SpanishValue); + /// Selects the stopword list for Swedish. + public static StopwordsList Swedish { get; } = new StopwordsList(SwedishValue); + /// Selects the stopword list for Thai. + public static StopwordsList Thai { get; } = new StopwordsList(ThaiValue); + /// Selects the stopword list for Turkish. + public static StopwordsList Turkish { get; } = new StopwordsList(TurkishValue); + /// Determines if two values are the same. + public static bool operator ==(StopwordsList left, StopwordsList right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StopwordsList left, StopwordsList right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator StopwordsList(string value) => new StopwordsList(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StopwordsList other && Equals(other); + /// + public bool Equals(StopwordsList other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StopwordsTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StopwordsTokenFilter.Serialization.cs new file mode 100644 index 000000000000..6ea4e1510f21 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StopwordsTokenFilter.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class StopwordsTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StopwordsTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Stopwords)) + { + writer.WritePropertyName("stopwords"u8); + writer.WriteStartArray(); + foreach (var item in Stopwords) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(StopwordsList)) + { + writer.WritePropertyName("stopwordsList"u8); + writer.WriteStringValue(StopwordsList.Value.ToString()); + } + if (Optional.IsDefined(IgnoreCase)) + { + writer.WritePropertyName("ignoreCase"u8); + writer.WriteBooleanValue(IgnoreCase.Value); + } + if (Optional.IsDefined(RemoveTrailing)) + { + writer.WritePropertyName("removeTrailing"u8); + writer.WriteBooleanValue(RemoveTrailing.Value); + } + } + + StopwordsTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StopwordsTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStopwordsTokenFilter(document.RootElement, options); + } + + internal static StopwordsTokenFilter DeserializeStopwordsTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList stopwords = default; + StopwordsList? stopwordsList = default; + bool? ignoreCase = default; + bool? removeTrailing = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("stopwords"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + stopwords = array; + continue; + } + if (property.NameEquals("stopwordsList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stopwordsList = new StopwordsList(property.Value.GetString()); + continue; + } + if (property.NameEquals("ignoreCase"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ignoreCase = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("removeTrailing"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + removeTrailing = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StopwordsTokenFilter( + odataType, + name, + serializedAdditionalRawData, + stopwords ?? new ChangeTrackingList(), + stopwordsList, + ignoreCase, + removeTrailing); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(StopwordsTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + StopwordsTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStopwordsTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StopwordsTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new StopwordsTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStopwordsTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StopwordsTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StopwordsTokenFilter.cs new file mode 100644 index 000000000000..7ac73715778b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/StopwordsTokenFilter.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Removes stop words from a token stream. This token filter is implemented using + /// Apache Lucene. + /// + public partial class StopwordsTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// is null. + public StopwordsTokenFilter(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.StopwordsTokenFilter"; + Stopwords = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// The list of stopwords. This property and the stopwords list property cannot + /// both be set. + /// + /// + /// A predefined list of stopwords to use. This property and the stopwords property + /// cannot both be set. Default is English. + /// + /// + /// A value indicating whether to ignore case. If true, all words are converted to + /// lower case first. Default is false. + /// + /// + /// A value indicating whether to ignore the last search term if it's a stop word. + /// Default is true. + /// + internal StopwordsTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, IList stopwords, StopwordsList? stopwordsList, bool? ignoreCase, bool? removeTrailing) : base(odataType, name, serializedAdditionalRawData) + { + Stopwords = stopwords; + StopwordsList = stopwordsList; + IgnoreCase = ignoreCase; + RemoveTrailing = removeTrailing; + } + + /// Initializes a new instance of for deserialization. + internal StopwordsTokenFilter() + { + } + + /// + /// The list of stopwords. This property and the stopwords list property cannot + /// both be set. + /// + public IList Stopwords { get; } + /// + /// A predefined list of stopwords to use. This property and the stopwords property + /// cannot both be set. Default is English. + /// + public StopwordsList? StopwordsList { get; set; } + /// + /// A value indicating whether to ignore case. If true, all words are converted to + /// lower case first. Default is false. + /// + public bool? IgnoreCase { get; set; } + /// + /// A value indicating whether to ignore the last search term if it's a stop word. + /// Default is true. + /// + public bool? RemoveTrailing { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymMap.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymMap.Serialization.cs new file mode 100644 index 000000000000..df94dc7491fa --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymMap.Serialization.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SynonymMap : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SynonymMap)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("format"u8); + writer.WriteStringValue(Format.ToString()); + writer.WritePropertyName("synonyms"u8); + writer.WriteStringValue(Synonyms); + if (Optional.IsDefined(EncryptionKey)) + { + writer.WritePropertyName("encryptionKey"u8); + writer.WriteObjectValue(EncryptionKey, options); + } + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("@odata.etag"u8); + writer.WriteStringValue(ETag); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SynonymMap IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SynonymMap)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSynonymMap(document.RootElement, options); + } + + internal static SynonymMap DeserializeSynonymMap(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + SynonymMapFormat format = default; + string synonyms = default; + SearchResourceEncryptionKey encryptionKey = default; + string odataEtag = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("format"u8)) + { + format = new SynonymMapFormat(property.Value.GetString()); + continue; + } + if (property.NameEquals("synonyms"u8)) + { + synonyms = property.Value.GetString(); + continue; + } + if (property.NameEquals("encryptionKey"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryptionKey = SearchResourceEncryptionKey.DeserializeSearchResourceEncryptionKey(property.Value, options); + continue; + } + if (property.NameEquals("@odata.etag"u8)) + { + odataEtag = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SynonymMap( + name, + format, + synonyms, + encryptionKey, + odataEtag, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SynonymMap)} does not support writing '{options.Format}' format."); + } + } + + SynonymMap IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSynonymMap(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SynonymMap)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SynonymMap FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSynonymMap(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymMap.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymMap.cs new file mode 100644 index 000000000000..9301a7702063 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymMap.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents a synonym map definition. + public partial class SynonymMap + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the synonym map. + /// + /// A series of synonym rules in the specified synonym map format. The rules must + /// be separated by newlines. + /// + /// or is null. + public SynonymMap(string name, string synonyms) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(synonyms, nameof(synonyms)); + + Name = name; + Synonyms = synonyms; + } + + /// Initializes a new instance of . + /// The name of the synonym map. + /// The format of the synonym map. Only the 'solr' format is currently supported. + /// + /// A series of synonym rules in the specified synonym map format. The rules must + /// be separated by newlines. + /// + /// + /// A description of an encryption key that you create in Azure Key Vault. This key + /// is used to provide an additional level of encryption-at-rest for your data when + /// you want full assurance that no one, not even Microsoft, can decrypt your data. + /// Once you have encrypted your data, it will always remain encrypted. The search + /// service will ignore attempts to set this property to null. You can change this + /// property as needed if you want to rotate your encryption key; Your data will be + /// unaffected. Encryption with customer-managed keys is not available for free + /// search services, and is only available for paid services created on or after + /// January 1, 2019. + /// + /// The ETag of the synonym map. + /// Keeps track of any properties unknown to the library. + internal SynonymMap(string name, SynonymMapFormat format, string synonyms, SearchResourceEncryptionKey encryptionKey, string eTag, IDictionary serializedAdditionalRawData) + { + Name = name; + Format = format; + Synonyms = synonyms; + EncryptionKey = encryptionKey; + ETag = eTag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SynonymMap() + { + } + + /// The name of the synonym map. + public string Name { get; set; } + /// The format of the synonym map. Only the 'solr' format is currently supported. + public SynonymMapFormat Format { get; } = SynonymMapFormat.Solr; + + /// + /// A series of synonym rules in the specified synonym map format. The rules must + /// be separated by newlines. + /// + public string Synonyms { get; set; } + /// + /// A description of an encryption key that you create in Azure Key Vault. This key + /// is used to provide an additional level of encryption-at-rest for your data when + /// you want full assurance that no one, not even Microsoft, can decrypt your data. + /// Once you have encrypted your data, it will always remain encrypted. The search + /// service will ignore attempts to set this property to null. You can change this + /// property as needed if you want to rotate your encryption key; Your data will be + /// unaffected. Encryption with customer-managed keys is not available for free + /// search services, and is only available for paid services created on or after + /// January 1, 2019. + /// + public SearchResourceEncryptionKey EncryptionKey { get; set; } + /// The ETag of the synonym map. + public string ETag { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymMapFormat.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymMapFormat.cs new file mode 100644 index 000000000000..ecc247c8c9a6 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymMapFormat.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 +{ + /// The SynonymMap_format. + public readonly partial struct SynonymMapFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SynonymMapFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SolrValue = "solr"; + + /// solr. + public static SynonymMapFormat Solr { get; } = new SynonymMapFormat(SolrValue); + /// Determines if two values are the same. + public static bool operator ==(SynonymMapFormat left, SynonymMapFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SynonymMapFormat left, SynonymMapFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SynonymMapFormat(string value) => new SynonymMapFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SynonymMapFormat other && Equals(other); + /// + public bool Equals(SynonymMapFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymMaps.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymMaps.cs new file mode 100644 index 000000000000..e0a0ec7e72b5 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymMaps.cs @@ -0,0 +1,695 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Search.Documents.Indexes +{ + // Data plane generated sub-client. + /// The SynonymMaps sub-client. + public partial class SynonymMaps + { + private const string AuthorizationHeader = "api-key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://search.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of SynonymMaps for mocking. + protected SynonymMaps() + { + } + + /// Initializes a new instance of SynonymMaps. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The key credential to copy. + /// The token credential to copy. + /// Service host. + /// The API version to use for this operation. + internal SynonymMaps(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _keyCredential = keyCredential; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Creates a new synonym map or updates a synonym map if it already exists. + /// The name of the synonym map. + /// The definition of the synonym map to create or update. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CreateOrUpdateAsync(string synonymMapName, SynonymMap synonymMap, MatchConditions matchConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(synonymMapName, nameof(synonymMapName)); + Argument.AssertNotNull(synonymMap, nameof(synonymMap)); + + using RequestContent content = synonymMap.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateOrUpdateAsync(synonymMapName, content, matchConditions, context).ConfigureAwait(false); + return Response.FromValue(SynonymMap.FromResponse(response), response); + } + + /// Creates a new synonym map or updates a synonym map if it already exists. + /// The name of the synonym map. + /// The definition of the synonym map to create or update. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CreateOrUpdate(string synonymMapName, SynonymMap synonymMap, MatchConditions matchConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(synonymMapName, nameof(synonymMapName)); + Argument.AssertNotNull(synonymMap, nameof(synonymMap)); + + using RequestContent content = synonymMap.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateOrUpdate(synonymMapName, content, matchConditions, context); + return Response.FromValue(SynonymMap.FromResponse(response), response); + } + + /// + /// [Protocol Method] Creates a new synonym map or updates a synonym map if it already exists. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the synonym map. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrUpdateAsync(string synonymMapName, RequestContent content, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(synonymMapName, nameof(synonymMapName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("SynonymMaps.CreateOrUpdate"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateRequest(synonymMapName, content, matchConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new synonym map or updates a synonym map if it already exists. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the synonym map. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrUpdate(string synonymMapName, RequestContent content, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(synonymMapName, nameof(synonymMapName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("SynonymMaps.CreateOrUpdate"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateRequest(synonymMapName, content, matchConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a synonym map. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The name of the synonym map. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteAsync(string synonymMapName, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(synonymMapName, nameof(synonymMapName)); + + using var scope = ClientDiagnostics.CreateScope("SynonymMaps.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(synonymMapName, matchConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a synonym map. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The name of the synonym map. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Delete(string synonymMapName, MatchConditions matchConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(synonymMapName, nameof(synonymMapName)); + + using var scope = ClientDiagnostics.CreateScope("SynonymMaps.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(synonymMapName, matchConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieves a synonym map definition. + /// The name of the synonym map. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetSynonymMapAsync(string synonymMapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(synonymMapName, nameof(synonymMapName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSynonymMapAsync(synonymMapName, context).ConfigureAwait(false); + return Response.FromValue(SynonymMap.FromResponse(response), response); + } + + /// Retrieves a synonym map definition. + /// The name of the synonym map. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetSynonymMap(string synonymMapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(synonymMapName, nameof(synonymMapName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSynonymMap(synonymMapName, context); + return Response.FromValue(SynonymMap.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieves a synonym map definition. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the synonym map. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetSynonymMapAsync(string synonymMapName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(synonymMapName, nameof(synonymMapName)); + + using var scope = ClientDiagnostics.CreateScope("SynonymMaps.GetSynonymMap"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSynonymMapRequest(synonymMapName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieves a synonym map definition. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the synonym map. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetSynonymMap(string synonymMapName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(synonymMapName, nameof(synonymMapName)); + + using var scope = ClientDiagnostics.CreateScope("SynonymMaps.GetSynonymMap"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSynonymMapRequest(synonymMapName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists all synonym maps available for a search service. + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The cancellation token to use. + /// + public virtual async Task> GetSynonymMapsAsync(string select = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSynonymMapsAsync(select, context).ConfigureAwait(false); + return Response.FromValue(ListSynonymMapsResult.FromResponse(response), response); + } + + /// Lists all synonym maps available for a search service. + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The cancellation token to use. + /// + public virtual Response GetSynonymMaps(string select = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSynonymMaps(select, context); + return Response.FromValue(ListSynonymMapsResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Lists all synonym maps available for a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetSynonymMapsAsync(string select, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("SynonymMaps.GetSynonymMaps"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSynonymMapsRequest(select, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists all synonym maps available for a search service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// + /// Selects which top-level properties to retrieve. + /// Specified as a comma-separated list of JSON property names, + /// or '*' for all properties. The default is all properties. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetSynonymMaps(string select, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("SynonymMaps.GetSynonymMaps"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSynonymMapsRequest(select, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a new synonym map. + /// The definition of the synonym map to create. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> CreateAsync(SynonymMap synonymMap, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(synonymMap, nameof(synonymMap)); + + using RequestContent content = synonymMap.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateAsync(content, context).ConfigureAwait(false); + return Response.FromValue(SynonymMap.FromResponse(response), response); + } + + /// Creates a new synonym map. + /// The definition of the synonym map to create. + /// The cancellation token to use. + /// is null. + /// + public virtual Response Create(SynonymMap synonymMap, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(synonymMap, nameof(synonymMap)); + + using RequestContent content = synonymMap.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Create(content, context); + return Response.FromValue(SynonymMap.FromResponse(response), response); + } + + /// + /// [Protocol Method] Creates a new synonym map. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateAsync(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("SynonymMaps.Create"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateRequest(content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new synonym map. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Create(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("SynonymMaps.Create"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateRequest(content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string synonymMapName, RequestContent content, MatchConditions matchConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/synonymmaps('", false); + uri.AppendPath(synonymMapName, true); + uri.AppendPath("')", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Prefer", "return=representation"); + request.Headers.Add("Accept", "application/json"); + if (matchConditions != null) + { + request.Headers.Add(matchConditions); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteRequest(string synonymMapName, MatchConditions matchConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204404); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/synonymmaps('", false); + uri.AppendPath(synonymMapName, true); + uri.AppendPath("')", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (matchConditions != null) + { + request.Headers.Add(matchConditions); + } + return message; + } + + internal HttpMessage CreateGetSynonymMapRequest(string synonymMapName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/synonymmaps('", false); + uri.AppendPath(synonymMapName, true); + uri.AppendPath("')", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSynonymMapsRequest(string select, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/synonymmaps", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier201); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/synonymmaps", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + private static ResponseClassifier _responseClassifier204404; + private static ResponseClassifier ResponseClassifier204404 => _responseClassifier204404 ??= new StatusCodeClassifier(stackalloc ushort[] { 204, 404 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier201; + private static ResponseClassifier ResponseClassifier201 => _responseClassifier201 ??= new StatusCodeClassifier(stackalloc ushort[] { 201 }); + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymTokenFilter.Serialization.cs new file mode 100644 index 000000000000..3c9d828a3c89 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymTokenFilter.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class SynonymTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SynonymTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("synonyms"u8); + writer.WriteStartArray(); + foreach (var item in Synonyms) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(IgnoreCase)) + { + writer.WritePropertyName("ignoreCase"u8); + writer.WriteBooleanValue(IgnoreCase.Value); + } + if (Optional.IsDefined(Expand)) + { + writer.WritePropertyName("expand"u8); + writer.WriteBooleanValue(Expand.Value); + } + } + + SynonymTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SynonymTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSynonymTokenFilter(document.RootElement, options); + } + + internal static SynonymTokenFilter DeserializeSynonymTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList synonyms = default; + bool? ignoreCase = default; + bool? expand = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("synonyms"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + synonyms = array; + continue; + } + if (property.NameEquals("ignoreCase"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ignoreCase = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("expand"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expand = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SynonymTokenFilter( + odataType, + name, + serializedAdditionalRawData, + synonyms, + ignoreCase, + expand); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SynonymTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + SynonymTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSynonymTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SynonymTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new SynonymTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSynonymTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymTokenFilter.cs new file mode 100644 index 000000000000..2b2fd6106eba --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/SynonymTokenFilter.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Matches single or multi-word synonyms in a token stream. This token filter is + /// implemented using Apache Lucene. + /// + public partial class SynonymTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// + /// A list of synonyms in following one of two formats: 1. incredible, + /// unbelievable, fabulous => amazing - all terms on the left side of => symbol + /// will be replaced with all terms on its right side; 2. incredible, unbelievable, + /// fabulous, amazing - comma separated list of equivalent words. Set the expand + /// option to change how this list is interpreted. + /// + /// or is null. + public SynonymTokenFilter(string name, IEnumerable synonyms) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(synonyms, nameof(synonyms)); + + OdataType = "#Microsoft.Azure.Search.SynonymTokenFilter"; + Synonyms = synonyms.ToList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// A list of synonyms in following one of two formats: 1. incredible, + /// unbelievable, fabulous => amazing - all terms on the left side of => symbol + /// will be replaced with all terms on its right side; 2. incredible, unbelievable, + /// fabulous, amazing - comma separated list of equivalent words. Set the expand + /// option to change how this list is interpreted. + /// + /// A value indicating whether to case-fold input for matching. Default is false. + /// + /// A value indicating whether all words in the list of synonyms (if => notation is + /// not used) will map to one another. If true, all words in the list of synonyms + /// (if => notation is not used) will map to one another. The following list: + /// incredible, unbelievable, fabulous, amazing is equivalent to: incredible, + /// unbelievable, fabulous, amazing => incredible, unbelievable, fabulous, amazing. + /// If false, the following list: incredible, unbelievable, fabulous, amazing will + /// be equivalent to: incredible, unbelievable, fabulous, amazing => incredible. + /// Default is true. + /// + internal SynonymTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, IList synonyms, bool? ignoreCase, bool? expand) : base(odataType, name, serializedAdditionalRawData) + { + Synonyms = synonyms; + IgnoreCase = ignoreCase; + Expand = expand; + } + + /// Initializes a new instance of for deserialization. + internal SynonymTokenFilter() + { + } + + /// + /// A list of synonyms in following one of two formats: 1. incredible, + /// unbelievable, fabulous => amazing - all terms on the left side of => symbol + /// will be replaced with all terms on its right side; 2. incredible, unbelievable, + /// fabulous, amazing - comma separated list of equivalent words. Set the expand + /// option to change how this list is interpreted. + /// + public IList Synonyms { get; } + /// A value indicating whether to case-fold input for matching. Default is false. + public bool? IgnoreCase { get; set; } + /// + /// A value indicating whether all words in the list of synonyms (if => notation is + /// not used) will map to one another. If true, all words in the list of synonyms + /// (if => notation is not used) will map to one another. The following list: + /// incredible, unbelievable, fabulous, amazing is equivalent to: incredible, + /// unbelievable, fabulous, amazing => incredible, unbelievable, fabulous, amazing. + /// If false, the following list: incredible, unbelievable, fabulous, amazing will + /// be equivalent to: incredible, unbelievable, fabulous, amazing => incredible. + /// Default is true. + /// + public bool? Expand { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TagScoringFunction.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TagScoringFunction.Serialization.cs new file mode 100644 index 000000000000..d607ccf7edd1 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TagScoringFunction.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class TagScoringFunction : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TagScoringFunction)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("tag"u8); + writer.WriteObjectValue(Tag, options); + } + + TagScoringFunction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TagScoringFunction)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTagScoringFunction(document.RootElement, options); + } + + internal static TagScoringFunction DeserializeTagScoringFunction(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TagScoringParameters tag = default; + string fieldName = default; + double boost = default; + ScoringFunctionInterpolation? interpolation = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tag"u8)) + { + tag = TagScoringParameters.DeserializeTagScoringParameters(property.Value, options); + continue; + } + if (property.NameEquals("fieldName"u8)) + { + fieldName = property.Value.GetString(); + continue; + } + if (property.NameEquals("boost"u8)) + { + boost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("interpolation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + interpolation = new ScoringFunctionInterpolation(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TagScoringFunction( + fieldName, + boost, + interpolation, + type, + serializedAdditionalRawData, + tag); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TagScoringFunction)} does not support writing '{options.Format}' format."); + } + } + + TagScoringFunction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTagScoringFunction(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TagScoringFunction)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new TagScoringFunction FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTagScoringFunction(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TagScoringFunction.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TagScoringFunction.cs new file mode 100644 index 000000000000..72b5ce6b73c9 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TagScoringFunction.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Defines a function that boosts scores of documents with string values matching + /// a given list of tags. + /// + public partial class TagScoringFunction : ScoringFunction + { + /// Initializes a new instance of . + /// The name of the field used as input to the scoring function. + /// A multiplier for the raw score. Must be a positive number not equal to 1.0. + /// Parameter values for the tag scoring function. + /// or is null. + public TagScoringFunction(string fieldName, double boost, TagScoringParameters tag) : base(fieldName, boost) + { + Argument.AssertNotNull(fieldName, nameof(fieldName)); + Argument.AssertNotNull(tag, nameof(tag)); + + Type = "tag"; + Tag = tag; + } + + /// Initializes a new instance of . + /// The name of the field used as input to the scoring function. + /// A multiplier for the raw score. Must be a positive number not equal to 1.0. + /// + /// A value indicating how boosting will be interpolated across document scores; + /// defaults to "Linear". + /// + /// Type of ScoringFunction. + /// Keeps track of any properties unknown to the library. + /// Parameter values for the tag scoring function. + internal TagScoringFunction(string fieldName, double boost, ScoringFunctionInterpolation? interpolation, string type, IDictionary serializedAdditionalRawData, TagScoringParameters tag) : base(fieldName, boost, interpolation, type, serializedAdditionalRawData) + { + Tag = tag; + } + + /// Initializes a new instance of for deserialization. + internal TagScoringFunction() + { + } + + /// Parameter values for the tag scoring function. + public TagScoringParameters Tag { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TagScoringParameters.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TagScoringParameters.Serialization.cs new file mode 100644 index 000000000000..36fb91d486dc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TagScoringParameters.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class TagScoringParameters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TagScoringParameters)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("tagsParameter"u8); + writer.WriteStringValue(TagsParameter); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TagScoringParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TagScoringParameters)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTagScoringParameters(document.RootElement, options); + } + + internal static TagScoringParameters DeserializeTagScoringParameters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string tagsParameter = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tagsParameter"u8)) + { + tagsParameter = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TagScoringParameters(tagsParameter, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TagScoringParameters)} does not support writing '{options.Format}' format."); + } + } + + TagScoringParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTagScoringParameters(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TagScoringParameters)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TagScoringParameters FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTagScoringParameters(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TagScoringParameters.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TagScoringParameters.cs new file mode 100644 index 000000000000..122da1461bfd --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TagScoringParameters.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Provides parameter values to a tag scoring function. + public partial class TagScoringParameters + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// The name of the parameter passed in search queries to specify the list of tags + /// to compare against the target field. + /// + /// is null. + public TagScoringParameters(string tagsParameter) + { + Argument.AssertNotNull(tagsParameter, nameof(tagsParameter)); + + TagsParameter = tagsParameter; + } + + /// Initializes a new instance of . + /// + /// The name of the parameter passed in search queries to specify the list of tags + /// to compare against the target field. + /// + /// Keeps track of any properties unknown to the library. + internal TagScoringParameters(string tagsParameter, IDictionary serializedAdditionalRawData) + { + TagsParameter = tagsParameter; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TagScoringParameters() + { + } + + /// + /// The name of the parameter passed in search queries to specify the list of tags + /// to compare against the target field. + /// + public string TagsParameter { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextSplitMode.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextSplitMode.cs new file mode 100644 index 000000000000..4b431abf7058 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextSplitMode.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 +{ + /// A value indicating which split mode to perform. + public readonly partial struct TextSplitMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TextSplitMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PagesValue = "pages"; + private const string SentencesValue = "sentences"; + + /// Split the text into individual pages. + public static TextSplitMode Pages { get; } = new TextSplitMode(PagesValue); + /// Split the text into individual sentences. + public static TextSplitMode Sentences { get; } = new TextSplitMode(SentencesValue); + /// Determines if two values are the same. + public static bool operator ==(TextSplitMode left, TextSplitMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TextSplitMode left, TextSplitMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TextSplitMode(string value) => new TextSplitMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TextSplitMode other && Equals(other); + /// + public bool Equals(TextSplitMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextTranslationSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextTranslationSkill.Serialization.cs new file mode 100644 index 000000000000..46239e2c12fc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextTranslationSkill.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class TextTranslationSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextTranslationSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("defaultToLanguageCode"u8); + writer.WriteStringValue(DefaultToLanguageCode.ToString()); + if (Optional.IsDefined(DefaultFromLanguageCode)) + { + writer.WritePropertyName("defaultFromLanguageCode"u8); + writer.WriteStringValue(DefaultFromLanguageCode.Value.ToString()); + } + if (Optional.IsDefined(SuggestedFrom)) + { + writer.WritePropertyName("suggestedFrom"u8); + writer.WriteStringValue(SuggestedFrom.Value.ToString()); + } + } + + TextTranslationSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextTranslationSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTextTranslationSkill(document.RootElement, options); + } + + internal static TextTranslationSkill DeserializeTextTranslationSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TextTranslationSkillLanguage defaultToLanguageCode = default; + TextTranslationSkillLanguage? defaultFromLanguageCode = default; + TextTranslationSkillLanguage? suggestedFrom = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("defaultToLanguageCode"u8)) + { + defaultToLanguageCode = new TextTranslationSkillLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("defaultFromLanguageCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultFromLanguageCode = new TextTranslationSkillLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("suggestedFrom"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suggestedFrom = new TextTranslationSkillLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TextTranslationSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + defaultToLanguageCode, + defaultFromLanguageCode, + suggestedFrom); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TextTranslationSkill)} does not support writing '{options.Format}' format."); + } + } + + TextTranslationSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTextTranslationSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TextTranslationSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new TextTranslationSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTextTranslationSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextTranslationSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextTranslationSkill.cs new file mode 100644 index 000000000000..e96b00e63cc2 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextTranslationSkill.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// A skill to translate text from one language to another. + public partial class TextTranslationSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// + /// The language code to translate documents into for documents that don't specify + /// the to language explicitly. + /// + /// or is null. + public TextTranslationSkill(IEnumerable inputs, IEnumerable outputs, TextTranslationSkillLanguage defaultToLanguageCode) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + OdataType = "#Microsoft.Skills.Text.TranslationSkill"; + DefaultToLanguageCode = defaultToLanguageCode; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// + /// The language code to translate documents into for documents that don't specify + /// the to language explicitly. + /// + /// + /// The language code to translate documents from for documents that don't specify + /// the from language explicitly. + /// + /// + /// The language code to translate documents from when neither the fromLanguageCode + /// input nor the defaultFromLanguageCode parameter are provided, and the automatic + /// language detection is unsuccessful. Default is `en`. + /// + internal TextTranslationSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, TextTranslationSkillLanguage defaultToLanguageCode, TextTranslationSkillLanguage? defaultFromLanguageCode, TextTranslationSkillLanguage? suggestedFrom) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + DefaultToLanguageCode = defaultToLanguageCode; + DefaultFromLanguageCode = defaultFromLanguageCode; + SuggestedFrom = suggestedFrom; + } + + /// Initializes a new instance of for deserialization. + internal TextTranslationSkill() + { + } + + /// + /// The language code to translate documents into for documents that don't specify + /// the to language explicitly. + /// + public TextTranslationSkillLanguage DefaultToLanguageCode { get; set; } + /// + /// The language code to translate documents from for documents that don't specify + /// the from language explicitly. + /// + public TextTranslationSkillLanguage? DefaultFromLanguageCode { get; set; } + /// + /// The language code to translate documents from when neither the fromLanguageCode + /// input nor the defaultFromLanguageCode parameter are provided, and the automatic + /// language detection is unsuccessful. Default is `en`. + /// + public TextTranslationSkillLanguage? SuggestedFrom { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextTranslationSkillLanguage.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextTranslationSkillLanguage.cs new file mode 100644 index 000000000000..c82b4ffa5d9a --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextTranslationSkillLanguage.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// The language codes supported for input text by TextTranslationSkill. + public readonly partial struct TextTranslationSkillLanguage : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TextTranslationSkillLanguage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AfValue = "af"; + private const string ArValue = "ar"; + private const string BnValue = "bn"; + private const string BsValue = "bs"; + private const string BgValue = "bg"; + private const string YueValue = "yue"; + private const string CaValue = "ca"; + private const string ZhHansValue = "zh-Hans"; + private const string ZhHantValue = "zh-Hant"; + private const string HrValue = "hr"; + private const string CsValue = "cs"; + private const string DaValue = "da"; + private const string NlValue = "nl"; + private const string EnValue = "en"; + private const string EtValue = "et"; + private const string FjValue = "fj"; + private const string FilValue = "fil"; + private const string FiValue = "fi"; + private const string FrValue = "fr"; + private const string DeValue = "de"; + private const string ElValue = "el"; + private const string HtValue = "ht"; + private const string HeValue = "he"; + private const string HiValue = "hi"; + private const string MwwValue = "mww"; + private const string HuValue = "hu"; + private const string IsValue = "is"; + private const string IdValue = "id"; + private const string ItValue = "it"; + private const string JaValue = "ja"; + private const string SwValue = "sw"; + private const string TlhValue = "tlh"; + private const string TlhLatnValue = "tlh-Latn"; + private const string TlhPiqdValue = "tlh-Piqd"; + private const string KoValue = "ko"; + private const string LvValue = "lv"; + private const string LtValue = "lt"; + private const string MgValue = "mg"; + private const string MsValue = "ms"; + private const string MtValue = "mt"; + private const string NbValue = "nb"; + private const string FaValue = "fa"; + private const string PlValue = "pl"; + private const string PtValue = "pt"; + private const string PtBrValue = "pt-br"; + private const string PtPTValue = "pt-PT"; + private const string OtqValue = "otq"; + private const string RoValue = "ro"; + private const string RuValue = "ru"; + private const string SmValue = "sm"; + private const string SrCyrlValue = "sr-Cyrl"; + private const string SrLatnValue = "sr-Latn"; + private const string SkValue = "sk"; + private const string SlValue = "sl"; + private const string EsValue = "es"; + private const string SvValue = "sv"; + private const string TyValue = "ty"; + private const string TaValue = "ta"; + private const string TeValue = "te"; + private const string ThValue = "th"; + private const string ToValue = "to"; + private const string TrValue = "tr"; + private const string UkValue = "uk"; + private const string UrValue = "ur"; + private const string ViValue = "vi"; + private const string CyValue = "cy"; + private const string YuaValue = "yua"; + private const string GaValue = "ga"; + private const string KnValue = "kn"; + private const string MiValue = "mi"; + private const string MlValue = "ml"; + private const string PaValue = "pa"; + + /// Afrikaans. + public static TextTranslationSkillLanguage Af { get; } = new TextTranslationSkillLanguage(AfValue); + /// Arabic. + public static TextTranslationSkillLanguage Ar { get; } = new TextTranslationSkillLanguage(ArValue); + /// Bangla. + public static TextTranslationSkillLanguage Bn { get; } = new TextTranslationSkillLanguage(BnValue); + /// Bosnian (Latin). + public static TextTranslationSkillLanguage Bs { get; } = new TextTranslationSkillLanguage(BsValue); + /// Bulgarian. + public static TextTranslationSkillLanguage Bg { get; } = new TextTranslationSkillLanguage(BgValue); + /// Cantonese (Traditional). + public static TextTranslationSkillLanguage Yue { get; } = new TextTranslationSkillLanguage(YueValue); + /// Catalan. + public static TextTranslationSkillLanguage Ca { get; } = new TextTranslationSkillLanguage(CaValue); + /// Chinese Simplified. + public static TextTranslationSkillLanguage ZhHans { get; } = new TextTranslationSkillLanguage(ZhHansValue); + /// Chinese Traditional. + public static TextTranslationSkillLanguage ZhHant { get; } = new TextTranslationSkillLanguage(ZhHantValue); + /// Croatian. + public static TextTranslationSkillLanguage Hr { get; } = new TextTranslationSkillLanguage(HrValue); + /// Czech. + public static TextTranslationSkillLanguage Cs { get; } = new TextTranslationSkillLanguage(CsValue); + /// Danish. + public static TextTranslationSkillLanguage Da { get; } = new TextTranslationSkillLanguage(DaValue); + /// Dutch. + public static TextTranslationSkillLanguage Nl { get; } = new TextTranslationSkillLanguage(NlValue); + /// English. + public static TextTranslationSkillLanguage En { get; } = new TextTranslationSkillLanguage(EnValue); + /// Estonian. + public static TextTranslationSkillLanguage Et { get; } = new TextTranslationSkillLanguage(EtValue); + /// Fijian. + public static TextTranslationSkillLanguage Fj { get; } = new TextTranslationSkillLanguage(FjValue); + /// Filipino. + public static TextTranslationSkillLanguage Fil { get; } = new TextTranslationSkillLanguage(FilValue); + /// Finnish. + public static TextTranslationSkillLanguage Fi { get; } = new TextTranslationSkillLanguage(FiValue); + /// French. + public static TextTranslationSkillLanguage Fr { get; } = new TextTranslationSkillLanguage(FrValue); + /// German. + public static TextTranslationSkillLanguage De { get; } = new TextTranslationSkillLanguage(DeValue); + /// Greek. + public static TextTranslationSkillLanguage El { get; } = new TextTranslationSkillLanguage(ElValue); + /// Haitian Creole. + public static TextTranslationSkillLanguage Ht { get; } = new TextTranslationSkillLanguage(HtValue); + /// Hebrew. + public static TextTranslationSkillLanguage He { get; } = new TextTranslationSkillLanguage(HeValue); + /// Hindi. + public static TextTranslationSkillLanguage Hi { get; } = new TextTranslationSkillLanguage(HiValue); + /// Hmong Daw. + public static TextTranslationSkillLanguage Mww { get; } = new TextTranslationSkillLanguage(MwwValue); + /// Hungarian. + public static TextTranslationSkillLanguage Hu { get; } = new TextTranslationSkillLanguage(HuValue); + /// Icelandic. + public static TextTranslationSkillLanguage Is { get; } = new TextTranslationSkillLanguage(IsValue); + /// Indonesian. + public static TextTranslationSkillLanguage Id { get; } = new TextTranslationSkillLanguage(IdValue); + /// Italian. + public static TextTranslationSkillLanguage It { get; } = new TextTranslationSkillLanguage(ItValue); + /// Japanese. + public static TextTranslationSkillLanguage Ja { get; } = new TextTranslationSkillLanguage(JaValue); + /// Kiswahili. + public static TextTranslationSkillLanguage Sw { get; } = new TextTranslationSkillLanguage(SwValue); + /// Klingon. + public static TextTranslationSkillLanguage Tlh { get; } = new TextTranslationSkillLanguage(TlhValue); + /// Klingon (Latin script). + public static TextTranslationSkillLanguage TlhLatn { get; } = new TextTranslationSkillLanguage(TlhLatnValue); + /// Klingon (Klingon script). + public static TextTranslationSkillLanguage TlhPiqd { get; } = new TextTranslationSkillLanguage(TlhPiqdValue); + /// Korean. + public static TextTranslationSkillLanguage Ko { get; } = new TextTranslationSkillLanguage(KoValue); + /// Latvian. + public static TextTranslationSkillLanguage Lv { get; } = new TextTranslationSkillLanguage(LvValue); + /// Lithuanian. + public static TextTranslationSkillLanguage Lt { get; } = new TextTranslationSkillLanguage(LtValue); + /// Malagasy. + public static TextTranslationSkillLanguage Mg { get; } = new TextTranslationSkillLanguage(MgValue); + /// Malay. + public static TextTranslationSkillLanguage Ms { get; } = new TextTranslationSkillLanguage(MsValue); + /// Maltese. + public static TextTranslationSkillLanguage Mt { get; } = new TextTranslationSkillLanguage(MtValue); + /// Norwegian. + public static TextTranslationSkillLanguage Nb { get; } = new TextTranslationSkillLanguage(NbValue); + /// Persian. + public static TextTranslationSkillLanguage Fa { get; } = new TextTranslationSkillLanguage(FaValue); + /// Polish. + public static TextTranslationSkillLanguage Pl { get; } = new TextTranslationSkillLanguage(PlValue); + /// Portuguese. + public static TextTranslationSkillLanguage Pt { get; } = new TextTranslationSkillLanguage(PtValue); + /// Portuguese (Brazil). + public static TextTranslationSkillLanguage PtBr { get; } = new TextTranslationSkillLanguage(PtBrValue); + /// Portuguese (Portugal). + public static TextTranslationSkillLanguage PtPT { get; } = new TextTranslationSkillLanguage(PtPTValue); + /// Queretaro Otomi. + public static TextTranslationSkillLanguage Otq { get; } = new TextTranslationSkillLanguage(OtqValue); + /// Romanian. + public static TextTranslationSkillLanguage Ro { get; } = new TextTranslationSkillLanguage(RoValue); + /// Russian. + public static TextTranslationSkillLanguage Ru { get; } = new TextTranslationSkillLanguage(RuValue); + /// Samoan. + public static TextTranslationSkillLanguage Sm { get; } = new TextTranslationSkillLanguage(SmValue); + /// Serbian (Cyrillic). + public static TextTranslationSkillLanguage SrCyrl { get; } = new TextTranslationSkillLanguage(SrCyrlValue); + /// Serbian (Latin). + public static TextTranslationSkillLanguage SrLatn { get; } = new TextTranslationSkillLanguage(SrLatnValue); + /// Slovak. + public static TextTranslationSkillLanguage Sk { get; } = new TextTranslationSkillLanguage(SkValue); + /// Slovenian. + public static TextTranslationSkillLanguage Sl { get; } = new TextTranslationSkillLanguage(SlValue); + /// Spanish. + public static TextTranslationSkillLanguage Es { get; } = new TextTranslationSkillLanguage(EsValue); + /// Swedish. + public static TextTranslationSkillLanguage Sv { get; } = new TextTranslationSkillLanguage(SvValue); + /// Tahitian. + public static TextTranslationSkillLanguage Ty { get; } = new TextTranslationSkillLanguage(TyValue); + /// Tamil. + public static TextTranslationSkillLanguage Ta { get; } = new TextTranslationSkillLanguage(TaValue); + /// Telugu. + public static TextTranslationSkillLanguage Te { get; } = new TextTranslationSkillLanguage(TeValue); + /// Thai. + public static TextTranslationSkillLanguage Th { get; } = new TextTranslationSkillLanguage(ThValue); + /// Tongan. + public static TextTranslationSkillLanguage To { get; } = new TextTranslationSkillLanguage(ToValue); + /// Turkish. + public static TextTranslationSkillLanguage Tr { get; } = new TextTranslationSkillLanguage(TrValue); + /// Ukrainian. + public static TextTranslationSkillLanguage Uk { get; } = new TextTranslationSkillLanguage(UkValue); + /// Urdu. + public static TextTranslationSkillLanguage Ur { get; } = new TextTranslationSkillLanguage(UrValue); + /// Vietnamese. + public static TextTranslationSkillLanguage Vi { get; } = new TextTranslationSkillLanguage(ViValue); + /// Welsh. + public static TextTranslationSkillLanguage Cy { get; } = new TextTranslationSkillLanguage(CyValue); + /// Yucatec Maya. + public static TextTranslationSkillLanguage Yua { get; } = new TextTranslationSkillLanguage(YuaValue); + /// Irish. + public static TextTranslationSkillLanguage Ga { get; } = new TextTranslationSkillLanguage(GaValue); + /// Kannada. + public static TextTranslationSkillLanguage Kn { get; } = new TextTranslationSkillLanguage(KnValue); + /// Maori. + public static TextTranslationSkillLanguage Mi { get; } = new TextTranslationSkillLanguage(MiValue); + /// Malayalam. + public static TextTranslationSkillLanguage Ml { get; } = new TextTranslationSkillLanguage(MlValue); + /// Punjabi. + public static TextTranslationSkillLanguage Pa { get; } = new TextTranslationSkillLanguage(PaValue); + /// Determines if two values are the same. + public static bool operator ==(TextTranslationSkillLanguage left, TextTranslationSkillLanguage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TextTranslationSkillLanguage left, TextTranslationSkillLanguage right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TextTranslationSkillLanguage(string value) => new TextTranslationSkillLanguage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TextTranslationSkillLanguage other && Equals(other); + /// + public bool Equals(TextTranslationSkillLanguage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextWeights.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextWeights.Serialization.cs new file mode 100644 index 000000000000..3f156107c419 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextWeights.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class TextWeights : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextWeights)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("weights"u8); + writer.WriteStartObject(); + foreach (var item in Weights) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TextWeights IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextWeights)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTextWeights(document.RootElement, options); + } + + internal static TextWeights DeserializeTextWeights(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary weights = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("weights"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetDouble()); + } + weights = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TextWeights(weights, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TextWeights)} does not support writing '{options.Format}' format."); + } + } + + TextWeights IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTextWeights(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TextWeights)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TextWeights FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTextWeights(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextWeights.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextWeights.cs new file mode 100644 index 000000000000..99c490f3505d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TextWeights.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Defines weights on index fields for which matches should boost scoring in + /// search queries. + /// + public partial class TextWeights + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// The dictionary of per-field weights to boost document scoring. The keys are + /// field names and the values are the weights for each field. + /// + /// is null. + public TextWeights(IDictionary weights) + { + Argument.AssertNotNull(weights, nameof(weights)); + + Weights = weights; + } + + /// Initializes a new instance of . + /// + /// The dictionary of per-field weights to boost document scoring. The keys are + /// field names and the values are the weights for each field. + /// + /// Keeps track of any properties unknown to the library. + internal TextWeights(IDictionary weights, IDictionary serializedAdditionalRawData) + { + Weights = weights; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TextWeights() + { + } + + /// + /// The dictionary of per-field weights to boost document scoring. The keys are + /// field names and the values are the weights for each field. + /// + public IDictionary Weights { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TokenCharacterKind.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TokenCharacterKind.cs new file mode 100644 index 000000000000..32da0871d76d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TokenCharacterKind.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Represents classes of characters on which a token filter can operate. + public readonly partial struct TokenCharacterKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TokenCharacterKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LetterValue = "letter"; + private const string DigitValue = "digit"; + private const string WhitespaceValue = "whitespace"; + private const string PunctuationValue = "punctuation"; + private const string SymbolValue = "symbol"; + + /// Keeps letters in tokens. + public static TokenCharacterKind Letter { get; } = new TokenCharacterKind(LetterValue); + /// Keeps digits in tokens. + public static TokenCharacterKind Digit { get; } = new TokenCharacterKind(DigitValue); + /// Keeps whitespace in tokens. + public static TokenCharacterKind Whitespace { get; } = new TokenCharacterKind(WhitespaceValue); + /// Keeps punctuation in tokens. + public static TokenCharacterKind Punctuation { get; } = new TokenCharacterKind(PunctuationValue); + /// Keeps symbols in tokens. + public static TokenCharacterKind Symbol { get; } = new TokenCharacterKind(SymbolValue); + /// Determines if two values are the same. + public static bool operator ==(TokenCharacterKind left, TokenCharacterKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TokenCharacterKind left, TokenCharacterKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TokenCharacterKind(string value) => new TokenCharacterKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TokenCharacterKind other && Equals(other); + /// + public bool Equals(TokenCharacterKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TokenFilter.Serialization.cs new file mode 100644 index 000000000000..2b98708b37fd --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TokenFilter.Serialization.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + [PersistableModelProxy(typeof(UnknownTokenFilter))] + public partial class TokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TokenFilter)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("@odata.type"u8); + writer.WriteStringValue(OdataType); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTokenFilter(document.RootElement, options); + } + + internal static TokenFilter DeserializeTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("@odata.type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "#Microsoft.Azure.Search.AsciiFoldingTokenFilter": return AsciiFoldingTokenFilter.DeserializeAsciiFoldingTokenFilter(element, options); + case "#Microsoft.Azure.Search.CjkBigramTokenFilter": return CjkBigramTokenFilter.DeserializeCjkBigramTokenFilter(element, options); + case "#Microsoft.Azure.Search.CommonGramTokenFilter": return CommonGramTokenFilter.DeserializeCommonGramTokenFilter(element, options); + case "#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter": return DictionaryDecompounderTokenFilter.DeserializeDictionaryDecompounderTokenFilter(element, options); + case "#Microsoft.Azure.Search.EdgeNGramTokenFilterV2": return EdgeNGramTokenFilterV2.DeserializeEdgeNGramTokenFilterV2(element, options); + case "#Microsoft.Azure.Search.ElisionTokenFilter": return ElisionTokenFilter.DeserializeElisionTokenFilter(element, options); + case "#Microsoft.Azure.Search.KeepTokenFilter": return KeepTokenFilter.DeserializeKeepTokenFilter(element, options); + case "#Microsoft.Azure.Search.KeywordMarkerTokenFilter": return KeywordMarkerTokenFilter.DeserializeKeywordMarkerTokenFilter(element, options); + case "#Microsoft.Azure.Search.LengthTokenFilter": return LengthTokenFilter.DeserializeLengthTokenFilter(element, options); + case "#Microsoft.Azure.Search.LimitTokenFilter": return LimitTokenFilter.DeserializeLimitTokenFilter(element, options); + case "#Microsoft.Azure.Search.NGramTokenFilterV2": return NGramTokenFilterV2.DeserializeNGramTokenFilterV2(element, options); + case "#Microsoft.Azure.Search.PatternCaptureTokenFilter": return PatternCaptureTokenFilter.DeserializePatternCaptureTokenFilter(element, options); + case "#Microsoft.Azure.Search.PatternReplaceTokenFilter": return PatternReplaceTokenFilter.DeserializePatternReplaceTokenFilter(element, options); + case "#Microsoft.Azure.Search.PhoneticTokenFilter": return PhoneticTokenFilter.DeserializePhoneticTokenFilter(element, options); + case "#Microsoft.Azure.Search.ShingleTokenFilter": return ShingleTokenFilter.DeserializeShingleTokenFilter(element, options); + case "#Microsoft.Azure.Search.SnowballTokenFilter": return SnowballTokenFilter.DeserializeSnowballTokenFilter(element, options); + case "#Microsoft.Azure.Search.StemmerOverrideTokenFilter": return StemmerOverrideTokenFilter.DeserializeStemmerOverrideTokenFilter(element, options); + case "#Microsoft.Azure.Search.StemmerTokenFilter": return StemmerTokenFilter.DeserializeStemmerTokenFilter(element, options); + case "#Microsoft.Azure.Search.StopwordsTokenFilter": return StopwordsTokenFilter.DeserializeStopwordsTokenFilter(element, options); + case "#Microsoft.Azure.Search.SynonymTokenFilter": return SynonymTokenFilter.DeserializeSynonymTokenFilter(element, options); + case "#Microsoft.Azure.Search.TruncateTokenFilter": return TruncateTokenFilter.DeserializeTruncateTokenFilter(element, options); + case "#Microsoft.Azure.Search.UniqueTokenFilter": return UniqueTokenFilter.DeserializeUniqueTokenFilter(element, options); + case "#Microsoft.Azure.Search.WordDelimiterTokenFilter": return WordDelimiterTokenFilter.DeserializeWordDelimiterTokenFilter(element, options); + } + } + return UnknownTokenFilter.DeserializeUnknownTokenFilter(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TokenFilter)} does not support writing '{options.Format}' format."); + } + } + + TokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTokenFilter(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TokenFilter.cs new file mode 100644 index 000000000000..0b43e69247af --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TokenFilter.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Base type for token filters. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , , , , , , , , , , , , , , and . + /// + public abstract partial class TokenFilter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// is null. + protected TokenFilter(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + internal TokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData) + { + OdataType = odataType; + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TokenFilter() + { + } + + /// The discriminator for derived types. + internal string OdataType { get; set; } + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + public string Name { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TokenFilterName.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TokenFilterName.cs new file mode 100644 index 000000000000..407b005845ba --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TokenFilterName.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// Defines the names of all token filters supported by the search engine. + public readonly partial struct TokenFilterName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TokenFilterName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ArabicNormalizationValue = "arabic_normalization"; + private const string ApostropheValue = "apostrophe"; + private const string AsciiFoldingValue = "asciifolding"; + private const string CjkBigramValue = "cjk_bigram"; + private const string CjkWidthValue = "cjk_width"; + private const string ClassicValue = "classic"; + private const string CommonGramValue = "common_grams"; + private const string EdgeNGramValue = "edgeNGram_v2"; + private const string ElisionValue = "elision"; + private const string GermanNormalizationValue = "german_normalization"; + private const string HindiNormalizationValue = "hindi_normalization"; + private const string IndicNormalizationValue = "indic_normalization"; + private const string KeywordRepeatValue = "keyword_repeat"; + private const string KStemValue = "kstem"; + private const string LengthValue = "length"; + private const string LimitValue = "limit"; + private const string LowercaseValue = "lowercase"; + private const string NGramValue = "nGram_v2"; + private const string PersianNormalizationValue = "persian_normalization"; + private const string PhoneticValue = "phonetic"; + private const string PorterStemValue = "porter_stem"; + private const string ReverseValue = "reverse"; + private const string ScandinavianNormalizationValue = "scandinavian_normalization"; + private const string ScandinavianFoldingNormalizationValue = "scandinavian_folding"; + private const string ShingleValue = "shingle"; + private const string SnowballValue = "snowball"; + private const string SoraniNormalizationValue = "sorani_normalization"; + private const string StemmerValue = "stemmer"; + private const string StopwordsValue = "stopwords"; + private const string TrimValue = "trim"; + private const string TruncateValue = "truncate"; + private const string UniqueValue = "unique"; + private const string UppercaseValue = "uppercase"; + private const string WordDelimiterValue = "word_delimiter"; + + /// + /// A token filter that applies the Arabic normalizer to normalize the orthography. + /// See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ar/ArabicNormalizationFilter.html + /// + public static TokenFilterName ArabicNormalization { get; } = new TokenFilterName(ArabicNormalizationValue); + /// + /// Strips all characters after an apostrophe (including the apostrophe itself). + /// See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/tr/ApostropheFilter.html + /// + public static TokenFilterName Apostrophe { get; } = new TokenFilterName(ApostropheValue); + /// + /// Converts alphabetic, numeric, and symbolic Unicode characters which are not in + /// the first 127 ASCII characters (the "Basic Latin" Unicode block) into their + /// ASCII equivalents, if such equivalents exist. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/ASCIIFoldingFilter.html + /// + public static TokenFilterName AsciiFolding { get; } = new TokenFilterName(AsciiFoldingValue); + /// + /// Forms bigrams of CJK terms that are generated from the standard tokenizer. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/cjk/CJKBigramFilter.html + /// + public static TokenFilterName CjkBigram { get; } = new TokenFilterName(CjkBigramValue); + /// + /// Normalizes CJK width differences. Folds fullwidth ASCII variants into the + /// equivalent basic Latin, and half-width Katakana variants into the equivalent + /// Kana. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/cjk/CJKWidthFilter.html + /// + public static TokenFilterName CjkWidth { get; } = new TokenFilterName(CjkWidthValue); + /// + /// Removes English possessives, and dots from acronyms. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/ClassicFilter.html + /// + public static TokenFilterName Classic { get; } = new TokenFilterName(ClassicValue); + /// + /// Construct bigrams for frequently occurring terms while indexing. Single terms + /// are still indexed too, with bigrams overlaid. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/commongrams/CommonGramsFilter.html + /// + public static TokenFilterName CommonGram { get; } = new TokenFilterName(CommonGramValue); + /// + /// Generates n-grams of the given size(s) starting from the front or the back of + /// an input token. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilter.html + /// + public static TokenFilterName EdgeNGram { get; } = new TokenFilterName(EdgeNGramValue); + /// + /// Removes elisions. For example, "l'avion" (the plane) will be converted to + /// "avion" (plane). See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/util/ElisionFilter.html + /// + public static TokenFilterName Elision { get; } = new TokenFilterName(ElisionValue); + /// + /// Normalizes German characters according to the heuristics of the German2 + /// snowball algorithm. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/de/GermanNormalizationFilter.html + /// + public static TokenFilterName GermanNormalization { get; } = new TokenFilterName(GermanNormalizationValue); + /// + /// Normalizes text in Hindi to remove some differences in spelling variations. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/hi/HindiNormalizationFilter.html + /// + public static TokenFilterName HindiNormalization { get; } = new TokenFilterName(HindiNormalizationValue); + /// + /// Normalizes the Unicode representation of text in Indian languages. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/in/IndicNormalizationFilter.html + /// + public static TokenFilterName IndicNormalization { get; } = new TokenFilterName(IndicNormalizationValue); + /// + /// Emits each incoming token twice, once as keyword and once as non-keyword. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/KeywordRepeatFilter.html + /// + public static TokenFilterName KeywordRepeat { get; } = new TokenFilterName(KeywordRepeatValue); + /// + /// A high-performance kstem filter for English. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/en/KStemFilter.html + /// + public static TokenFilterName KStem { get; } = new TokenFilterName(KStemValue); + /// + /// Removes words that are too long or too short. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/LengthFilter.html + /// + public static TokenFilterName Length { get; } = new TokenFilterName(LengthValue); + /// + /// Limits the number of tokens while indexing. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/LimitTokenCountFilter.html + /// + public static TokenFilterName Limit { get; } = new TokenFilterName(LimitValue); + /// + /// Normalizes token text to lower case. See + /// https://lucene.apache.org/core/6_6_1/analyzers-common/org/apache/lucene/analysis/core/LowerCaseFilter.html + /// + public static TokenFilterName Lowercase { get; } = new TokenFilterName(LowercaseValue); + /// + /// Generates n-grams of the given size(s). See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/NGramTokenFilter.html + /// + public static TokenFilterName NGram { get; } = new TokenFilterName(NGramValue); + /// + /// Applies normalization for Persian. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/fa/PersianNormalizationFilter.html + /// + public static TokenFilterName PersianNormalization { get; } = new TokenFilterName(PersianNormalizationValue); + /// + /// Create tokens for phonetic matches. See + /// https://lucene.apache.org/core/4_10_3/analyzers-phonetic/org/apache/lucene/analysis/phonetic/package-tree.html + /// + public static TokenFilterName Phonetic { get; } = new TokenFilterName(PhoneticValue); + /// + /// Uses the Porter stemming algorithm to transform the token stream. See + /// http://tartarus.org/~martin/PorterStemmer + /// + public static TokenFilterName PorterStem { get; } = new TokenFilterName(PorterStemValue); + /// + /// Reverses the token string. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/reverse/ReverseStringFilter.html + /// + public static TokenFilterName Reverse { get; } = new TokenFilterName(ReverseValue); + /// + /// Normalizes use of the interchangeable Scandinavian characters. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/ScandinavianNormalizationFilter.html + /// + public static TokenFilterName ScandinavianNormalization { get; } = new TokenFilterName(ScandinavianNormalizationValue); + /// + /// Folds Scandinavian characters åÅäæÄÆ->a and öÖøØ->o. It also + /// discriminates against use of double vowels aa, ae, ao, oe and oo, leaving just + /// the first one. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/ScandinavianFoldingFilter.html + /// + public static TokenFilterName ScandinavianFoldingNormalization { get; } = new TokenFilterName(ScandinavianFoldingNormalizationValue); + /// + /// Creates combinations of tokens as a single token. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/shingle/ShingleFilter.html + /// + public static TokenFilterName Shingle { get; } = new TokenFilterName(ShingleValue); + /// + /// A filter that stems words using a Snowball-generated stemmer. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/snowball/SnowballFilter.html + /// + public static TokenFilterName Snowball { get; } = new TokenFilterName(SnowballValue); + /// + /// Normalizes the Unicode representation of Sorani text. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ckb/SoraniNormalizationFilter.html + /// + public static TokenFilterName SoraniNormalization { get; } = new TokenFilterName(SoraniNormalizationValue); + /// + /// Language specific stemming filter. See + /// https://learn.microsoft.com/rest/api/searchservice/Custom-analyzers-in-Azure-Search#TokenFilters + /// + public static TokenFilterName Stemmer { get; } = new TokenFilterName(StemmerValue); + /// + /// Removes stop words from a token stream. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/StopFilter.html + /// + public static TokenFilterName Stopwords { get; } = new TokenFilterName(StopwordsValue); + /// + /// Trims leading and trailing whitespace from tokens. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/TrimFilter.html + /// + public static TokenFilterName Trim { get; } = new TokenFilterName(TrimValue); + /// + /// Truncates the terms to a specific length. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilter.html + /// + public static TokenFilterName Truncate { get; } = new TokenFilterName(TruncateValue); + /// + /// Filters out tokens with same text as the previous token. See + /// http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/RemoveDuplicatesTokenFilter.html + /// + public static TokenFilterName Unique { get; } = new TokenFilterName(UniqueValue); + /// + /// Normalizes token text to upper case. See + /// https://lucene.apache.org/core/6_6_1/analyzers-common/org/apache/lucene/analysis/core/UpperCaseFilter.html + /// + public static TokenFilterName Uppercase { get; } = new TokenFilterName(UppercaseValue); + /// + /// Splits words into subwords and performs optional transformations on subword + /// groups. + /// + public static TokenFilterName WordDelimiter { get; } = new TokenFilterName(WordDelimiterValue); + /// Determines if two values are the same. + public static bool operator ==(TokenFilterName left, TokenFilterName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TokenFilterName left, TokenFilterName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TokenFilterName(string value) => new TokenFilterName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TokenFilterName other && Equals(other); + /// + public bool Equals(TokenFilterName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TruncateTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TruncateTokenFilter.Serialization.cs new file mode 100644 index 000000000000..172aa843defa --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TruncateTokenFilter.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class TruncateTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TruncateTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Length)) + { + writer.WritePropertyName("length"u8); + writer.WriteNumberValue(Length.Value); + } + } + + TruncateTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TruncateTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTruncateTokenFilter(document.RootElement, options); + } + + internal static TruncateTokenFilter DeserializeTruncateTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? length = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("length"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + length = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TruncateTokenFilter(odataType, name, serializedAdditionalRawData, length); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TruncateTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + TruncateTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTruncateTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TruncateTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new TruncateTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTruncateTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TruncateTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TruncateTokenFilter.cs new file mode 100644 index 000000000000..58ae37b8c7a5 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/TruncateTokenFilter.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Truncates the terms to a specific length. This token filter is implemented + /// using Apache Lucene. + /// + public partial class TruncateTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// is null. + public TruncateTokenFilter(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.TruncateTokenFilter"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// The length at which terms will be truncated. Default and maximum is 300. + internal TruncateTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, int? length) : base(odataType, name, serializedAdditionalRawData) + { + Length = length; + } + + /// Initializes a new instance of for deserialization. + internal TruncateTokenFilter() + { + } + + /// The length at which terms will be truncated. Default and maximum is 300. + public int? Length { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UaxUrlEmailTokenizer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UaxUrlEmailTokenizer.Serialization.cs new file mode 100644 index 000000000000..9e275f7821d1 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UaxUrlEmailTokenizer.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class UaxUrlEmailTokenizer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UaxUrlEmailTokenizer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(MaxTokenLength)) + { + writer.WritePropertyName("maxTokenLength"u8); + writer.WriteNumberValue(MaxTokenLength.Value); + } + } + + UaxUrlEmailTokenizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UaxUrlEmailTokenizer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUaxUrlEmailTokenizer(document.RootElement, options); + } + + internal static UaxUrlEmailTokenizer DeserializeUaxUrlEmailTokenizer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxTokenLength = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxTokenLength"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxTokenLength = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UaxUrlEmailTokenizer(odataType, name, serializedAdditionalRawData, maxTokenLength); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UaxUrlEmailTokenizer)} does not support writing '{options.Format}' format."); + } + } + + UaxUrlEmailTokenizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUaxUrlEmailTokenizer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UaxUrlEmailTokenizer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UaxUrlEmailTokenizer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUaxUrlEmailTokenizer(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UaxUrlEmailTokenizer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UaxUrlEmailTokenizer.cs new file mode 100644 index 000000000000..d6b21d4335bf --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UaxUrlEmailTokenizer.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Tokenizes urls and emails as one token. This tokenizer is implemented using + /// Apache Lucene. + /// + public partial class UaxUrlEmailTokenizer : LexicalTokenizer + { + /// Initializes a new instance of . + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// is null. + public UaxUrlEmailTokenizer(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.UaxUrlEmailTokenizer"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// The maximum token length. Default is 255. Tokens longer than the maximum length + /// are split. The maximum token length that can be used is 300 characters. + /// + internal UaxUrlEmailTokenizer(string odataType, string name, IDictionary serializedAdditionalRawData, int? maxTokenLength) : base(odataType, name, serializedAdditionalRawData) + { + MaxTokenLength = maxTokenLength; + } + + /// Initializes a new instance of for deserialization. + internal UaxUrlEmailTokenizer() + { + } + + /// + /// The maximum token length. Default is 255. Tokens longer than the maximum length + /// are split. The maximum token length that can be used is 300 characters. + /// + public int? MaxTokenLength { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UniqueTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UniqueTokenFilter.Serialization.cs new file mode 100644 index 000000000000..624c414cb182 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UniqueTokenFilter.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class UniqueTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UniqueTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(OnlyOnSamePosition)) + { + writer.WritePropertyName("onlyOnSamePosition"u8); + writer.WriteBooleanValue(OnlyOnSamePosition.Value); + } + } + + UniqueTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UniqueTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUniqueTokenFilter(document.RootElement, options); + } + + internal static UniqueTokenFilter DeserializeUniqueTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? onlyOnSamePosition = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("onlyOnSamePosition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + onlyOnSamePosition = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UniqueTokenFilter(odataType, name, serializedAdditionalRawData, onlyOnSamePosition); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UniqueTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + UniqueTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUniqueTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UniqueTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UniqueTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUniqueTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UniqueTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UniqueTokenFilter.cs new file mode 100644 index 000000000000..2a5396bc7735 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UniqueTokenFilter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Filters out tokens with same text as the previous token. This token filter is + /// implemented using Apache Lucene. + /// + public partial class UniqueTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// is null. + public UniqueTokenFilter(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.UniqueTokenFilter"; + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// A value indicating whether to remove duplicates only at the same position. + /// Default is false. + /// + internal UniqueTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, bool? onlyOnSamePosition) : base(odataType, name, serializedAdditionalRawData) + { + OnlyOnSamePosition = onlyOnSamePosition; + } + + /// Initializes a new instance of for deserialization. + internal UniqueTokenFilter() + { + } + + /// + /// A value indicating whether to remove duplicates only at the same position. + /// Default is false. + /// + public bool? OnlyOnSamePosition { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownCharFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownCharFilter.Serialization.cs new file mode 100644 index 000000000000..6bcf0f4c0c14 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownCharFilter.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + internal partial class UnknownCharFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CharFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + CharFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CharFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCharFilter(document.RootElement, options); + } + + internal static UnknownCharFilter DeserializeUnknownCharFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string odataType = "Unknown"; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownCharFilter(odataType, name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CharFilter)} does not support writing '{options.Format}' format."); + } + } + + CharFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCharFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CharFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownCharFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownCharFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownCharFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownCharFilter.cs new file mode 100644 index 000000000000..ae9257d9efcd --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownCharFilter.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Unknown version of CharFilter. + internal partial class UnknownCharFilter : CharFilter + { + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the char filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + internal UnknownCharFilter(string odataType, string name, IDictionary serializedAdditionalRawData) : base(odataType, name, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownCharFilter() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownCognitiveServicesAccount.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownCognitiveServicesAccount.Serialization.cs new file mode 100644 index 000000000000..4a40f0fb3e39 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownCognitiveServicesAccount.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + internal partial class UnknownCognitiveServicesAccount : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CognitiveServicesAccount)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + CognitiveServicesAccount IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CognitiveServicesAccount)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCognitiveServicesAccount(document.RootElement, options); + } + + internal static UnknownCognitiveServicesAccount DeserializeUnknownCognitiveServicesAccount(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string odataType = "Unknown"; + string description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownCognitiveServicesAccount(odataType, description, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CognitiveServicesAccount)} does not support writing '{options.Format}' format."); + } + } + + CognitiveServicesAccount IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCognitiveServicesAccount(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CognitiveServicesAccount)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownCognitiveServicesAccount FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownCognitiveServicesAccount(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownCognitiveServicesAccount.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownCognitiveServicesAccount.cs new file mode 100644 index 000000000000..7c353ee4f7d1 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownCognitiveServicesAccount.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Unknown version of CognitiveServicesAccount. + internal partial class UnknownCognitiveServicesAccount : CognitiveServicesAccount + { + /// Initializes a new instance of . + /// The discriminator for derived types. + /// Description of the Azure AI service resource attached to a skillset. + /// Keeps track of any properties unknown to the library. + internal UnknownCognitiveServicesAccount(string odataType, string description, IDictionary serializedAdditionalRawData) : base(odataType, description, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownCognitiveServicesAccount() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownDataChangeDetectionPolicy.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownDataChangeDetectionPolicy.Serialization.cs new file mode 100644 index 000000000000..a678038714ae --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownDataChangeDetectionPolicy.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + internal partial class UnknownDataChangeDetectionPolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataChangeDetectionPolicy)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataChangeDetectionPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataChangeDetectionPolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataChangeDetectionPolicy(document.RootElement, options); + } + + internal static UnknownDataChangeDetectionPolicy DeserializeUnknownDataChangeDetectionPolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string odataType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataChangeDetectionPolicy(odataType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataChangeDetectionPolicy)} does not support writing '{options.Format}' format."); + } + } + + DataChangeDetectionPolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataChangeDetectionPolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataChangeDetectionPolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownDataChangeDetectionPolicy FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownDataChangeDetectionPolicy(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownDataChangeDetectionPolicy.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownDataChangeDetectionPolicy.cs new file mode 100644 index 000000000000..29f79c50c9bc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownDataChangeDetectionPolicy.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Unknown version of DataChangeDetectionPolicy. + internal partial class UnknownDataChangeDetectionPolicy : DataChangeDetectionPolicy + { + /// Initializes a new instance of . + /// The discriminator for derived types. + /// Keeps track of any properties unknown to the library. + internal UnknownDataChangeDetectionPolicy(string odataType, IDictionary serializedAdditionalRawData) : base(odataType, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataChangeDetectionPolicy() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownDataDeletionDetectionPolicy.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownDataDeletionDetectionPolicy.Serialization.cs new file mode 100644 index 000000000000..a7bfdd248cbe --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownDataDeletionDetectionPolicy.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + internal partial class UnknownDataDeletionDetectionPolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataDeletionDetectionPolicy)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataDeletionDetectionPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataDeletionDetectionPolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataDeletionDetectionPolicy(document.RootElement, options); + } + + internal static UnknownDataDeletionDetectionPolicy DeserializeUnknownDataDeletionDetectionPolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string odataType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataDeletionDetectionPolicy(odataType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataDeletionDetectionPolicy)} does not support writing '{options.Format}' format."); + } + } + + DataDeletionDetectionPolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataDeletionDetectionPolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataDeletionDetectionPolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownDataDeletionDetectionPolicy FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownDataDeletionDetectionPolicy(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownDataDeletionDetectionPolicy.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownDataDeletionDetectionPolicy.cs new file mode 100644 index 000000000000..c92d71d6c567 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownDataDeletionDetectionPolicy.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Unknown version of DataDeletionDetectionPolicy. + internal partial class UnknownDataDeletionDetectionPolicy : DataDeletionDetectionPolicy + { + /// Initializes a new instance of . + /// The discriminator for derived types. + /// Keeps track of any properties unknown to the library. + internal UnknownDataDeletionDetectionPolicy(string odataType, IDictionary serializedAdditionalRawData) : base(odataType, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataDeletionDetectionPolicy() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownLexicalAnalyzer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownLexicalAnalyzer.Serialization.cs new file mode 100644 index 000000000000..2df425d40e83 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownLexicalAnalyzer.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + internal partial class UnknownLexicalAnalyzer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LexicalAnalyzer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + LexicalAnalyzer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LexicalAnalyzer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLexicalAnalyzer(document.RootElement, options); + } + + internal static UnknownLexicalAnalyzer DeserializeUnknownLexicalAnalyzer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string odataType = "Unknown"; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownLexicalAnalyzer(odataType, name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LexicalAnalyzer)} does not support writing '{options.Format}' format."); + } + } + + LexicalAnalyzer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLexicalAnalyzer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LexicalAnalyzer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownLexicalAnalyzer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownLexicalAnalyzer(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownLexicalAnalyzer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownLexicalAnalyzer.cs new file mode 100644 index 000000000000..dbe0ff9dca3d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownLexicalAnalyzer.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Unknown version of LexicalAnalyzer. + internal partial class UnknownLexicalAnalyzer : LexicalAnalyzer + { + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the analyzer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + internal UnknownLexicalAnalyzer(string odataType, string name, IDictionary serializedAdditionalRawData) : base(odataType, name, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownLexicalAnalyzer() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownLexicalTokenizer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownLexicalTokenizer.Serialization.cs new file mode 100644 index 000000000000..646fcbd29d51 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownLexicalTokenizer.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + internal partial class UnknownLexicalTokenizer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LexicalTokenizer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + LexicalTokenizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LexicalTokenizer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLexicalTokenizer(document.RootElement, options); + } + + internal static UnknownLexicalTokenizer DeserializeUnknownLexicalTokenizer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string odataType = "Unknown"; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownLexicalTokenizer(odataType, name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LexicalTokenizer)} does not support writing '{options.Format}' format."); + } + } + + LexicalTokenizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLexicalTokenizer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LexicalTokenizer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownLexicalTokenizer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownLexicalTokenizer(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownLexicalTokenizer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownLexicalTokenizer.cs new file mode 100644 index 000000000000..b07047ed374f --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownLexicalTokenizer.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Unknown version of LexicalTokenizer. + internal partial class UnknownLexicalTokenizer : LexicalTokenizer + { + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the tokenizer. It must only contain letters, digits, spaces, dashes + /// or underscores, can only start and end with alphanumeric characters, and is + /// limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + internal UnknownLexicalTokenizer(string odataType, string name, IDictionary serializedAdditionalRawData) : base(odataType, name, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownLexicalTokenizer() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownScoringFunction.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownScoringFunction.Serialization.cs new file mode 100644 index 000000000000..083744db60b4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownScoringFunction.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + internal partial class UnknownScoringFunction : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ScoringFunction)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ScoringFunction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ScoringFunction)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeScoringFunction(document.RootElement, options); + } + + internal static UnknownScoringFunction DeserializeUnknownScoringFunction(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string fieldName = default; + double boost = default; + ScoringFunctionInterpolation? interpolation = default; + string type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("fieldName"u8)) + { + fieldName = property.Value.GetString(); + continue; + } + if (property.NameEquals("boost"u8)) + { + boost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("interpolation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + interpolation = new ScoringFunctionInterpolation(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownScoringFunction(fieldName, boost, interpolation, type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ScoringFunction)} does not support writing '{options.Format}' format."); + } + } + + ScoringFunction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeScoringFunction(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ScoringFunction)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownScoringFunction FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownScoringFunction(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownScoringFunction.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownScoringFunction.cs new file mode 100644 index 000000000000..65118963667a --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownScoringFunction.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Unknown version of ScoringFunction. + internal partial class UnknownScoringFunction : ScoringFunction + { + /// Initializes a new instance of . + /// The name of the field used as input to the scoring function. + /// A multiplier for the raw score. Must be a positive number not equal to 1.0. + /// + /// A value indicating how boosting will be interpolated across document scores; + /// defaults to "Linear". + /// + /// Type of ScoringFunction. + /// Keeps track of any properties unknown to the library. + internal UnknownScoringFunction(string fieldName, double boost, ScoringFunctionInterpolation? interpolation, string type, IDictionary serializedAdditionalRawData) : base(fieldName, boost, interpolation, type, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownScoringFunction() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSearchIndexerDataIdentity.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSearchIndexerDataIdentity.Serialization.cs new file mode 100644 index 000000000000..242605419566 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSearchIndexerDataIdentity.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + internal partial class UnknownSearchIndexerDataIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerDataIdentity)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SearchIndexerDataIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerDataIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerDataIdentity(document.RootElement, options); + } + + internal static UnknownSearchIndexerDataIdentity DeserializeUnknownSearchIndexerDataIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string odataType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownSearchIndexerDataIdentity(odataType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerDataIdentity)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerDataIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerDataIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerDataIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownSearchIndexerDataIdentity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownSearchIndexerDataIdentity(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSearchIndexerDataIdentity.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSearchIndexerDataIdentity.cs new file mode 100644 index 000000000000..6aac6469eb38 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSearchIndexerDataIdentity.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Unknown version of SearchIndexerDataIdentity. + internal partial class UnknownSearchIndexerDataIdentity : SearchIndexerDataIdentity + { + /// Initializes a new instance of . + /// A URI fragment specifying the type of identity. + /// Keeps track of any properties unknown to the library. + internal UnknownSearchIndexerDataIdentity(string odataType, IDictionary serializedAdditionalRawData) : base(odataType, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownSearchIndexerDataIdentity() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSearchIndexerSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSearchIndexerSkill.Serialization.cs new file mode 100644 index 000000000000..0e911a1ee956 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSearchIndexerSkill.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + internal partial class UnknownSearchIndexerSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SearchIndexerSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchIndexerSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchIndexerSkill(document.RootElement, options); + } + + internal static UnknownSearchIndexerSkill DeserializeUnknownSearchIndexerSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string odataType = "Unknown"; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownSearchIndexerSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchIndexerSkill)} does not support writing '{options.Format}' format."); + } + } + + SearchIndexerSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchIndexerSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchIndexerSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownSearchIndexerSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownSearchIndexerSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSearchIndexerSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSearchIndexerSkill.cs new file mode 100644 index 000000000000..16fa0bd734dc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSearchIndexerSkill.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Unknown version of SearchIndexerSkill. + internal partial class UnknownSearchIndexerSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + internal UnknownSearchIndexerSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownSearchIndexerSkill() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSimilarityAlgorithm.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSimilarityAlgorithm.Serialization.cs new file mode 100644 index 000000000000..862cdeaf16b9 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSimilarityAlgorithm.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + internal partial class UnknownSimilarityAlgorithm : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SimilarityAlgorithm)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SimilarityAlgorithm IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SimilarityAlgorithm)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSimilarityAlgorithm(document.RootElement, options); + } + + internal static UnknownSimilarityAlgorithm DeserializeUnknownSimilarityAlgorithm(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string odataType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownSimilarityAlgorithm(odataType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SimilarityAlgorithm)} does not support writing '{options.Format}' format."); + } + } + + SimilarityAlgorithm IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSimilarityAlgorithm(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SimilarityAlgorithm)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownSimilarityAlgorithm FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownSimilarityAlgorithm(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSimilarityAlgorithm.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSimilarityAlgorithm.cs new file mode 100644 index 000000000000..9845a2f223ce --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownSimilarityAlgorithm.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Unknown version of SimilarityAlgorithm. + internal partial class UnknownSimilarityAlgorithm : SimilarityAlgorithm + { + /// Initializes a new instance of . + /// The discriminator for derived types. + /// Keeps track of any properties unknown to the library. + internal UnknownSimilarityAlgorithm(string odataType, IDictionary serializedAdditionalRawData) : base(odataType, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownSimilarityAlgorithm() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownTokenFilter.Serialization.cs new file mode 100644 index 000000000000..c140ed5da59d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownTokenFilter.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + internal partial class UnknownTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + TokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTokenFilter(document.RootElement, options); + } + + internal static UnknownTokenFilter DeserializeUnknownTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string odataType = "Unknown"; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownTokenFilter(odataType, name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TokenFilter)} does not support writing '{options.Format}' format."); + } + } + + TokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownTokenFilter.cs new file mode 100644 index 000000000000..c80aafacb601 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownTokenFilter.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Unknown version of TokenFilter. + internal partial class UnknownTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + internal UnknownTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData) : base(odataType, name, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownTokenFilter() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchAlgorithmConfiguration.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchAlgorithmConfiguration.Serialization.cs new file mode 100644 index 000000000000..527501391a7f --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchAlgorithmConfiguration.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + internal partial class UnknownVectorSearchAlgorithmConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorSearchAlgorithmConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + VectorSearchAlgorithmConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorSearchAlgorithmConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVectorSearchAlgorithmConfiguration(document.RootElement, options); + } + + internal static UnknownVectorSearchAlgorithmConfiguration DeserializeUnknownVectorSearchAlgorithmConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + VectorSearchAlgorithmKind kind = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new VectorSearchAlgorithmKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownVectorSearchAlgorithmConfiguration(name, kind, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VectorSearchAlgorithmConfiguration)} does not support writing '{options.Format}' format."); + } + } + + VectorSearchAlgorithmConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorSearchAlgorithmConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VectorSearchAlgorithmConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownVectorSearchAlgorithmConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownVectorSearchAlgorithmConfiguration(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchAlgorithmConfiguration.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchAlgorithmConfiguration.cs new file mode 100644 index 000000000000..2cdbb63a02ed --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchAlgorithmConfiguration.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Unknown version of VectorSearchAlgorithmConfiguration. + internal partial class UnknownVectorSearchAlgorithmConfiguration : VectorSearchAlgorithmConfiguration + { + /// Initializes a new instance of . + /// The name to associate with this particular configuration. + /// Type of VectorSearchAlgorithmConfiguration. + /// Keeps track of any properties unknown to the library. + internal UnknownVectorSearchAlgorithmConfiguration(string name, VectorSearchAlgorithmKind kind, IDictionary serializedAdditionalRawData) : base(name, kind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownVectorSearchAlgorithmConfiguration() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchCompression.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchCompression.Serialization.cs new file mode 100644 index 000000000000..488cda7df316 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchCompression.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + internal partial class UnknownVectorSearchCompression : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorSearchCompression)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + VectorSearchCompression IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorSearchCompression)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVectorSearchCompression(document.RootElement, options); + } + + internal static UnknownVectorSearchCompression DeserializeUnknownVectorSearchCompression(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + bool? rerankWithOriginalVectors = default; + double? defaultOversampling = default; + VectorSearchCompressionKind kind = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("rerankWithOriginalVectors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rerankWithOriginalVectors = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("defaultOversampling"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultOversampling = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new VectorSearchCompressionKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownVectorSearchCompression(name, rerankWithOriginalVectors, defaultOversampling, kind, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VectorSearchCompression)} does not support writing '{options.Format}' format."); + } + } + + VectorSearchCompression IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorSearchCompression(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VectorSearchCompression)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownVectorSearchCompression FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownVectorSearchCompression(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchCompression.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchCompression.cs new file mode 100644 index 000000000000..c2629a5b27e6 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchCompression.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Unknown version of VectorSearchCompression. + internal partial class UnknownVectorSearchCompression : VectorSearchCompression + { + /// Initializes a new instance of . + /// The name to associate with this particular configuration. + /// + /// If set to true, once the ordered set of results calculated using compressed + /// vectors are obtained, they will be reranked again by recalculating the + /// full-precision similarity scores. This will improve recall at the expense of + /// latency. + /// + /// + /// Default oversampling factor. Oversampling will internally request more + /// documents (specified by this multiplier) in the initial search. This increases + /// the set of results that will be reranked using recomputed similarity scores + /// from full-precision vectors. Minimum value is 1, meaning no oversampling (1x). + /// This parameter can only be set when rerankWithOriginalVectors is true. Higher + /// values improve recall at the expense of latency. + /// + /// Type of VectorSearchCompression. + /// Keeps track of any properties unknown to the library. + internal UnknownVectorSearchCompression(string name, bool? rerankWithOriginalVectors, double? defaultOversampling, VectorSearchCompressionKind kind, IDictionary serializedAdditionalRawData) : base(name, rerankWithOriginalVectors, defaultOversampling, kind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownVectorSearchCompression() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchVectorizer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchVectorizer.Serialization.cs new file mode 100644 index 000000000000..12ac21e3227d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchVectorizer.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + internal partial class UnknownVectorSearchVectorizer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorSearchVectorizer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + VectorSearchVectorizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorSearchVectorizer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVectorSearchVectorizer(document.RootElement, options); + } + + internal static UnknownVectorSearchVectorizer DeserializeUnknownVectorSearchVectorizer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + VectorSearchVectorizerKind kind = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new VectorSearchVectorizerKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownVectorSearchVectorizer(name, kind, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VectorSearchVectorizer)} does not support writing '{options.Format}' format."); + } + } + + VectorSearchVectorizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorSearchVectorizer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VectorSearchVectorizer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownVectorSearchVectorizer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownVectorSearchVectorizer(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchVectorizer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchVectorizer.cs new file mode 100644 index 000000000000..177db3dd1d02 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/UnknownVectorSearchVectorizer.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Unknown version of VectorSearchVectorizer. + internal partial class UnknownVectorSearchVectorizer : VectorSearchVectorizer + { + /// Initializes a new instance of . + /// The name to associate with this particular vectorization method. + /// Type of VectorSearchVectorizer. + /// Keeps track of any properties unknown to the library. + internal UnknownVectorSearchVectorizer(string name, VectorSearchVectorizerKind kind, IDictionary serializedAdditionalRawData) : base(name, kind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownVectorSearchVectorizer() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorEncodingFormat.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorEncodingFormat.cs new file mode 100644 index 000000000000..27c3b90789c4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorEncodingFormat.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 +{ + /// The encoding format for interpreting vector field contents. + public readonly partial struct VectorEncodingFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VectorEncodingFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PackedBitValue = "packedBit"; + + /// Encoding format representing bits packed into a wider data type. + public static VectorEncodingFormat PackedBit { get; } = new VectorEncodingFormat(PackedBitValue); + /// Determines if two values are the same. + public static bool operator ==(VectorEncodingFormat left, VectorEncodingFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VectorEncodingFormat left, VectorEncodingFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VectorEncodingFormat(string value) => new VectorEncodingFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VectorEncodingFormat other && Equals(other); + /// + public bool Equals(VectorEncodingFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearch.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearch.Serialization.cs new file mode 100644 index 000000000000..9c77072a8d1a --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearch.Serialization.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class VectorSearch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorSearch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Profiles)) + { + writer.WritePropertyName("profiles"u8); + writer.WriteStartArray(); + foreach (var item in Profiles) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Algorithms)) + { + writer.WritePropertyName("algorithms"u8); + writer.WriteStartArray(); + foreach (var item in Algorithms) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Vectorizers)) + { + writer.WritePropertyName("vectorizers"u8); + writer.WriteStartArray(); + foreach (var item in Vectorizers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Compressions)) + { + writer.WritePropertyName("compressions"u8); + writer.WriteStartArray(); + foreach (var item in Compressions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VectorSearch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorSearch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVectorSearch(document.RootElement, options); + } + + internal static VectorSearch DeserializeVectorSearch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList profiles = default; + IList algorithms = default; + IList vectorizers = default; + IList compressions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("profiles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VectorSearchProfile.DeserializeVectorSearchProfile(item, options)); + } + profiles = array; + continue; + } + if (property.NameEquals("algorithms"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VectorSearchAlgorithmConfiguration.DeserializeVectorSearchAlgorithmConfiguration(item, options)); + } + algorithms = array; + continue; + } + if (property.NameEquals("vectorizers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VectorSearchVectorizer.DeserializeVectorSearchVectorizer(item, options)); + } + vectorizers = array; + continue; + } + if (property.NameEquals("compressions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VectorSearchCompression.DeserializeVectorSearchCompression(item, options)); + } + compressions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VectorSearch(profiles ?? new ChangeTrackingList(), algorithms ?? new ChangeTrackingList(), vectorizers ?? new ChangeTrackingList(), compressions ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VectorSearch)} does not support writing '{options.Format}' format."); + } + } + + VectorSearch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorSearch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VectorSearch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static VectorSearch FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorSearch(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearch.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearch.cs new file mode 100644 index 000000000000..e6f3460dad7a --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearch.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Contains configuration options related to vector search. + public partial class VectorSearch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public VectorSearch() + { + Profiles = new ChangeTrackingList(); + Algorithms = new ChangeTrackingList(); + Vectorizers = new ChangeTrackingList(); + Compressions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Defines combinations of configurations to use with vector search. + /// + /// Contains configuration options specific to the algorithm used during indexing + /// or querying. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// + /// Contains configuration options on how to vectorize text vector queries. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// + /// Contains configuration options specific to the compression method used during + /// indexing or querying. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Keeps track of any properties unknown to the library. + internal VectorSearch(IList profiles, IList algorithms, IList vectorizers, IList compressions, IDictionary serializedAdditionalRawData) + { + Profiles = profiles; + Algorithms = algorithms; + Vectorizers = vectorizers; + Compressions = compressions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Defines combinations of configurations to use with vector search. + public IList Profiles { get; } + /// + /// Contains configuration options specific to the algorithm used during indexing + /// or querying. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public IList Algorithms { get; } + /// + /// Contains configuration options on how to vectorize text vector queries. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public IList Vectorizers { get; } + /// + /// Contains configuration options specific to the compression method used during + /// indexing or querying. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public IList Compressions { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchAlgorithmConfiguration.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchAlgorithmConfiguration.Serialization.cs new file mode 100644 index 000000000000..6398fb4c1388 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchAlgorithmConfiguration.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + [PersistableModelProxy(typeof(UnknownVectorSearchAlgorithmConfiguration))] + public partial class VectorSearchAlgorithmConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorSearchAlgorithmConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VectorSearchAlgorithmConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorSearchAlgorithmConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVectorSearchAlgorithmConfiguration(document.RootElement, options); + } + + internal static VectorSearchAlgorithmConfiguration DeserializeVectorSearchAlgorithmConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("kind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "exhaustiveKnn": return ExhaustiveKnnAlgorithmConfiguration.DeserializeExhaustiveKnnAlgorithmConfiguration(element, options); + case "hnsw": return HnswAlgorithmConfiguration.DeserializeHnswAlgorithmConfiguration(element, options); + } + } + return UnknownVectorSearchAlgorithmConfiguration.DeserializeUnknownVectorSearchAlgorithmConfiguration(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VectorSearchAlgorithmConfiguration)} does not support writing '{options.Format}' format."); + } + } + + VectorSearchAlgorithmConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorSearchAlgorithmConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VectorSearchAlgorithmConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static VectorSearchAlgorithmConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorSearchAlgorithmConfiguration(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchAlgorithmConfiguration.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchAlgorithmConfiguration.cs new file mode 100644 index 000000000000..7899095dd9b4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchAlgorithmConfiguration.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Contains configuration options specific to the algorithm used during indexing + /// or querying. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class VectorSearchAlgorithmConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name to associate with this particular configuration. + /// is null. + protected VectorSearchAlgorithmConfiguration(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The name to associate with this particular configuration. + /// Type of VectorSearchAlgorithmConfiguration. + /// Keeps track of any properties unknown to the library. + internal VectorSearchAlgorithmConfiguration(string name, VectorSearchAlgorithmKind kind, IDictionary serializedAdditionalRawData) + { + Name = name; + Kind = kind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VectorSearchAlgorithmConfiguration() + { + } + + /// The name to associate with this particular configuration. + public string Name { get; set; } + /// Type of VectorSearchAlgorithmConfiguration. + internal VectorSearchAlgorithmKind Kind { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchAlgorithmKind.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchAlgorithmKind.cs new file mode 100644 index 000000000000..65411901900b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchAlgorithmKind.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// The algorithm used for indexing and querying. + internal readonly partial struct VectorSearchAlgorithmKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VectorSearchAlgorithmKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HnswValue = "hnsw"; + private const string ExhaustiveKnnValue = "exhaustiveKnn"; + + /// + /// HNSW (Hierarchical Navigable Small World), a type of approximate nearest + /// neighbors algorithm. + /// + public static VectorSearchAlgorithmKind Hnsw { get; } = new VectorSearchAlgorithmKind(HnswValue); + /// Exhaustive KNN algorithm which will perform brute-force search. + public static VectorSearchAlgorithmKind ExhaustiveKnn { get; } = new VectorSearchAlgorithmKind(ExhaustiveKnnValue); + /// Determines if two values are the same. + public static bool operator ==(VectorSearchAlgorithmKind left, VectorSearchAlgorithmKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VectorSearchAlgorithmKind left, VectorSearchAlgorithmKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VectorSearchAlgorithmKind(string value) => new VectorSearchAlgorithmKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VectorSearchAlgorithmKind other && Equals(other); + /// + public bool Equals(VectorSearchAlgorithmKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchAlgorithmMetric.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchAlgorithmMetric.cs new file mode 100644 index 000000000000..938fa67d4146 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchAlgorithmMetric.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// The similarity metric to use for vector comparisons. It is recommended to + /// choose the same similarity metric as the embedding model was trained on. + /// + public readonly partial struct VectorSearchAlgorithmMetric : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VectorSearchAlgorithmMetric(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CosineValue = "cosine"; + private const string EuclideanValue = "euclidean"; + private const string DotProductValue = "dotProduct"; + private const string HammingValue = "hamming"; + + /// + /// Measures the angle between vectors to quantify their similarity, disregarding + /// magnitude. The smaller the angle, the closer the similarity. + /// + public static VectorSearchAlgorithmMetric Cosine { get; } = new VectorSearchAlgorithmMetric(CosineValue); + /// + /// Computes the straight-line distance between vectors in a multi-dimensional + /// space. The smaller the distance, the closer the similarity. + /// + public static VectorSearchAlgorithmMetric Euclidean { get; } = new VectorSearchAlgorithmMetric(EuclideanValue); + /// + /// Calculates the sum of element-wise products to gauge alignment and magnitude + /// similarity. The larger and more positive, the closer the similarity. + /// + public static VectorSearchAlgorithmMetric DotProduct { get; } = new VectorSearchAlgorithmMetric(DotProductValue); + /// + /// Only applicable to bit-packed binary data types. Determines dissimilarity by + /// counting differing positions in binary vectors. The fewer differences, the + /// closer the similarity. + /// + public static VectorSearchAlgorithmMetric Hamming { get; } = new VectorSearchAlgorithmMetric(HammingValue); + /// Determines if two values are the same. + public static bool operator ==(VectorSearchAlgorithmMetric left, VectorSearchAlgorithmMetric right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VectorSearchAlgorithmMetric left, VectorSearchAlgorithmMetric right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VectorSearchAlgorithmMetric(string value) => new VectorSearchAlgorithmMetric(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VectorSearchAlgorithmMetric other && Equals(other); + /// + public bool Equals(VectorSearchAlgorithmMetric other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchCompression.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchCompression.Serialization.cs new file mode 100644 index 000000000000..e496ab51107e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchCompression.Serialization.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + [PersistableModelProxy(typeof(UnknownVectorSearchCompression))] + public partial class VectorSearchCompression : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorSearchCompression)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(RerankWithOriginalVectors)) + { + writer.WritePropertyName("rerankWithOriginalVectors"u8); + writer.WriteBooleanValue(RerankWithOriginalVectors.Value); + } + if (Optional.IsDefined(DefaultOversampling)) + { + writer.WritePropertyName("defaultOversampling"u8); + writer.WriteNumberValue(DefaultOversampling.Value); + } + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VectorSearchCompression IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorSearchCompression)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVectorSearchCompression(document.RootElement, options); + } + + internal static VectorSearchCompression DeserializeVectorSearchCompression(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("kind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "binaryQuantization": return BinaryQuantizationCompression.DeserializeBinaryQuantizationCompression(element, options); + case "scalarQuantization": return ScalarQuantizationCompression.DeserializeScalarQuantizationCompression(element, options); + } + } + return UnknownVectorSearchCompression.DeserializeUnknownVectorSearchCompression(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VectorSearchCompression)} does not support writing '{options.Format}' format."); + } + } + + VectorSearchCompression IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorSearchCompression(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VectorSearchCompression)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static VectorSearchCompression FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorSearchCompression(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchCompression.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchCompression.cs new file mode 100644 index 000000000000..d8e85b2c52c0 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchCompression.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Contains configuration options specific to the compression method used during + /// indexing or querying. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class VectorSearchCompression + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name to associate with this particular configuration. + /// is null. + protected VectorSearchCompression(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The name to associate with this particular configuration. + /// + /// If set to true, once the ordered set of results calculated using compressed + /// vectors are obtained, they will be reranked again by recalculating the + /// full-precision similarity scores. This will improve recall at the expense of + /// latency. + /// + /// + /// Default oversampling factor. Oversampling will internally request more + /// documents (specified by this multiplier) in the initial search. This increases + /// the set of results that will be reranked using recomputed similarity scores + /// from full-precision vectors. Minimum value is 1, meaning no oversampling (1x). + /// This parameter can only be set when rerankWithOriginalVectors is true. Higher + /// values improve recall at the expense of latency. + /// + /// Type of VectorSearchCompression. + /// Keeps track of any properties unknown to the library. + internal VectorSearchCompression(string name, bool? rerankWithOriginalVectors, double? defaultOversampling, VectorSearchCompressionKind kind, IDictionary serializedAdditionalRawData) + { + Name = name; + RerankWithOriginalVectors = rerankWithOriginalVectors; + DefaultOversampling = defaultOversampling; + Kind = kind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VectorSearchCompression() + { + } + + /// The name to associate with this particular configuration. + public string Name { get; set; } + /// + /// If set to true, once the ordered set of results calculated using compressed + /// vectors are obtained, they will be reranked again by recalculating the + /// full-precision similarity scores. This will improve recall at the expense of + /// latency. + /// + public bool? RerankWithOriginalVectors { get; set; } + /// + /// Default oversampling factor. Oversampling will internally request more + /// documents (specified by this multiplier) in the initial search. This increases + /// the set of results that will be reranked using recomputed similarity scores + /// from full-precision vectors. Minimum value is 1, meaning no oversampling (1x). + /// This parameter can only be set when rerankWithOriginalVectors is true. Higher + /// values improve recall at the expense of latency. + /// + public double? DefaultOversampling { get; set; } + /// Type of VectorSearchCompression. + internal VectorSearchCompressionKind Kind { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchCompressionKind.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchCompressionKind.cs new file mode 100644 index 000000000000..5ef54b7c12f4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchCompressionKind.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// The compression method used for indexing and querying. + internal readonly partial struct VectorSearchCompressionKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VectorSearchCompressionKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ScalarQuantizationValue = "scalarQuantization"; + private const string BinaryQuantizationValue = "binaryQuantization"; + + /// + /// Scalar Quantization, a type of compression method. In scalar quantization, the + /// original vectors values are compressed to a narrower type by discretizing and + /// representing each component of a vector using a reduced set of quantized + /// values, thereby reducing the overall data size. + /// + public static VectorSearchCompressionKind ScalarQuantization { get; } = new VectorSearchCompressionKind(ScalarQuantizationValue); + /// + /// Binary Quantization, a type of compression method. In binary quantization, the + /// original vectors values are compressed to the narrower binary type by discretizing + /// and representing each component of a vector using binary values, + /// thereby reducing the overall data size. + /// + public static VectorSearchCompressionKind BinaryQuantization { get; } = new VectorSearchCompressionKind(BinaryQuantizationValue); + /// Determines if two values are the same. + public static bool operator ==(VectorSearchCompressionKind left, VectorSearchCompressionKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VectorSearchCompressionKind left, VectorSearchCompressionKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VectorSearchCompressionKind(string value) => new VectorSearchCompressionKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VectorSearchCompressionKind other && Equals(other); + /// + public bool Equals(VectorSearchCompressionKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchCompressionTarget.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchCompressionTarget.cs new file mode 100644 index 000000000000..70899023437e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchCompressionTarget.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 +{ + /// The quantized data type of compressed vector values. + public readonly partial struct VectorSearchCompressionTarget : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VectorSearchCompressionTarget(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Int8Value = "int8"; + + /// 8-bit signed integer. + public static VectorSearchCompressionTarget Int8 { get; } = new VectorSearchCompressionTarget(Int8Value); + /// Determines if two values are the same. + public static bool operator ==(VectorSearchCompressionTarget left, VectorSearchCompressionTarget right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VectorSearchCompressionTarget left, VectorSearchCompressionTarget right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VectorSearchCompressionTarget(string value) => new VectorSearchCompressionTarget(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VectorSearchCompressionTarget other && Equals(other); + /// + public bool Equals(VectorSearchCompressionTarget other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchProfile.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchProfile.Serialization.cs new file mode 100644 index 000000000000..b0678c7996dc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchProfile.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class VectorSearchProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorSearchProfile)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("algorithm"u8); + writer.WriteStringValue(Algorithm); + if (Optional.IsDefined(Vectorizer)) + { + writer.WritePropertyName("vectorizer"u8); + writer.WriteStringValue(Vectorizer); + } + if (Optional.IsDefined(Compression)) + { + writer.WritePropertyName("compression"u8); + writer.WriteStringValue(Compression); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VectorSearchProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorSearchProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVectorSearchProfile(document.RootElement, options); + } + + internal static VectorSearchProfile DeserializeVectorSearchProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string algorithm = default; + string vectorizer = default; + string compression = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("algorithm"u8)) + { + algorithm = property.Value.GetString(); + continue; + } + if (property.NameEquals("vectorizer"u8)) + { + vectorizer = property.Value.GetString(); + continue; + } + if (property.NameEquals("compression"u8)) + { + compression = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VectorSearchProfile(name, algorithm, vectorizer, compression, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VectorSearchProfile)} does not support writing '{options.Format}' format."); + } + } + + VectorSearchProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorSearchProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VectorSearchProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static VectorSearchProfile FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorSearchProfile(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchProfile.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchProfile.cs new file mode 100644 index 000000000000..fa8984b3a948 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchProfile.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Defines a combination of configurations to use with vector search. + public partial class VectorSearchProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name to associate with this particular vector search profile. + /// + /// The name of the vector search algorithm configuration that specifies the + /// algorithm and optional parameters. + /// + /// or is null. + public VectorSearchProfile(string name, string algorithm) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(algorithm, nameof(algorithm)); + + Name = name; + Algorithm = algorithm; + } + + /// Initializes a new instance of . + /// The name to associate with this particular vector search profile. + /// + /// The name of the vector search algorithm configuration that specifies the + /// algorithm and optional parameters. + /// + /// The name of the vectorization being configured for use with vector search. + /// + /// The name of the compression method configuration that specifies the compression + /// method and optional parameters. + /// + /// Keeps track of any properties unknown to the library. + internal VectorSearchProfile(string name, string algorithm, string vectorizer, string compression, IDictionary serializedAdditionalRawData) + { + Name = name; + Algorithm = algorithm; + Vectorizer = vectorizer; + Compression = compression; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VectorSearchProfile() + { + } + + /// The name to associate with this particular vector search profile. + public string Name { get; set; } + /// + /// The name of the vector search algorithm configuration that specifies the + /// algorithm and optional parameters. + /// + public string Algorithm { get; set; } + /// The name of the vectorization being configured for use with vector search. + public string Vectorizer { get; set; } + /// + /// The name of the compression method configuration that specifies the compression + /// method and optional parameters. + /// + public string Compression { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchVectorizer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchVectorizer.Serialization.cs new file mode 100644 index 000000000000..1be3c9491cc0 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchVectorizer.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + [PersistableModelProxy(typeof(UnknownVectorSearchVectorizer))] + public partial class VectorSearchVectorizer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorSearchVectorizer)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VectorSearchVectorizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorSearchVectorizer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVectorSearchVectorizer(document.RootElement, options); + } + + internal static VectorSearchVectorizer DeserializeVectorSearchVectorizer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("kind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "azureOpenAI": return AzureOpenAIVectorizer.DeserializeAzureOpenAIVectorizer(element, options); + case "customWebApi": return WebApiVectorizer.DeserializeWebApiVectorizer(element, options); + } + } + return UnknownVectorSearchVectorizer.DeserializeUnknownVectorSearchVectorizer(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VectorSearchVectorizer)} does not support writing '{options.Format}' format."); + } + } + + VectorSearchVectorizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorSearchVectorizer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VectorSearchVectorizer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static VectorSearchVectorizer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorSearchVectorizer(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchVectorizer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchVectorizer.cs new file mode 100644 index 000000000000..b07c58bff61c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchVectorizer.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Specifies the vectorization method to be used during query time. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class VectorSearchVectorizer + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name to associate with this particular vectorization method. + /// is null. + protected VectorSearchVectorizer(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The name to associate with this particular vectorization method. + /// Type of VectorSearchVectorizer. + /// Keeps track of any properties unknown to the library. + internal VectorSearchVectorizer(string name, VectorSearchVectorizerKind kind, IDictionary serializedAdditionalRawData) + { + Name = name; + Kind = kind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VectorSearchVectorizer() + { + } + + /// The name to associate with this particular vectorization method. + public string Name { get; set; } + /// Type of VectorSearchVectorizer. + internal VectorSearchVectorizerKind Kind { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchVectorizerKind.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchVectorizerKind.cs new file mode 100644 index 000000000000..95ed844940bd --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VectorSearchVectorizerKind.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 +{ + /// The vectorization method to be used during query time. + internal readonly partial struct VectorSearchVectorizerKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VectorSearchVectorizerKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureOpenAIValue = "azureOpenAI"; + private const string CustomWebApiValue = "customWebApi"; + + /// Generate embeddings using an Azure OpenAI resource at query time. + public static VectorSearchVectorizerKind AzureOpenAI { get; } = new VectorSearchVectorizerKind(AzureOpenAIValue); + /// Generate embeddings using a custom web endpoint at query time. + public static VectorSearchVectorizerKind CustomWebApi { get; } = new VectorSearchVectorizerKind(CustomWebApiValue); + /// Determines if two values are the same. + public static bool operator ==(VectorSearchVectorizerKind left, VectorSearchVectorizerKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VectorSearchVectorizerKind left, VectorSearchVectorizerKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VectorSearchVectorizerKind(string value) => new VectorSearchVectorizerKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VectorSearchVectorizerKind other && Equals(other); + /// + public bool Equals(VectorSearchVectorizerKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VisualFeature.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VisualFeature.cs new file mode 100644 index 000000000000..7fc3497ca460 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/VisualFeature.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Indexes +{ + /// The strings indicating what visual feature types to return. + public readonly partial struct VisualFeature : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VisualFeature(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AdultValue = "adult"; + private const string BrandsValue = "brands"; + private const string CategoriesValue = "categories"; + private const string DescriptionValue = "description"; + private const string FacesValue = "faces"; + private const string ObjectsValue = "objects"; + private const string TagsValue = "tags"; + + /// Visual features recognized as adult persons. + public static VisualFeature Adult { get; } = new VisualFeature(AdultValue); + /// Visual features recognized as commercial brands. + public static VisualFeature Brands { get; } = new VisualFeature(BrandsValue); + /// Categories. + public static VisualFeature Categories { get; } = new VisualFeature(CategoriesValue); + /// Description. + public static VisualFeature Description { get; } = new VisualFeature(DescriptionValue); + /// Visual features recognized as people faces. + public static VisualFeature Faces { get; } = new VisualFeature(FacesValue); + /// Visual features recognized as objects. + public static VisualFeature Objects { get; } = new VisualFeature(ObjectsValue); + /// Tags. + public static VisualFeature Tags { get; } = new VisualFeature(TagsValue); + /// Determines if two values are the same. + public static bool operator ==(VisualFeature left, VisualFeature right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VisualFeature left, VisualFeature right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VisualFeature(string value) => new VisualFeature(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VisualFeature other && Equals(other); + /// + public bool Equals(VisualFeature other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiSkill.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiSkill.Serialization.cs new file mode 100644 index 000000000000..eac8f01de5b4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiSkill.Serialization.cs @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class WebApiSkill : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebApiSkill)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri); + if (Optional.IsCollectionDefined(HttpHeaders)) + { + writer.WritePropertyName("httpHeaders"u8); + writer.WriteStartObject(); + foreach (var item in HttpHeaders) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(HttpMethod)) + { + writer.WritePropertyName("httpMethod"u8); + writer.WriteStringValue(HttpMethod); + } + if (Optional.IsDefined(Timeout)) + { + writer.WritePropertyName("timeout"u8); + writer.WriteStringValue(Timeout.Value, "P"); + } + if (Optional.IsDefined(BatchSize)) + { + writer.WritePropertyName("batchSize"u8); + writer.WriteNumberValue(BatchSize.Value); + } + if (Optional.IsDefined(DegreeOfParallelism)) + { + writer.WritePropertyName("degreeOfParallelism"u8); + writer.WriteNumberValue(DegreeOfParallelism.Value); + } + if (Optional.IsDefined(AuthResourceId)) + { + writer.WritePropertyName("authResourceId"u8); + writer.WriteStringValue(AuthResourceId); + } + if (Optional.IsDefined(AuthIdentity)) + { + writer.WritePropertyName("authIdentity"u8); + writer.WriteObjectValue(AuthIdentity, options); + } + } + + WebApiSkill IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebApiSkill)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebApiSkill(document.RootElement, options); + } + + internal static WebApiSkill DeserializeWebApiSkill(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string uri = default; + IDictionary httpHeaders = default; + string httpMethod = default; + TimeSpan? timeout = default; + int? batchSize = default; + int? degreeOfParallelism = default; + string authResourceId = default; + SearchIndexerDataIdentity authIdentity = default; + string odataType = default; + string name = default; + string description = default; + string context = default; + IList inputs = default; + IList outputs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uri"u8)) + { + uri = property.Value.GetString(); + continue; + } + if (property.NameEquals("httpHeaders"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + httpHeaders = dictionary; + continue; + } + if (property.NameEquals("httpMethod"u8)) + { + httpMethod = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeout"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeout = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("batchSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + batchSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("degreeOfParallelism"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + degreeOfParallelism = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("authResourceId"u8)) + { + authResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("authIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authIdentity = SearchIndexerDataIdentity.DeserializeSearchIndexerDataIdentity(property.Value, options); + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("context"u8)) + { + context = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item, options)); + } + inputs = array; + continue; + } + if (property.NameEquals("outputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item, options)); + } + outputs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WebApiSkill( + odataType, + name, + description, + context, + inputs, + outputs, + serializedAdditionalRawData, + uri, + httpHeaders ?? new ChangeTrackingDictionary(), + httpMethod, + timeout, + batchSize, + degreeOfParallelism, + authResourceId, + authIdentity); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WebApiSkill)} does not support writing '{options.Format}' format."); + } + } + + WebApiSkill IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWebApiSkill(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WebApiSkill)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new WebApiSkill FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWebApiSkill(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiSkill.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiSkill.cs new file mode 100644 index 000000000000..6737dd57a9a9 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiSkill.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// A skill that can call a Web API endpoint, allowing you to extend a skillset by + /// having it call your custom code. + /// + public partial class WebApiSkill : SearchIndexerSkill + { + /// Initializes a new instance of . + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// The url for the Web API. + /// , or is null. + public WebApiSkill(IEnumerable inputs, IEnumerable outputs, string uri) : base(inputs, outputs) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(outputs, nameof(outputs)); + Argument.AssertNotNull(uri, nameof(uri)); + + OdataType = "#Microsoft.Skills.Custom.WebApiSkill"; + Uri = uri; + HttpHeaders = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the skill which uniquely identifies it within the skillset. A skill + /// with no name defined will be given a default name of its 1-based index in the + /// skills array, prefixed with the character '#'. + /// + /// + /// The description of the skill which describes the inputs, outputs, and usage of + /// the skill. + /// + /// + /// Represents the level at which operations take place, such as the document root + /// or document content (for example, /document or /document/content). The default + /// is /document. + /// + /// + /// Inputs of the skills could be a column in the source data set, or the output of + /// an upstream skill. + /// + /// + /// The output of a skill is either a field in a search index, or a value that can + /// be consumed as an input by another skill. + /// + /// Keeps track of any properties unknown to the library. + /// The url for the Web API. + /// The headers required to make the http request. + /// The method for the http request. + /// The desired timeout for the request. Default is 30 seconds. + /// The desired batch size which indicates number of documents. + /// If set, the number of parallel calls that can be made to the Web API. + /// + /// Applies to custom skills that connect to external code in an Azure function or + /// some other application that provides the transformations. This value should be + /// the application ID created for the function or app when it was registered with + /// Azure Active Directory. When specified, the custom skill connects to the + /// function or app using a managed ID (either system or user-assigned) of the + /// search service and the access token of the function or app, using this value as + /// the resource id for creating the scope of the access token. + /// + /// + /// The user-assigned managed identity used for outbound connections. If an + /// authResourceId is provided and it's not specified, the system-assigned managed + /// identity is used. On updates to the indexer, if the identity is unspecified, + /// the value remains unchanged. If set to "none", the value of this property is + /// cleared. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + internal WebApiSkill(string odataType, string name, string description, string context, IList inputs, IList outputs, IDictionary serializedAdditionalRawData, string uri, IDictionary httpHeaders, string httpMethod, TimeSpan? timeout, int? batchSize, int? degreeOfParallelism, string authResourceId, SearchIndexerDataIdentity authIdentity) : base(odataType, name, description, context, inputs, outputs, serializedAdditionalRawData) + { + Uri = uri; + HttpHeaders = httpHeaders; + HttpMethod = httpMethod; + Timeout = timeout; + BatchSize = batchSize; + DegreeOfParallelism = degreeOfParallelism; + AuthResourceId = authResourceId; + AuthIdentity = authIdentity; + } + + /// Initializes a new instance of for deserialization. + internal WebApiSkill() + { + } + + /// The url for the Web API. + public string Uri { get; set; } + /// The headers required to make the http request. + public IDictionary HttpHeaders { get; } + /// The method for the http request. + public string HttpMethod { get; set; } + /// The desired timeout for the request. Default is 30 seconds. + public TimeSpan? Timeout { get; set; } + /// The desired batch size which indicates number of documents. + public int? BatchSize { get; set; } + /// If set, the number of parallel calls that can be made to the Web API. + public int? DegreeOfParallelism { get; set; } + /// + /// Applies to custom skills that connect to external code in an Azure function or + /// some other application that provides the transformations. This value should be + /// the application ID created for the function or app when it was registered with + /// Azure Active Directory. When specified, the custom skill connects to the + /// function or app using a managed ID (either system or user-assigned) of the + /// search service and the access token of the function or app, using this value as + /// the resource id for creating the scope of the access token. + /// + public string AuthResourceId { get; set; } + /// + /// The user-assigned managed identity used for outbound connections. If an + /// authResourceId is provided and it's not specified, the system-assigned managed + /// identity is used. On updates to the indexer, if the identity is unspecified, + /// the value remains unchanged. If set to "none", the value of this property is + /// cleared. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public SearchIndexerDataIdentity AuthIdentity { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiVectorizer.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiVectorizer.Serialization.cs new file mode 100644 index 000000000000..82e7ef8570c1 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiVectorizer.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class WebApiVectorizer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebApiVectorizer)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(CustomWebApiParameters)) + { + writer.WritePropertyName("customWebApiParameters"u8); + writer.WriteObjectValue(CustomWebApiParameters, options); + } + } + + WebApiVectorizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebApiVectorizer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebApiVectorizer(document.RootElement, options); + } + + internal static WebApiVectorizer DeserializeWebApiVectorizer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WebApiVectorizerParameters customWebApiParameters = default; + string name = default; + VectorSearchVectorizerKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customWebApiParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customWebApiParameters = WebApiVectorizerParameters.DeserializeWebApiVectorizerParameters(property.Value, options); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new VectorSearchVectorizerKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WebApiVectorizer(name, kind, serializedAdditionalRawData, customWebApiParameters); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WebApiVectorizer)} does not support writing '{options.Format}' format."); + } + } + + WebApiVectorizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWebApiVectorizer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WebApiVectorizer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new WebApiVectorizer FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWebApiVectorizer(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiVectorizer.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiVectorizer.cs new file mode 100644 index 000000000000..78d920daaf32 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiVectorizer.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Specifies a user-defined vectorizer for generating the vector embedding of a + /// query string. Integration of an external vectorizer is achieved using the + /// custom Web API interface of a skillset. + /// + public partial class WebApiVectorizer : VectorSearchVectorizer + { + /// Initializes a new instance of . + /// The name to associate with this particular vectorization method. + /// is null. + public WebApiVectorizer(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + Kind = VectorSearchVectorizerKind.CustomWebApi; + } + + /// Initializes a new instance of . + /// The name to associate with this particular vectorization method. + /// Type of VectorSearchVectorizer. + /// Keeps track of any properties unknown to the library. + /// Specifies the properties of the user-defined vectorizer. + internal WebApiVectorizer(string name, VectorSearchVectorizerKind kind, IDictionary serializedAdditionalRawData, WebApiVectorizerParameters customWebApiParameters) : base(name, kind, serializedAdditionalRawData) + { + CustomWebApiParameters = customWebApiParameters; + } + + /// Initializes a new instance of for deserialization. + internal WebApiVectorizer() + { + } + + /// Specifies the properties of the user-defined vectorizer. + public WebApiVectorizerParameters CustomWebApiParameters { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiVectorizerParameters.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiVectorizerParameters.Serialization.cs new file mode 100644 index 000000000000..58f6248114dd --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiVectorizerParameters.Serialization.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class WebApiVectorizerParameters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebApiVectorizerParameters)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Uri)) + { + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + } + if (Optional.IsCollectionDefined(HttpHeaders)) + { + writer.WritePropertyName("httpHeaders"u8); + writer.WriteStartObject(); + foreach (var item in HttpHeaders) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(HttpMethod)) + { + writer.WritePropertyName("httpMethod"u8); + writer.WriteStringValue(HttpMethod); + } + if (Optional.IsDefined(Timeout)) + { + writer.WritePropertyName("timeout"u8); + writer.WriteStringValue(Timeout.Value, "P"); + } + if (Optional.IsDefined(AuthResourceId)) + { + writer.WritePropertyName("authResourceId"u8); + writer.WriteStringValue(AuthResourceId); + } + if (Optional.IsDefined(AuthIdentity)) + { + writer.WritePropertyName("authIdentity"u8); + writer.WriteObjectValue(AuthIdentity, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + WebApiVectorizerParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebApiVectorizerParameters)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebApiVectorizerParameters(document.RootElement, options); + } + + internal static WebApiVectorizerParameters DeserializeWebApiVectorizerParameters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri uri = default; + IDictionary httpHeaders = default; + string httpMethod = default; + TimeSpan? timeout = default; + string authResourceId = default; + SearchIndexerDataIdentity authIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("httpHeaders"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + httpHeaders = dictionary; + continue; + } + if (property.NameEquals("httpMethod"u8)) + { + httpMethod = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeout"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeout = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("authResourceId"u8)) + { + authResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("authIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authIdentity = SearchIndexerDataIdentity.DeserializeSearchIndexerDataIdentity(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WebApiVectorizerParameters( + uri, + httpHeaders ?? new ChangeTrackingDictionary(), + httpMethod, + timeout, + authResourceId, + authIdentity, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WebApiVectorizerParameters)} does not support writing '{options.Format}' format."); + } + } + + WebApiVectorizerParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWebApiVectorizerParameters(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WebApiVectorizerParameters)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static WebApiVectorizerParameters FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWebApiVectorizerParameters(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiVectorizerParameters.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiVectorizerParameters.cs new file mode 100644 index 000000000000..8e1baad6f184 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WebApiVectorizerParameters.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// Specifies the properties for connecting to a user-defined vectorizer. + public partial class WebApiVectorizerParameters + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public WebApiVectorizerParameters() + { + HttpHeaders = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The URI of the Web API providing the vectorizer. + /// The headers required to make the HTTP request. + /// The method for the HTTP request. + /// The desired timeout for the request. Default is 30 seconds. + /// + /// Applies to custom endpoints that connect to external code in an Azure function + /// or some other application that provides the transformations. This value should + /// be the application ID created for the function or app when it was registered + /// with Azure Active Directory. When specified, the vectorization connects to the + /// function or app using a managed ID (either system or user-assigned) of the + /// search service and the access token of the function or app, using this value as + /// the resource id for creating the scope of the access token. + /// + /// + /// The user-assigned managed identity used for outbound connections. If an + /// authResourceId is provided and it's not specified, the system-assigned managed + /// identity is used. On updates to the indexer, if the identity is unspecified, + /// the value remains unchanged. If set to "none", the value of this property is + /// cleared. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Keeps track of any properties unknown to the library. + internal WebApiVectorizerParameters(Uri uri, IDictionary httpHeaders, string httpMethod, TimeSpan? timeout, string authResourceId, SearchIndexerDataIdentity authIdentity, IDictionary serializedAdditionalRawData) + { + Uri = uri; + HttpHeaders = httpHeaders; + HttpMethod = httpMethod; + Timeout = timeout; + AuthResourceId = authResourceId; + AuthIdentity = authIdentity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The URI of the Web API providing the vectorizer. + public Uri Uri { get; set; } + /// The headers required to make the HTTP request. + public IDictionary HttpHeaders { get; } + /// The method for the HTTP request. + public string HttpMethod { get; set; } + /// The desired timeout for the request. Default is 30 seconds. + public TimeSpan? Timeout { get; set; } + /// + /// Applies to custom endpoints that connect to external code in an Azure function + /// or some other application that provides the transformations. This value should + /// be the application ID created for the function or app when it was registered + /// with Azure Active Directory. When specified, the vectorization connects to the + /// function or app using a managed ID (either system or user-assigned) of the + /// search service and the access token of the function or app, using this value as + /// the resource id for creating the scope of the access token. + /// + public string AuthResourceId { get; set; } + /// + /// The user-assigned managed identity used for outbound connections. If an + /// authResourceId is provided and it's not specified, the system-assigned managed + /// identity is used. On updates to the indexer, if the identity is unspecified, + /// the value remains unchanged. If set to "none", the value of this property is + /// cleared. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public SearchIndexerDataIdentity AuthIdentity { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WordDelimiterTokenFilter.Serialization.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WordDelimiterTokenFilter.Serialization.cs new file mode 100644 index 000000000000..dd747b671613 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WordDelimiterTokenFilter.Serialization.cs @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Indexes +{ + public partial class WordDelimiterTokenFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WordDelimiterTokenFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(GenerateWordParts)) + { + writer.WritePropertyName("generateWordParts"u8); + writer.WriteBooleanValue(GenerateWordParts.Value); + } + if (Optional.IsDefined(GenerateNumberParts)) + { + writer.WritePropertyName("generateNumberParts"u8); + writer.WriteBooleanValue(GenerateNumberParts.Value); + } + if (Optional.IsDefined(CatenateWords)) + { + writer.WritePropertyName("catenateWords"u8); + writer.WriteBooleanValue(CatenateWords.Value); + } + if (Optional.IsDefined(CatenateNumbers)) + { + writer.WritePropertyName("catenateNumbers"u8); + writer.WriteBooleanValue(CatenateNumbers.Value); + } + if (Optional.IsDefined(CatenateAll)) + { + writer.WritePropertyName("catenateAll"u8); + writer.WriteBooleanValue(CatenateAll.Value); + } + if (Optional.IsDefined(SplitOnCaseChange)) + { + writer.WritePropertyName("splitOnCaseChange"u8); + writer.WriteBooleanValue(SplitOnCaseChange.Value); + } + if (Optional.IsDefined(PreserveOriginal)) + { + writer.WritePropertyName("preserveOriginal"u8); + writer.WriteBooleanValue(PreserveOriginal.Value); + } + if (Optional.IsDefined(SplitOnNumerics)) + { + writer.WritePropertyName("splitOnNumerics"u8); + writer.WriteBooleanValue(SplitOnNumerics.Value); + } + if (Optional.IsDefined(StemEnglishPossessive)) + { + writer.WritePropertyName("stemEnglishPossessive"u8); + writer.WriteBooleanValue(StemEnglishPossessive.Value); + } + if (Optional.IsCollectionDefined(ProtectedWords)) + { + writer.WritePropertyName("protectedWords"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedWords) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + WordDelimiterTokenFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WordDelimiterTokenFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWordDelimiterTokenFilter(document.RootElement, options); + } + + internal static WordDelimiterTokenFilter DeserializeWordDelimiterTokenFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? generateWordParts = default; + bool? generateNumberParts = default; + bool? catenateWords = default; + bool? catenateNumbers = default; + bool? catenateAll = default; + bool? splitOnCaseChange = default; + bool? preserveOriginal = default; + bool? splitOnNumerics = default; + bool? stemEnglishPossessive = default; + IList protectedWords = default; + string odataType = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("generateWordParts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + generateWordParts = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("generateNumberParts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + generateNumberParts = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("catenateWords"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + catenateWords = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("catenateNumbers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + catenateNumbers = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("catenateAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + catenateAll = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("splitOnCaseChange"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + splitOnCaseChange = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("preserveOriginal"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + preserveOriginal = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("splitOnNumerics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + splitOnNumerics = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("stemEnglishPossessive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stemEnglishPossessive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("protectedWords"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + protectedWords = array; + continue; + } + if (property.NameEquals("@odata.type"u8)) + { + odataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WordDelimiterTokenFilter( + odataType, + name, + serializedAdditionalRawData, + generateWordParts, + generateNumberParts, + catenateWords, + catenateNumbers, + catenateAll, + splitOnCaseChange, + preserveOriginal, + splitOnNumerics, + stemEnglishPossessive, + protectedWords ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WordDelimiterTokenFilter)} does not support writing '{options.Format}' format."); + } + } + + WordDelimiterTokenFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWordDelimiterTokenFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WordDelimiterTokenFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new WordDelimiterTokenFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWordDelimiterTokenFilter(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WordDelimiterTokenFilter.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WordDelimiterTokenFilter.cs new file mode 100644 index 000000000000..16208a88e781 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Generated/WordDelimiterTokenFilter.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Indexes +{ + /// + /// Splits words into subwords and performs optional transformations on subword + /// groups. This token filter is implemented using Apache Lucene. + /// + public partial class WordDelimiterTokenFilter : TokenFilter + { + /// Initializes a new instance of . + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// is null. + public WordDelimiterTokenFilter(string name) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + OdataType = "#Microsoft.Azure.Search.WordDelimiterTokenFilter"; + ProtectedWords = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The discriminator for derived types. + /// + /// The name of the token filter. It must only contain letters, digits, spaces, + /// dashes or underscores, can only start and end with alphanumeric characters, and + /// is limited to 128 characters. + /// + /// Keeps track of any properties unknown to the library. + /// + /// A value indicating whether to generate part words. If set, causes parts of + /// words to be generated; for example "AzureSearch" becomes "Azure" "Search". + /// Default is true. + /// + /// A value indicating whether to generate number subwords. Default is true. + /// + /// A value indicating whether maximum runs of word parts will be catenated. For + /// example, if this is set to true, "Azure-Search" becomes "AzureSearch". Default + /// is false. + /// + /// + /// A value indicating whether maximum runs of number parts will be catenated. For + /// example, if this is set to true, "1-2" becomes "12". Default is false. + /// + /// + /// A value indicating whether all subword parts will be catenated. For example, if + /// this is set to true, "Azure-Search-1" becomes "AzureSearch1". Default is false. + /// + /// + /// A value indicating whether to split words on caseChange. For example, if this + /// is set to true, "AzureSearch" becomes "Azure" "Search". Default is true. + /// + /// + /// A value indicating whether original words will be preserved and added to the + /// subword list. Default is false. + /// + /// + /// A value indicating whether to split on numbers. For example, if this is set to + /// true, "Azure1Search" becomes "Azure" "1" "Search". Default is true. + /// + /// + /// A value indicating whether to remove trailing "'s" for each subword. Default is + /// true. + /// + /// A list of tokens to protect from being delimited. + internal WordDelimiterTokenFilter(string odataType, string name, IDictionary serializedAdditionalRawData, bool? generateWordParts, bool? generateNumberParts, bool? catenateWords, bool? catenateNumbers, bool? catenateAll, bool? splitOnCaseChange, bool? preserveOriginal, bool? splitOnNumerics, bool? stemEnglishPossessive, IList protectedWords) : base(odataType, name, serializedAdditionalRawData) + { + GenerateWordParts = generateWordParts; + GenerateNumberParts = generateNumberParts; + CatenateWords = catenateWords; + CatenateNumbers = catenateNumbers; + CatenateAll = catenateAll; + SplitOnCaseChange = splitOnCaseChange; + PreserveOriginal = preserveOriginal; + SplitOnNumerics = splitOnNumerics; + StemEnglishPossessive = stemEnglishPossessive; + ProtectedWords = protectedWords; + } + + /// Initializes a new instance of for deserialization. + internal WordDelimiterTokenFilter() + { + } + + /// + /// A value indicating whether to generate part words. If set, causes parts of + /// words to be generated; for example "AzureSearch" becomes "Azure" "Search". + /// Default is true. + /// + public bool? GenerateWordParts { get; set; } + /// A value indicating whether to generate number subwords. Default is true. + public bool? GenerateNumberParts { get; set; } + /// + /// A value indicating whether maximum runs of word parts will be catenated. For + /// example, if this is set to true, "Azure-Search" becomes "AzureSearch". Default + /// is false. + /// + public bool? CatenateWords { get; set; } + /// + /// A value indicating whether maximum runs of number parts will be catenated. For + /// example, if this is set to true, "1-2" becomes "12". Default is false. + /// + public bool? CatenateNumbers { get; set; } + /// + /// A value indicating whether all subword parts will be catenated. For example, if + /// this is set to true, "Azure-Search-1" becomes "AzureSearch1". Default is false. + /// + public bool? CatenateAll { get; set; } + /// + /// A value indicating whether to split words on caseChange. For example, if this + /// is set to true, "AzureSearch" becomes "Azure" "Search". Default is true. + /// + public bool? SplitOnCaseChange { get; set; } + /// + /// A value indicating whether original words will be preserved and added to the + /// subword list. Default is false. + /// + public bool? PreserveOriginal { get; set; } + /// + /// A value indicating whether to split on numbers. For example, if this is set to + /// true, "Azure1Search" becomes "Azure" "1" "Search". Default is true. + /// + public bool? SplitOnNumerics { get; set; } + /// + /// A value indicating whether to remove trailing "'s" for each subword. Default is + /// true. + /// + public bool? StemEnglishPossessive { get; set; } + /// A list of tokens to protect from being delimited. + public IList ProtectedWords { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/src/Properties/AssemblyInfo.cs b/sdk/search/Azure.Search.Documents.Indexes/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..e75b229b6c18 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.Search.Documents.Indexes.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Template")] diff --git a/sdk/search/Azure.Search.Documents.Indexes/tests/Azure.Search.Documents.Indexes.Tests.csproj b/sdk/search/Azure.Search.Documents.Indexes/tests/Azure.Search.Documents.Indexes.Tests.csproj new file mode 100644 index 000000000000..0d7e156dbbbe --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/tests/Azure.Search.Documents.Indexes.Tests.csproj @@ -0,0 +1,20 @@ + + + $(RequiredTargetFrameworks) + + $(NoWarn);CS1591 + + + + + + + + + + + + + + + diff --git a/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_DataSources.cs b/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_DataSources.cs new file mode 100644 index 000000000000..3392049fbf22 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_DataSources.cs @@ -0,0 +1,488 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Search.Documents.Indexes.Samples +{ + public partial class Samples_DataSources + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DataSources_CreateOrUpdate_SearchServiceCreateOrUpdateDataSource() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "mydocdbdatasource", + description = "My Cosmos DB data source.", + type = "cosmosdb", + credentials = new + { + connectionString = "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId", + }, + container = new + { + name = "myDocDbCollectionId", + query = "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts", + }, + dataChangeDetectionPolicy = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy", + ["highWaterMarkColumnName"] = "_ts" + }, + dataDeletionDetectionPolicy = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy", + ["softDeleteColumnName"] = "isDeleted", + ["softDeleteMarkerValue"] = "true" + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, + }); + Response response = client.CreateOrUpdate("mydatasource", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("credentials").ToString()); + Console.WriteLine(result.GetProperty("container").GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DataSources_CreateOrUpdate_SearchServiceCreateOrUpdateDataSource_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "mydocdbdatasource", + description = "My Cosmos DB data source.", + type = "cosmosdb", + credentials = new + { + connectionString = "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId", + }, + container = new + { + name = "myDocDbCollectionId", + query = "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts", + }, + dataChangeDetectionPolicy = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy", + ["highWaterMarkColumnName"] = "_ts" + }, + dataDeletionDetectionPolicy = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy", + ["softDeleteColumnName"] = "isDeleted", + ["softDeleteMarkerValue"] = "true" + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, + }); + Response response = await client.CreateOrUpdateAsync("mydatasource", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("credentials").ToString()); + Console.WriteLine(result.GetProperty("container").GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DataSources_CreateOrUpdate_SearchServiceCreateOrUpdateDataSource_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + SearchIndexerDataSource dataSource = new SearchIndexerDataSource("mydocdbdatasource", SearchIndexerDataSourceType.CosmosDb, new DataSourceCredentials + { + ConnectionString = "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId", + }, new SearchIndexerDataContainer("myDocDbCollectionId") + { + Query = "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts", + }) + { + Description = "My Cosmos DB data source.", + DataChangeDetectionPolicy = new HighWaterMarkChangeDetectionPolicy("_ts"), + DataDeletionDetectionPolicy = new SoftDeleteColumnDeletionDetectionPolicy + { + SoftDeleteColumnName = "isDeleted", + SoftDeleteMarkerValue = "true", + }, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), + }; + Response response = client.CreateOrUpdate("mydatasource", dataSource); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DataSources_CreateOrUpdate_SearchServiceCreateOrUpdateDataSource_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + SearchIndexerDataSource dataSource = new SearchIndexerDataSource("mydocdbdatasource", SearchIndexerDataSourceType.CosmosDb, new DataSourceCredentials + { + ConnectionString = "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId", + }, new SearchIndexerDataContainer("myDocDbCollectionId") + { + Query = "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts", + }) + { + Description = "My Cosmos DB data source.", + DataChangeDetectionPolicy = new HighWaterMarkChangeDetectionPolicy("_ts"), + DataDeletionDetectionPolicy = new SoftDeleteColumnDeletionDetectionPolicy + { + SoftDeleteColumnName = "isDeleted", + SoftDeleteMarkerValue = "true", + }, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), + }; + Response response = await client.CreateOrUpdateAsync("mydatasource", dataSource); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DataSources_Delete_SearchServiceDeleteDataSource() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + Response response = client.Delete("mydatasource"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DataSources_Delete_SearchServiceDeleteDataSource_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + Response response = await client.DeleteAsync("mydatasource"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DataSources_GetDataSource_SearchServiceGetDataSource() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + Response response = client.GetDataSource("mydatasource", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("credentials").ToString()); + Console.WriteLine(result.GetProperty("container").GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DataSources_GetDataSource_SearchServiceGetDataSource_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + Response response = await client.GetDataSourceAsync("mydatasource", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("credentials").ToString()); + Console.WriteLine(result.GetProperty("container").GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DataSources_GetDataSource_SearchServiceGetDataSource_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + Response response = client.GetDataSource("mydatasource"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DataSources_GetDataSource_SearchServiceGetDataSource_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + Response response = await client.GetDataSourceAsync("mydatasource"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DataSources_GetDataSources_SearchServiceListDataSources() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + Response response = client.GetDataSources("*", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("credentials").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("container").GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DataSources_GetDataSources_SearchServiceListDataSources_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + Response response = await client.GetDataSourcesAsync("*", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("credentials").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("container").GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DataSources_GetDataSources_SearchServiceListDataSources_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + Response response = client.GetDataSources(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DataSources_GetDataSources_SearchServiceListDataSources_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + Response response = await client.GetDataSourcesAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DataSources_Create_SearchServiceCreateDataSource() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "mydocdbdatasource", + description = "My Cosmos DB data source.", + type = "cosmosdb", + credentials = new + { + connectionString = "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId", + }, + container = new + { + name = "myDocDbCollectionId", + query = "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts", + }, + dataChangeDetectionPolicy = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy", + ["highWaterMarkColumnName"] = "_ts" + }, + dataDeletionDetectionPolicy = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy", + ["softDeleteColumnName"] = "isDeleted", + ["softDeleteMarkerValue"] = "true" + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "", + }, + }, + }); + Response response = client.Create(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("credentials").ToString()); + Console.WriteLine(result.GetProperty("container").GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DataSources_Create_SearchServiceCreateDataSource_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "mydocdbdatasource", + description = "My Cosmos DB data source.", + type = "cosmosdb", + credentials = new + { + connectionString = "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId", + }, + container = new + { + name = "myDocDbCollectionId", + query = "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts", + }, + dataChangeDetectionPolicy = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy", + ["highWaterMarkColumnName"] = "_ts" + }, + dataDeletionDetectionPolicy = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy", + ["softDeleteColumnName"] = "isDeleted", + ["softDeleteMarkerValue"] = "true" + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "", + }, + }, + }); + Response response = await client.CreateAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("credentials").ToString()); + Console.WriteLine(result.GetProperty("container").GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DataSources_Create_SearchServiceCreateDataSource_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + SearchIndexerDataSource dataSource = new SearchIndexerDataSource("mydocdbdatasource", SearchIndexerDataSourceType.CosmosDb, new DataSourceCredentials + { + ConnectionString = "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId", + }, new SearchIndexerDataContainer("myDocDbCollectionId") + { + Query = "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts", + }) + { + Description = "My Cosmos DB data source.", + DataChangeDetectionPolicy = new HighWaterMarkChangeDetectionPolicy("_ts"), + DataDeletionDetectionPolicy = new SoftDeleteColumnDeletionDetectionPolicy + { + SoftDeleteColumnName = "isDeleted", + SoftDeleteMarkerValue = "true", + }, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "", + }, + }, + }; + Response response = client.Create(dataSource); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DataSources_Create_SearchServiceCreateDataSource_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + DataSources client = new SearchClient(endpoint, credential).GetDataSourcesClient(); + + SearchIndexerDataSource dataSource = new SearchIndexerDataSource("mydocdbdatasource", SearchIndexerDataSourceType.CosmosDb, new DataSourceCredentials + { + ConnectionString = "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId", + }, new SearchIndexerDataContainer("myDocDbCollectionId") + { + Query = "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts", + }) + { + Description = "My Cosmos DB data source.", + DataChangeDetectionPolicy = new HighWaterMarkChangeDetectionPolicy("_ts"), + DataDeletionDetectionPolicy = new SoftDeleteColumnDeletionDetectionPolicy + { + SoftDeleteColumnName = "isDeleted", + SoftDeleteMarkerValue = "true", + }, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "", + }, + }, + }; + Response response = await client.CreateAsync(dataSource); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_Indexers.cs b/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_Indexers.cs new file mode 100644 index 000000000000..1142cc7d792c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_Indexers.cs @@ -0,0 +1,548 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using System.Xml; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Search.Documents.Indexes.Samples +{ + public partial class Samples_Indexers + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexers_Reset_SearchServiceResetIndexer() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = client.Reset("myindexer"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexers_Reset_SearchServiceResetIndexer_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = await client.ResetAsync("myindexer"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexers_Run_SearchServiceRunIndexer() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = client.Run("myindexer"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexers_Run_SearchServiceRunIndexer_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = await client.RunAsync("myindexer"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexers_CreateOrUpdate_SearchServiceCreateOrUpdateIndexer() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "myindexer", + description = "a cool indexer", + dataSourceName = "mydatasource", + targetIndexName = "orders", + schedule = new + { + interval = "PT1H", + startTime = "2015-01-01T00:00:00Z", + }, + parameters = new + { + maxFailedItems = 10, + maxFailedItemsPerBatch = 5, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, + }); + Response response = client.CreateOrUpdate("myindexer", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("dataSourceName").ToString()); + Console.WriteLine(result.GetProperty("targetIndexName").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexers_CreateOrUpdate_SearchServiceCreateOrUpdateIndexer_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "myindexer", + description = "a cool indexer", + dataSourceName = "mydatasource", + targetIndexName = "orders", + schedule = new + { + interval = "PT1H", + startTime = "2015-01-01T00:00:00Z", + }, + parameters = new + { + maxFailedItems = 10, + maxFailedItemsPerBatch = 5, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, + }); + Response response = await client.CreateOrUpdateAsync("myindexer", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("dataSourceName").ToString()); + Console.WriteLine(result.GetProperty("targetIndexName").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexers_CreateOrUpdate_SearchServiceCreateOrUpdateIndexer_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + SearchIndexer indexer = new SearchIndexer("myindexer", "mydatasource", "orders") + { + Description = "a cool indexer", + Schedule = new IndexingSchedule(XmlConvert.ToTimeSpan("PT1H")) + { + StartTime = DateTimeOffset.Parse("2015-01-01T00:00:00Z"), + }, + Parameters = new IndexingParameters + { + MaxFailedItems = 10, + MaxFailedItemsPerBatch = 5, + }, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), + }; + Response response = client.CreateOrUpdate("myindexer", indexer); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexers_CreateOrUpdate_SearchServiceCreateOrUpdateIndexer_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + SearchIndexer indexer = new SearchIndexer("myindexer", "mydatasource", "orders") + { + Description = "a cool indexer", + Schedule = new IndexingSchedule(XmlConvert.ToTimeSpan("PT1H")) + { + StartTime = DateTimeOffset.Parse("2015-01-01T00:00:00Z"), + }, + Parameters = new IndexingParameters + { + MaxFailedItems = 10, + MaxFailedItemsPerBatch = 5, + }, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), + }; + Response response = await client.CreateOrUpdateAsync("myindexer", indexer); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexers_Delete_SearchServiceDeleteIndexer() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = client.Delete("myindexer"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexers_Delete_SearchServiceDeleteIndexer_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = await client.DeleteAsync("myindexer"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexers_GetIndexer_SearchServiceGetIndexer() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = client.GetIndexer("myindexer", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("dataSourceName").ToString()); + Console.WriteLine(result.GetProperty("targetIndexName").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexers_GetIndexer_SearchServiceGetIndexer_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = await client.GetIndexerAsync("myindexer", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("dataSourceName").ToString()); + Console.WriteLine(result.GetProperty("targetIndexName").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexers_GetIndexer_SearchServiceGetIndexer_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = client.GetIndexer("myindexer"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexers_GetIndexer_SearchServiceGetIndexer_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = await client.GetIndexerAsync("myindexer"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexers_GetIndexers_SearchServiceListIndexers() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = client.GetIndexers("*", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("dataSourceName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("targetIndexName").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexers_GetIndexers_SearchServiceListIndexers_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = await client.GetIndexersAsync("*", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("dataSourceName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("targetIndexName").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexers_GetIndexers_SearchServiceListIndexers_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = client.GetIndexers(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexers_GetIndexers_SearchServiceListIndexers_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = await client.GetIndexersAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexers_Create_SearchServiceCreateIndexer() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "myindexer", + description = "an indexer", + dataSourceName = "mydatasource", + targetIndexName = "orders", + schedule = new + { + interval = "PT1H", + startTime = "2015-01-01T00:00:00Z", + }, + parameters = new + { + maxFailedItems = 10, + maxFailedItemsPerBatch = 5, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "", + }, + }, + }); + Response response = client.Create(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("dataSourceName").ToString()); + Console.WriteLine(result.GetProperty("targetIndexName").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexers_Create_SearchServiceCreateIndexer_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "myindexer", + description = "an indexer", + dataSourceName = "mydatasource", + targetIndexName = "orders", + schedule = new + { + interval = "PT1H", + startTime = "2015-01-01T00:00:00Z", + }, + parameters = new + { + maxFailedItems = 10, + maxFailedItemsPerBatch = 5, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "", + }, + }, + }); + Response response = await client.CreateAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("dataSourceName").ToString()); + Console.WriteLine(result.GetProperty("targetIndexName").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexers_Create_SearchServiceCreateIndexer_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + SearchIndexer indexer = new SearchIndexer("myindexer", "mydatasource", "orders") + { + Description = "an indexer", + Schedule = new IndexingSchedule(XmlConvert.ToTimeSpan("PT1H")) + { + StartTime = DateTimeOffset.Parse("2015-01-01T00:00:00Z"), + }, + Parameters = new IndexingParameters + { + MaxFailedItems = 10, + MaxFailedItemsPerBatch = 5, + }, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "", + }, + }, + }; + Response response = client.Create(indexer); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexers_Create_SearchServiceCreateIndexer_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + SearchIndexer indexer = new SearchIndexer("myindexer", "mydatasource", "orders") + { + Description = "an indexer", + Schedule = new IndexingSchedule(XmlConvert.ToTimeSpan("PT1H")) + { + StartTime = DateTimeOffset.Parse("2015-01-01T00:00:00Z"), + }, + Parameters = new IndexingParameters + { + MaxFailedItems = 10, + MaxFailedItemsPerBatch = 5, + }, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "", + }, + }, + }; + Response response = await client.CreateAsync(indexer); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexers_GetStatus_SearchServiceGetIndexerStatus() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = client.GetStatus("myindexer", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("errors")[0].GetProperty("errorMessage").ToString()); + Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("errors")[0].GetProperty("statusCode").ToString()); + Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("itemsProcessed").ToString()); + Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("itemsFailed").ToString()); + Console.WriteLine(result.GetProperty("limits").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexers_GetStatus_SearchServiceGetIndexerStatus_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = await client.GetStatusAsync("myindexer", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("errors")[0].GetProperty("errorMessage").ToString()); + Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("errors")[0].GetProperty("statusCode").ToString()); + Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("itemsProcessed").ToString()); + Console.WriteLine(result.GetProperty("executionHistory")[0].GetProperty("itemsFailed").ToString()); + Console.WriteLine(result.GetProperty("limits").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexers_GetStatus_SearchServiceGetIndexerStatus_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = client.GetStatus("myindexer"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexers_GetStatus_SearchServiceGetIndexerStatus_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexers client = new SearchClient(endpoint, credential).GetIndexersClient(); + + Response response = await client.GetStatusAsync("myindexer"); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_Indexes.cs b/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_Indexes.cs new file mode 100644 index 000000000000..97f33d2afd9c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_Indexes.cs @@ -0,0 +1,2026 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Search.Documents.Indexes.Samples +{ + public partial class Samples_Indexes + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_Create_SearchServiceCreateIndex() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "hotels", + fields = new object[] + { +new +{ +name = "hotelId", +type = "Edm.String", +key = true, +searchable = false, +}, +new +{ +name = "baseRate", +type = "Edm.Double", +}, +new +{ +name = "description", +type = "Edm.String", +filterable = false, +sortable = false, +facetable = false, +}, +new +{ +name = "descriptionEmbedding", +type = "Collection(Edm.Single)", +searchable = true, +filterable = false, +retrievable = true, +sortable = false, +facetable = false, +key = false, +synonymMaps = Array.Empty(), +dimensions = 1536, +vectorSearchProfile = "myHnswSQProfile", +}, +new +{ +name = "descriptionEmbedding_notstored", +type = "Collection(Edm.Single)", +searchable = true, +filterable = false, +retrievable = false, +stored = false, +sortable = false, +facetable = false, +key = false, +synonymMaps = Array.Empty(), +dimensions = 1536, +vectorSearchProfile = "myHnswSQProfile", +}, +new +{ +name = "descriptionEmbedding_forBQ", +type = "Collection(Edm.Single)", +searchable = true, +filterable = false, +retrievable = true, +sortable = false, +facetable = false, +key = false, +synonymMaps = Array.Empty(), +dimensions = 1536, +vectorSearchProfile = "myHnswBQProfile", +}, +new +{ +name = "description_fr", +type = "Edm.String", +filterable = false, +sortable = false, +facetable = false, +analyzer = "fr.lucene", +}, +new +{ +name = "hotelName", +type = "Edm.String", +}, +new +{ +name = "nameEmbedding", +type = "Collection(Edm.Half)", +searchable = true, +filterable = false, +retrievable = true, +sortable = false, +facetable = false, +key = false, +synonymMaps = Array.Empty(), +dimensions = 1536, +vectorSearchProfile = "myHnswProfile", +}, +new +{ +name = "category", +type = "Edm.String", +}, +new +{ +name = "tags", +type = "Collection(Edm.String)", +analyzer = "tagsAnalyzer", +}, +new +{ +name = "parkingIncluded", +type = "Edm.Boolean", +}, +new +{ +name = "smokingAllowed", +type = "Edm.Boolean", +}, +new +{ +name = "lastRenovationDate", +type = "Edm.DateTimeOffset", +}, +new +{ +name = "rating", +type = "Edm.Int32", +}, +new +{ +name = "location", +type = "Edm.GeographyPoint", +} + }, + scoringProfiles = new object[] + { +new +{ +name = "geo", +text = new +{ +weights = new +{ +hotelName = 5, +}, +}, +functions = new object[] +{ +new +{ +type = "distance", +boost = 5, +fieldName = "location", +interpolation = "logarithmic", +distance = new +{ +referencePointParameter = "currentLocation", +boostingDistance = 10, +}, +} +}, +} + }, + defaultScoringProfile = "geo", + suggesters = new object[] + { +new +{ +name = "sg", +searchMode = "analyzingInfixMatching", +sourceFields = new object[] +{ +"hotelName" +}, +} + }, + analyzers = new object[] + { +new Dictionary +{ +["name"] = "tagsAnalyzer", +["@odata.type"] = "#Microsoft.Azure.Search.CustomAnalyzer", +["charFilters"] = new object[] +{ +"html_strip" +}, +["tokenizer"] = "standard_v2" +} + }, + corsOptions = new + { + allowedOrigins = new object[] + { +"tempuri.org" + }, + maxAgeInSeconds = 60L, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "", + }, + }, + similarity = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.BM25Similarity", + ["b"] = 0.5, + ["k1"] = 1.3 + }, + semantic = new + { + configurations = new object[] + { +new +{ +name = "semanticHotels", +prioritizedFields = new +{ +titleField = new +{ +fieldName = "hotelName", +}, +prioritizedContentFields = new object[] +{ +new +{ +fieldName = "description", +}, +new +{ +fieldName = "description_fr", +} +}, +prioritizedKeywordsFields = new object[] +{ +new +{ +fieldName = "tags", +}, +new +{ +fieldName = "category", +} +}, +}, +} + }, + }, + vectorSearch = new + { + profiles = new object[] + { +new +{ +name = "myHnswProfile", +algorithm = "myHnsw", +}, +new +{ +name = "myHnswSQProfile", +algorithm = "myHnsw", +compression = "mySQ8", +}, +new +{ +name = "myHnswBQProfile", +algorithm = "myHnsw", +compression = "myBQ", +}, +new +{ +name = "myAlgorithm", +algorithm = "myExhaustive", +} + }, + algorithms = new object[] + { +new +{ +name = "myHnsw", +kind = "hnsw", +hnswParameters = new +{ +m = 4, +metric = "cosine", +}, +}, +new +{ +name = "myExhaustive", +kind = "exhaustiveKnn", +exhaustiveKnnParameters = new +{ +metric = "cosine", +}, +} + }, + compressions = new object[] + { +new +{ +name = "mySQ8", +kind = "scalarQuantization", +scalarQuantizationParameters = new +{ +quantizedDataType = "int8", +}, +rerankWithOriginalVectors = true, +defaultOversampling = 10, +}, +new +{ +name = "myBQ", +kind = "binaryQuantization", +rerankWithOriginalVectors = true, +defaultOversampling = 10, +} + }, + }, + }); + Response response = client.Create(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("type").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_Create_SearchServiceCreateIndex_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "hotels", + fields = new object[] + { +new +{ +name = "hotelId", +type = "Edm.String", +key = true, +searchable = false, +}, +new +{ +name = "baseRate", +type = "Edm.Double", +}, +new +{ +name = "description", +type = "Edm.String", +filterable = false, +sortable = false, +facetable = false, +}, +new +{ +name = "descriptionEmbedding", +type = "Collection(Edm.Single)", +searchable = true, +filterable = false, +retrievable = true, +sortable = false, +facetable = false, +key = false, +synonymMaps = Array.Empty(), +dimensions = 1536, +vectorSearchProfile = "myHnswSQProfile", +}, +new +{ +name = "descriptionEmbedding_notstored", +type = "Collection(Edm.Single)", +searchable = true, +filterable = false, +retrievable = false, +stored = false, +sortable = false, +facetable = false, +key = false, +synonymMaps = Array.Empty(), +dimensions = 1536, +vectorSearchProfile = "myHnswSQProfile", +}, +new +{ +name = "descriptionEmbedding_forBQ", +type = "Collection(Edm.Single)", +searchable = true, +filterable = false, +retrievable = true, +sortable = false, +facetable = false, +key = false, +synonymMaps = Array.Empty(), +dimensions = 1536, +vectorSearchProfile = "myHnswBQProfile", +}, +new +{ +name = "description_fr", +type = "Edm.String", +filterable = false, +sortable = false, +facetable = false, +analyzer = "fr.lucene", +}, +new +{ +name = "hotelName", +type = "Edm.String", +}, +new +{ +name = "nameEmbedding", +type = "Collection(Edm.Half)", +searchable = true, +filterable = false, +retrievable = true, +sortable = false, +facetable = false, +key = false, +synonymMaps = Array.Empty(), +dimensions = 1536, +vectorSearchProfile = "myHnswProfile", +}, +new +{ +name = "category", +type = "Edm.String", +}, +new +{ +name = "tags", +type = "Collection(Edm.String)", +analyzer = "tagsAnalyzer", +}, +new +{ +name = "parkingIncluded", +type = "Edm.Boolean", +}, +new +{ +name = "smokingAllowed", +type = "Edm.Boolean", +}, +new +{ +name = "lastRenovationDate", +type = "Edm.DateTimeOffset", +}, +new +{ +name = "rating", +type = "Edm.Int32", +}, +new +{ +name = "location", +type = "Edm.GeographyPoint", +} + }, + scoringProfiles = new object[] + { +new +{ +name = "geo", +text = new +{ +weights = new +{ +hotelName = 5, +}, +}, +functions = new object[] +{ +new +{ +type = "distance", +boost = 5, +fieldName = "location", +interpolation = "logarithmic", +distance = new +{ +referencePointParameter = "currentLocation", +boostingDistance = 10, +}, +} +}, +} + }, + defaultScoringProfile = "geo", + suggesters = new object[] + { +new +{ +name = "sg", +searchMode = "analyzingInfixMatching", +sourceFields = new object[] +{ +"hotelName" +}, +} + }, + analyzers = new object[] + { +new Dictionary +{ +["name"] = "tagsAnalyzer", +["@odata.type"] = "#Microsoft.Azure.Search.CustomAnalyzer", +["charFilters"] = new object[] +{ +"html_strip" +}, +["tokenizer"] = "standard_v2" +} + }, + corsOptions = new + { + allowedOrigins = new object[] + { +"tempuri.org" + }, + maxAgeInSeconds = 60L, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "", + }, + }, + similarity = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.BM25Similarity", + ["b"] = 0.5, + ["k1"] = 1.3 + }, + semantic = new + { + configurations = new object[] + { +new +{ +name = "semanticHotels", +prioritizedFields = new +{ +titleField = new +{ +fieldName = "hotelName", +}, +prioritizedContentFields = new object[] +{ +new +{ +fieldName = "description", +}, +new +{ +fieldName = "description_fr", +} +}, +prioritizedKeywordsFields = new object[] +{ +new +{ +fieldName = "tags", +}, +new +{ +fieldName = "category", +} +}, +}, +} + }, + }, + vectorSearch = new + { + profiles = new object[] + { +new +{ +name = "myHnswProfile", +algorithm = "myHnsw", +}, +new +{ +name = "myHnswSQProfile", +algorithm = "myHnsw", +compression = "mySQ8", +}, +new +{ +name = "myHnswBQProfile", +algorithm = "myHnsw", +compression = "myBQ", +}, +new +{ +name = "myAlgorithm", +algorithm = "myExhaustive", +} + }, + algorithms = new object[] + { +new +{ +name = "myHnsw", +kind = "hnsw", +hnswParameters = new +{ +m = 4, +metric = "cosine", +}, +}, +new +{ +name = "myExhaustive", +kind = "exhaustiveKnn", +exhaustiveKnnParameters = new +{ +metric = "cosine", +}, +} + }, + compressions = new object[] + { +new +{ +name = "mySQ8", +kind = "scalarQuantization", +scalarQuantizationParameters = new +{ +quantizedDataType = "int8", +}, +rerankWithOriginalVectors = true, +defaultOversampling = 10, +}, +new +{ +name = "myBQ", +kind = "binaryQuantization", +rerankWithOriginalVectors = true, +defaultOversampling = 10, +} + }, + }, + }); + Response response = await client.CreateAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("type").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_Create_SearchServiceCreateIndex_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + SearchIndex index = new SearchIndex("hotels", new SearchField[] + { +new SearchField("hotelId", SearchFieldDataType.String) +{ +Key = true, +Searchable = false, +}, +new SearchField("baseRate", SearchFieldDataType.Double), +new SearchField("description", SearchFieldDataType.String) +{ +Filterable = false, +Sortable = false, +Facetable = false, +}, +new SearchField("descriptionEmbedding", new SearchFieldDataType("Collection(Edm.Single)")) +{ +Key = false, +Retrievable = true, +Searchable = true, +Filterable = false, +Sortable = false, +Facetable = false, +Dimensions = 1536, +VectorSearchProfile = "myHnswSQProfile", +SynonymMaps = {}, +}, +new SearchField("descriptionEmbedding_notstored", new SearchFieldDataType("Collection(Edm.Single)")) +{ +Key = false, +Retrievable = false, +Stored = false, +Searchable = true, +Filterable = false, +Sortable = false, +Facetable = false, +Dimensions = 1536, +VectorSearchProfile = "myHnswSQProfile", +SynonymMaps = {}, +}, +new SearchField("descriptionEmbedding_forBQ", new SearchFieldDataType("Collection(Edm.Single)")) +{ +Key = false, +Retrievable = true, +Searchable = true, +Filterable = false, +Sortable = false, +Facetable = false, +Dimensions = 1536, +VectorSearchProfile = "myHnswBQProfile", +SynonymMaps = {}, +}, +new SearchField("description_fr", SearchFieldDataType.String) +{ +Filterable = false, +Sortable = false, +Facetable = false, +Analyzer = LexicalAnalyzerName.FrLucene, +}, +new SearchField("hotelName", SearchFieldDataType.String), +new SearchField("nameEmbedding", new SearchFieldDataType("Collection(Edm.Half)")) +{ +Key = false, +Retrievable = true, +Searchable = true, +Filterable = false, +Sortable = false, +Facetable = false, +Dimensions = 1536, +VectorSearchProfile = "myHnswProfile", +SynonymMaps = {}, +}, +new SearchField("category", SearchFieldDataType.String), +new SearchField("tags", new SearchFieldDataType("Collection(Edm.String)")) +{ +Analyzer = new LexicalAnalyzerName("tagsAnalyzer"), +}, +new SearchField("parkingIncluded", SearchFieldDataType.Boolean), +new SearchField("smokingAllowed", SearchFieldDataType.Boolean), +new SearchField("lastRenovationDate", SearchFieldDataType.DateTimeOffset), +new SearchField("rating", SearchFieldDataType.Int32), +new SearchField("location", SearchFieldDataType.GeographyPoint) + }) + { + ScoringProfiles = {new ScoringProfile("geo") +{ +Text = new TextWeights(new Dictionary +{ +["hotelName"] = 5 +}), +Functions = {new DistanceScoringFunction("location", 5, new DistanceScoringParameters("currentLocation", 10)) +{ +Interpolation = ScoringFunctionInterpolation.Logarithmic, +}}, +}}, + DefaultScoringProfile = "geo", + CorsOptions = new CorsOptions(new string[] { "tempuri.org" }) + { + MaxAgeInSeconds = 60L, + }, + Suggesters = { new SearchSuggester("sg", new string[] { "hotelName" }) }, + Analyzers = {new CustomAnalyzer("tagsAnalyzer", LexicalTokenizerName.Standard) +{ +CharFilters = {CharFilterName.HtmlStrip}, +}}, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "", + }, + }, + Similarity = new BM25SimilarityAlgorithm + { + K1 = 1.3, + B = 0.5, + }, + Semantic = new SemanticSearch + { + Configurations = {new SemanticConfiguration("semanticHotels", new SemanticPrioritizedFields +{ +TitleField = new SemanticField("hotelName"), +PrioritizedContentFields = {new SemanticField("description"), new SemanticField("description_fr")}, +PrioritizedKeywordsFields = {new SemanticField("tags"), new SemanticField("category")}, +})}, + }, + VectorSearch = new VectorSearch + { + Profiles = {new VectorSearchProfile("myHnswProfile", "myHnsw"), new VectorSearchProfile("myHnswSQProfile", "myHnsw") +{ +Compression = "mySQ8", +}, new VectorSearchProfile("myHnswBQProfile", "myHnsw") +{ +Compression = "myBQ", +}, new VectorSearchProfile("myAlgorithm", "myExhaustive")}, + Algorithms = {new HnswAlgorithmConfiguration("myHnsw") +{ +HnswParameters = new HnswParameters +{ +M = 4, +Metric = VectorSearchAlgorithmMetric.Cosine, +}, +}, new ExhaustiveKnnAlgorithmConfiguration("myExhaustive") +{ +ExhaustiveKnnParameters = new ExhaustiveKnnParameters +{ +Metric = VectorSearchAlgorithmMetric.Cosine, +}, +}}, + Compressions = {new ScalarQuantizationCompression("mySQ8") +{ +ScalarQuantizationParameters = new ScalarQuantizationParameters +{ +QuantizedDataType = VectorSearchCompressionTarget.Int8, +}, +RerankWithOriginalVectors = true, +DefaultOversampling = 10, +}, new BinaryQuantizationCompression("myBQ") +{ +RerankWithOriginalVectors = true, +DefaultOversampling = 10, +}}, + }, + }; + Response response = client.Create(index); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_Create_SearchServiceCreateIndex_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + SearchIndex index = new SearchIndex("hotels", new SearchField[] + { +new SearchField("hotelId", SearchFieldDataType.String) +{ +Key = true, +Searchable = false, +}, +new SearchField("baseRate", SearchFieldDataType.Double), +new SearchField("description", SearchFieldDataType.String) +{ +Filterable = false, +Sortable = false, +Facetable = false, +}, +new SearchField("descriptionEmbedding", new SearchFieldDataType("Collection(Edm.Single)")) +{ +Key = false, +Retrievable = true, +Searchable = true, +Filterable = false, +Sortable = false, +Facetable = false, +Dimensions = 1536, +VectorSearchProfile = "myHnswSQProfile", +SynonymMaps = {}, +}, +new SearchField("descriptionEmbedding_notstored", new SearchFieldDataType("Collection(Edm.Single)")) +{ +Key = false, +Retrievable = false, +Stored = false, +Searchable = true, +Filterable = false, +Sortable = false, +Facetable = false, +Dimensions = 1536, +VectorSearchProfile = "myHnswSQProfile", +SynonymMaps = {}, +}, +new SearchField("descriptionEmbedding_forBQ", new SearchFieldDataType("Collection(Edm.Single)")) +{ +Key = false, +Retrievable = true, +Searchable = true, +Filterable = false, +Sortable = false, +Facetable = false, +Dimensions = 1536, +VectorSearchProfile = "myHnswBQProfile", +SynonymMaps = {}, +}, +new SearchField("description_fr", SearchFieldDataType.String) +{ +Filterable = false, +Sortable = false, +Facetable = false, +Analyzer = LexicalAnalyzerName.FrLucene, +}, +new SearchField("hotelName", SearchFieldDataType.String), +new SearchField("nameEmbedding", new SearchFieldDataType("Collection(Edm.Half)")) +{ +Key = false, +Retrievable = true, +Searchable = true, +Filterable = false, +Sortable = false, +Facetable = false, +Dimensions = 1536, +VectorSearchProfile = "myHnswProfile", +SynonymMaps = {}, +}, +new SearchField("category", SearchFieldDataType.String), +new SearchField("tags", new SearchFieldDataType("Collection(Edm.String)")) +{ +Analyzer = new LexicalAnalyzerName("tagsAnalyzer"), +}, +new SearchField("parkingIncluded", SearchFieldDataType.Boolean), +new SearchField("smokingAllowed", SearchFieldDataType.Boolean), +new SearchField("lastRenovationDate", SearchFieldDataType.DateTimeOffset), +new SearchField("rating", SearchFieldDataType.Int32), +new SearchField("location", SearchFieldDataType.GeographyPoint) + }) + { + ScoringProfiles = {new ScoringProfile("geo") +{ +Text = new TextWeights(new Dictionary +{ +["hotelName"] = 5 +}), +Functions = {new DistanceScoringFunction("location", 5, new DistanceScoringParameters("currentLocation", 10)) +{ +Interpolation = ScoringFunctionInterpolation.Logarithmic, +}}, +}}, + DefaultScoringProfile = "geo", + CorsOptions = new CorsOptions(new string[] { "tempuri.org" }) + { + MaxAgeInSeconds = 60L, + }, + Suggesters = { new SearchSuggester("sg", new string[] { "hotelName" }) }, + Analyzers = {new CustomAnalyzer("tagsAnalyzer", LexicalTokenizerName.Standard) +{ +CharFilters = {CharFilterName.HtmlStrip}, +}}, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "", + }, + }, + Similarity = new BM25SimilarityAlgorithm + { + K1 = 1.3, + B = 0.5, + }, + Semantic = new SemanticSearch + { + Configurations = {new SemanticConfiguration("semanticHotels", new SemanticPrioritizedFields +{ +TitleField = new SemanticField("hotelName"), +PrioritizedContentFields = {new SemanticField("description"), new SemanticField("description_fr")}, +PrioritizedKeywordsFields = {new SemanticField("tags"), new SemanticField("category")}, +})}, + }, + VectorSearch = new VectorSearch + { + Profiles = {new VectorSearchProfile("myHnswProfile", "myHnsw"), new VectorSearchProfile("myHnswSQProfile", "myHnsw") +{ +Compression = "mySQ8", +}, new VectorSearchProfile("myHnswBQProfile", "myHnsw") +{ +Compression = "myBQ", +}, new VectorSearchProfile("myAlgorithm", "myExhaustive")}, + Algorithms = {new HnswAlgorithmConfiguration("myHnsw") +{ +HnswParameters = new HnswParameters +{ +M = 4, +Metric = VectorSearchAlgorithmMetric.Cosine, +}, +}, new ExhaustiveKnnAlgorithmConfiguration("myExhaustive") +{ +ExhaustiveKnnParameters = new ExhaustiveKnnParameters +{ +Metric = VectorSearchAlgorithmMetric.Cosine, +}, +}}, + Compressions = {new ScalarQuantizationCompression("mySQ8") +{ +ScalarQuantizationParameters = new ScalarQuantizationParameters +{ +QuantizedDataType = VectorSearchCompressionTarget.Int8, +}, +RerankWithOriginalVectors = true, +DefaultOversampling = 10, +}, new BinaryQuantizationCompression("myBQ") +{ +RerankWithOriginalVectors = true, +DefaultOversampling = 10, +}}, + }, + }; + Response response = await client.CreateAsync(index); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_CreateOrUpdate_SearchServiceCreateOrUpdateIndex() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "hotels", + fields = new object[] + { +new +{ +name = "hotelId", +type = "Edm.String", +key = true, +searchable = false, +}, +new +{ +name = "baseRate", +type = "Edm.Double", +}, +new +{ +name = "description", +type = "Edm.String", +filterable = false, +sortable = false, +facetable = false, +}, +new +{ +name = "descriptionEmbedding", +type = "Collection(Edm.Single)", +dimensions = 1536, +vectorSearchProfile = "myHnswProfile", +searchable = true, +retrievable = true, +}, +new +{ +name = "description_fr", +type = "Edm.String", +filterable = false, +sortable = false, +facetable = false, +analyzer = "fr.lucene", +}, +new +{ +name = "hotelName", +type = "Edm.String", +}, +new +{ +name = "category", +type = "Edm.String", +}, +new +{ +name = "tags", +type = "Collection(Edm.String)", +analyzer = "tagsAnalyzer", +}, +new +{ +name = "parkingIncluded", +type = "Edm.Boolean", +}, +new +{ +name = "smokingAllowed", +type = "Edm.Boolean", +}, +new +{ +name = "lastRenovationDate", +type = "Edm.DateTimeOffset", +}, +new +{ +name = "rating", +type = "Edm.Int32", +}, +new +{ +name = "location", +type = "Edm.GeographyPoint", +} + }, + scoringProfiles = new object[] + { +new +{ +name = "geo", +text = new +{ +weights = new +{ +hotelName = 5, +}, +}, +functions = new object[] +{ +new +{ +type = "distance", +boost = 5, +fieldName = "location", +interpolation = "logarithmic", +distance = new +{ +referencePointParameter = "currentLocation", +boostingDistance = 10, +}, +} +}, +} + }, + defaultScoringProfile = "geo", + suggesters = new object[] + { +new +{ +name = "sg", +searchMode = "analyzingInfixMatching", +sourceFields = new object[] +{ +"hotelName" +}, +} + }, + analyzers = new object[] + { +new Dictionary +{ +["name"] = "tagsAnalyzer", +["@odata.type"] = "#Microsoft.Azure.Search.CustomAnalyzer", +["charFilters"] = new object[] +{ +"html_strip" +}, +["tokenizer"] = "standard_v2" +} + }, + corsOptions = new + { + allowedOrigins = new object[] + { +"tempuri.org" + }, + maxAgeInSeconds = 60L, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, + similarity = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.ClassicSimilarity" + }, + semantic = new + { + configurations = new object[] + { +new +{ +name = "semanticHotels", +prioritizedFields = new +{ +titleField = new +{ +fieldName = "hotelName", +}, +prioritizedContentFields = new object[] +{ +new +{ +fieldName = "description", +}, +new +{ +fieldName = "description_fr", +} +}, +prioritizedKeywordsFields = new object[] +{ +new +{ +fieldName = "tags", +}, +new +{ +fieldName = "category", +} +}, +}, +} + }, + }, + vectorSearch = new + { + profiles = new object[] + { +new +{ +name = "myHnswProfile", +algorithm = "myHnsw", +}, +new +{ +name = "myAlgorithm", +algorithm = "myExhaustive", +} + }, + algorithms = new object[] + { +new +{ +name = "myHnsw", +kind = "hnsw", +hnswParameters = new +{ +m = 4, +metric = "cosine", +}, +}, +new +{ +name = "myExhaustive", +kind = "exhaustiveKnn", +exhaustiveKnnParameters = new +{ +metric = "cosine", +}, +} + }, + }, + }); + Response response = client.CreateOrUpdate("hotels", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("type").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_CreateOrUpdate_SearchServiceCreateOrUpdateIndex_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "hotels", + fields = new object[] + { +new +{ +name = "hotelId", +type = "Edm.String", +key = true, +searchable = false, +}, +new +{ +name = "baseRate", +type = "Edm.Double", +}, +new +{ +name = "description", +type = "Edm.String", +filterable = false, +sortable = false, +facetable = false, +}, +new +{ +name = "descriptionEmbedding", +type = "Collection(Edm.Single)", +dimensions = 1536, +vectorSearchProfile = "myHnswProfile", +searchable = true, +retrievable = true, +}, +new +{ +name = "description_fr", +type = "Edm.String", +filterable = false, +sortable = false, +facetable = false, +analyzer = "fr.lucene", +}, +new +{ +name = "hotelName", +type = "Edm.String", +}, +new +{ +name = "category", +type = "Edm.String", +}, +new +{ +name = "tags", +type = "Collection(Edm.String)", +analyzer = "tagsAnalyzer", +}, +new +{ +name = "parkingIncluded", +type = "Edm.Boolean", +}, +new +{ +name = "smokingAllowed", +type = "Edm.Boolean", +}, +new +{ +name = "lastRenovationDate", +type = "Edm.DateTimeOffset", +}, +new +{ +name = "rating", +type = "Edm.Int32", +}, +new +{ +name = "location", +type = "Edm.GeographyPoint", +} + }, + scoringProfiles = new object[] + { +new +{ +name = "geo", +text = new +{ +weights = new +{ +hotelName = 5, +}, +}, +functions = new object[] +{ +new +{ +type = "distance", +boost = 5, +fieldName = "location", +interpolation = "logarithmic", +distance = new +{ +referencePointParameter = "currentLocation", +boostingDistance = 10, +}, +} +}, +} + }, + defaultScoringProfile = "geo", + suggesters = new object[] + { +new +{ +name = "sg", +searchMode = "analyzingInfixMatching", +sourceFields = new object[] +{ +"hotelName" +}, +} + }, + analyzers = new object[] + { +new Dictionary +{ +["name"] = "tagsAnalyzer", +["@odata.type"] = "#Microsoft.Azure.Search.CustomAnalyzer", +["charFilters"] = new object[] +{ +"html_strip" +}, +["tokenizer"] = "standard_v2" +} + }, + corsOptions = new + { + allowedOrigins = new object[] + { +"tempuri.org" + }, + maxAgeInSeconds = 60L, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, + similarity = new Dictionary + { + ["@odata.type"] = "#Microsoft.Azure.Search.ClassicSimilarity" + }, + semantic = new + { + configurations = new object[] + { +new +{ +name = "semanticHotels", +prioritizedFields = new +{ +titleField = new +{ +fieldName = "hotelName", +}, +prioritizedContentFields = new object[] +{ +new +{ +fieldName = "description", +}, +new +{ +fieldName = "description_fr", +} +}, +prioritizedKeywordsFields = new object[] +{ +new +{ +fieldName = "tags", +}, +new +{ +fieldName = "category", +} +}, +}, +} + }, + }, + vectorSearch = new + { + profiles = new object[] + { +new +{ +name = "myHnswProfile", +algorithm = "myHnsw", +}, +new +{ +name = "myAlgorithm", +algorithm = "myExhaustive", +} + }, + algorithms = new object[] + { +new +{ +name = "myHnsw", +kind = "hnsw", +hnswParameters = new +{ +m = 4, +metric = "cosine", +}, +}, +new +{ +name = "myExhaustive", +kind = "exhaustiveKnn", +exhaustiveKnnParameters = new +{ +metric = "cosine", +}, +} + }, + }, + }); + Response response = await client.CreateOrUpdateAsync("hotels", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("type").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_CreateOrUpdate_SearchServiceCreateOrUpdateIndex_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + SearchIndex index = new SearchIndex("hotels", new SearchField[] + { +new SearchField("hotelId", SearchFieldDataType.String) +{ +Key = true, +Searchable = false, +}, +new SearchField("baseRate", SearchFieldDataType.Double), +new SearchField("description", SearchFieldDataType.String) +{ +Filterable = false, +Sortable = false, +Facetable = false, +}, +new SearchField("descriptionEmbedding", new SearchFieldDataType("Collection(Edm.Single)")) +{ +Retrievable = true, +Searchable = true, +Dimensions = 1536, +VectorSearchProfile = "myHnswProfile", +}, +new SearchField("description_fr", SearchFieldDataType.String) +{ +Filterable = false, +Sortable = false, +Facetable = false, +Analyzer = LexicalAnalyzerName.FrLucene, +}, +new SearchField("hotelName", SearchFieldDataType.String), +new SearchField("category", SearchFieldDataType.String), +new SearchField("tags", new SearchFieldDataType("Collection(Edm.String)")) +{ +Analyzer = new LexicalAnalyzerName("tagsAnalyzer"), +}, +new SearchField("parkingIncluded", SearchFieldDataType.Boolean), +new SearchField("smokingAllowed", SearchFieldDataType.Boolean), +new SearchField("lastRenovationDate", SearchFieldDataType.DateTimeOffset), +new SearchField("rating", SearchFieldDataType.Int32), +new SearchField("location", SearchFieldDataType.GeographyPoint) + }) + { + ScoringProfiles = {new ScoringProfile("geo") +{ +Text = new TextWeights(new Dictionary +{ +["hotelName"] = 5 +}), +Functions = {new DistanceScoringFunction("location", 5, new DistanceScoringParameters("currentLocation", 10)) +{ +Interpolation = ScoringFunctionInterpolation.Logarithmic, +}}, +}}, + DefaultScoringProfile = "geo", + CorsOptions = new CorsOptions(new string[] { "tempuri.org" }) + { + MaxAgeInSeconds = 60L, + }, + Suggesters = { new SearchSuggester("sg", new string[] { "hotelName" }) }, + Analyzers = {new CustomAnalyzer("tagsAnalyzer", LexicalTokenizerName.Standard) +{ +CharFilters = {CharFilterName.HtmlStrip}, +}}, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), + Similarity = new ClassicSimilarityAlgorithm(), + Semantic = new SemanticSearch + { + Configurations = {new SemanticConfiguration("semanticHotels", new SemanticPrioritizedFields +{ +TitleField = new SemanticField("hotelName"), +PrioritizedContentFields = {new SemanticField("description"), new SemanticField("description_fr")}, +PrioritizedKeywordsFields = {new SemanticField("tags"), new SemanticField("category")}, +})}, + }, + VectorSearch = new VectorSearch + { + Profiles = { new VectorSearchProfile("myHnswProfile", "myHnsw"), new VectorSearchProfile("myAlgorithm", "myExhaustive") }, + Algorithms = {new HnswAlgorithmConfiguration("myHnsw") +{ +HnswParameters = new HnswParameters +{ +M = 4, +Metric = VectorSearchAlgorithmMetric.Cosine, +}, +}, new ExhaustiveKnnAlgorithmConfiguration("myExhaustive") +{ +ExhaustiveKnnParameters = new ExhaustiveKnnParameters +{ +Metric = VectorSearchAlgorithmMetric.Cosine, +}, +}}, + }, + }; + Response response = client.CreateOrUpdate("hotels", index); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_CreateOrUpdate_SearchServiceCreateOrUpdateIndex_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + SearchIndex index = new SearchIndex("hotels", new SearchField[] + { +new SearchField("hotelId", SearchFieldDataType.String) +{ +Key = true, +Searchable = false, +}, +new SearchField("baseRate", SearchFieldDataType.Double), +new SearchField("description", SearchFieldDataType.String) +{ +Filterable = false, +Sortable = false, +Facetable = false, +}, +new SearchField("descriptionEmbedding", new SearchFieldDataType("Collection(Edm.Single)")) +{ +Retrievable = true, +Searchable = true, +Dimensions = 1536, +VectorSearchProfile = "myHnswProfile", +}, +new SearchField("description_fr", SearchFieldDataType.String) +{ +Filterable = false, +Sortable = false, +Facetable = false, +Analyzer = LexicalAnalyzerName.FrLucene, +}, +new SearchField("hotelName", SearchFieldDataType.String), +new SearchField("category", SearchFieldDataType.String), +new SearchField("tags", new SearchFieldDataType("Collection(Edm.String)")) +{ +Analyzer = new LexicalAnalyzerName("tagsAnalyzer"), +}, +new SearchField("parkingIncluded", SearchFieldDataType.Boolean), +new SearchField("smokingAllowed", SearchFieldDataType.Boolean), +new SearchField("lastRenovationDate", SearchFieldDataType.DateTimeOffset), +new SearchField("rating", SearchFieldDataType.Int32), +new SearchField("location", SearchFieldDataType.GeographyPoint) + }) + { + ScoringProfiles = {new ScoringProfile("geo") +{ +Text = new TextWeights(new Dictionary +{ +["hotelName"] = 5 +}), +Functions = {new DistanceScoringFunction("location", 5, new DistanceScoringParameters("currentLocation", 10)) +{ +Interpolation = ScoringFunctionInterpolation.Logarithmic, +}}, +}}, + DefaultScoringProfile = "geo", + CorsOptions = new CorsOptions(new string[] { "tempuri.org" }) + { + MaxAgeInSeconds = 60L, + }, + Suggesters = { new SearchSuggester("sg", new string[] { "hotelName" }) }, + Analyzers = {new CustomAnalyzer("tagsAnalyzer", LexicalTokenizerName.Standard) +{ +CharFilters = {CharFilterName.HtmlStrip}, +}}, + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), + Similarity = new ClassicSimilarityAlgorithm(), + Semantic = new SemanticSearch + { + Configurations = {new SemanticConfiguration("semanticHotels", new SemanticPrioritizedFields +{ +TitleField = new SemanticField("hotelName"), +PrioritizedContentFields = {new SemanticField("description"), new SemanticField("description_fr")}, +PrioritizedKeywordsFields = {new SemanticField("tags"), new SemanticField("category")}, +})}, + }, + VectorSearch = new VectorSearch + { + Profiles = { new VectorSearchProfile("myHnswProfile", "myHnsw"), new VectorSearchProfile("myAlgorithm", "myExhaustive") }, + Algorithms = {new HnswAlgorithmConfiguration("myHnsw") +{ +HnswParameters = new HnswParameters +{ +M = 4, +Metric = VectorSearchAlgorithmMetric.Cosine, +}, +}, new ExhaustiveKnnAlgorithmConfiguration("myExhaustive") +{ +ExhaustiveKnnParameters = new ExhaustiveKnnParameters +{ +Metric = VectorSearchAlgorithmMetric.Cosine, +}, +}}, + }, + }; + Response response = await client.CreateOrUpdateAsync("hotels", index); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_Delete_SearchServiceDeleteIndex() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + Response response = client.Delete("myindex"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_Delete_SearchServiceDeleteIndex_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + Response response = await client.DeleteAsync("myindex"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_GetIndex_SearchServiceGetIndex() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + Response response = client.GetIndex("hotels", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("type").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_GetIndex_SearchServiceGetIndex_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + Response response = await client.GetIndexAsync("hotels", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("type").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_GetIndex_SearchServiceGetIndex_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + Response response = client.GetIndex("hotels"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_GetIndex_SearchServiceGetIndex_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + Response response = await client.GetIndexAsync("hotels"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_GetStatistics_SearchServiceGetIndexStatistics() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + Response response = client.GetStatistics("hotels", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("documentCount").ToString()); + Console.WriteLine(result.GetProperty("storageSize").ToString()); + Console.WriteLine(result.GetProperty("vectorIndexSize").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_GetStatistics_SearchServiceGetIndexStatistics_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + Response response = await client.GetStatisticsAsync("hotels", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("documentCount").ToString()); + Console.WriteLine(result.GetProperty("storageSize").ToString()); + Console.WriteLine(result.GetProperty("vectorIndexSize").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_GetStatistics_SearchServiceGetIndexStatistics_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + Response response = client.GetStatistics("hotels"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_GetStatistics_SearchServiceGetIndexStatistics_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + Response response = await client.GetStatisticsAsync("hotels"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_Analyze_SearchServiceIndexAnalyze() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + using RequestContent content = RequestContent.Create(new + { + text = "Text to analyze", + analyzer = "standard.lucene", + }); + Response response = client.Analyze("hotels", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("tokens")[0].GetProperty("token").ToString()); + Console.WriteLine(result.GetProperty("tokens")[0].GetProperty("startOffset").ToString()); + Console.WriteLine(result.GetProperty("tokens")[0].GetProperty("endOffset").ToString()); + Console.WriteLine(result.GetProperty("tokens")[0].GetProperty("position").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_Analyze_SearchServiceIndexAnalyze_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + using RequestContent content = RequestContent.Create(new + { + text = "Text to analyze", + analyzer = "standard.lucene", + }); + Response response = await client.AnalyzeAsync("hotels", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("tokens")[0].GetProperty("token").ToString()); + Console.WriteLine(result.GetProperty("tokens")[0].GetProperty("startOffset").ToString()); + Console.WriteLine(result.GetProperty("tokens")[0].GetProperty("endOffset").ToString()); + Console.WriteLine(result.GetProperty("tokens")[0].GetProperty("position").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_Analyze_SearchServiceIndexAnalyze_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + AnalyzeRequest request = new AnalyzeRequest("Text to analyze") + { + Analyzer = LexicalAnalyzerName.StandardLucene, + }; + Response response = client.Analyze("hotels", request); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_Analyze_SearchServiceIndexAnalyze_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + AnalyzeRequest request = new AnalyzeRequest("Text to analyze") + { + Analyzer = LexicalAnalyzerName.StandardLucene, + }; + Response response = await client.AnalyzeAsync("hotels", request); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_GetIndexes_SearchServiceListIndexes() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + foreach (BinaryData item in client.GetIndexes("*", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("type").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_GetIndexes_SearchServiceListIndexes_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + await foreach (BinaryData item in client.GetIndexesAsync("*", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("fields")[0].GetProperty("type").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_GetIndexes_SearchServiceListIndexes_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + foreach (SearchIndex item in client.GetIndexes()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_GetIndexes_SearchServiceListIndexes_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Indexes client = new SearchClient(endpoint, credential).GetIndexesClient(); + + await foreach (SearchIndex item in client.GetIndexesAsync()) + { + } + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_SearchClient.cs b/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_SearchClient.cs new file mode 100644 index 000000000000..f10c9c0a4a5a --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_SearchClient.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Search.Documents.Indexes.Samples +{ + public partial class Samples_SearchClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Search_GetServiceStatistics_SearchServiceGetServiceStatistics() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SearchClient client = new SearchClient(endpoint, credential); + + Response response = client.GetServiceStatistics(null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("counters").GetProperty("documentCount").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("counters").GetProperty("indexesCount").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("counters").GetProperty("indexersCount").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("counters").GetProperty("dataSourcesCount").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("counters").GetProperty("storageSize").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("counters").GetProperty("synonymMaps").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("counters").GetProperty("skillsetCount").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("counters").GetProperty("vectorIndexSize").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("limits").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Search_GetServiceStatistics_SearchServiceGetServiceStatistics_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SearchClient client = new SearchClient(endpoint, credential); + + Response response = await client.GetServiceStatisticsAsync(null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("counters").GetProperty("documentCount").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("counters").GetProperty("indexesCount").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("counters").GetProperty("indexersCount").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("counters").GetProperty("dataSourcesCount").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("counters").GetProperty("storageSize").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("counters").GetProperty("synonymMaps").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("counters").GetProperty("skillsetCount").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("counters").GetProperty("vectorIndexSize").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("limits").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Search_GetServiceStatistics_SearchServiceGetServiceStatistics_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SearchClient client = new SearchClient(endpoint, credential); + + Response response = client.GetServiceStatistics(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Search_GetServiceStatistics_SearchServiceGetServiceStatistics_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SearchClient client = new SearchClient(endpoint, credential); + + Response response = await client.GetServiceStatisticsAsync(); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_Skillsets.cs b/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_Skillsets.cs new file mode 100644 index 000000000000..cab4dc1d6457 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_Skillsets.cs @@ -0,0 +1,1457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading.Tasks; +using System.Xml; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Search.Documents.Indexes.Samples +{ + public partial class Samples_Skillsets + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Skillsets_CreateOrUpdate_SearchServiceCreateOrUpdateSkillset() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "demoskillset", + description = "Extract entities, detect language and extract key-phrases", + skills = new object[] + { +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Text.EntityRecognitionSkill", +["categories"] = new object[] +{ +"organization" +}, +["defaultLanguageCode"] = "en", +["minimumPrecision"] = 0.7, +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/content", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "organizations", +targetName = "organizations", +} +} +}, +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Text.LanguageDetectionSkill", +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/content", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "languageCode", +targetName = "languageCode", +} +} +}, +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Text.SplitSkill", +["textSplitMode"] = "pages", +["maximumPageLength"] = 4000, +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/content", +}, +new +{ +name = "languageCode", +source = "/document/languageCode", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "textItems", +targetName = "pages", +} +} +}, +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Text.KeyPhraseExtractionSkill", +["context"] = "/document/pages/*", +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/pages/*", +}, +new +{ +name = "languageCode", +source = "/document/languageCode", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "keyPhrases", +targetName = "keyPhrases", +} +} +}, +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Custom.WebApiSkill", +["name"] = "MyCustomWebApiSkill", +["uri"] = "https://contoso.example.org", +["httpMethod"] = "POST", +["timeout"] = "PT30S", +["batchSize"] = 1, +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/pages/*", +}, +new +{ +name = "languageCode", +source = "/document/languageCode", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "customresult", +targetName = "result", +} +}, +["httpHeaders"] = new object() +} + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, + }); + Response response = client.CreateOrUpdate("demoskillset", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("@odata.type").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("inputs")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("outputs")[0].GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Skillsets_CreateOrUpdate_SearchServiceCreateOrUpdateSkillset_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "demoskillset", + description = "Extract entities, detect language and extract key-phrases", + skills = new object[] + { +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Text.EntityRecognitionSkill", +["categories"] = new object[] +{ +"organization" +}, +["defaultLanguageCode"] = "en", +["minimumPrecision"] = 0.7, +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/content", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "organizations", +targetName = "organizations", +} +} +}, +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Text.LanguageDetectionSkill", +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/content", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "languageCode", +targetName = "languageCode", +} +} +}, +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Text.SplitSkill", +["textSplitMode"] = "pages", +["maximumPageLength"] = 4000, +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/content", +}, +new +{ +name = "languageCode", +source = "/document/languageCode", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "textItems", +targetName = "pages", +} +} +}, +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Text.KeyPhraseExtractionSkill", +["context"] = "/document/pages/*", +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/pages/*", +}, +new +{ +name = "languageCode", +source = "/document/languageCode", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "keyPhrases", +targetName = "keyPhrases", +} +} +}, +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Custom.WebApiSkill", +["name"] = "MyCustomWebApiSkill", +["uri"] = "https://contoso.example.org", +["httpMethod"] = "POST", +["timeout"] = "PT30S", +["batchSize"] = 1, +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/pages/*", +}, +new +{ +name = "languageCode", +source = "/document/languageCode", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "customresult", +targetName = "result", +} +}, +["httpHeaders"] = new object() +} + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, + }); + Response response = await client.CreateOrUpdateAsync("demoskillset", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("@odata.type").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("inputs")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("outputs")[0].GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Skillsets_CreateOrUpdate_SearchServiceCreateOrUpdateSkillset_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + SearchIndexerSkillset skillset = new SearchIndexerSkillset("demoskillset", new SearchIndexerSkill[] + { +new EntityRecognitionSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/content", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("organizations") +{ +TargetName = "organizations", +} +}) +{ +Categories = {EntityCategory.Organization}, +DefaultLanguageCode = EntityRecognitionSkillLanguage.En, +MinimumPrecision = 0.7, +}, +new LanguageDetectionSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/content", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("languageCode") +{ +TargetName = "languageCode", +} +}), +new SplitSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/content", +}, +new InputFieldMappingEntry("languageCode") +{ +Source = "/document/languageCode", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("textItems") +{ +TargetName = "pages", +} +}) +{ +TextSplitMode = TextSplitMode.Pages, +MaximumPageLength = 4000, +}, +new KeyPhraseExtractionSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/pages/*", +}, +new InputFieldMappingEntry("languageCode") +{ +Source = "/document/languageCode", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("keyPhrases") +{ +TargetName = "keyPhrases", +} +}) +{ +Context = "/document/pages/*", +}, +new WebApiSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/pages/*", +}, +new InputFieldMappingEntry("languageCode") +{ +Source = "/document/languageCode", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("customresult") +{ +TargetName = "result", +} +}, "https://contoso.example.org") +{ +HttpHeaders = {}, +HttpMethod = "POST", +Timeout = XmlConvert.ToTimeSpan("PT30S"), +BatchSize = 1, +Name = "MyCustomWebApiSkill", +} + }) + { + Description = "Extract entities, detect language and extract key-phrases", + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), + }; + Response response = client.CreateOrUpdate("demoskillset", skillset); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Skillsets_CreateOrUpdate_SearchServiceCreateOrUpdateSkillset_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + SearchIndexerSkillset skillset = new SearchIndexerSkillset("demoskillset", new SearchIndexerSkill[] + { +new EntityRecognitionSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/content", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("organizations") +{ +TargetName = "organizations", +} +}) +{ +Categories = {EntityCategory.Organization}, +DefaultLanguageCode = EntityRecognitionSkillLanguage.En, +MinimumPrecision = 0.7, +}, +new LanguageDetectionSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/content", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("languageCode") +{ +TargetName = "languageCode", +} +}), +new SplitSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/content", +}, +new InputFieldMappingEntry("languageCode") +{ +Source = "/document/languageCode", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("textItems") +{ +TargetName = "pages", +} +}) +{ +TextSplitMode = TextSplitMode.Pages, +MaximumPageLength = 4000, +}, +new KeyPhraseExtractionSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/pages/*", +}, +new InputFieldMappingEntry("languageCode") +{ +Source = "/document/languageCode", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("keyPhrases") +{ +TargetName = "keyPhrases", +} +}) +{ +Context = "/document/pages/*", +}, +new WebApiSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/pages/*", +}, +new InputFieldMappingEntry("languageCode") +{ +Source = "/document/languageCode", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("customresult") +{ +TargetName = "result", +} +}, "https://contoso.example.org") +{ +HttpHeaders = {}, +HttpMethod = "POST", +Timeout = XmlConvert.ToTimeSpan("PT30S"), +BatchSize = 1, +Name = "MyCustomWebApiSkill", +} + }) + { + Description = "Extract entities, detect language and extract key-phrases", + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), + }; + Response response = await client.CreateOrUpdateAsync("demoskillset", skillset); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Skillsets_Delete_SearchServiceDeleteSkillset() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + Response response = client.Delete("demoskillset"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Skillsets_Delete_SearchServiceDeleteSkillset_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + Response response = await client.DeleteAsync("demoskillset"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Skillsets_GetSkillset_SearchServiceGetSkillset() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + Response response = client.GetSkillset("demoskillset", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("@odata.type").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("inputs")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("outputs")[0].GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Skillsets_GetSkillset_SearchServiceGetSkillset_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + Response response = await client.GetSkillsetAsync("demoskillset", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("@odata.type").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("inputs")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("outputs")[0].GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Skillsets_GetSkillset_SearchServiceGetSkillset_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + Response response = client.GetSkillset("demoskillset"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Skillsets_GetSkillset_SearchServiceGetSkillset_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + Response response = await client.GetSkillsetAsync("demoskillset"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Skillsets_GetSkillsets_SearchServiceListSkillsets() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + Response response = client.GetSkillsets("*", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("skills")[0].GetProperty("@odata.type").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("skills")[0].GetProperty("inputs")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("skills")[0].GetProperty("outputs")[0].GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Skillsets_GetSkillsets_SearchServiceListSkillsets_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + Response response = await client.GetSkillsetsAsync("*", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("skills")[0].GetProperty("@odata.type").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("skills")[0].GetProperty("inputs")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("skills")[0].GetProperty("outputs")[0].GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Skillsets_GetSkillsets_SearchServiceListSkillsets_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + Response response = client.GetSkillsets(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Skillsets_GetSkillsets_SearchServiceListSkillsets_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + Response response = await client.GetSkillsetsAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Skillsets_Create_SearchServiceCreateSkillset() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "demoskillset", + description = "Extract entities, detect language and extract key-phrases", + skills = new object[] + { +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Text.EntityRecognitionSkill", +["categories"] = new object[] +{ +"organization" +}, +["defaultLanguageCode"] = "en", +["minimumPrecision"] = 0.7, +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/content", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "organizations", +targetName = "organizations", +} +} +}, +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Text.LanguageDetectionSkill", +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/content", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "languageCode", +targetName = "languageCode", +} +} +}, +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Text.SplitSkill", +["textSplitMode"] = "pages", +["maximumPageLength"] = 4000, +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/content", +}, +new +{ +name = "languageCode", +source = "/document/languageCode", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "textItems", +targetName = "pages", +} +} +}, +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Text.KeyPhraseExtractionSkill", +["context"] = "/document/pages/*", +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/pages/*", +}, +new +{ +name = "languageCode", +source = "/document/languageCode", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "keyPhrases", +targetName = "keyPhrases", +} +} +}, +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Custom.WebApiSkill", +["name"] = "MyCustomWebApiSkill", +["uri"] = "https://contoso.example.org", +["httpMethod"] = "POST", +["timeout"] = "PT30S", +["batchSize"] = 1, +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/pages/*", +}, +new +{ +name = "languageCode", +source = "/document/languageCode", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "customresult", +targetName = "result", +} +}, +["httpHeaders"] = new object() +} + }, + knowledgeStore = new + { + storageConnectionString = "DefaultEndpointsProtocol=https;AccountName=myStorage;AccountKey=myStorageKey;EndpointSuffix=core.windows.net", + projections = new object[] + { +new +{ +tables = new object[] +{ +new +{ +tableName = "Reviews", +generatedKeyName = "ReviewId", +source = "/document/Review", +inputs = Array.Empty(), +}, +new +{ +tableName = "Sentences", +generatedKeyName = "SentenceId", +source = "/document/Review/Sentences/*", +inputs = Array.Empty(), +}, +new +{ +tableName = "KeyPhrases", +generatedKeyName = "KeyPhraseId", +source = "/document/Review/Sentences/*/KeyPhrases", +inputs = Array.Empty(), +}, +new +{ +tableName = "Entities", +generatedKeyName = "EntityId", +source = "/document/Review/Sentences/*/Entities/*", +inputs = Array.Empty(), +} +}, +}, +new +{ +objects = new object[] +{ +new +{ +storageContainer = "Reviews", +source = "/document/Review", +generatedKeyName = "/document/Review/Id", +} +}, +} + }, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "", + }, + }, + }); + Response response = client.Create(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("@odata.type").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("inputs")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("outputs")[0].GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Skillsets_Create_SearchServiceCreateSkillset_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "demoskillset", + description = "Extract entities, detect language and extract key-phrases", + skills = new object[] + { +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Text.EntityRecognitionSkill", +["categories"] = new object[] +{ +"organization" +}, +["defaultLanguageCode"] = "en", +["minimumPrecision"] = 0.7, +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/content", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "organizations", +targetName = "organizations", +} +} +}, +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Text.LanguageDetectionSkill", +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/content", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "languageCode", +targetName = "languageCode", +} +} +}, +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Text.SplitSkill", +["textSplitMode"] = "pages", +["maximumPageLength"] = 4000, +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/content", +}, +new +{ +name = "languageCode", +source = "/document/languageCode", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "textItems", +targetName = "pages", +} +} +}, +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Text.KeyPhraseExtractionSkill", +["context"] = "/document/pages/*", +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/pages/*", +}, +new +{ +name = "languageCode", +source = "/document/languageCode", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "keyPhrases", +targetName = "keyPhrases", +} +} +}, +new Dictionary +{ +["@odata.type"] = "#Microsoft.Skills.Custom.WebApiSkill", +["name"] = "MyCustomWebApiSkill", +["uri"] = "https://contoso.example.org", +["httpMethod"] = "POST", +["timeout"] = "PT30S", +["batchSize"] = 1, +["inputs"] = new object[] +{ +new +{ +name = "text", +source = "/document/pages/*", +}, +new +{ +name = "languageCode", +source = "/document/languageCode", +} +}, +["outputs"] = new object[] +{ +new +{ +name = "customresult", +targetName = "result", +} +}, +["httpHeaders"] = new object() +} + }, + knowledgeStore = new + { + storageConnectionString = "DefaultEndpointsProtocol=https;AccountName=myStorage;AccountKey=myStorageKey;EndpointSuffix=core.windows.net", + projections = new object[] + { +new +{ +tables = new object[] +{ +new +{ +tableName = "Reviews", +generatedKeyName = "ReviewId", +source = "/document/Review", +inputs = Array.Empty(), +}, +new +{ +tableName = "Sentences", +generatedKeyName = "SentenceId", +source = "/document/Review/Sentences/*", +inputs = Array.Empty(), +}, +new +{ +tableName = "KeyPhrases", +generatedKeyName = "KeyPhraseId", +source = "/document/Review/Sentences/*/KeyPhrases", +inputs = Array.Empty(), +}, +new +{ +tableName = "Entities", +generatedKeyName = "EntityId", +source = "/document/Review/Sentences/*/Entities/*", +inputs = Array.Empty(), +} +}, +}, +new +{ +objects = new object[] +{ +new +{ +storageContainer = "Reviews", +source = "/document/Review", +generatedKeyName = "/document/Review/Id", +} +}, +} + }, + }, + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "", + }, + }, + }); + Response response = await client.CreateAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("@odata.type").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("inputs")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("skills")[0].GetProperty("outputs")[0].GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Skillsets_Create_SearchServiceCreateSkillset_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + SearchIndexerSkillset skillset = new SearchIndexerSkillset("demoskillset", new SearchIndexerSkill[] + { +new EntityRecognitionSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/content", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("organizations") +{ +TargetName = "organizations", +} +}) +{ +Categories = {EntityCategory.Organization}, +DefaultLanguageCode = EntityRecognitionSkillLanguage.En, +MinimumPrecision = 0.7, +}, +new LanguageDetectionSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/content", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("languageCode") +{ +TargetName = "languageCode", +} +}), +new SplitSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/content", +}, +new InputFieldMappingEntry("languageCode") +{ +Source = "/document/languageCode", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("textItems") +{ +TargetName = "pages", +} +}) +{ +TextSplitMode = TextSplitMode.Pages, +MaximumPageLength = 4000, +}, +new KeyPhraseExtractionSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/pages/*", +}, +new InputFieldMappingEntry("languageCode") +{ +Source = "/document/languageCode", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("keyPhrases") +{ +TargetName = "keyPhrases", +} +}) +{ +Context = "/document/pages/*", +}, +new WebApiSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/pages/*", +}, +new InputFieldMappingEntry("languageCode") +{ +Source = "/document/languageCode", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("customresult") +{ +TargetName = "result", +} +}, "https://contoso.example.org") +{ +HttpHeaders = {}, +HttpMethod = "POST", +Timeout = XmlConvert.ToTimeSpan("PT30S"), +BatchSize = 1, +Name = "MyCustomWebApiSkill", +} + }) + { + Description = "Extract entities, detect language and extract key-phrases", + KnowledgeStore = new SearchIndexerKnowledgeStore("DefaultEndpointsProtocol=https;AccountName=myStorage;AccountKey=myStorageKey;EndpointSuffix=core.windows.net", new SearchIndexerKnowledgeStoreProjection[] + { +new SearchIndexerKnowledgeStoreProjection +{ +Tables = {new SearchIndexerKnowledgeStoreTableProjectionSelector("Reviews") +{ +GeneratedKeyName = "ReviewId", +Source = "/document/Review", +Inputs = {}, +}, new SearchIndexerKnowledgeStoreTableProjectionSelector("Sentences") +{ +GeneratedKeyName = "SentenceId", +Source = "/document/Review/Sentences/*", +Inputs = {}, +}, new SearchIndexerKnowledgeStoreTableProjectionSelector("KeyPhrases") +{ +GeneratedKeyName = "KeyPhraseId", +Source = "/document/Review/Sentences/*/KeyPhrases", +Inputs = {}, +}, new SearchIndexerKnowledgeStoreTableProjectionSelector("Entities") +{ +GeneratedKeyName = "EntityId", +Source = "/document/Review/Sentences/*/Entities/*", +Inputs = {}, +}}, +}, +new SearchIndexerKnowledgeStoreProjection +{ +Objects = {new SearchIndexerKnowledgeStoreObjectProjectionSelector("Reviews") +{ +GeneratedKeyName = "/document/Review/Id", +Source = "/document/Review", +}}, +} + }), + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "", + }, + }, + }; + Response response = client.Create(skillset); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Skillsets_Create_SearchServiceCreateSkillset_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Skillsets client = new SearchClient(endpoint, credential).GetSkillsetsClient(); + + SearchIndexerSkillset skillset = new SearchIndexerSkillset("demoskillset", new SearchIndexerSkill[] + { +new EntityRecognitionSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/content", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("organizations") +{ +TargetName = "organizations", +} +}) +{ +Categories = {EntityCategory.Organization}, +DefaultLanguageCode = EntityRecognitionSkillLanguage.En, +MinimumPrecision = 0.7, +}, +new LanguageDetectionSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/content", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("languageCode") +{ +TargetName = "languageCode", +} +}), +new SplitSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/content", +}, +new InputFieldMappingEntry("languageCode") +{ +Source = "/document/languageCode", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("textItems") +{ +TargetName = "pages", +} +}) +{ +TextSplitMode = TextSplitMode.Pages, +MaximumPageLength = 4000, +}, +new KeyPhraseExtractionSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/pages/*", +}, +new InputFieldMappingEntry("languageCode") +{ +Source = "/document/languageCode", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("keyPhrases") +{ +TargetName = "keyPhrases", +} +}) +{ +Context = "/document/pages/*", +}, +new WebApiSkill(new InputFieldMappingEntry[] +{ +new InputFieldMappingEntry("text") +{ +Source = "/document/pages/*", +}, +new InputFieldMappingEntry("languageCode") +{ +Source = "/document/languageCode", +} +}, new OutputFieldMappingEntry[] +{ +new OutputFieldMappingEntry("customresult") +{ +TargetName = "result", +} +}, "https://contoso.example.org") +{ +HttpHeaders = {}, +HttpMethod = "POST", +Timeout = XmlConvert.ToTimeSpan("PT30S"), +BatchSize = 1, +Name = "MyCustomWebApiSkill", +} + }) + { + Description = "Extract entities, detect language and extract key-phrases", + KnowledgeStore = new SearchIndexerKnowledgeStore("DefaultEndpointsProtocol=https;AccountName=myStorage;AccountKey=myStorageKey;EndpointSuffix=core.windows.net", new SearchIndexerKnowledgeStoreProjection[] + { +new SearchIndexerKnowledgeStoreProjection +{ +Tables = {new SearchIndexerKnowledgeStoreTableProjectionSelector("Reviews") +{ +GeneratedKeyName = "ReviewId", +Source = "/document/Review", +Inputs = {}, +}, new SearchIndexerKnowledgeStoreTableProjectionSelector("Sentences") +{ +GeneratedKeyName = "SentenceId", +Source = "/document/Review/Sentences/*", +Inputs = {}, +}, new SearchIndexerKnowledgeStoreTableProjectionSelector("KeyPhrases") +{ +GeneratedKeyName = "KeyPhraseId", +Source = "/document/Review/Sentences/*/KeyPhrases", +Inputs = {}, +}, new SearchIndexerKnowledgeStoreTableProjectionSelector("Entities") +{ +GeneratedKeyName = "EntityId", +Source = "/document/Review/Sentences/*/Entities/*", +Inputs = {}, +}}, +}, +new SearchIndexerKnowledgeStoreProjection +{ +Objects = {new SearchIndexerKnowledgeStoreObjectProjectionSelector("Reviews") +{ +GeneratedKeyName = "/document/Review/Id", +Source = "/document/Review", +}}, +} + }), + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "", + }, + }, + }; + Response response = await client.CreateAsync(skillset); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_SynonymMaps.cs b/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_SynonymMaps.cs new file mode 100644 index 000000000000..c617f3420bcc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/tests/Generated/Samples/Samples_SynonymMaps.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Search.Documents.Indexes.Samples +{ + public partial class Samples_SynonymMaps + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SynonymMaps_CreateOrUpdate_SearchServiceCreateOrUpdateSynonymMap() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "mysynonymmap", + format = "solr", + synonyms = "United States, United States of America, USA\nWashington, Wash. => WA", + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, + }); + Response response = client.CreateOrUpdate("mysynonymmap", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("format").ToString()); + Console.WriteLine(result.GetProperty("synonyms").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SynonymMaps_CreateOrUpdate_SearchServiceCreateOrUpdateSynonymMap_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "mysynonymmap", + format = "solr", + synonyms = "United States, United States of America, USA\nWashington, Wash. => WA", + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + }, + }); + Response response = await client.CreateOrUpdateAsync("mysynonymmap", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("format").ToString()); + Console.WriteLine(result.GetProperty("synonyms").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SynonymMaps_CreateOrUpdate_SearchServiceCreateOrUpdateSynonymMap_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + SynonymMap synonymMap = new SynonymMap("mysynonymmap", "United States, United States of America, USA\nWashington, Wash. => WA") + { + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), + }; + Response response = client.CreateOrUpdate("mysynonymmap", synonymMap); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SynonymMaps_CreateOrUpdate_SearchServiceCreateOrUpdateSynonymMap_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + SynonymMap synonymMap = new SynonymMap("mysynonymmap", "United States, United States of America, USA\nWashington, Wash. => WA") + { + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net"), + }; + Response response = await client.CreateOrUpdateAsync("mysynonymmap", synonymMap); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SynonymMaps_Delete_SearchServiceDeleteSynonymMap() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + Response response = client.Delete("mysynonymmap"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SynonymMaps_Delete_SearchServiceDeleteSynonymMap_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + Response response = await client.DeleteAsync("mysynonymmap"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SynonymMaps_GetSynonymMap_SearchServiceGetSynonymMap() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + Response response = client.GetSynonymMap("mysynonymmap", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("format").ToString()); + Console.WriteLine(result.GetProperty("synonyms").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SynonymMaps_GetSynonymMap_SearchServiceGetSynonymMap_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + Response response = await client.GetSynonymMapAsync("mysynonymmap", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("format").ToString()); + Console.WriteLine(result.GetProperty("synonyms").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SynonymMaps_GetSynonymMap_SearchServiceGetSynonymMap_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + Response response = client.GetSynonymMap("mysynonymmap"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SynonymMaps_GetSynonymMap_SearchServiceGetSynonymMap_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + Response response = await client.GetSynonymMapAsync("mysynonymmap"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SynonymMaps_GetSynonymMaps_SearchServiceListSynonymMaps() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + Response response = client.GetSynonymMaps(null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("format").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("synonyms").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SynonymMaps_GetSynonymMaps_SearchServiceListSynonymMaps_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + Response response = await client.GetSynonymMapsAsync(null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("format").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("synonyms").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SynonymMaps_GetSynonymMaps_SearchServiceListSynonymMaps_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + Response response = client.GetSynonymMaps(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SynonymMaps_GetSynonymMaps_SearchServiceListSynonymMaps_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + Response response = await client.GetSynonymMapsAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SynonymMaps_Create_SearchServiceCreateSynonymMap() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "mysynonymmap", + format = "solr", + synonyms = "United States, United States of America, USA\nWashington, Wash. => WA", + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "myApplicationSecret", + }, + }, + }); + Response response = client.Create(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("format").ToString()); + Console.WriteLine(result.GetProperty("synonyms").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SynonymMaps_Create_SearchServiceCreateSynonymMap_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "mysynonymmap", + format = "solr", + synonyms = "United States, United States of America, USA\nWashington, Wash. => WA", + encryptionKey = new + { + keyVaultKeyName = "myUserManagedEncryptionKey-createdinAzureKeyVault", + keyVaultKeyVersion = "myKeyVersion-32charAlphaNumericString", + keyVaultUri = "https://myKeyVault.vault.azure.net", + accessCredentials = new + { + applicationId = "00000000-0000-0000-0000-000000000000", + applicationSecret = "myApplicationSecret", + }, + }, + }); + Response response = await client.CreateAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("format").ToString()); + Console.WriteLine(result.GetProperty("synonyms").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SynonymMaps_Create_SearchServiceCreateSynonymMap_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + SynonymMap synonymMap = new SynonymMap("mysynonymmap", "United States, United States of America, USA\nWashington, Wash. => WA") + { + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "myApplicationSecret", + }, + }, + }; + Response response = client.Create(synonymMap); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SynonymMaps_Create_SearchServiceCreateSynonymMap_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + SynonymMaps client = new SearchClient(endpoint, credential).GetSynonymMapsClient(); + + SynonymMap synonymMap = new SynonymMap("mysynonymmap", "United States, United States of America, USA\nWashington, Wash. => WA") + { + EncryptionKey = new SearchResourceEncryptionKey("myUserManagedEncryptionKey-createdinAzureKeyVault", "myKeyVersion-32charAlphaNumericString", "https://myKeyVault.vault.azure.net") + { + AccessCredentials = new AzureActiveDirectoryApplicationCredentials("00000000-0000-0000-0000-000000000000") + { + ApplicationSecret = "myApplicationSecret", + }, + }, + }; + Response response = await client.CreateAsync(synonymMap); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Indexes/tsp-location.yaml b/sdk/search/Azure.Search.Documents.Indexes/tsp-location.yaml new file mode 100644 index 000000000000..51ad26bb205c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Indexes/tsp-location.yaml @@ -0,0 +1,5 @@ +directory: specification/search/Azure.Search.Service +commit: 3b2e690eef322f0774065210f9d9a2939e0c1674 +repo: Azure/azure-rest-api-specs +additionalDirectories: +- specification/search/Azure.Search diff --git a/sdk/search/Azure.Search.Documents.Search/Azure.Search.Documents.Search.sln b/sdk/search/Azure.Search.Documents.Search/Azure.Search.Documents.Search.sln new file mode 100644 index 000000000000..6e13bd17af58 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/Azure.Search.Documents.Search.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Search.Documents.Search", "src\Azure.Search.Documents.Search.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Search.Documents.Search.Tests", "tests\Azure.Search.Documents.Search.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/search/Azure.Search.Documents.Search/CHANGELOG.md b/sdk/search/Azure.Search.Documents.Search/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes \ No newline at end of file diff --git a/sdk/search/Azure.Search.Documents.Search/Directory.Build.props b/sdk/search/Azure.Search.Documents.Search/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/search/Azure.Search.Documents.Search/README.md b/sdk/search/Azure.Search.Documents.Search/README.md new file mode 100644 index 000000000000..07ff0c867f8f --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/README.md @@ -0,0 +1,107 @@ +# Azure.Search.Documents.Search client library for .NET + +Azure.Search.Documents.Search is a managed service that helps developers get secret simply and securely. + +Use the client library for to: + +* [Get secret](https://docs.microsoft.com/azure) + +[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples] + + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents.Search/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + +## Getting started + +This section should include everything a developer needs to do to install and create their first client connection *very quickly*. + +### Install the package + +First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository. + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.Search.Documents.Search --prerelease +``` + +### Prerequisites + +Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: + +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. + +### Authenticate the client + +If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. + +For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. + +### Service API versions + +The client library targets the latest service API version by default. A client instance accepts an optional service API version parameter from its options to specify which API version service to communicate. + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when instantiating a client by configuring its associated options. This ensures that the client can communicate with services using the specified API version. + +For example, + +```C# Snippet:CreateClientForSpecificApiVersion +Uri endpoint = new Uri(""); +DefaultAzureCredential credential = new DefaultAzureCredential(); +ClientOptions options = new ClientOptions(ClientOptions.ServiceVersion.) +var client = new Client(endpoint, credential, options); +``` + +When selecting an API version, it's important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility. + +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. + +## Key concepts + +The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. + +Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of: + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts + +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) + + +## Examples + +You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Azure.Search.Documents.Search/samples). + +## Troubleshooting + +Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. + +Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. + +If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. + +## Next steps + +* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. +* If appropriate, point users to other packages that might be useful. +* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. + +## Contributing + +This is a template, but your SDK readme should include details on how to contribute code to the repo/package. + + +[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/search/Azure.Search.Documents.Search/README.png) \ No newline at end of file diff --git a/sdk/search/Azure.Search.Documents.Search/src/Azure.Search.Documents.Search.csproj b/sdk/search/Azure.Search.Documents.Search/src/Azure.Search.Documents.Search.csproj new file mode 100644 index 000000000000..588bdc2c81a9 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Azure.Search.Documents.Search.csproj @@ -0,0 +1,20 @@ + + + This is the Azure.Search.Documents.Search client library for developing .NET applications with rich experience. + Azure SDK Code Generation Azure.Search.Documents.Search for Azure Data Plane + 1.0.0-beta.1 + Azure.Search.Documents.Search + $(RequiredTargetFrameworks) + true + + + + + + + + + + + + diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteItem.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteItem.Serialization.cs new file mode 100644 index 000000000000..eb9a70fe0246 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteItem.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class AutocompleteItem : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutocompleteItem)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + writer.WritePropertyName("queryPlusText"u8); + writer.WriteStringValue(QueryPlusText); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AutocompleteItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutocompleteItem)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutocompleteItem(document.RootElement, options); + } + + internal static AutocompleteItem DeserializeAutocompleteItem(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string text = default; + string queryPlusText = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("queryPlusText"u8)) + { + queryPlusText = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutocompleteItem(text, queryPlusText, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutocompleteItem)} does not support writing '{options.Format}' format."); + } + } + + AutocompleteItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAutocompleteItem(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutocompleteItem)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AutocompleteItem FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAutocompleteItem(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteItem.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteItem.cs new file mode 100644 index 000000000000..f64e9ed16f50 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteItem.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + /// The result of Autocomplete requests. + public partial class AutocompleteItem + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The completed term. + /// The query along with the completed term. + /// or is null. + internal AutocompleteItem(string text, string queryPlusText) + { + Argument.AssertNotNull(text, nameof(text)); + Argument.AssertNotNull(queryPlusText, nameof(queryPlusText)); + + Text = text; + QueryPlusText = queryPlusText; + } + + /// Initializes a new instance of . + /// The completed term. + /// The query along with the completed term. + /// Keeps track of any properties unknown to the library. + internal AutocompleteItem(string text, string queryPlusText, IDictionary serializedAdditionalRawData) + { + Text = text; + QueryPlusText = queryPlusText; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutocompleteItem() + { + } + + /// The completed term. + public string Text { get; } + /// The query along with the completed term. + public string QueryPlusText { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteMode.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteMode.cs new file mode 100644 index 000000000000..bbb72afb49d2 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteMode.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Search +{ + /// + /// Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' + /// to get shingles and 'oneTermWithContext' to use the current context in + /// producing autocomplete terms. + /// + public readonly partial struct AutocompleteMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutocompleteMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OneTermValue = "oneTerm"; + private const string TwoTermsValue = "twoTerms"; + private const string OneTermWithContextValue = "oneTermWithContext"; + + /// + /// Only one term is suggested. If the query has two terms, only the last term is + /// completed. For example, if the input is 'washington medic', the suggested terms + /// could include 'medicaid', 'medicare', and 'medicine'. + /// + public static AutocompleteMode OneTerm { get; } = new AutocompleteMode(OneTermValue); + /// + /// Matching two-term phrases in the index will be suggested. For example, if the + /// input is 'medic', the suggested terms could include 'medicare coverage' and 'medical assistant'. + /// + public static AutocompleteMode TwoTerms { get; } = new AutocompleteMode(TwoTermsValue); + /// + /// Completes the last term in a query with two or more terms, where the last two + /// terms are a phrase that exists in the index. For example, if the input is 'washington medic', the suggested terms could include 'washington medicaid' and 'washington medical'. + /// + public static AutocompleteMode OneTermWithContext { get; } = new AutocompleteMode(OneTermWithContextValue); + /// Determines if two values are the same. + public static bool operator ==(AutocompleteMode left, AutocompleteMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutocompleteMode left, AutocompleteMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutocompleteMode(string value) => new AutocompleteMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutocompleteMode other && Equals(other); + /// + public bool Equals(AutocompleteMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteRequest.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteRequest.Serialization.cs new file mode 100644 index 000000000000..68a779b24f60 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteRequest.Serialization.cs @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class AutocompleteRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutocompleteRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("search"u8); + writer.WriteStringValue(Search); + if (Optional.IsDefined(AutocompleteMode)) + { + writer.WritePropertyName("autocompleteMode"u8); + writer.WriteStringValue(AutocompleteMode.Value.ToString()); + } + if (Optional.IsDefined(Filter)) + { + writer.WritePropertyName("filter"u8); + writer.WriteStringValue(Filter); + } + if (Optional.IsDefined(Fuzzy)) + { + writer.WritePropertyName("fuzzy"u8); + writer.WriteBooleanValue(Fuzzy.Value); + } + if (Optional.IsDefined(HighlightPostTag)) + { + writer.WritePropertyName("highlightPostTag"u8); + writer.WriteStringValue(HighlightPostTag); + } + if (Optional.IsDefined(HighlightPreTag)) + { + writer.WritePropertyName("highlightPreTag"u8); + writer.WriteStringValue(HighlightPreTag); + } + if (Optional.IsDefined(MinimumCoverage)) + { + writer.WritePropertyName("minimumCoverage"u8); + writer.WriteNumberValue(MinimumCoverage.Value); + } + if (Optional.IsDefined(SearchFields)) + { + writer.WritePropertyName("searchFields"u8); + writer.WriteStringValue(SearchFields); + } + writer.WritePropertyName("suggesterName"u8); + writer.WriteStringValue(SuggesterName); + if (Optional.IsDefined(Top)) + { + writer.WritePropertyName("top"u8); + writer.WriteNumberValue(Top.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AutocompleteRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutocompleteRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutocompleteRequest(document.RootElement, options); + } + + internal static AutocompleteRequest DeserializeAutocompleteRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string search = default; + AutocompleteMode? autocompleteMode = default; + string filter = default; + bool? fuzzy = default; + string highlightPostTag = default; + string highlightPreTag = default; + double? minimumCoverage = default; + string searchFields = default; + string suggesterName = default; + int? top = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("search"u8)) + { + search = property.Value.GetString(); + continue; + } + if (property.NameEquals("autocompleteMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autocompleteMode = new AutocompleteMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("filter"u8)) + { + filter = property.Value.GetString(); + continue; + } + if (property.NameEquals("fuzzy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fuzzy = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("highlightPostTag"u8)) + { + highlightPostTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("highlightPreTag"u8)) + { + highlightPreTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("minimumCoverage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minimumCoverage = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("searchFields"u8)) + { + searchFields = property.Value.GetString(); + continue; + } + if (property.NameEquals("suggesterName"u8)) + { + suggesterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("top"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + top = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutocompleteRequest( + search, + autocompleteMode, + filter, + fuzzy, + highlightPostTag, + highlightPreTag, + minimumCoverage, + searchFields, + suggesterName, + top, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutocompleteRequest)} does not support writing '{options.Format}' format."); + } + } + + AutocompleteRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAutocompleteRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutocompleteRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AutocompleteRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAutocompleteRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteRequest.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteRequest.cs new file mode 100644 index 000000000000..d62546704c4e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteRequest.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + /// Parameters for fuzzy matching, and other autocomplete query behaviors. + public partial class AutocompleteRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The search text on which to base autocomplete results. + /// + /// The name of the suggester as specified in the suggesters collection that's part + /// of the index definition. + /// + /// or is null. + public AutocompleteRequest(string search, string suggesterName) + { + Argument.AssertNotNull(search, nameof(search)); + Argument.AssertNotNull(suggesterName, nameof(suggesterName)); + + Search = search; + SuggesterName = suggesterName; + } + + /// Initializes a new instance of . + /// The search text on which to base autocomplete results. + /// + /// Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' + /// to get shingles and 'oneTermWithContext' to use the current context while + /// producing auto-completed terms. + /// + /// + /// An OData expression that filters the documents used to produce completed terms + /// for the Autocomplete result. + /// + /// + /// A value indicating whether to use fuzzy matching for the autocomplete query. + /// Default is false. When set to true, the query will autocomplete terms even if + /// there's a substituted or missing character in the search text. While this + /// provides a better experience in some scenarios, it comes at a performance cost + /// as fuzzy autocomplete queries are slower and consume more resources. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. If omitted, hit highlighting is disabled. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. If omitted, hit highlighting is disabled. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by an autocomplete query in order for the query to be reported as a + /// success. This parameter can be useful for ensuring search availability even for + /// services with only one replica. The default is 80. + /// + /// + /// The comma-separated list of field names to consider when querying for + /// auto-completed terms. Target fields must be included in the specified + /// suggester. + /// + /// + /// The name of the suggester as specified in the suggesters collection that's part + /// of the index definition. + /// + /// + /// The number of auto-completed terms to retrieve. This must be a value between 1 + /// and 100. The default is 5. + /// + /// Keeps track of any properties unknown to the library. + internal AutocompleteRequest(string search, AutocompleteMode? autocompleteMode, string filter, bool? fuzzy, string highlightPostTag, string highlightPreTag, double? minimumCoverage, string searchFields, string suggesterName, int? top, IDictionary serializedAdditionalRawData) + { + Search = search; + AutocompleteMode = autocompleteMode; + Filter = filter; + Fuzzy = fuzzy; + HighlightPostTag = highlightPostTag; + HighlightPreTag = highlightPreTag; + MinimumCoverage = minimumCoverage; + SearchFields = searchFields; + SuggesterName = suggesterName; + Top = top; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutocompleteRequest() + { + } + + /// The search text on which to base autocomplete results. + public string Search { get; } + /// + /// Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' + /// to get shingles and 'oneTermWithContext' to use the current context while + /// producing auto-completed terms. + /// + public AutocompleteMode? AutocompleteMode { get; set; } + /// + /// An OData expression that filters the documents used to produce completed terms + /// for the Autocomplete result. + /// + public string Filter { get; set; } + /// + /// A value indicating whether to use fuzzy matching for the autocomplete query. + /// Default is false. When set to true, the query will autocomplete terms even if + /// there's a substituted or missing character in the search text. While this + /// provides a better experience in some scenarios, it comes at a performance cost + /// as fuzzy autocomplete queries are slower and consume more resources. + /// + public bool? Fuzzy { get; set; } + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. If omitted, hit highlighting is disabled. + /// + public string HighlightPostTag { get; set; } + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. If omitted, hit highlighting is disabled. + /// + public string HighlightPreTag { get; set; } + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by an autocomplete query in order for the query to be reported as a + /// success. This parameter can be useful for ensuring search availability even for + /// services with only one replica. The default is 80. + /// + public double? MinimumCoverage { get; set; } + /// + /// The comma-separated list of field names to consider when querying for + /// auto-completed terms. Target fields must be included in the specified + /// suggester. + /// + public string SearchFields { get; set; } + /// + /// The name of the suggester as specified in the suggesters collection that's part + /// of the index definition. + /// + public string SuggesterName { get; } + /// + /// The number of auto-completed terms to retrieve. This must be a value between 1 + /// and 100. The default is 5. + /// + public int? Top { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteResult.Serialization.cs new file mode 100644 index 000000000000..fae837862f53 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteResult.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class AutocompleteResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutocompleteResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Coverage)) + { + writer.WritePropertyName("@search.coverage"u8); + writer.WriteNumberValue(Coverage.Value); + } + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AutocompleteResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutocompleteResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutocompleteResult(document.RootElement, options); + } + + internal static AutocompleteResult DeserializeAutocompleteResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double? searchCoverage = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@search.coverage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + searchCoverage = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AutocompleteItem.DeserializeAutocompleteItem(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutocompleteResult(searchCoverage, value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutocompleteResult)} does not support writing '{options.Format}' format."); + } + } + + AutocompleteResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAutocompleteResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutocompleteResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AutocompleteResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAutocompleteResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteResult.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteResult.cs new file mode 100644 index 000000000000..e9e932884cbd --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/AutocompleteResult.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Search +{ + /// The result of Autocomplete query. + public partial class AutocompleteResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of returned Autocompleted items. + /// is null. + internal AutocompleteResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// + /// A value indicating the percentage of the index that was considered by the + /// autocomplete request, or null if minimumCoverage was not specified in the + /// request. + /// + /// The list of returned Autocompleted items. + /// Keeps track of any properties unknown to the library. + internal AutocompleteResult(double? coverage, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + Coverage = coverage; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutocompleteResult() + { + } + + /// + /// A value indicating the percentage of the index that was considered by the + /// autocomplete request, or null if minimumCoverage was not specified in the + /// request. + /// + public double? Coverage { get; } + /// The list of returned Autocompleted items. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/Docs/Documents.xml b/sdk/search/Azure.Search.Documents.Search/src/Generated/Docs/Documents.xml new file mode 100644 index 000000000000..cd55832893fe --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/Docs/Documents.xml @@ -0,0 +1,921 @@ + + + + + +This sample shows how to call CountAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = await client.CountAsync("myindex"); +]]> + + + +This sample shows how to call Count. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = client.Count("myindex"); +]]> + + + +This sample shows how to call CountAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = await client.CountAsync("myindex", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call Count and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = client.Count("myindex", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call SearchGetAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = await client.SearchGetAsync("myindex"); +]]> +This sample shows how to call SearchGetAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = await client.SearchGetAsync("myindex"); +]]> + + + +This sample shows how to call SearchGet. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = client.SearchGet("myindex"); +]]> +This sample shows how to call SearchGet. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = client.SearchGet("myindex"); +]]> + + + +This sample shows how to call SearchGetAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = await client.SearchGetAsync("myindex", "nice hotels", true, new string[] { "category,count:10,sort:count" }, "rating gt 10", new string[] { "title" }, "", "", 80, new string[] { "search.score() desc", "rating desc" }, "simple", null, "sp", new string[] { "title", "description" }, "any", "global", "mysessionid", new string[] { "docId", "title", "description" }, 100, 10, null, null, null, null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.score").ToString()); +]]> +This sample shows how to call SearchGetAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = await client.SearchGetAsync("myindex", "how do clouds form", true, null, null, null, "", "", null, null, "semantic", null, null, null, null, null, null, null, null, null, "my-semantic-config", "partial", 780, "extractive|count-3", "extractive|highlight-true", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.score").ToString()); +]]> + + + +This sample shows how to call SearchGet and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = client.SearchGet("myindex", "nice hotels", true, new string[] { "category,count:10,sort:count" }, "rating gt 10", new string[] { "title" }, "", "", 80, new string[] { "search.score() desc", "rating desc" }, "simple", null, "sp", new string[] { "title", "description" }, "any", "global", "mysessionid", new string[] { "docId", "title", "description" }, 100, 10, null, null, null, null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.score").ToString()); +]]> +This sample shows how to call SearchGet and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = client.SearchGet("myindex", "how do clouds form", true, null, null, null, "", "", null, null, "semantic", null, null, null, null, null, null, null, null, null, "my-semantic-config", "partial", 780, "extractive|count-3", "extractive|highlight-true", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.score").ToString()); +]]> + + + +This sample shows how to call SearchPostAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +SearchRequest searchRequest = new SearchRequest +{ + Count = true, + Facets = { "category,count:10,sort:count" }, + Filter = "rating gt 4.0", + Highlight = "description", + HighlightPostTag = "", + HighlightPreTag = "", + Orderby = "rating desc", + QueryType = QueryType.Simple, + ScoringStatistics = ScoringStatistics.Global, + SessionId = "mysessionid", + ScoringParameters = { "currentLocation--122.123,44.77233" }, + ScoringProfile = "sp", + Search = "nice hotels", + SearchFields = "category,description", + SearchMode = SearchMode.Any, + Select = "hotelId,category,description", + Skip = 0, + Top = 10, + VectorQueries = {new VectorizedQuery(new float[]{0.103F, 0.0712F, 0.0852F, 0.1547F, 0.1183F}) + { + K = 5, + Fields = "descriptionEmbedding", + Exhaustive = true, + Oversampling = 20, + Weight = 2F, + }}, + VectorFilterMode = VectorFilterMode.PreFilter, +}; +Response response = await client.SearchPostAsync("myindex", searchRequest); +]]> +This sample shows how to call SearchPostAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +SearchRequest searchRequest = new SearchRequest +{ + Count = true, + HighlightPostTag = "", + HighlightPreTag = "", + QueryType = QueryType.Semantic, + Search = "how do clouds form", + SemanticConfiguration = "my-semantic-config", + SemanticErrorHandling = SemanticErrorMode.Partial, + SemanticMaxWaitInMilliseconds = 780, + Answers = new QueryAnswerType("extractive|count-3"), + Captions = new QueryCaptionType("extractive|highlight-true"), +}; +Response response = await client.SearchPostAsync("myindex", searchRequest); +]]> + + + +This sample shows how to call SearchPost. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +SearchRequest searchRequest = new SearchRequest +{ + Count = true, + Facets = { "category,count:10,sort:count" }, + Filter = "rating gt 4.0", + Highlight = "description", + HighlightPostTag = "", + HighlightPreTag = "", + Orderby = "rating desc", + QueryType = QueryType.Simple, + ScoringStatistics = ScoringStatistics.Global, + SessionId = "mysessionid", + ScoringParameters = { "currentLocation--122.123,44.77233" }, + ScoringProfile = "sp", + Search = "nice hotels", + SearchFields = "category,description", + SearchMode = SearchMode.Any, + Select = "hotelId,category,description", + Skip = 0, + Top = 10, + VectorQueries = {new VectorizedQuery(new float[]{0.103F, 0.0712F, 0.0852F, 0.1547F, 0.1183F}) + { + K = 5, + Fields = "descriptionEmbedding", + Exhaustive = true, + Oversampling = 20, + Weight = 2F, + }}, + VectorFilterMode = VectorFilterMode.PreFilter, +}; +Response response = client.SearchPost("myindex", searchRequest); +]]> +This sample shows how to call SearchPost. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +SearchRequest searchRequest = new SearchRequest +{ + Count = true, + HighlightPostTag = "", + HighlightPreTag = "", + QueryType = QueryType.Semantic, + Search = "how do clouds form", + SemanticConfiguration = "my-semantic-config", + SemanticErrorHandling = SemanticErrorMode.Partial, + SemanticMaxWaitInMilliseconds = 780, + Answers = new QueryAnswerType("extractive|count-3"), + Captions = new QueryCaptionType("extractive|highlight-true"), +}; +Response response = client.SearchPost("myindex", searchRequest); +]]> + + + +This sample shows how to call SearchPostAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +using RequestContent content = RequestContent.Create(new +{ + count = true, + facets = new object[] + { + "category,count:10,sort:count" + }, + filter = "rating gt 4.0", + highlight = "description", + highlightPostTag = "", + highlightPreTag = "", + orderby = "rating desc", + queryType = "simple", + scoringParameters = new object[] + { + "currentLocation--122.123,44.77233" + }, + scoringProfile = "sp", + search = "nice hotels", + searchFields = "category,description", + searchMode = "any", + sessionId = "mysessionid", + scoringStatistics = "global", + select = "hotelId,category,description", + skip = 0, + top = 10, + vectorQueries = new object[] + { + new + { + kind = "vector", + vector = new object[] + { + 0.103F, + 0.0712F, + 0.0852F, + 0.1547F, + 0.1183F + }, + fields = "descriptionEmbedding", + k = 5, + exhaustive = true, + oversampling = 20, + weight = 2F, + } + }, + vectorFilterMode = "preFilter", +}); +Response response = await client.SearchPostAsync("myindex", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.score").ToString()); +]]> +This sample shows how to call SearchPostAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +using RequestContent content = RequestContent.Create(new +{ + count = true, + highlightPostTag = "", + highlightPreTag = "", + queryType = "semantic", + search = "how do clouds form", + semanticConfiguration = "my-semantic-config", + answers = "extractive|count-3", + captions = "extractive|highlight-true", + semanticErrorHandling = "partial", + semanticMaxWaitInMilliseconds = 780, +}); +Response response = await client.SearchPostAsync("myindex", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.score").ToString()); +]]> + + + +This sample shows how to call SearchPost and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +using RequestContent content = RequestContent.Create(new +{ + count = true, + facets = new object[] + { + "category,count:10,sort:count" + }, + filter = "rating gt 4.0", + highlight = "description", + highlightPostTag = "", + highlightPreTag = "", + orderby = "rating desc", + queryType = "simple", + scoringParameters = new object[] + { + "currentLocation--122.123,44.77233" + }, + scoringProfile = "sp", + search = "nice hotels", + searchFields = "category,description", + searchMode = "any", + sessionId = "mysessionid", + scoringStatistics = "global", + select = "hotelId,category,description", + skip = 0, + top = 10, + vectorQueries = new object[] + { + new + { + kind = "vector", + vector = new object[] + { + 0.103F, + 0.0712F, + 0.0852F, + 0.1547F, + 0.1183F + }, + fields = "descriptionEmbedding", + k = 5, + exhaustive = true, + oversampling = 20, + weight = 2F, + } + }, + vectorFilterMode = "preFilter", +}); +Response response = client.SearchPost("myindex", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.score").ToString()); +]]> +This sample shows how to call SearchPost and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +using RequestContent content = RequestContent.Create(new +{ + count = true, + highlightPostTag = "", + highlightPreTag = "", + queryType = "semantic", + search = "how do clouds form", + semanticConfiguration = "my-semantic-config", + answers = "extractive|count-3", + captions = "extractive|highlight-true", + semanticErrorHandling = "partial", + semanticMaxWaitInMilliseconds = 780, +}); +Response response = client.SearchPost("myindex", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.score").ToString()); +]]> + + + +This sample shows how to call GetDocumentAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = await client.GetDocumentAsync("getdocumentexample", "1"); +]]> + + + +This sample shows how to call GetDocument. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = client.GetDocument("getdocumentexample", "1"); +]]> + + + +This sample shows how to call GetDocumentAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = await client.GetDocumentAsync("getdocumentexample", "1", new string[] { "docId", "title", "description" }, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call GetDocument and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = client.GetDocument("getdocumentexample", "1", new string[] { "docId", "title", "description" }, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call SuggestGetAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = await client.SuggestGetAsync("myindex", "hote", "sg"); +]]> + + + +This sample shows how to call SuggestGet. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = client.SuggestGet("myindex", "hote", "sg"); +]]> + + + +This sample shows how to call SuggestGetAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = await client.SuggestGetAsync("myindex", "hote", "sg", "rating gt 10", false, "", "", 80, new string[] { "search.score() desc", "rating desc" }, new string[] { "title" }, new string[] { "docId", "title", "description" }, 10, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.text").ToString()); +]]> + + + +This sample shows how to call SuggestGet and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = client.SuggestGet("myindex", "hote", "sg", "rating gt 10", false, "", "", 80, new string[] { "search.score() desc", "rating desc" }, new string[] { "title" }, new string[] { "docId", "title", "description" }, 10, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.text").ToString()); +]]> + + + +This sample shows how to call SuggestPostAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +SuggestRequest suggestRequest = new SuggestRequest("hote", "sg") +{ + Filter = "rating gt 4.0", + HighlightPostTag = "", + HighlightPreTag = "", + MinimumCoverage = 80, + Orderby = "rating desc", + SearchFields = "title", + Select = "docId,title,description", + Top = 10, +}; +Response response = await client.SuggestPostAsync("myindex", suggestRequest); +]]> + + + +This sample shows how to call SuggestPost. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +SuggestRequest suggestRequest = new SuggestRequest("hote", "sg") +{ + Filter = "rating gt 4.0", + HighlightPostTag = "", + HighlightPreTag = "", + MinimumCoverage = 80, + Orderby = "rating desc", + SearchFields = "title", + Select = "docId,title,description", + Top = 10, +}; +Response response = client.SuggestPost("myindex", suggestRequest); +]]> + + + +This sample shows how to call SuggestPostAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +using RequestContent content = RequestContent.Create(new +{ + filter = "rating gt 4.0", + highlightPostTag = "", + highlightPreTag = "", + minimumCoverage = 80, + orderby = "rating desc", + search = "hote", + searchFields = "title", + select = "docId,title,description", + suggesterName = "sg", + top = 10, +}); +Response response = await client.SuggestPostAsync("myindex", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.text").ToString()); +]]> + + + +This sample shows how to call SuggestPost and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +using RequestContent content = RequestContent.Create(new +{ + filter = "rating gt 4.0", + highlightPostTag = "", + highlightPreTag = "", + minimumCoverage = 80, + orderby = "rating desc", + search = "hote", + searchFields = "title", + select = "docId,title,description", + suggesterName = "sg", + top = 10, +}); +Response response = client.SuggestPost("myindex", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.text").ToString()); +]]> + + + +This sample shows how to call IndexAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +IndexBatch batch = new IndexBatch(new IndexAction[] +{ + new IndexAction + { + ActionType = IndexActionType.Upload, + }, + new IndexAction + { + ActionType = IndexActionType.Merge, + }, + new IndexAction + { + ActionType = IndexActionType.MergeOrUpload, + }, + new IndexAction + { + ActionType = IndexActionType.Delete, + } +}); +Response response = await client.IndexAsync("indexdocumentsexample", batch); +]]> + + + +This sample shows how to call Index. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +IndexBatch batch = new IndexBatch(new IndexAction[] +{ + new IndexAction + { + ActionType = IndexActionType.Upload, + }, + new IndexAction + { + ActionType = IndexActionType.Merge, + }, + new IndexAction + { + ActionType = IndexActionType.MergeOrUpload, + }, + new IndexAction + { + ActionType = IndexActionType.Delete, + } +}); +Response response = client.Index("indexdocumentsexample", batch); +]]> + + + +This sample shows how to call IndexAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +using RequestContent content = RequestContent.Create(new +{ + value = new object[] + { + new Dictionary + { + ["@search.action"] = "upload" + }, + new Dictionary + { + ["@search.action"] = "merge" + }, + new Dictionary + { + ["@search.action"] = "mergeOrUpload" + }, + new Dictionary + { + ["@search.action"] = "delete" + } + }, +}); +Response response = await client.IndexAsync("indexdocumentsexample", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("key").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("statusCode").ToString()); +]]> + + + +This sample shows how to call Index and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +using RequestContent content = RequestContent.Create(new +{ + value = new object[] + { + new Dictionary + { + ["@search.action"] = "upload" + }, + new Dictionary + { + ["@search.action"] = "merge" + }, + new Dictionary + { + ["@search.action"] = "mergeOrUpload" + }, + new Dictionary + { + ["@search.action"] = "delete" + } + }, +}); +Response response = client.Index("indexdocumentsexample", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("key").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("statusCode").ToString()); +]]> + + + +This sample shows how to call AutocompleteGetAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = await client.AutocompleteGetAsync("myindex", "washington medic", "sg"); +]]> + + + +This sample shows how to call AutocompleteGet. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = client.AutocompleteGet("myindex", "washington medic", "sg"); +]]> + + + +This sample shows how to call AutocompleteGetAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = await client.AutocompleteGetAsync("myindex", "washington medic", "sg", "oneTerm", null, false, "", "", 80, new string[] { "title", "description" }, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("queryPlusText").ToString()); +]]> + + + +This sample shows how to call AutocompleteGet and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +Response response = client.AutocompleteGet("myindex", "washington medic", "sg", "oneTerm", null, false, "", "", 80, new string[] { "title", "description" }, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("queryPlusText").ToString()); +]]> + + + +This sample shows how to call AutocompletePostAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +AutocompleteRequest autocompleteRequest = new AutocompleteRequest("washington medic", "sg") +{ + AutocompleteMode = AutocompleteMode.OneTerm, + Filter = "search.in(docId,'101,102,105')", + HighlightPostTag = "", + HighlightPreTag = "", + MinimumCoverage = 80, + SearchFields = "title,description", + Top = 10, +}; +Response response = await client.AutocompletePostAsync("myindex", autocompleteRequest); +]]> + + + +This sample shows how to call AutocompletePost. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +AutocompleteRequest autocompleteRequest = new AutocompleteRequest("washington medic", "sg") +{ + AutocompleteMode = AutocompleteMode.OneTerm, + Filter = "search.in(docId,'101,102,105')", + HighlightPostTag = "", + HighlightPreTag = "", + MinimumCoverage = 80, + SearchFields = "title,description", + Top = 10, +}; +Response response = client.AutocompletePost("myindex", autocompleteRequest); +]]> + + + +This sample shows how to call AutocompletePostAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +using RequestContent content = RequestContent.Create(new +{ + autocompleteMode = "oneTerm", + search = "washington medic", + suggesterName = "sg", + filter = "search.in(docId,'101,102,105')", + highlightPostTag = "", + highlightPreTag = "", + minimumCoverage = 80, + searchFields = "title,description", + top = 10, +}); +Response response = await client.AutocompletePostAsync("myindex", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("queryPlusText").ToString()); +]]> + + + +This sample shows how to call AutocompletePost and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + +using RequestContent content = RequestContent.Create(new +{ + autocompleteMode = "oneTerm", + search = "washington medic", + suggesterName = "sg", + filter = "search.in(docId,'101,102,105')", + highlightPostTag = "", + highlightPreTag = "", + minimumCoverage = 80, + searchFields = "title,description", + top = 10, +}); +Response response = client.AutocompletePost("myindex", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("queryPlusText").ToString()); +]]> + + + \ No newline at end of file diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/Documents.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/Documents.cs new file mode 100644 index 000000000000..91a85c2c16a8 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/Documents.cs @@ -0,0 +1,2399 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Search.Documents.Search +{ + // Data plane generated sub-client. + /// The Documents sub-client. + public partial class Documents + { + private const string AuthorizationHeader = "api-key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://search.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of Documents for mocking. + protected Documents() + { + } + + /// Initializes a new instance of Documents. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The key credential to copy. + /// The token credential to copy. + /// Service host. + /// The API version to use for this operation. + internal Documents(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _keyCredential = keyCredential; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Queries the number of documents in the index. + /// The name of the index. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CountAsync(string indexName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CountAsync(indexName, context).ConfigureAwait(false); + return Response.FromValue(response.Content.ToObjectFromJson(), response); + } + + /// Queries the number of documents in the index. + /// The name of the index. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response Count(string indexName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Count(indexName, context); + return Response.FromValue(response.Content.ToObjectFromJson(), response); + } + + /// + /// [Protocol Method] Queries the number of documents in the index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CountAsync(string indexName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + using var scope = ClientDiagnostics.CreateScope("Documents.Count"); + scope.Start(); + try + { + using HttpMessage message = CreateCountRequest(indexName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Queries the number of documents in the index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Count(string indexName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + using var scope = ClientDiagnostics.CreateScope("Documents.Count"); + scope.Start(); + try + { + using HttpMessage message = CreateCountRequest(indexName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Searches for documents in the index. + /// The name of the index. + /// + /// A full-text search query expression; Use "*" or omit this parameter to match + /// all documents. + /// + /// + /// A value that specifies whether to fetch the total count of results. Default is + /// false. Setting this value to true may have a performance impact. Note that the + /// count returned is an approximation. + /// + /// + /// The list of facet expressions to apply to the search query. Each facet + /// expression contains a field name, optionally followed by a comma-separated list + /// of name:value pairs. + /// + /// The OData $filter expression to apply to the search query. + /// + /// The list of field names to use for hit highlights. Only searchable fields can + /// be used for hit highlighting. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. Default is </em>. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. Default is <em>. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by a search query in order for the query to be reported as a success. + /// This parameter can be useful for ensuring search availability even for services + /// with only one replica. The default is 100. + /// + /// + /// The list of OData $orderby expressions by which to sort the results. Each + /// expression can be either a field name or a call to either the geo.distance() or + /// the search.score() functions. Each expression can be followed by asc to + /// indicate ascending, and desc to indicate descending. The default is ascending + /// order. Ties will be broken by the match scores of documents. If no OrderBy is + /// specified, the default sort order is descending by document match score. There + /// can be at most 32 $orderby clauses. + /// + /// + /// A value that specifies the syntax of the search query. The default is 'simple'. + /// Use 'full' if your query uses the Lucene query syntax. + /// + /// + /// The list of parameter values to be used in scoring functions (for example, + /// referencePointParameter) using the format name-values. For example, if the + /// scoring profile defines a function with a parameter called 'mylocation' the + /// parameter string would be "mylocation--122.2,44.8" (without the quotes). + /// + /// + /// The name of a scoring profile to evaluate match scores for matching documents + /// in order to sort the results. + /// + /// + /// The list of field names to which to scope the full-text search. When using + /// fielded search (fieldName:searchExpression) in a full Lucene query, the field + /// names of each fielded search expression take precedence over any field names + /// listed in this parameter. + /// + /// + /// A value that specifies whether any or all of the search terms must be matched + /// in order to count the document as a match. + /// + /// + /// A value that specifies whether we want to calculate scoring statistics (such as + /// document frequency) globally for more consistent scoring, or locally, for lower + /// latency. + /// + /// + /// A value to be used to create a sticky session, which can help to get more + /// consistent results. As long as the same sessionId is used, a best-effort + /// attempt will be made to target the same replica set. Be wary that reusing the + /// same sessionID values repeatedly can interfere with the load balancing of the + /// requests across replicas and adversely affect the performance of the search + /// service. The value used as sessionId cannot start with a '_' character. + /// + /// + /// The list of fields to retrieve. If unspecified, all fields marked as + /// retrievable in the schema are included. + /// + /// + /// The number of search results to skip. This value cannot be greater than + /// 100,000. If you need to scan documents in sequence, but cannot use $skip due to + /// this limitation, consider using $orderby on a totally-ordered key and $filter + /// with a range query instead. + /// + /// + /// The number of search results to retrieve. This can be used in conjunction with + /// $skip to implement client-side paging of search results. If results are + /// truncated due to server-side paging, the response will include a continuation + /// token that can be used to issue another Search request for the next page of + /// results. + /// + /// + /// The name of the semantic configuration that lists which fields should be used + /// for semantic ranking, captions, highlights, and answers + /// + /// + /// Allows the user to choose whether a semantic call should fail completely, or to + /// return partial results (default). + /// + /// + /// Allows the user to set an upper bound on the amount of time it takes for + /// semantic enrichment to finish processing before the request fails. + /// + /// + /// This parameter is only valid if the query type is `semantic`. If set, the query + /// returns answers extracted from key passages in the highest ranked documents. + /// The number of answers returned can be configured by appending the pipe + /// character `|` followed by the `count-<number of answers>` option after the + /// answers parameter value, such as `extractive|count-3`. Default count is 1. The + /// confidence threshold can be configured by appending the pipe character `|` + /// followed by the `threshold-<confidence threshold>` option after the answers + /// parameter value, such as `extractive|threshold-0.9`. Default threshold is 0.7. + /// + /// + /// This parameter is only valid if the query type is `semantic`. If set, the query + /// returns captions extracted from key passages in the highest ranked documents. + /// When Captions is set to `extractive`, highlighting is enabled by default, and + /// can be configured by appending the pipe character `|` followed by the + /// `highlight-<true/false>` option, such as `extractive|highlight-true`. Defaults + /// to `None`. + /// + /// + /// Allows setting a separate search query that will be solely used for semantic + /// reranking, semantic captions and semantic answers. Is useful for scenarios + /// where there is a need to use different queries between the base retrieval and + /// ranking phase, and the L2 semantic phase. + /// + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> SearchGetAsync(string indexName, string searchText = null, bool? includeTotalResultCount = null, IEnumerable facets = null, string filter = null, IEnumerable highlightFields = null, string highlightPostTag = null, string highlightPreTag = null, double? minimumCoverage = null, IEnumerable orderBy = null, QueryType? queryType = null, IEnumerable scoringParameters = null, string scoringProfile = null, IEnumerable searchFields = null, SearchMode? searchMode = null, ScoringStatistics? scoringStatistics = null, string sessionId = null, IEnumerable select = null, int? skip = null, int? top = null, string semanticConfiguration = null, SemanticErrorMode? semanticErrorHandling = null, int? semanticMaxWaitInMilliseconds = null, QueryAnswerType? answers = null, QueryCaptionType? captions = null, string semanticQuery = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await SearchGetAsync(indexName, searchText, includeTotalResultCount, facets, filter, highlightFields, highlightPostTag, highlightPreTag, minimumCoverage, orderBy, queryType?.ToString(), scoringParameters, scoringProfile, searchFields, searchMode?.ToString(), scoringStatistics?.ToString(), sessionId, select, skip, top, semanticConfiguration, semanticErrorHandling?.ToString(), semanticMaxWaitInMilliseconds, answers?.ToString(), captions?.ToString(), semanticQuery, context).ConfigureAwait(false); + return Response.FromValue(SearchDocumentsResult.FromResponse(response), response); + } + + /// Searches for documents in the index. + /// The name of the index. + /// + /// A full-text search query expression; Use "*" or omit this parameter to match + /// all documents. + /// + /// + /// A value that specifies whether to fetch the total count of results. Default is + /// false. Setting this value to true may have a performance impact. Note that the + /// count returned is an approximation. + /// + /// + /// The list of facet expressions to apply to the search query. Each facet + /// expression contains a field name, optionally followed by a comma-separated list + /// of name:value pairs. + /// + /// The OData $filter expression to apply to the search query. + /// + /// The list of field names to use for hit highlights. Only searchable fields can + /// be used for hit highlighting. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. Default is </em>. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. Default is <em>. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by a search query in order for the query to be reported as a success. + /// This parameter can be useful for ensuring search availability even for services + /// with only one replica. The default is 100. + /// + /// + /// The list of OData $orderby expressions by which to sort the results. Each + /// expression can be either a field name or a call to either the geo.distance() or + /// the search.score() functions. Each expression can be followed by asc to + /// indicate ascending, and desc to indicate descending. The default is ascending + /// order. Ties will be broken by the match scores of documents. If no OrderBy is + /// specified, the default sort order is descending by document match score. There + /// can be at most 32 $orderby clauses. + /// + /// + /// A value that specifies the syntax of the search query. The default is 'simple'. + /// Use 'full' if your query uses the Lucene query syntax. + /// + /// + /// The list of parameter values to be used in scoring functions (for example, + /// referencePointParameter) using the format name-values. For example, if the + /// scoring profile defines a function with a parameter called 'mylocation' the + /// parameter string would be "mylocation--122.2,44.8" (without the quotes). + /// + /// + /// The name of a scoring profile to evaluate match scores for matching documents + /// in order to sort the results. + /// + /// + /// The list of field names to which to scope the full-text search. When using + /// fielded search (fieldName:searchExpression) in a full Lucene query, the field + /// names of each fielded search expression take precedence over any field names + /// listed in this parameter. + /// + /// + /// A value that specifies whether any or all of the search terms must be matched + /// in order to count the document as a match. + /// + /// + /// A value that specifies whether we want to calculate scoring statistics (such as + /// document frequency) globally for more consistent scoring, or locally, for lower + /// latency. + /// + /// + /// A value to be used to create a sticky session, which can help to get more + /// consistent results. As long as the same sessionId is used, a best-effort + /// attempt will be made to target the same replica set. Be wary that reusing the + /// same sessionID values repeatedly can interfere with the load balancing of the + /// requests across replicas and adversely affect the performance of the search + /// service. The value used as sessionId cannot start with a '_' character. + /// + /// + /// The list of fields to retrieve. If unspecified, all fields marked as + /// retrievable in the schema are included. + /// + /// + /// The number of search results to skip. This value cannot be greater than + /// 100,000. If you need to scan documents in sequence, but cannot use $skip due to + /// this limitation, consider using $orderby on a totally-ordered key and $filter + /// with a range query instead. + /// + /// + /// The number of search results to retrieve. This can be used in conjunction with + /// $skip to implement client-side paging of search results. If results are + /// truncated due to server-side paging, the response will include a continuation + /// token that can be used to issue another Search request for the next page of + /// results. + /// + /// + /// The name of the semantic configuration that lists which fields should be used + /// for semantic ranking, captions, highlights, and answers + /// + /// + /// Allows the user to choose whether a semantic call should fail completely, or to + /// return partial results (default). + /// + /// + /// Allows the user to set an upper bound on the amount of time it takes for + /// semantic enrichment to finish processing before the request fails. + /// + /// + /// This parameter is only valid if the query type is `semantic`. If set, the query + /// returns answers extracted from key passages in the highest ranked documents. + /// The number of answers returned can be configured by appending the pipe + /// character `|` followed by the `count-<number of answers>` option after the + /// answers parameter value, such as `extractive|count-3`. Default count is 1. The + /// confidence threshold can be configured by appending the pipe character `|` + /// followed by the `threshold-<confidence threshold>` option after the answers + /// parameter value, such as `extractive|threshold-0.9`. Default threshold is 0.7. + /// + /// + /// This parameter is only valid if the query type is `semantic`. If set, the query + /// returns captions extracted from key passages in the highest ranked documents. + /// When Captions is set to `extractive`, highlighting is enabled by default, and + /// can be configured by appending the pipe character `|` followed by the + /// `highlight-<true/false>` option, such as `extractive|highlight-true`. Defaults + /// to `None`. + /// + /// + /// Allows setting a separate search query that will be solely used for semantic + /// reranking, semantic captions and semantic answers. Is useful for scenarios + /// where there is a need to use different queries between the base retrieval and + /// ranking phase, and the L2 semantic phase. + /// + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response SearchGet(string indexName, string searchText = null, bool? includeTotalResultCount = null, IEnumerable facets = null, string filter = null, IEnumerable highlightFields = null, string highlightPostTag = null, string highlightPreTag = null, double? minimumCoverage = null, IEnumerable orderBy = null, QueryType? queryType = null, IEnumerable scoringParameters = null, string scoringProfile = null, IEnumerable searchFields = null, SearchMode? searchMode = null, ScoringStatistics? scoringStatistics = null, string sessionId = null, IEnumerable select = null, int? skip = null, int? top = null, string semanticConfiguration = null, SemanticErrorMode? semanticErrorHandling = null, int? semanticMaxWaitInMilliseconds = null, QueryAnswerType? answers = null, QueryCaptionType? captions = null, string semanticQuery = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = SearchGet(indexName, searchText, includeTotalResultCount, facets, filter, highlightFields, highlightPostTag, highlightPreTag, minimumCoverage, orderBy, queryType?.ToString(), scoringParameters, scoringProfile, searchFields, searchMode?.ToString(), scoringStatistics?.ToString(), sessionId, select, skip, top, semanticConfiguration, semanticErrorHandling?.ToString(), semanticMaxWaitInMilliseconds, answers?.ToString(), captions?.ToString(), semanticQuery, context); + return Response.FromValue(SearchDocumentsResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Searches for documents in the index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// + /// A full-text search query expression; Use "*" or omit this parameter to match + /// all documents. + /// + /// + /// A value that specifies whether to fetch the total count of results. Default is + /// false. Setting this value to true may have a performance impact. Note that the + /// count returned is an approximation. + /// + /// + /// The list of facet expressions to apply to the search query. Each facet + /// expression contains a field name, optionally followed by a comma-separated list + /// of name:value pairs. + /// + /// The OData $filter expression to apply to the search query. + /// + /// The list of field names to use for hit highlights. Only searchable fields can + /// be used for hit highlighting. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. Default is </em>. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. Default is <em>. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by a search query in order for the query to be reported as a success. + /// This parameter can be useful for ensuring search availability even for services + /// with only one replica. The default is 100. + /// + /// + /// The list of OData $orderby expressions by which to sort the results. Each + /// expression can be either a field name or a call to either the geo.distance() or + /// the search.score() functions. Each expression can be followed by asc to + /// indicate ascending, and desc to indicate descending. The default is ascending + /// order. Ties will be broken by the match scores of documents. If no OrderBy is + /// specified, the default sort order is descending by document match score. There + /// can be at most 32 $orderby clauses. + /// + /// + /// A value that specifies the syntax of the search query. The default is 'simple'. + /// Use 'full' if your query uses the Lucene query syntax. Allowed values: "simple" | "full" | "semantic" + /// + /// + /// The list of parameter values to be used in scoring functions (for example, + /// referencePointParameter) using the format name-values. For example, if the + /// scoring profile defines a function with a parameter called 'mylocation' the + /// parameter string would be "mylocation--122.2,44.8" (without the quotes). + /// + /// + /// The name of a scoring profile to evaluate match scores for matching documents + /// in order to sort the results. + /// + /// + /// The list of field names to which to scope the full-text search. When using + /// fielded search (fieldName:searchExpression) in a full Lucene query, the field + /// names of each fielded search expression take precedence over any field names + /// listed in this parameter. + /// + /// + /// A value that specifies whether any or all of the search terms must be matched + /// in order to count the document as a match. Allowed values: "any" | "all" + /// + /// + /// A value that specifies whether we want to calculate scoring statistics (such as + /// document frequency) globally for more consistent scoring, or locally, for lower + /// latency. Allowed values: "local" | "global" + /// + /// + /// A value to be used to create a sticky session, which can help to get more + /// consistent results. As long as the same sessionId is used, a best-effort + /// attempt will be made to target the same replica set. Be wary that reusing the + /// same sessionID values repeatedly can interfere with the load balancing of the + /// requests across replicas and adversely affect the performance of the search + /// service. The value used as sessionId cannot start with a '_' character. + /// + /// + /// The list of fields to retrieve. If unspecified, all fields marked as + /// retrievable in the schema are included. + /// + /// + /// The number of search results to skip. This value cannot be greater than + /// 100,000. If you need to scan documents in sequence, but cannot use $skip due to + /// this limitation, consider using $orderby on a totally-ordered key and $filter + /// with a range query instead. + /// + /// + /// The number of search results to retrieve. This can be used in conjunction with + /// $skip to implement client-side paging of search results. If results are + /// truncated due to server-side paging, the response will include a continuation + /// token that can be used to issue another Search request for the next page of + /// results. + /// + /// + /// The name of the semantic configuration that lists which fields should be used + /// for semantic ranking, captions, highlights, and answers + /// + /// + /// Allows the user to choose whether a semantic call should fail completely, or to + /// return partial results (default). Allowed values: "partial" | "fail" + /// + /// + /// Allows the user to set an upper bound on the amount of time it takes for + /// semantic enrichment to finish processing before the request fails. + /// + /// + /// This parameter is only valid if the query type is `semantic`. If set, the query + /// returns answers extracted from key passages in the highest ranked documents. + /// The number of answers returned can be configured by appending the pipe + /// character `|` followed by the `count-<number of answers>` option after the + /// answers parameter value, such as `extractive|count-3`. Default count is 1. The + /// confidence threshold can be configured by appending the pipe character `|` + /// followed by the `threshold-<confidence threshold>` option after the answers + /// parameter value, such as `extractive|threshold-0.9`. Default threshold is 0.7. Allowed values: "none" | "extractive" + /// + /// + /// This parameter is only valid if the query type is `semantic`. If set, the query + /// returns captions extracted from key passages in the highest ranked documents. + /// When Captions is set to `extractive`, highlighting is enabled by default, and + /// can be configured by appending the pipe character `|` followed by the + /// `highlight-<true/false>` option, such as `extractive|highlight-true`. Defaults + /// to `None`. Allowed values: "none" | "extractive" + /// + /// + /// Allows setting a separate search query that will be solely used for semantic + /// reranking, semantic captions and semantic answers. Is useful for scenarios + /// where there is a need to use different queries between the base retrieval and + /// ranking phase, and the L2 semantic phase. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task SearchGetAsync(string indexName, string searchText, bool? includeTotalResultCount, IEnumerable facets, string filter, IEnumerable highlightFields, string highlightPostTag, string highlightPreTag, double? minimumCoverage, IEnumerable orderBy, string queryType, IEnumerable scoringParameters, string scoringProfile, IEnumerable searchFields, string searchMode, string scoringStatistics, string sessionId, IEnumerable select, int? skip, int? top, string semanticConfiguration, string semanticErrorHandling, int? semanticMaxWaitInMilliseconds, string answers, string captions, string semanticQuery, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + using var scope = ClientDiagnostics.CreateScope("Documents.SearchGet"); + scope.Start(); + try + { + using HttpMessage message = CreateSearchGetRequest(indexName, searchText, includeTotalResultCount, facets, filter, highlightFields, highlightPostTag, highlightPreTag, minimumCoverage, orderBy, queryType, scoringParameters, scoringProfile, searchFields, searchMode, scoringStatistics, sessionId, select, skip, top, semanticConfiguration, semanticErrorHandling, semanticMaxWaitInMilliseconds, answers, captions, semanticQuery, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Searches for documents in the index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// + /// A full-text search query expression; Use "*" or omit this parameter to match + /// all documents. + /// + /// + /// A value that specifies whether to fetch the total count of results. Default is + /// false. Setting this value to true may have a performance impact. Note that the + /// count returned is an approximation. + /// + /// + /// The list of facet expressions to apply to the search query. Each facet + /// expression contains a field name, optionally followed by a comma-separated list + /// of name:value pairs. + /// + /// The OData $filter expression to apply to the search query. + /// + /// The list of field names to use for hit highlights. Only searchable fields can + /// be used for hit highlighting. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. Default is </em>. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. Default is <em>. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by a search query in order for the query to be reported as a success. + /// This parameter can be useful for ensuring search availability even for services + /// with only one replica. The default is 100. + /// + /// + /// The list of OData $orderby expressions by which to sort the results. Each + /// expression can be either a field name or a call to either the geo.distance() or + /// the search.score() functions. Each expression can be followed by asc to + /// indicate ascending, and desc to indicate descending. The default is ascending + /// order. Ties will be broken by the match scores of documents. If no OrderBy is + /// specified, the default sort order is descending by document match score. There + /// can be at most 32 $orderby clauses. + /// + /// + /// A value that specifies the syntax of the search query. The default is 'simple'. + /// Use 'full' if your query uses the Lucene query syntax. Allowed values: "simple" | "full" | "semantic" + /// + /// + /// The list of parameter values to be used in scoring functions (for example, + /// referencePointParameter) using the format name-values. For example, if the + /// scoring profile defines a function with a parameter called 'mylocation' the + /// parameter string would be "mylocation--122.2,44.8" (without the quotes). + /// + /// + /// The name of a scoring profile to evaluate match scores for matching documents + /// in order to sort the results. + /// + /// + /// The list of field names to which to scope the full-text search. When using + /// fielded search (fieldName:searchExpression) in a full Lucene query, the field + /// names of each fielded search expression take precedence over any field names + /// listed in this parameter. + /// + /// + /// A value that specifies whether any or all of the search terms must be matched + /// in order to count the document as a match. Allowed values: "any" | "all" + /// + /// + /// A value that specifies whether we want to calculate scoring statistics (such as + /// document frequency) globally for more consistent scoring, or locally, for lower + /// latency. Allowed values: "local" | "global" + /// + /// + /// A value to be used to create a sticky session, which can help to get more + /// consistent results. As long as the same sessionId is used, a best-effort + /// attempt will be made to target the same replica set. Be wary that reusing the + /// same sessionID values repeatedly can interfere with the load balancing of the + /// requests across replicas and adversely affect the performance of the search + /// service. The value used as sessionId cannot start with a '_' character. + /// + /// + /// The list of fields to retrieve. If unspecified, all fields marked as + /// retrievable in the schema are included. + /// + /// + /// The number of search results to skip. This value cannot be greater than + /// 100,000. If you need to scan documents in sequence, but cannot use $skip due to + /// this limitation, consider using $orderby on a totally-ordered key and $filter + /// with a range query instead. + /// + /// + /// The number of search results to retrieve. This can be used in conjunction with + /// $skip to implement client-side paging of search results. If results are + /// truncated due to server-side paging, the response will include a continuation + /// token that can be used to issue another Search request for the next page of + /// results. + /// + /// + /// The name of the semantic configuration that lists which fields should be used + /// for semantic ranking, captions, highlights, and answers + /// + /// + /// Allows the user to choose whether a semantic call should fail completely, or to + /// return partial results (default). Allowed values: "partial" | "fail" + /// + /// + /// Allows the user to set an upper bound on the amount of time it takes for + /// semantic enrichment to finish processing before the request fails. + /// + /// + /// This parameter is only valid if the query type is `semantic`. If set, the query + /// returns answers extracted from key passages in the highest ranked documents. + /// The number of answers returned can be configured by appending the pipe + /// character `|` followed by the `count-<number of answers>` option after the + /// answers parameter value, such as `extractive|count-3`. Default count is 1. The + /// confidence threshold can be configured by appending the pipe character `|` + /// followed by the `threshold-<confidence threshold>` option after the answers + /// parameter value, such as `extractive|threshold-0.9`. Default threshold is 0.7. Allowed values: "none" | "extractive" + /// + /// + /// This parameter is only valid if the query type is `semantic`. If set, the query + /// returns captions extracted from key passages in the highest ranked documents. + /// When Captions is set to `extractive`, highlighting is enabled by default, and + /// can be configured by appending the pipe character `|` followed by the + /// `highlight-<true/false>` option, such as `extractive|highlight-true`. Defaults + /// to `None`. Allowed values: "none" | "extractive" + /// + /// + /// Allows setting a separate search query that will be solely used for semantic + /// reranking, semantic captions and semantic answers. Is useful for scenarios + /// where there is a need to use different queries between the base retrieval and + /// ranking phase, and the L2 semantic phase. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response SearchGet(string indexName, string searchText, bool? includeTotalResultCount, IEnumerable facets, string filter, IEnumerable highlightFields, string highlightPostTag, string highlightPreTag, double? minimumCoverage, IEnumerable orderBy, string queryType, IEnumerable scoringParameters, string scoringProfile, IEnumerable searchFields, string searchMode, string scoringStatistics, string sessionId, IEnumerable select, int? skip, int? top, string semanticConfiguration, string semanticErrorHandling, int? semanticMaxWaitInMilliseconds, string answers, string captions, string semanticQuery, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + + using var scope = ClientDiagnostics.CreateScope("Documents.SearchGet"); + scope.Start(); + try + { + using HttpMessage message = CreateSearchGetRequest(indexName, searchText, includeTotalResultCount, facets, filter, highlightFields, highlightPostTag, highlightPreTag, minimumCoverage, orderBy, queryType, scoringParameters, scoringProfile, searchFields, searchMode, scoringStatistics, sessionId, select, skip, top, semanticConfiguration, semanticErrorHandling, semanticMaxWaitInMilliseconds, answers, captions, semanticQuery, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Searches for documents in the index. + /// The name of the index. + /// The definition of the Search request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> SearchPostAsync(string indexName, SearchRequest searchRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(searchRequest, nameof(searchRequest)); + + using RequestContent content = searchRequest.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await SearchPostAsync(indexName, content, context).ConfigureAwait(false); + return Response.FromValue(SearchDocumentsResult.FromResponse(response), response); + } + + /// Searches for documents in the index. + /// The name of the index. + /// The definition of the Search request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response SearchPost(string indexName, SearchRequest searchRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(searchRequest, nameof(searchRequest)); + + using RequestContent content = searchRequest.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = SearchPost(indexName, content, context); + return Response.FromValue(SearchDocumentsResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Searches for documents in the index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task SearchPostAsync(string indexName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Documents.SearchPost"); + scope.Start(); + try + { + using HttpMessage message = CreateSearchPostRequest(indexName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Searches for documents in the index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response SearchPost(string indexName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Documents.SearchPost"); + scope.Start(); + try + { + using HttpMessage message = CreateSearchPostRequest(indexName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieves a document from the index. + /// The name of the index. + /// The key of the document to retrieve. + /// + /// List of field names to retrieve for the document; Any field not retrieved will + /// be missing from the returned document. + /// + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDocumentAsync(string indexName, string key, IEnumerable selectedFields = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNullOrEmpty(key, nameof(key)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDocumentAsync(indexName, key, selectedFields, context).ConfigureAwait(false); + return Response.FromValue(LookupDocument.FromResponse(response), response); + } + + /// Retrieves a document from the index. + /// The name of the index. + /// The key of the document to retrieve. + /// + /// List of field names to retrieve for the document; Any field not retrieved will + /// be missing from the returned document. + /// + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDocument(string indexName, string key, IEnumerable selectedFields = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNullOrEmpty(key, nameof(key)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDocument(indexName, key, selectedFields, context); + return Response.FromValue(LookupDocument.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieves a document from the index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The key of the document to retrieve. + /// + /// List of field names to retrieve for the document; Any field not retrieved will + /// be missing from the returned document. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetDocumentAsync(string indexName, string key, IEnumerable selectedFields, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNullOrEmpty(key, nameof(key)); + + using var scope = ClientDiagnostics.CreateScope("Documents.GetDocument"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDocumentRequest(indexName, key, selectedFields, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieves a document from the index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The key of the document to retrieve. + /// + /// List of field names to retrieve for the document; Any field not retrieved will + /// be missing from the returned document. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetDocument(string indexName, string key, IEnumerable selectedFields, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNullOrEmpty(key, nameof(key)); + + using var scope = ClientDiagnostics.CreateScope("Documents.GetDocument"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDocumentRequest(indexName, key, selectedFields, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Suggests documents in the index that match the given partial query text. + /// The name of the index. + /// + /// The search text to use to suggest documents. Must be at least 1 character, and + /// no more than 100 characters. + /// + /// + /// The name of the suggester as specified in the suggesters collection that's part + /// of the index definition. + /// + /// An OData expression that filters the documents considered for suggestions. + /// + /// A value indicating whether to use fuzzy matching for the suggestions query. + /// Default is false. When set to true, the query will find terms even if there's a + /// substituted or missing character in the search text. While this provides a + /// better experience in some scenarios, it comes at a performance cost as fuzzy + /// suggestions queries are slower and consume more resources. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. If omitted, hit highlighting of suggestions is disabled. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. If omitted, hit highlighting of suggestions is disabled. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by a suggestions query in order for the query to be reported as a + /// success. This parameter can be useful for ensuring search availability even for + /// services with only one replica. The default is 80. + /// + /// + /// The list of OData $orderby expressions by which to sort the results. Each + /// expression can be either a field name or a call to either the geo.distance() or + /// the search.score() functions. Each expression can be followed by asc to + /// indicate ascending, or desc to indicate descending. The default is ascending + /// order. Ties will be broken by the match scores of documents. If no $orderby is + /// specified, the default sort order is descending by document match score. There + /// can be at most 32 $orderby clauses. + /// + /// + /// The list of field names to search for the specified search text. Target fields + /// must be included in the specified suggester. + /// + /// + /// The list of fields to retrieve. If unspecified, only the key field will be + /// included in the results. + /// + /// + /// The number of suggestions to retrieve. The value must be a number between 1 and + /// 100. The default is 5. + /// + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> SuggestGetAsync(string indexName, string searchText, string suggesterName, string filter = null, bool? useFuzzyMatching = null, string highlightPostTag = null, string highlightPreTag = null, double? minimumCoverage = null, IEnumerable orderBy = null, IEnumerable searchFields = null, IEnumerable select = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(searchText, nameof(searchText)); + Argument.AssertNotNull(suggesterName, nameof(suggesterName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await SuggestGetAsync(indexName, searchText, suggesterName, filter, useFuzzyMatching, highlightPostTag, highlightPreTag, minimumCoverage, orderBy, searchFields, select, top, context).ConfigureAwait(false); + return Response.FromValue(SuggestDocumentsResult.FromResponse(response), response); + } + + /// Suggests documents in the index that match the given partial query text. + /// The name of the index. + /// + /// The search text to use to suggest documents. Must be at least 1 character, and + /// no more than 100 characters. + /// + /// + /// The name of the suggester as specified in the suggesters collection that's part + /// of the index definition. + /// + /// An OData expression that filters the documents considered for suggestions. + /// + /// A value indicating whether to use fuzzy matching for the suggestions query. + /// Default is false. When set to true, the query will find terms even if there's a + /// substituted or missing character in the search text. While this provides a + /// better experience in some scenarios, it comes at a performance cost as fuzzy + /// suggestions queries are slower and consume more resources. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. If omitted, hit highlighting of suggestions is disabled. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. If omitted, hit highlighting of suggestions is disabled. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by a suggestions query in order for the query to be reported as a + /// success. This parameter can be useful for ensuring search availability even for + /// services with only one replica. The default is 80. + /// + /// + /// The list of OData $orderby expressions by which to sort the results. Each + /// expression can be either a field name or a call to either the geo.distance() or + /// the search.score() functions. Each expression can be followed by asc to + /// indicate ascending, or desc to indicate descending. The default is ascending + /// order. Ties will be broken by the match scores of documents. If no $orderby is + /// specified, the default sort order is descending by document match score. There + /// can be at most 32 $orderby clauses. + /// + /// + /// The list of field names to search for the specified search text. Target fields + /// must be included in the specified suggester. + /// + /// + /// The list of fields to retrieve. If unspecified, only the key field will be + /// included in the results. + /// + /// + /// The number of suggestions to retrieve. The value must be a number between 1 and + /// 100. The default is 5. + /// + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response SuggestGet(string indexName, string searchText, string suggesterName, string filter = null, bool? useFuzzyMatching = null, string highlightPostTag = null, string highlightPreTag = null, double? minimumCoverage = null, IEnumerable orderBy = null, IEnumerable searchFields = null, IEnumerable select = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(searchText, nameof(searchText)); + Argument.AssertNotNull(suggesterName, nameof(suggesterName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = SuggestGet(indexName, searchText, suggesterName, filter, useFuzzyMatching, highlightPostTag, highlightPreTag, minimumCoverage, orderBy, searchFields, select, top, context); + return Response.FromValue(SuggestDocumentsResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Suggests documents in the index that match the given partial query text. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// + /// The search text to use to suggest documents. Must be at least 1 character, and + /// no more than 100 characters. + /// + /// + /// The name of the suggester as specified in the suggesters collection that's part + /// of the index definition. + /// + /// An OData expression that filters the documents considered for suggestions. + /// + /// A value indicating whether to use fuzzy matching for the suggestions query. + /// Default is false. When set to true, the query will find terms even if there's a + /// substituted or missing character in the search text. While this provides a + /// better experience in some scenarios, it comes at a performance cost as fuzzy + /// suggestions queries are slower and consume more resources. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. If omitted, hit highlighting of suggestions is disabled. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. If omitted, hit highlighting of suggestions is disabled. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by a suggestions query in order for the query to be reported as a + /// success. This parameter can be useful for ensuring search availability even for + /// services with only one replica. The default is 80. + /// + /// + /// The list of OData $orderby expressions by which to sort the results. Each + /// expression can be either a field name or a call to either the geo.distance() or + /// the search.score() functions. Each expression can be followed by asc to + /// indicate ascending, or desc to indicate descending. The default is ascending + /// order. Ties will be broken by the match scores of documents. If no $orderby is + /// specified, the default sort order is descending by document match score. There + /// can be at most 32 $orderby clauses. + /// + /// + /// The list of field names to search for the specified search text. Target fields + /// must be included in the specified suggester. + /// + /// + /// The list of fields to retrieve. If unspecified, only the key field will be + /// included in the results. + /// + /// + /// The number of suggestions to retrieve. The value must be a number between 1 and + /// 100. The default is 5. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task SuggestGetAsync(string indexName, string searchText, string suggesterName, string filter, bool? useFuzzyMatching, string highlightPostTag, string highlightPreTag, double? minimumCoverage, IEnumerable orderBy, IEnumerable searchFields, IEnumerable select, int? top, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(searchText, nameof(searchText)); + Argument.AssertNotNull(suggesterName, nameof(suggesterName)); + + using var scope = ClientDiagnostics.CreateScope("Documents.SuggestGet"); + scope.Start(); + try + { + using HttpMessage message = CreateSuggestGetRequest(indexName, searchText, suggesterName, filter, useFuzzyMatching, highlightPostTag, highlightPreTag, minimumCoverage, orderBy, searchFields, select, top, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Suggests documents in the index that match the given partial query text. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// + /// The search text to use to suggest documents. Must be at least 1 character, and + /// no more than 100 characters. + /// + /// + /// The name of the suggester as specified in the suggesters collection that's part + /// of the index definition. + /// + /// An OData expression that filters the documents considered for suggestions. + /// + /// A value indicating whether to use fuzzy matching for the suggestions query. + /// Default is false. When set to true, the query will find terms even if there's a + /// substituted or missing character in the search text. While this provides a + /// better experience in some scenarios, it comes at a performance cost as fuzzy + /// suggestions queries are slower and consume more resources. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. If omitted, hit highlighting of suggestions is disabled. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. If omitted, hit highlighting of suggestions is disabled. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by a suggestions query in order for the query to be reported as a + /// success. This parameter can be useful for ensuring search availability even for + /// services with only one replica. The default is 80. + /// + /// + /// The list of OData $orderby expressions by which to sort the results. Each + /// expression can be either a field name or a call to either the geo.distance() or + /// the search.score() functions. Each expression can be followed by asc to + /// indicate ascending, or desc to indicate descending. The default is ascending + /// order. Ties will be broken by the match scores of documents. If no $orderby is + /// specified, the default sort order is descending by document match score. There + /// can be at most 32 $orderby clauses. + /// + /// + /// The list of field names to search for the specified search text. Target fields + /// must be included in the specified suggester. + /// + /// + /// The list of fields to retrieve. If unspecified, only the key field will be + /// included in the results. + /// + /// + /// The number of suggestions to retrieve. The value must be a number between 1 and + /// 100. The default is 5. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response SuggestGet(string indexName, string searchText, string suggesterName, string filter, bool? useFuzzyMatching, string highlightPostTag, string highlightPreTag, double? minimumCoverage, IEnumerable orderBy, IEnumerable searchFields, IEnumerable select, int? top, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(searchText, nameof(searchText)); + Argument.AssertNotNull(suggesterName, nameof(suggesterName)); + + using var scope = ClientDiagnostics.CreateScope("Documents.SuggestGet"); + scope.Start(); + try + { + using HttpMessage message = CreateSuggestGetRequest(indexName, searchText, suggesterName, filter, useFuzzyMatching, highlightPostTag, highlightPreTag, minimumCoverage, orderBy, searchFields, select, top, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Suggests documents in the index that match the given partial query text. + /// The name of the index. + /// The Suggest request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> SuggestPostAsync(string indexName, SuggestRequest suggestRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(suggestRequest, nameof(suggestRequest)); + + using RequestContent content = suggestRequest.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await SuggestPostAsync(indexName, content, context).ConfigureAwait(false); + return Response.FromValue(SuggestDocumentsResult.FromResponse(response), response); + } + + /// Suggests documents in the index that match the given partial query text. + /// The name of the index. + /// The Suggest request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response SuggestPost(string indexName, SuggestRequest suggestRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(suggestRequest, nameof(suggestRequest)); + + using RequestContent content = suggestRequest.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = SuggestPost(indexName, content, context); + return Response.FromValue(SuggestDocumentsResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Suggests documents in the index that match the given partial query text. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task SuggestPostAsync(string indexName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Documents.SuggestPost"); + scope.Start(); + try + { + using HttpMessage message = CreateSuggestPostRequest(indexName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Suggests documents in the index that match the given partial query text. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response SuggestPost(string indexName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Documents.SuggestPost"); + scope.Start(); + try + { + using HttpMessage message = CreateSuggestPostRequest(indexName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Sends a batch of document write actions to the index. + /// The name of the index. + /// The batch of index actions. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> IndexAsync(string indexName, IndexBatch batch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(batch, nameof(batch)); + + using RequestContent content = batch.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await IndexAsync(indexName, content, context).ConfigureAwait(false); + return Response.FromValue(IndexDocumentsResult.FromResponse(response), response); + } + + /// Sends a batch of document write actions to the index. + /// The name of the index. + /// The batch of index actions. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response Index(string indexName, IndexBatch batch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(batch, nameof(batch)); + + using RequestContent content = batch.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Index(indexName, content, context); + return Response.FromValue(IndexDocumentsResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Sends a batch of document write actions to the index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task IndexAsync(string indexName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Documents.Index"); + scope.Start(); + try + { + using HttpMessage message = CreateIndexRequest(indexName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Sends a batch of document write actions to the index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Index(string indexName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Documents.Index"); + scope.Start(); + try + { + using HttpMessage message = CreateIndexRequest(indexName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Autocompletes incomplete query terms based on input text and matching terms in + /// the index. + /// + /// The name of the index. + /// The incomplete term which should be auto-completed. + /// + /// The name of the suggester as specified in the suggesters collection that's part + /// of the index definition. + /// + /// + /// Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' + /// to get shingles and 'oneTermWithContext' to use the current context while + /// producing auto-completed terms. + /// + /// + /// An OData expression that filters the documents used to produce completed terms + /// for the Autocomplete result. + /// + /// + /// A value indicating whether to use fuzzy matching for the autocomplete query. + /// Default is false. When set to true, the query will find terms even if there's a + /// substituted or missing character in the search text. While this provides a + /// better experience in some scenarios, it comes at a performance cost as fuzzy + /// autocomplete queries are slower and consume more resources. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. If omitted, hit highlighting is disabled. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. If omitted, hit highlighting is disabled. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by an autocomplete query in order for the query to be reported as a + /// success. This parameter can be useful for ensuring search availability even for + /// services with only one replica. The default is 80. + /// + /// + /// The list of field names to consider when querying for auto-completed terms. + /// Target fields must be included in the specified suggester. + /// + /// + /// The number of auto-completed terms to retrieve. This must be a value between 1 + /// and 100. The default is 5. + /// + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> AutocompleteGetAsync(string indexName, string searchText, string suggesterName, AutocompleteMode? autocompleteMode = null, string filter = null, bool? useFuzzyMatching = null, string highlightPostTag = null, string highlightPreTag = null, double? minimumCoverage = null, IEnumerable searchFields = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(searchText, nameof(searchText)); + Argument.AssertNotNull(suggesterName, nameof(suggesterName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await AutocompleteGetAsync(indexName, searchText, suggesterName, autocompleteMode?.ToString(), filter, useFuzzyMatching, highlightPostTag, highlightPreTag, minimumCoverage, searchFields, top, context).ConfigureAwait(false); + return Response.FromValue(AutocompleteResult.FromResponse(response), response); + } + + /// + /// Autocompletes incomplete query terms based on input text and matching terms in + /// the index. + /// + /// The name of the index. + /// The incomplete term which should be auto-completed. + /// + /// The name of the suggester as specified in the suggesters collection that's part + /// of the index definition. + /// + /// + /// Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' + /// to get shingles and 'oneTermWithContext' to use the current context while + /// producing auto-completed terms. + /// + /// + /// An OData expression that filters the documents used to produce completed terms + /// for the Autocomplete result. + /// + /// + /// A value indicating whether to use fuzzy matching for the autocomplete query. + /// Default is false. When set to true, the query will find terms even if there's a + /// substituted or missing character in the search text. While this provides a + /// better experience in some scenarios, it comes at a performance cost as fuzzy + /// autocomplete queries are slower and consume more resources. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. If omitted, hit highlighting is disabled. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. If omitted, hit highlighting is disabled. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by an autocomplete query in order for the query to be reported as a + /// success. This parameter can be useful for ensuring search availability even for + /// services with only one replica. The default is 80. + /// + /// + /// The list of field names to consider when querying for auto-completed terms. + /// Target fields must be included in the specified suggester. + /// + /// + /// The number of auto-completed terms to retrieve. This must be a value between 1 + /// and 100. The default is 5. + /// + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response AutocompleteGet(string indexName, string searchText, string suggesterName, AutocompleteMode? autocompleteMode = null, string filter = null, bool? useFuzzyMatching = null, string highlightPostTag = null, string highlightPreTag = null, double? minimumCoverage = null, IEnumerable searchFields = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(searchText, nameof(searchText)); + Argument.AssertNotNull(suggesterName, nameof(suggesterName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = AutocompleteGet(indexName, searchText, suggesterName, autocompleteMode?.ToString(), filter, useFuzzyMatching, highlightPostTag, highlightPreTag, minimumCoverage, searchFields, top, context); + return Response.FromValue(AutocompleteResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Autocompletes incomplete query terms based on input text and matching terms in + /// the index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The incomplete term which should be auto-completed. + /// + /// The name of the suggester as specified in the suggesters collection that's part + /// of the index definition. + /// + /// + /// Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' + /// to get shingles and 'oneTermWithContext' to use the current context while + /// producing auto-completed terms. Allowed values: "oneTerm" | "twoTerms" | "oneTermWithContext" + /// + /// + /// An OData expression that filters the documents used to produce completed terms + /// for the Autocomplete result. + /// + /// + /// A value indicating whether to use fuzzy matching for the autocomplete query. + /// Default is false. When set to true, the query will find terms even if there's a + /// substituted or missing character in the search text. While this provides a + /// better experience in some scenarios, it comes at a performance cost as fuzzy + /// autocomplete queries are slower and consume more resources. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. If omitted, hit highlighting is disabled. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. If omitted, hit highlighting is disabled. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by an autocomplete query in order for the query to be reported as a + /// success. This parameter can be useful for ensuring search availability even for + /// services with only one replica. The default is 80. + /// + /// + /// The list of field names to consider when querying for auto-completed terms. + /// Target fields must be included in the specified suggester. + /// + /// + /// The number of auto-completed terms to retrieve. This must be a value between 1 + /// and 100. The default is 5. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task AutocompleteGetAsync(string indexName, string searchText, string suggesterName, string autocompleteMode, string filter, bool? useFuzzyMatching, string highlightPostTag, string highlightPreTag, double? minimumCoverage, IEnumerable searchFields, int? top, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(searchText, nameof(searchText)); + Argument.AssertNotNull(suggesterName, nameof(suggesterName)); + + using var scope = ClientDiagnostics.CreateScope("Documents.AutocompleteGet"); + scope.Start(); + try + { + using HttpMessage message = CreateAutocompleteGetRequest(indexName, searchText, suggesterName, autocompleteMode, filter, useFuzzyMatching, highlightPostTag, highlightPreTag, minimumCoverage, searchFields, top, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Autocompletes incomplete query terms based on input text and matching terms in + /// the index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The incomplete term which should be auto-completed. + /// + /// The name of the suggester as specified in the suggesters collection that's part + /// of the index definition. + /// + /// + /// Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' + /// to get shingles and 'oneTermWithContext' to use the current context while + /// producing auto-completed terms. Allowed values: "oneTerm" | "twoTerms" | "oneTermWithContext" + /// + /// + /// An OData expression that filters the documents used to produce completed terms + /// for the Autocomplete result. + /// + /// + /// A value indicating whether to use fuzzy matching for the autocomplete query. + /// Default is false. When set to true, the query will find terms even if there's a + /// substituted or missing character in the search text. While this provides a + /// better experience in some scenarios, it comes at a performance cost as fuzzy + /// autocomplete queries are slower and consume more resources. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. If omitted, hit highlighting is disabled. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. If omitted, hit highlighting is disabled. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by an autocomplete query in order for the query to be reported as a + /// success. This parameter can be useful for ensuring search availability even for + /// services with only one replica. The default is 80. + /// + /// + /// The list of field names to consider when querying for auto-completed terms. + /// Target fields must be included in the specified suggester. + /// + /// + /// The number of auto-completed terms to retrieve. This must be a value between 1 + /// and 100. The default is 5. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response AutocompleteGet(string indexName, string searchText, string suggesterName, string autocompleteMode, string filter, bool? useFuzzyMatching, string highlightPostTag, string highlightPreTag, double? minimumCoverage, IEnumerable searchFields, int? top, RequestContext context) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(searchText, nameof(searchText)); + Argument.AssertNotNull(suggesterName, nameof(suggesterName)); + + using var scope = ClientDiagnostics.CreateScope("Documents.AutocompleteGet"); + scope.Start(); + try + { + using HttpMessage message = CreateAutocompleteGetRequest(indexName, searchText, suggesterName, autocompleteMode, filter, useFuzzyMatching, highlightPostTag, highlightPreTag, minimumCoverage, searchFields, top, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Autocompletes incomplete query terms based on input text and matching terms in + /// the index. + /// + /// The name of the index. + /// The definition of the Autocomplete request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> AutocompletePostAsync(string indexName, AutocompleteRequest autocompleteRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(autocompleteRequest, nameof(autocompleteRequest)); + + using RequestContent content = autocompleteRequest.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await AutocompletePostAsync(indexName, content, context).ConfigureAwait(false); + return Response.FromValue(AutocompleteResult.FromResponse(response), response); + } + + /// + /// Autocompletes incomplete query terms based on input text and matching terms in + /// the index. + /// + /// The name of the index. + /// The definition of the Autocomplete request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response AutocompletePost(string indexName, AutocompleteRequest autocompleteRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(autocompleteRequest, nameof(autocompleteRequest)); + + using RequestContent content = autocompleteRequest.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = AutocompletePost(indexName, content, context); + return Response.FromValue(AutocompleteResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Autocompletes incomplete query terms based on input text and matching terms in + /// the index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task AutocompletePostAsync(string indexName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Documents.AutocompletePost"); + scope.Start(); + try + { + using HttpMessage message = CreateAutocompletePostRequest(indexName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Autocompletes incomplete query terms based on input text and matching terms in + /// the index. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the index. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response AutocompletePost(string indexName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(indexName, nameof(indexName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Documents.AutocompletePost"); + scope.Start(); + try + { + using HttpMessage message = CreateAutocompletePostRequest(indexName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateCountRequest(string indexName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes('", false); + uri.AppendPath(indexName, true); + uri.AppendPath("')/docs/$count", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "text/plain"); + return message; + } + + internal HttpMessage CreateSearchGetRequest(string indexName, string searchText, bool? includeTotalResultCount, IEnumerable facets, string filter, IEnumerable highlightFields, string highlightPostTag, string highlightPreTag, double? minimumCoverage, IEnumerable orderBy, string queryType, IEnumerable scoringParameters, string scoringProfile, IEnumerable searchFields, string searchMode, string scoringStatistics, string sessionId, IEnumerable select, int? skip, int? top, string semanticConfiguration, string semanticErrorHandling, int? semanticMaxWaitInMilliseconds, string answers, string captions, string semanticQuery, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes('", false); + uri.AppendPath(indexName, true); + uri.AppendPath("')/docs", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (searchText != null) + { + uri.AppendQuery("search", searchText, true); + } + if (includeTotalResultCount != null) + { + uri.AppendQuery("$count", includeTotalResultCount.Value, true); + } + if (facets != null && !(facets is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined)) + { + foreach (var param in facets) + { + uri.AppendQuery("facet", param, true); + } + } + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (highlightFields != null && !(highlightFields is ChangeTrackingList changeTrackingList0 && changeTrackingList0.IsUndefined)) + { + uri.AppendQueryDelimited("highlight", highlightFields, ",", true); + } + if (highlightPostTag != null) + { + uri.AppendQuery("highlightPostTag", highlightPostTag, true); + } + if (highlightPreTag != null) + { + uri.AppendQuery("highlightPreTag", highlightPreTag, true); + } + if (minimumCoverage != null) + { + uri.AppendQuery("minimumCoverage", minimumCoverage.Value, true); + } + if (orderBy != null && !(orderBy is ChangeTrackingList changeTrackingList1 && changeTrackingList1.IsUndefined)) + { + uri.AppendQueryDelimited("$orderby", orderBy, ",", true); + } + if (queryType != null) + { + uri.AppendQuery("queryType", queryType, true); + } + if (scoringParameters != null && !(scoringParameters is ChangeTrackingList changeTrackingList2 && changeTrackingList2.IsUndefined)) + { + foreach (var param in scoringParameters) + { + uri.AppendQuery("scoringParameter", param, true); + } + } + if (scoringProfile != null) + { + uri.AppendQuery("scoringProfile", scoringProfile, true); + } + if (searchFields != null && !(searchFields is ChangeTrackingList changeTrackingList3 && changeTrackingList3.IsUndefined)) + { + uri.AppendQueryDelimited("searchFields", searchFields, ",", true); + } + if (searchMode != null) + { + uri.AppendQuery("searchMode", searchMode, true); + } + if (scoringStatistics != null) + { + uri.AppendQuery("scoringStatistics", scoringStatistics, true); + } + if (sessionId != null) + { + uri.AppendQuery("sessionId", sessionId, true); + } + if (select != null && !(select is ChangeTrackingList changeTrackingList4 && changeTrackingList4.IsUndefined)) + { + uri.AppendQueryDelimited("$select", select, ",", true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (semanticConfiguration != null) + { + uri.AppendQuery("semanticConfiguration", semanticConfiguration, true); + } + if (semanticErrorHandling != null) + { + uri.AppendQuery("semanticErrorHandling", semanticErrorHandling, true); + } + if (semanticMaxWaitInMilliseconds != null) + { + uri.AppendQuery("semanticMaxWaitInMilliseconds", semanticMaxWaitInMilliseconds.Value, true); + } + if (answers != null) + { + uri.AppendQuery("answers", answers, true); + } + if (captions != null) + { + uri.AppendQuery("captions", captions, true); + } + if (semanticQuery != null) + { + uri.AppendQuery("semanticQuery", semanticQuery, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateSearchPostRequest(string indexName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes('", false); + uri.AppendPath(indexName, true); + uri.AppendPath("')/docs/search.post.search", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetDocumentRequest(string indexName, string key, IEnumerable selectedFields, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes('", false); + uri.AppendPath(indexName, true); + uri.AppendPath("')/docs('", false); + uri.AppendPath(key, true); + uri.AppendPath("')", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (selectedFields != null && !(selectedFields is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined)) + { + uri.AppendQueryDelimited("$select", selectedFields, ",", true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateSuggestGetRequest(string indexName, string searchText, string suggesterName, string filter, bool? useFuzzyMatching, string highlightPostTag, string highlightPreTag, double? minimumCoverage, IEnumerable orderBy, IEnumerable searchFields, IEnumerable select, int? top, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes('", false); + uri.AppendPath(indexName, true); + uri.AppendPath("')/docs/search.suggest", false); + uri.AppendQuery("search", searchText, true); + uri.AppendQuery("suggesterName", suggesterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (useFuzzyMatching != null) + { + uri.AppendQuery("fuzzy", useFuzzyMatching.Value, true); + } + if (highlightPostTag != null) + { + uri.AppendQuery("highlightPostTag", highlightPostTag, true); + } + if (highlightPreTag != null) + { + uri.AppendQuery("highlightPreTag", highlightPreTag, true); + } + if (minimumCoverage != null) + { + uri.AppendQuery("minimumCoverage", minimumCoverage.Value, true); + } + if (orderBy != null && !(orderBy is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined)) + { + uri.AppendQueryDelimited("$orderby", orderBy, ",", true); + } + if (searchFields != null && !(searchFields is ChangeTrackingList changeTrackingList0 && changeTrackingList0.IsUndefined)) + { + uri.AppendQueryDelimited("searchFields", searchFields, ",", true); + } + if (select != null && !(select is ChangeTrackingList changeTrackingList1 && changeTrackingList1.IsUndefined)) + { + uri.AppendQueryDelimited("$select", select, ",", true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateSuggestPostRequest(string indexName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes('", false); + uri.AppendPath(indexName, true); + uri.AppendPath("')/docs/search.post.suggest", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateIndexRequest(string indexName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200207); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes('", false); + uri.AppendPath(indexName, true); + uri.AppendPath("')/docs/search.index", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateAutocompleteGetRequest(string indexName, string searchText, string suggesterName, string autocompleteMode, string filter, bool? useFuzzyMatching, string highlightPostTag, string highlightPreTag, double? minimumCoverage, IEnumerable searchFields, int? top, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes('", false); + uri.AppendPath(indexName, true); + uri.AppendPath("')/docs/search.autocomplete", false); + uri.AppendQuery("search", searchText, true); + uri.AppendQuery("suggesterName", suggesterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (autocompleteMode != null) + { + uri.AppendQuery("autocompleteMode", autocompleteMode, true); + } + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (useFuzzyMatching != null) + { + uri.AppendQuery("fuzzy", useFuzzyMatching.Value, true); + } + if (highlightPostTag != null) + { + uri.AppendQuery("highlightPostTag", highlightPostTag, true); + } + if (highlightPreTag != null) + { + uri.AppendQuery("highlightPreTag", highlightPreTag, true); + } + if (minimumCoverage != null) + { + uri.AppendQuery("minimumCoverage", minimumCoverage.Value, true); + } + if (searchFields != null && !(searchFields is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined)) + { + uri.AppendQueryDelimited("searchFields", searchFields, ",", true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateAutocompletePostRequest(string indexName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes('", false); + uri.AppendPath(indexName, true); + uri.AppendPath("')/docs/search.post.autocomplete", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier200207; + private static ResponseClassifier ResponseClassifier200207 => _responseClassifier200207 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 207 }); + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/FacetResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/FacetResult.Serialization.cs new file mode 100644 index 000000000000..a03c32cf4db4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/FacetResult.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class FacetResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FacetResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count.Value); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + FacetResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FacetResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFacetResult(document.RootElement, options); + } + + internal static FacetResult DeserializeFacetResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? count = default; + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new FacetResult(count, additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FacetResult)} does not support writing '{options.Format}' format."); + } + } + + FacetResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFacetResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FacetResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FacetResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFacetResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/FacetResult.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/FacetResult.cs new file mode 100644 index 000000000000..4fee123c2ba9 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/FacetResult.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + /// + /// A single bucket of a facet query result. Reports the number of documents with a + /// field value falling within a particular range or having a particular value or + /// interval. + /// + public partial class FacetResult + { + /// Initializes a new instance of . + internal FacetResult() + { + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// + /// The approximate count of documents falling within the bucket described by this + /// facet. + /// + /// Additional Properties. + internal FacetResult(long? count, IReadOnlyDictionary additionalProperties) + { + Count = count; + AdditionalProperties = additionalProperties; + } + + /// + /// The approximate count of documents falling within the bucket described by this + /// facet. + /// + public long? Count { get; } + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IReadOnlyDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexAction.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexAction.Serialization.cs new file mode 100644 index 000000000000..48c0c39204d0 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexAction.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class IndexAction : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IndexAction)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ActionType)) + { + writer.WritePropertyName("@search.action"u8); + writer.WriteStringValue(ActionType.Value.ToString()); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + IndexAction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IndexAction)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIndexAction(document.RootElement, options); + } + + internal static IndexAction DeserializeIndexAction(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IndexActionType? searchAction = default; + IDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@search.action"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + searchAction = new IndexActionType(property.Value.GetString()); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new IndexAction(searchAction, additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IndexAction)} does not support writing '{options.Format}' format."); + } + } + + IndexAction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIndexAction(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IndexAction)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static IndexAction FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIndexAction(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexAction.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexAction.cs new file mode 100644 index 000000000000..e852e19f0a9f --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexAction.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + /// Represents an index action that operates on a document. + public partial class IndexAction + { + /// Initializes a new instance of . + public IndexAction() + { + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The operation to perform on a document in an indexing batch. + /// Additional Properties. + internal IndexAction(IndexActionType? actionType, IDictionary additionalProperties) + { + ActionType = actionType; + AdditionalProperties = additionalProperties; + } + + /// The operation to perform on a document in an indexing batch. + public IndexActionType? ActionType { get; set; } + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexActionType.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexActionType.cs new file mode 100644 index 000000000000..63c33383f508 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexActionType.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Search +{ + /// The operation to perform on a document in an indexing batch. + public readonly partial struct IndexActionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IndexActionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UploadValue = "upload"; + private const string MergeValue = "merge"; + private const string MergeOrUploadValue = "mergeOrUpload"; + private const string DeleteValue = "delete"; + + /// + /// Inserts the document into the index if it is new and updates it if it exists. + /// All fields are replaced in the update case. + /// + public static IndexActionType Upload { get; } = new IndexActionType(UploadValue); + /// + /// Merges the specified field values with an existing document. If the document + /// does not exist, the merge will fail. Any field you specify in a merge will + /// replace the existing field in the document. This also applies to collections of + /// primitive and complex types. + /// + public static IndexActionType Merge { get; } = new IndexActionType(MergeValue); + /// + /// Behaves like merge if a document with the given key already exists in the + /// index. If the document does not exist, it behaves like upload with a new + /// document. + /// + public static IndexActionType MergeOrUpload { get; } = new IndexActionType(MergeOrUploadValue); + /// + /// Removes the specified document from the index. Any field you specify in a + /// delete operation other than the key field will be ignored. If you want to + /// remove an individual field from a document, use merge instead and set the field + /// explicitly to null. + /// + public static IndexActionType Delete { get; } = new IndexActionType(DeleteValue); + /// Determines if two values are the same. + public static bool operator ==(IndexActionType left, IndexActionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IndexActionType left, IndexActionType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IndexActionType(string value) => new IndexActionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IndexActionType other && Equals(other); + /// + public bool Equals(IndexActionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexBatch.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexBatch.Serialization.cs new file mode 100644 index 000000000000..3cb1af680dde --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexBatch.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class IndexBatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IndexBatch)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IndexBatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IndexBatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIndexBatch(document.RootElement, options); + } + + internal static IndexBatch DeserializeIndexBatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IndexAction.DeserializeIndexAction(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IndexBatch(value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IndexBatch)} does not support writing '{options.Format}' format."); + } + } + + IndexBatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIndexBatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IndexBatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static IndexBatch FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIndexBatch(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexBatch.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexBatch.cs new file mode 100644 index 000000000000..1113c0d401a0 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexBatch.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Search +{ + /// Contains a batch of document write actions to send to the index. + public partial class IndexBatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The actions in the batch. + /// is null. + public IndexBatch(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The actions in the batch. + /// Keeps track of any properties unknown to the library. + internal IndexBatch(IList value, IDictionary serializedAdditionalRawData) + { + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IndexBatch() + { + } + + /// The actions in the batch. + public IList Value { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexDocumentsResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexDocumentsResult.Serialization.cs new file mode 100644 index 000000000000..f3ddd549d47c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexDocumentsResult.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class IndexDocumentsResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IndexDocumentsResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IndexDocumentsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IndexDocumentsResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIndexDocumentsResult(document.RootElement, options); + } + + internal static IndexDocumentsResult DeserializeIndexDocumentsResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IndexingResult.DeserializeIndexingResult(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IndexDocumentsResult(value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IndexDocumentsResult)} does not support writing '{options.Format}' format."); + } + } + + IndexDocumentsResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIndexDocumentsResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IndexDocumentsResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static IndexDocumentsResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIndexDocumentsResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexDocumentsResult.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexDocumentsResult.cs new file mode 100644 index 000000000000..720e9bdaa242 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexDocumentsResult.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Search +{ + /// + /// Response containing the status of operations for all documents in the indexing + /// request. + /// + public partial class IndexDocumentsResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of status information for each document in the indexing request. + /// is null. + internal IndexDocumentsResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The list of status information for each document in the indexing request. + /// Keeps track of any properties unknown to the library. + internal IndexDocumentsResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IndexDocumentsResult() + { + } + + /// The list of status information for each document in the indexing request. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexingResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexingResult.Serialization.cs new file mode 100644 index 000000000000..79d74b6706ae --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexingResult.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class IndexingResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IndexingResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + if (Optional.IsDefined(ErrorMessage)) + { + writer.WritePropertyName("errorMessage"u8); + writer.WriteStringValue(ErrorMessage); + } + writer.WritePropertyName("status"u8); + writer.WriteBooleanValue(Status); + writer.WritePropertyName("statusCode"u8); + writer.WriteNumberValue(StatusCode); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IndexingResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IndexingResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIndexingResult(document.RootElement, options); + } + + internal static IndexingResult DeserializeIndexingResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + string errorMessage = default; + bool status = default; + int statusCode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("errorMessage"u8)) + { + errorMessage = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("statusCode"u8)) + { + statusCode = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IndexingResult(key, errorMessage, status, statusCode, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IndexingResult)} does not support writing '{options.Format}' format."); + } + } + + IndexingResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIndexingResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IndexingResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static IndexingResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIndexingResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexingResult.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexingResult.cs new file mode 100644 index 000000000000..b86cf643dbd1 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/IndexingResult.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + /// Status of an indexing operation for a single document. + public partial class IndexingResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The key of a document that was in the indexing request. + /// + /// A value indicating whether the indexing operation succeeded for the document + /// identified by the key. + /// + /// + /// The status code of the indexing operation. Possible values include: 200 for a + /// successful update or delete, 201 for successful document creation, 400 for a + /// malformed input document, 404 for document not found, 409 for a version + /// conflict, 422 when the index is temporarily unavailable, or 503 for when the + /// service is too busy. + /// + /// is null. + internal IndexingResult(string key, bool status, int statusCode) + { + Argument.AssertNotNull(key, nameof(key)); + + Key = key; + Status = status; + StatusCode = statusCode; + } + + /// Initializes a new instance of . + /// The key of a document that was in the indexing request. + /// + /// The error message explaining why the indexing operation failed for the document + /// identified by the key; null if indexing succeeded. + /// + /// + /// A value indicating whether the indexing operation succeeded for the document + /// identified by the key. + /// + /// + /// The status code of the indexing operation. Possible values include: 200 for a + /// successful update or delete, 201 for successful document creation, 400 for a + /// malformed input document, 404 for document not found, 409 for a version + /// conflict, 422 when the index is temporarily unavailable, or 503 for when the + /// service is too busy. + /// + /// Keeps track of any properties unknown to the library. + internal IndexingResult(string key, string errorMessage, bool status, int statusCode, IDictionary serializedAdditionalRawData) + { + Key = key; + ErrorMessage = errorMessage; + Status = status; + StatusCode = statusCode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IndexingResult() + { + } + + /// The key of a document that was in the indexing request. + public string Key { get; } + /// + /// The error message explaining why the indexing operation failed for the document + /// identified by the key; null if indexing succeeded. + /// + public string ErrorMessage { get; } + /// + /// A value indicating whether the indexing operation succeeded for the document + /// identified by the key. + /// + public bool Status { get; } + /// + /// The status code of the indexing operation. Possible values include: 200 for a + /// successful update or delete, 201 for successful document creation, 400 for a + /// malformed input document, 404 for document not found, 409 for a version + /// conflict, 422 when the index is temporarily unavailable, or 503 for when the + /// service is too busy. + /// + public int StatusCode { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/Argument.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..2966720d5ab3 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..1fc1838d3c67 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/ChangeTrackingList.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..57c7a54ec7bd --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Search +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..b920e0eeebbe --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,399 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + internal static class ModelSerializationExtensions + { + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/Optional.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..7e0b52668ab3 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Search.Documents.Search +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..bed7b1df0708 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/LookupDocument.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/LookupDocument.Serialization.cs new file mode 100644 index 000000000000..fe1d88195b8a --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/LookupDocument.Serialization.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class LookupDocument : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LookupDocument)} does not support writing '{format}' format."); + } + + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + LookupDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LookupDocument)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLookupDocument(document.RootElement, options); + } + + internal static LookupDocument DeserializeLookupDocument(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new LookupDocument(additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LookupDocument)} does not support writing '{options.Format}' format."); + } + } + + LookupDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLookupDocument(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LookupDocument)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static LookupDocument FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLookupDocument(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/LookupDocument.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/LookupDocument.cs new file mode 100644 index 000000000000..0370a7187fb9 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/LookupDocument.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + /// A document retrieved via a document lookup operation. + public partial class LookupDocument + { + /// Initializes a new instance of . + internal LookupDocument() + { + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Additional Properties. + internal LookupDocument(IReadOnlyDictionary additionalProperties) + { + AdditionalProperties = additionalProperties; + } + + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IReadOnlyDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryAnswerResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryAnswerResult.Serialization.cs new file mode 100644 index 000000000000..a7baf452e5f8 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryAnswerResult.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class QueryAnswerResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QueryAnswerResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Score)) + { + writer.WritePropertyName("score"u8); + writer.WriteNumberValue(Score.Value); + } + if (Optional.IsDefined(Key)) + { + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + } + if (Optional.IsDefined(Highlights)) + { + writer.WritePropertyName("highlights"u8); + writer.WriteStringValue(Highlights); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + QueryAnswerResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QueryAnswerResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeQueryAnswerResult(document.RootElement, options); + } + + internal static QueryAnswerResult DeserializeQueryAnswerResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double? score = default; + string key = default; + string text = default; + string highlights = default; + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("score"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + score = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("highlights"u8)) + { + highlights = property.Value.GetString(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new QueryAnswerResult(score, key, text, highlights, additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(QueryAnswerResult)} does not support writing '{options.Format}' format."); + } + } + + QueryAnswerResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeQueryAnswerResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(QueryAnswerResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static QueryAnswerResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeQueryAnswerResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryAnswerResult.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryAnswerResult.cs new file mode 100644 index 000000000000..e918b6ee78b7 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryAnswerResult.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + /// + /// An answer is a text passage extracted from the contents of the most relevant + /// documents that matched the query. Answers are extracted from the top search + /// results. Answer candidates are scored and the top answers are selected. + /// + public partial class QueryAnswerResult + { + /// Initializes a new instance of . + internal QueryAnswerResult() + { + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// + /// The score value represents how relevant the answer is to the query relative to + /// other answers returned for the query. + /// + /// The key of the document the answer was extracted from. + /// The text passage extracted from the document contents as the answer. + /// + /// Same text passage as in the Text property with highlighted text phrases most + /// relevant to the query. + /// + /// Additional Properties. + internal QueryAnswerResult(double? score, string key, string text, string highlights, IReadOnlyDictionary additionalProperties) + { + Score = score; + Key = key; + Text = text; + Highlights = highlights; + AdditionalProperties = additionalProperties; + } + + /// + /// The score value represents how relevant the answer is to the query relative to + /// other answers returned for the query. + /// + public double? Score { get; } + /// The key of the document the answer was extracted from. + public string Key { get; } + /// The text passage extracted from the document contents as the answer. + public string Text { get; } + /// + /// Same text passage as in the Text property with highlighted text phrases most + /// relevant to the query. + /// + public string Highlights { get; } + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IReadOnlyDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryAnswerType.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryAnswerType.cs new file mode 100644 index 000000000000..1630fa28c69b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryAnswerType.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Search +{ + /// + /// This parameter is only valid if the query type is `semantic`. If set, the query + /// returns answers extracted from key passages in the highest ranked documents. + /// The number of answers returned can be configured by appending the pipe + /// character `|` followed by the `count-` option after the + /// answers parameter value, such as `extractive|count-3`. Default count is 1. The + /// confidence threshold can be configured by appending the pipe character `|` + /// followed by the `threshold-` option after the answers + /// parameter value, such as `extractive|threshold-0.9`. Default threshold is 0.7. + /// + public readonly partial struct QueryAnswerType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public QueryAnswerType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "none"; + private const string ExtractiveValue = "extractive"; + + /// Do not return answers for the query. + public static QueryAnswerType None { get; } = new QueryAnswerType(NoneValue); + /// + /// Extracts answer candidates from the contents of the documents returned in + /// response to a query expressed as a question in natural language. + /// + public static QueryAnswerType Extractive { get; } = new QueryAnswerType(ExtractiveValue); + /// Determines if two values are the same. + public static bool operator ==(QueryAnswerType left, QueryAnswerType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(QueryAnswerType left, QueryAnswerType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator QueryAnswerType(string value) => new QueryAnswerType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is QueryAnswerType other && Equals(other); + /// + public bool Equals(QueryAnswerType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryCaptionResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryCaptionResult.Serialization.cs new file mode 100644 index 000000000000..0eb4140a498c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryCaptionResult.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class QueryCaptionResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QueryCaptionResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + } + if (Optional.IsDefined(Highlights)) + { + writer.WritePropertyName("highlights"u8); + writer.WriteStringValue(Highlights); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + QueryCaptionResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QueryCaptionResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeQueryCaptionResult(document.RootElement, options); + } + + internal static QueryCaptionResult DeserializeQueryCaptionResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string text = default; + string highlights = default; + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("highlights"u8)) + { + highlights = property.Value.GetString(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new QueryCaptionResult(text, highlights, additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(QueryCaptionResult)} does not support writing '{options.Format}' format."); + } + } + + QueryCaptionResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeQueryCaptionResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(QueryCaptionResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static QueryCaptionResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeQueryCaptionResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryCaptionResult.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryCaptionResult.cs new file mode 100644 index 000000000000..ed17c34dbb36 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryCaptionResult.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + /// + /// Captions are the most representative passages from the document relatively to + /// the search query. They are often used as document summary. Captions are only + /// returned for queries of type `semantic`. + /// + public partial class QueryCaptionResult + { + /// Initializes a new instance of . + internal QueryCaptionResult() + { + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// + /// A representative text passage extracted from the document most relevant to the + /// search query. + /// + /// + /// Same text passage as in the Text property with highlighted phrases most + /// relevant to the query. + /// + /// Additional Properties. + internal QueryCaptionResult(string text, string highlights, IReadOnlyDictionary additionalProperties) + { + Text = text; + Highlights = highlights; + AdditionalProperties = additionalProperties; + } + + /// + /// A representative text passage extracted from the document most relevant to the + /// search query. + /// + public string Text { get; } + /// + /// Same text passage as in the Text property with highlighted phrases most + /// relevant to the query. + /// + public string Highlights { get; } + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IReadOnlyDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryCaptionType.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryCaptionType.cs new file mode 100644 index 000000000000..142083f68490 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryCaptionType.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Search +{ + /// + /// This parameter is only valid if the query type is `semantic`. If set, the query + /// returns captions extracted from key passages in the highest ranked documents. + /// When Captions is set to `extractive`, highlighting is enabled by default, and + /// can be configured by appending the pipe character `|` followed by the + /// `highlight-` option, such as `extractive|highlight-true`. Defaults + /// to `None`. + /// + public readonly partial struct QueryCaptionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public QueryCaptionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "none"; + private const string ExtractiveValue = "extractive"; + + /// Do not return captions for the query. + public static QueryCaptionType None { get; } = new QueryCaptionType(NoneValue); + /// + /// Extracts captions from the matching documents that contain passages relevant to + /// the search query. + /// + public static QueryCaptionType Extractive { get; } = new QueryCaptionType(ExtractiveValue); + /// Determines if two values are the same. + public static bool operator ==(QueryCaptionType left, QueryCaptionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(QueryCaptionType left, QueryCaptionType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator QueryCaptionType(string value) => new QueryCaptionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is QueryCaptionType other && Equals(other); + /// + public bool Equals(QueryCaptionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryType.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryType.cs new file mode 100644 index 000000000000..c52309b1003e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/QueryType.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Search +{ + /// + /// Specifies the syntax of the search query. The default is 'simple'. Use 'full' + /// if your query uses the Lucene query syntax. + /// + public readonly partial struct QueryType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public QueryType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SimpleValue = "simple"; + private const string FullValue = "full"; + private const string SemanticValue = "semantic"; + + /// + /// Uses the simple query syntax for searches. Search text is interpreted using a + /// simple query language that allows for symbols such as +, * and "". Queries are + /// evaluated across all searchable fields by default, unless the searchFields + /// parameter is specified. + /// + public static QueryType Simple { get; } = new QueryType(SimpleValue); + /// + /// Uses the full Lucene query syntax for searches. Search text is interpreted + /// using the Lucene query language which allows field-specific and weighted + /// searches, as well as other advanced features. + /// + public static QueryType Full { get; } = new QueryType(FullValue); + /// + /// Best suited for queries expressed in natural language as opposed to keywords. + /// Improves precision of search results by re-ranking the top search results using + /// a ranking model trained on the Web corpus. + /// + public static QueryType Semantic { get; } = new QueryType(SemanticValue); + /// Determines if two values are the same. + public static bool operator ==(QueryType left, QueryType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(QueryType left, QueryType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator QueryType(string value) => new QueryType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is QueryType other && Equals(other); + /// + public bool Equals(QueryType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/ScoringStatistics.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/ScoringStatistics.cs new file mode 100644 index 000000000000..92dfcc334e6a --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/ScoringStatistics.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Search +{ + /// + /// A value that specifies whether we want to calculate scoring statistics (such as + /// document frequency) globally for more consistent scoring, or locally, for lower + /// latency. The default is 'local'. Use 'global' to aggregate scoring statistics + /// globally before scoring. Using global scoring statistics can increase latency + /// of search queries. + /// + public readonly partial struct ScoringStatistics : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ScoringStatistics(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LocalValue = "local"; + private const string GlobalValue = "global"; + + /// The scoring statistics will be calculated locally for lower latency. + public static ScoringStatistics Local { get; } = new ScoringStatistics(LocalValue); + /// The scoring statistics will be calculated globally for more consistent scoring. + public static ScoringStatistics Global { get; } = new ScoringStatistics(GlobalValue); + /// Determines if two values are the same. + public static bool operator ==(ScoringStatistics left, ScoringStatistics right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ScoringStatistics left, ScoringStatistics right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ScoringStatistics(string value) => new ScoringStatistics(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ScoringStatistics other && Equals(other); + /// + public bool Equals(ScoringStatistics other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchClient.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchClient.cs new file mode 100644 index 000000000000..ff05c62cf4dc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchClient.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Search.Documents.Search +{ + // Data plane generated client. + /// Client that can be used to query an index and upload, merge, or delete documents. + public partial class SearchClient + { + private const string AuthorizationHeader = "api-key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://search.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of SearchClient for mocking. + protected SearchClient() + { + } + + /// Initializes a new instance of SearchClient. + /// Service host. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public SearchClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new SearchClientOptions()) + { + } + + /// Initializes a new instance of SearchClient. + /// Service host. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public SearchClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new SearchClientOptions()) + { + } + + /// Initializes a new instance of SearchClient. + /// Service host. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public SearchClient(Uri endpoint, AzureKeyCredential credential, SearchClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new SearchClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); + _endpoint = endpoint; + } + + /// Initializes a new instance of SearchClient. + /// Service host. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public SearchClient(Uri endpoint, TokenCredential credential, SearchClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new SearchClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + } + + /// Initializes a new instance of Documents. + /// The API version to use for this operation. + /// is null. + public virtual Documents GetDocumentsClient(string apiVersion = "2024-07-01") + { + Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new Documents(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchClientOptions.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchClientOptions.cs new file mode 100644 index 000000000000..24b260520780 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + /// Client options for SearchClient. + public partial class SearchClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2024_07_01; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2024-07-01". + V2024_07_01 = 1, + } + + internal string Version { get; } + + /// Initializes new instance of SearchClientOptions. + public SearchClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2024_07_01 => "2024-07-01", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchDocumentsResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchDocumentsResult.Serialization.cs new file mode 100644 index 000000000000..a2e6a297b421 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchDocumentsResult.Serialization.cs @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class SearchDocumentsResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchDocumentsResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Count)) + { + writer.WritePropertyName("@odata.count"u8); + writer.WriteNumberValue(Count.Value); + } + if (Optional.IsDefined(Coverage)) + { + writer.WritePropertyName("@search.coverage"u8); + writer.WriteNumberValue(Coverage.Value); + } + if (Optional.IsCollectionDefined(Facets)) + { + writer.WritePropertyName("@search.facets"u8); + writer.WriteStartObject(); + foreach (var item in Facets) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStartArray(); + foreach (var item0 in item.Value) + { + writer.WriteObjectValue(item0, options); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(Answers)) + { + writer.WritePropertyName("@search.answers"u8); + writer.WriteStartArray(); + foreach (var item in Answers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextPageParameters)) + { + writer.WritePropertyName("@search.nextPageParameters"u8); + writer.WriteObjectValue(NextPageParameters, options); + } + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("@odata.nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsDefined(SemanticPartialResponseReason)) + { + writer.WritePropertyName("@search.semanticPartialResponseReason"u8); + writer.WriteStringValue(SemanticPartialResponseReason.Value.ToString()); + } + if (Optional.IsDefined(SemanticPartialResponseType)) + { + writer.WritePropertyName("@search.semanticPartialResponseType"u8); + writer.WriteStringValue(SemanticPartialResponseType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchDocumentsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchDocumentsResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchDocumentsResult(document.RootElement, options); + } + + internal static SearchDocumentsResult DeserializeSearchDocumentsResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? odataCount = default; + double? searchCoverage = default; + IReadOnlyDictionary> searchFacets = default; + IReadOnlyList searchAnswers = default; + SearchRequest searchNextPageParameters = default; + IReadOnlyList value = default; + string odataNextLink = default; + SemanticErrorReason? searchSemanticPartialResponseReason = default; + SemanticSearchResultsType? searchSemanticPartialResponseType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@odata.count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + odataCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("@search.coverage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + searchCoverage = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("@search.facets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary> dictionary = new Dictionary>(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(FacetResult.DeserializeFacetResult(item, options)); + } + dictionary.Add(property0.Name, array); + } + } + searchFacets = dictionary; + continue; + } + if (property.NameEquals("@search.answers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(QueryAnswerResult.DeserializeQueryAnswerResult(item, options)); + } + searchAnswers = array; + continue; + } + if (property.NameEquals("@search.nextPageParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + searchNextPageParameters = SearchRequest.DeserializeSearchRequest(property.Value, options); + continue; + } + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SearchResult.DeserializeSearchResult(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("@odata.nextLink"u8)) + { + odataNextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("@search.semanticPartialResponseReason"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + searchSemanticPartialResponseReason = new SemanticErrorReason(property.Value.GetString()); + continue; + } + if (property.NameEquals("@search.semanticPartialResponseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + searchSemanticPartialResponseType = new SemanticSearchResultsType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchDocumentsResult( + odataCount, + searchCoverage, + searchFacets ?? new ChangeTrackingDictionary>(), + searchAnswers ?? new ChangeTrackingList(), + searchNextPageParameters, + value, + odataNextLink, + searchSemanticPartialResponseReason, + searchSemanticPartialResponseType, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchDocumentsResult)} does not support writing '{options.Format}' format."); + } + } + + SearchDocumentsResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchDocumentsResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchDocumentsResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchDocumentsResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchDocumentsResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchDocumentsResult.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchDocumentsResult.cs new file mode 100644 index 000000000000..46518f371fb5 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchDocumentsResult.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Search +{ + /// Response containing search results from an index. + public partial class SearchDocumentsResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The sequence of results returned by the query. + /// is null. + internal SearchDocumentsResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Facets = new ChangeTrackingDictionary>(); + Answers = new ChangeTrackingList(); + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// + /// The total count of results found by the search operation, or null if the count + /// was not requested. If present, the count may be greater than the number of + /// results in this response. This can happen if you use the $top or $skip + /// parameters, or if the query can't return all the requested documents in a + /// single response. + /// + /// + /// A value indicating the percentage of the index that was included in the query, + /// or null if minimumCoverage was not specified in the request. + /// + /// + /// The facet query results for the search operation, organized as a collection of + /// buckets for each faceted field; null if the query did not include any facet + /// expressions. + /// + /// + /// The answers query results for the search operation; null if the answers query + /// parameter was not specified or set to 'none'. + /// + /// + /// Continuation JSON payload returned when the query can't return all the + /// requested results in a single response. You can use this JSON along with + /// + /// The sequence of results returned by the query. + /// + /// Continuation URL returned when the query can't return all the requested results + /// in a single response. You can use this URL to formulate another GET or POST + /// Search request to get the next part of the search response. Make sure to use + /// the same verb (GET or POST) as the request that produced this response. + /// + /// Reason that a partial response was returned for a semantic ranking request. + /// Type of partial response that was returned for a semantic ranking request. + /// Keeps track of any properties unknown to the library. + internal SearchDocumentsResult(long? count, double? coverage, IReadOnlyDictionary> facets, IReadOnlyList answers, SearchRequest nextPageParameters, IReadOnlyList value, string nextLink, SemanticErrorReason? semanticPartialResponseReason, SemanticSearchResultsType? semanticPartialResponseType, IDictionary serializedAdditionalRawData) + { + Count = count; + Coverage = coverage; + Facets = facets; + Answers = answers; + NextPageParameters = nextPageParameters; + Value = value; + NextLink = nextLink; + SemanticPartialResponseReason = semanticPartialResponseReason; + SemanticPartialResponseType = semanticPartialResponseType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SearchDocumentsResult() + { + } + + /// + /// The total count of results found by the search operation, or null if the count + /// was not requested. If present, the count may be greater than the number of + /// results in this response. This can happen if you use the $top or $skip + /// parameters, or if the query can't return all the requested documents in a + /// single response. + /// + public long? Count { get; } + /// + /// A value indicating the percentage of the index that was included in the query, + /// or null if minimumCoverage was not specified in the request. + /// + public double? Coverage { get; } + /// + /// The facet query results for the search operation, organized as a collection of + /// buckets for each faceted field; null if the query did not include any facet + /// expressions. + /// + public IReadOnlyDictionary> Facets { get; } + /// + /// The answers query results for the search operation; null if the answers query + /// parameter was not specified or set to 'none'. + /// + public IReadOnlyList Answers { get; } + /// + /// Continuation JSON payload returned when the query can't return all the + /// requested results in a single response. You can use this JSON along with + /// + public SearchRequest NextPageParameters { get; } + /// The sequence of results returned by the query. + public IReadOnlyList Value { get; } + /// + /// Continuation URL returned when the query can't return all the requested results + /// in a single response. You can use this URL to formulate another GET or POST + /// Search request to get the next part of the search response. Make sure to use + /// the same verb (GET or POST) as the request that produced this response. + /// + public string NextLink { get; } + /// Reason that a partial response was returned for a semantic ranking request. + public SemanticErrorReason? SemanticPartialResponseReason { get; } + /// Type of partial response that was returned for a semantic ranking request. + public SemanticSearchResultsType? SemanticPartialResponseType { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchDocumentsSearchClientBuilderExtensions.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchDocumentsSearchClientBuilderExtensions.cs new file mode 100644 index 000000000000..5baed71f5518 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchDocumentsSearchClientBuilderExtensions.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core.Extensions; +using Azure.Search.Documents.Search; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class SearchDocumentsSearchClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// Service host. + /// A credential used to authenticate to an Azure Service. + public static IAzureClientBuilder AddSearchClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new SearchClient(endpoint, credential, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// Service host. + public static IAzureClientBuilder AddSearchClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new SearchClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddSearchClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchDocumentsSearchModelFactory.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchDocumentsSearchModelFactory.cs new file mode 100644 index 000000000000..75ea19ae3503 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchDocumentsSearchModelFactory.cs @@ -0,0 +1,378 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Search +{ + /// Model factory for models. + public static partial class SearchDocumentsSearchModelFactory + { + /// Initializes a new instance of . + /// + /// The total count of results found by the search operation, or null if the count + /// was not requested. If present, the count may be greater than the number of + /// results in this response. This can happen if you use the $top or $skip + /// parameters, or if the query can't return all the requested documents in a + /// single response. + /// + /// + /// A value indicating the percentage of the index that was included in the query, + /// or null if minimumCoverage was not specified in the request. + /// + /// + /// The facet query results for the search operation, organized as a collection of + /// buckets for each faceted field; null if the query did not include any facet + /// expressions. + /// + /// + /// The answers query results for the search operation; null if the answers query + /// parameter was not specified or set to 'none'. + /// + /// + /// Continuation JSON payload returned when the query can't return all the + /// requested results in a single response. You can use this JSON along with + /// + /// The sequence of results returned by the query. + /// + /// Continuation URL returned when the query can't return all the requested results + /// in a single response. You can use this URL to formulate another GET or POST + /// Search request to get the next part of the search response. Make sure to use + /// the same verb (GET or POST) as the request that produced this response. + /// + /// Reason that a partial response was returned for a semantic ranking request. + /// Type of partial response that was returned for a semantic ranking request. + /// A new instance for mocking. + public static SearchDocumentsResult SearchDocumentsResult(long? count = null, double? coverage = null, IReadOnlyDictionary> facets = null, IEnumerable answers = null, SearchRequest nextPageParameters = null, IEnumerable value = null, string nextLink = null, SemanticErrorReason? semanticPartialResponseReason = null, SemanticSearchResultsType? semanticPartialResponseType = null) + { + facets ??= new Dictionary>(); + answers ??= new List(); + value ??= new List(); + + return new SearchDocumentsResult( + count, + coverage, + facets, + answers?.ToList(), + nextPageParameters, + value?.ToList(), + nextLink, + semanticPartialResponseReason, + semanticPartialResponseType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// The approximate count of documents falling within the bucket described by this + /// facet. + /// + /// Additional Properties. + /// A new instance for mocking. + public static FacetResult FacetResult(long? count = null, IReadOnlyDictionary additionalProperties = null) + { + additionalProperties ??= new Dictionary(); + + return new FacetResult(count, additionalProperties); + } + + /// Initializes a new instance of . + /// + /// The score value represents how relevant the answer is to the query relative to + /// other answers returned for the query. + /// + /// The key of the document the answer was extracted from. + /// The text passage extracted from the document contents as the answer. + /// + /// Same text passage as in the Text property with highlighted text phrases most + /// relevant to the query. + /// + /// Additional Properties. + /// A new instance for mocking. + public static QueryAnswerResult QueryAnswerResult(double? score = null, string key = null, string text = null, string highlights = null, IReadOnlyDictionary additionalProperties = null) + { + additionalProperties ??= new Dictionary(); + + return new QueryAnswerResult(score, key, text, highlights, additionalProperties); + } + + /// Initializes a new instance of . + /// + /// The relevance score of the document compared to other documents returned by the + /// query. + /// + /// + /// The relevance score computed by the semantic ranker for the top search results. + /// Search results are sorted by the RerankerScore first and then by the Score. + /// RerankerScore is only returned for queries of type 'semantic'. + /// + /// + /// Text fragments from the document that indicate the matching search terms, + /// organized by each applicable field; null if hit highlighting was not enabled + /// for the query. + /// + /// + /// Captions are the most representative passages from the document relatively to + /// the search query. They are often used as document summary. Captions are only + /// returned for queries of type 'semantic'. + /// + /// Additional Properties. + /// A new instance for mocking. + public static SearchResult SearchResult(double score = default, double? rerankerScore = null, IReadOnlyDictionary> highlights = null, IEnumerable captions = null, IReadOnlyDictionary additionalProperties = null) + { + highlights ??= new Dictionary>(); + captions ??= new List(); + additionalProperties ??= new Dictionary(); + + return new SearchResult(score, rerankerScore, highlights, captions?.ToList(), additionalProperties); + } + + /// Initializes a new instance of . + /// + /// A representative text passage extracted from the document most relevant to the + /// search query. + /// + /// + /// Same text passage as in the Text property with highlighted phrases most + /// relevant to the query. + /// + /// Additional Properties. + /// A new instance for mocking. + public static QueryCaptionResult QueryCaptionResult(string text = null, string highlights = null, IReadOnlyDictionary additionalProperties = null) + { + additionalProperties ??= new Dictionary(); + + return new QueryCaptionResult(text, highlights, additionalProperties); + } + + /// Initializes a new instance of . + /// Additional Properties. + /// A new instance for mocking. + public static LookupDocument LookupDocument(IReadOnlyDictionary additionalProperties = null) + { + additionalProperties ??= new Dictionary(); + + return new LookupDocument(additionalProperties); + } + + /// Initializes a new instance of . + /// The sequence of results returned by the query. + /// + /// A value indicating the percentage of the index that was included in the query, + /// or null if minimumCoverage was not set in the request. + /// + /// A new instance for mocking. + public static SuggestDocumentsResult SuggestDocumentsResult(IEnumerable value = null, double? coverage = null) + { + value ??= new List(); + + return new SuggestDocumentsResult(value?.ToList(), coverage, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The text of the suggestion result. + /// Additional Properties. + /// A new instance for mocking. + public static SuggestResult SuggestResult(string text = null, IReadOnlyDictionary additionalProperties = null) + { + additionalProperties ??= new Dictionary(); + + return new SuggestResult(text, additionalProperties); + } + + /// Initializes a new instance of . + /// An OData expression that filters the documents considered for suggestions. + /// + /// A value indicating whether to use fuzzy matching for the suggestion query. + /// Default is false. When set to true, the query will find suggestions even if + /// there's a substituted or missing character in the search text. While this + /// provides a better experience in some scenarios, it comes at a performance cost + /// as fuzzy suggestion searches are slower and consume more resources. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. If omitted, hit highlighting of suggestions is disabled. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. If omitted, hit highlighting of suggestions is disabled. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by a suggestion query in order for the query to be reported as a + /// success. This parameter can be useful for ensuring search availability even for + /// services with only one replica. The default is 80. + /// + /// + /// The comma-separated list of OData $orderby expressions by which to sort the + /// results. Each expression can be either a field name or a call to either the + /// geo.distance() or the search.score() functions. Each expression can be followed + /// by asc to indicate ascending, or desc to indicate descending. The default is + /// ascending order. Ties will be broken by the match scores of documents. If no + /// $orderby is specified, the default sort order is descending by document match + /// score. There can be at most 32 $orderby clauses. + /// + /// + /// The search text to use to suggest documents. Must be at least 1 character, and + /// no more than 100 characters. + /// + /// + /// The comma-separated list of field names to search for the specified search + /// text. Target fields must be included in the specified suggester. + /// + /// + /// The comma-separated list of fields to retrieve. If unspecified, only the key + /// field will be included in the results. + /// + /// + /// The name of the suggester as specified in the suggesters collection that's part + /// of the index definition. + /// + /// + /// The number of suggestions to retrieve. This must be a value between 1 and 100. + /// The default is 5. + /// + /// A new instance for mocking. + public static SuggestRequest SuggestRequest(string filter = null, bool? fuzzy = null, string highlightPostTag = null, string highlightPreTag = null, double? minimumCoverage = null, string orderby = null, string search = null, string searchFields = null, string select = null, string suggesterName = null, int? top = null) + { + return new SuggestRequest( + filter, + fuzzy, + highlightPostTag, + highlightPreTag, + minimumCoverage, + orderby, + search, + searchFields, + select, + suggesterName, + top, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The list of status information for each document in the indexing request. + /// A new instance for mocking. + public static IndexDocumentsResult IndexDocumentsResult(IEnumerable value = null) + { + value ??= new List(); + + return new IndexDocumentsResult(value?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The key of a document that was in the indexing request. + /// + /// The error message explaining why the indexing operation failed for the document + /// identified by the key; null if indexing succeeded. + /// + /// + /// A value indicating whether the indexing operation succeeded for the document + /// identified by the key. + /// + /// + /// The status code of the indexing operation. Possible values include: 200 for a + /// successful update or delete, 201 for successful document creation, 400 for a + /// malformed input document, 404 for document not found, 409 for a version + /// conflict, 422 when the index is temporarily unavailable, or 503 for when the + /// service is too busy. + /// + /// A new instance for mocking. + public static IndexingResult IndexingResult(string key = null, string errorMessage = null, bool status = default, int statusCode = default) + { + return new IndexingResult(key, errorMessage, status, statusCode, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// A value indicating the percentage of the index that was considered by the + /// autocomplete request, or null if minimumCoverage was not specified in the + /// request. + /// + /// The list of returned Autocompleted items. + /// A new instance for mocking. + public static AutocompleteResult AutocompleteResult(double? coverage = null, IEnumerable value = null) + { + value ??= new List(); + + return new AutocompleteResult(coverage, value?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The completed term. + /// The query along with the completed term. + /// A new instance for mocking. + public static AutocompleteItem AutocompleteItem(string text = null, string queryPlusText = null) + { + return new AutocompleteItem(text, queryPlusText, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The search text on which to base autocomplete results. + /// + /// Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' + /// to get shingles and 'oneTermWithContext' to use the current context while + /// producing auto-completed terms. + /// + /// + /// An OData expression that filters the documents used to produce completed terms + /// for the Autocomplete result. + /// + /// + /// A value indicating whether to use fuzzy matching for the autocomplete query. + /// Default is false. When set to true, the query will autocomplete terms even if + /// there's a substituted or missing character in the search text. While this + /// provides a better experience in some scenarios, it comes at a performance cost + /// as fuzzy autocomplete queries are slower and consume more resources. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. If omitted, hit highlighting is disabled. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. If omitted, hit highlighting is disabled. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by an autocomplete query in order for the query to be reported as a + /// success. This parameter can be useful for ensuring search availability even for + /// services with only one replica. The default is 80. + /// + /// + /// The comma-separated list of field names to consider when querying for + /// auto-completed terms. Target fields must be included in the specified + /// suggester. + /// + /// + /// The name of the suggester as specified in the suggesters collection that's part + /// of the index definition. + /// + /// + /// The number of auto-completed terms to retrieve. This must be a value between 1 + /// and 100. The default is 5. + /// + /// A new instance for mocking. + public static AutocompleteRequest AutocompleteRequest(string search = null, AutocompleteMode? autocompleteMode = null, string filter = null, bool? fuzzy = null, string highlightPostTag = null, string highlightPreTag = null, double? minimumCoverage = null, string searchFields = null, string suggesterName = null, int? top = null) + { + return new AutocompleteRequest( + search, + autocompleteMode, + filter, + fuzzy, + highlightPostTag, + highlightPreTag, + minimumCoverage, + searchFields, + suggesterName, + top, + serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchMode.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchMode.cs new file mode 100644 index 000000000000..48478047f056 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchMode.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Search +{ + /// + /// Specifies whether any or all of the search terms must be matched in order to + /// count the document as a match. + /// + public readonly partial struct SearchMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SearchMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AnyValue = "any"; + private const string AllValue = "all"; + + /// + /// Any of the search terms must be matched in order to count the document as a + /// match. + /// + public static SearchMode Any { get; } = new SearchMode(AnyValue); + /// + /// All of the search terms must be matched in order to count the document as a + /// match. + /// + public static SearchMode All { get; } = new SearchMode(AllValue); + /// Determines if two values are the same. + public static bool operator ==(SearchMode left, SearchMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SearchMode left, SearchMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SearchMode(string value) => new SearchMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SearchMode other && Equals(other); + /// + public bool Equals(SearchMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchRequest.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchRequest.Serialization.cs new file mode 100644 index 000000000000..cc775882ea02 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchRequest.Serialization.cs @@ -0,0 +1,549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class SearchRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchRequest)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"u8); + writer.WriteBooleanValue(Count.Value); + } + if (Optional.IsCollectionDefined(Facets)) + { + writer.WritePropertyName("facets"u8); + writer.WriteStartArray(); + foreach (var item in Facets) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Filter)) + { + writer.WritePropertyName("filter"u8); + writer.WriteStringValue(Filter); + } + if (Optional.IsDefined(Highlight)) + { + writer.WritePropertyName("highlight"u8); + writer.WriteStringValue(Highlight); + } + if (Optional.IsDefined(HighlightPostTag)) + { + writer.WritePropertyName("highlightPostTag"u8); + writer.WriteStringValue(HighlightPostTag); + } + if (Optional.IsDefined(HighlightPreTag)) + { + writer.WritePropertyName("highlightPreTag"u8); + writer.WriteStringValue(HighlightPreTag); + } + if (Optional.IsDefined(MinimumCoverage)) + { + writer.WritePropertyName("minimumCoverage"u8); + writer.WriteNumberValue(MinimumCoverage.Value); + } + if (Optional.IsDefined(Orderby)) + { + writer.WritePropertyName("orderby"u8); + writer.WriteStringValue(Orderby); + } + if (Optional.IsDefined(QueryType)) + { + writer.WritePropertyName("queryType"u8); + writer.WriteStringValue(QueryType.Value.ToString()); + } + if (Optional.IsDefined(ScoringStatistics)) + { + writer.WritePropertyName("scoringStatistics"u8); + writer.WriteStringValue(ScoringStatistics.Value.ToString()); + } + if (Optional.IsDefined(SessionId)) + { + writer.WritePropertyName("sessionId"u8); + writer.WriteStringValue(SessionId); + } + if (Optional.IsCollectionDefined(ScoringParameters)) + { + writer.WritePropertyName("scoringParameters"u8); + writer.WriteStartArray(); + foreach (var item in ScoringParameters) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ScoringProfile)) + { + writer.WritePropertyName("scoringProfile"u8); + writer.WriteStringValue(ScoringProfile); + } + if (Optional.IsDefined(Search)) + { + writer.WritePropertyName("search"u8); + writer.WriteStringValue(Search); + } + if (Optional.IsDefined(SearchFields)) + { + writer.WritePropertyName("searchFields"u8); + writer.WriteStringValue(SearchFields); + } + if (Optional.IsDefined(SearchMode)) + { + writer.WritePropertyName("searchMode"u8); + writer.WriteStringValue(SearchMode.Value.ToString()); + } + if (Optional.IsDefined(Select)) + { + writer.WritePropertyName("select"u8); + writer.WriteStringValue(Select); + } + if (Optional.IsDefined(Skip)) + { + writer.WritePropertyName("skip"u8); + writer.WriteNumberValue(Skip.Value); + } + if (Optional.IsDefined(Top)) + { + writer.WritePropertyName("top"u8); + writer.WriteNumberValue(Top.Value); + } + if (Optional.IsDefined(SemanticConfiguration)) + { + writer.WritePropertyName("semanticConfiguration"u8); + writer.WriteStringValue(SemanticConfiguration); + } + if (Optional.IsDefined(SemanticErrorHandling)) + { + writer.WritePropertyName("semanticErrorHandling"u8); + writer.WriteStringValue(SemanticErrorHandling.Value.ToString()); + } + if (Optional.IsDefined(SemanticMaxWaitInMilliseconds)) + { + writer.WritePropertyName("semanticMaxWaitInMilliseconds"u8); + writer.WriteNumberValue(SemanticMaxWaitInMilliseconds.Value); + } + if (Optional.IsDefined(SemanticQuery)) + { + writer.WritePropertyName("semanticQuery"u8); + writer.WriteStringValue(SemanticQuery); + } + if (Optional.IsDefined(Answers)) + { + writer.WritePropertyName("answers"u8); + writer.WriteStringValue(Answers.Value.ToString()); + } + if (Optional.IsDefined(Captions)) + { + writer.WritePropertyName("captions"u8); + writer.WriteStringValue(Captions.Value.ToString()); + } + if (Optional.IsCollectionDefined(VectorQueries)) + { + writer.WritePropertyName("vectorQueries"u8); + writer.WriteStartArray(); + foreach (var item in VectorQueries) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(VectorFilterMode)) + { + writer.WritePropertyName("vectorFilterMode"u8); + writer.WriteStringValue(VectorFilterMode.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SearchRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchRequest(document.RootElement, options); + } + + internal static SearchRequest DeserializeSearchRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? count = default; + IList facets = default; + string filter = default; + string highlight = default; + string highlightPostTag = default; + string highlightPreTag = default; + double? minimumCoverage = default; + string orderby = default; + QueryType? queryType = default; + ScoringStatistics? scoringStatistics = default; + string sessionId = default; + IList scoringParameters = default; + string scoringProfile = default; + string search = default; + string searchFields = default; + SearchMode? searchMode = default; + string select = default; + int? skip = default; + int? top = default; + string semanticConfiguration = default; + SemanticErrorMode? semanticErrorHandling = default; + int? semanticMaxWaitInMilliseconds = default; + string semanticQuery = default; + QueryAnswerType? answers = default; + QueryCaptionType? captions = default; + IList vectorQueries = default; + VectorFilterMode? vectorFilterMode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("facets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + facets = array; + continue; + } + if (property.NameEquals("filter"u8)) + { + filter = property.Value.GetString(); + continue; + } + if (property.NameEquals("highlight"u8)) + { + highlight = property.Value.GetString(); + continue; + } + if (property.NameEquals("highlightPostTag"u8)) + { + highlightPostTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("highlightPreTag"u8)) + { + highlightPreTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("minimumCoverage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minimumCoverage = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("orderby"u8)) + { + orderby = property.Value.GetString(); + continue; + } + if (property.NameEquals("queryType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + queryType = new QueryType(property.Value.GetString()); + continue; + } + if (property.NameEquals("scoringStatistics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scoringStatistics = new ScoringStatistics(property.Value.GetString()); + continue; + } + if (property.NameEquals("sessionId"u8)) + { + sessionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("scoringParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + scoringParameters = array; + continue; + } + if (property.NameEquals("scoringProfile"u8)) + { + scoringProfile = property.Value.GetString(); + continue; + } + if (property.NameEquals("search"u8)) + { + search = property.Value.GetString(); + continue; + } + if (property.NameEquals("searchFields"u8)) + { + searchFields = property.Value.GetString(); + continue; + } + if (property.NameEquals("searchMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + searchMode = new SearchMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("select"u8)) + { + select = property.Value.GetString(); + continue; + } + if (property.NameEquals("skip"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + skip = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("top"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + top = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("semanticConfiguration"u8)) + { + semanticConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("semanticErrorHandling"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + semanticErrorHandling = new SemanticErrorMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("semanticMaxWaitInMilliseconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + semanticMaxWaitInMilliseconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("semanticQuery"u8)) + { + semanticQuery = property.Value.GetString(); + continue; + } + if (property.NameEquals("answers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + answers = new QueryAnswerType(property.Value.GetString()); + continue; + } + if (property.NameEquals("captions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + captions = new QueryCaptionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("vectorQueries"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VectorQuery.DeserializeVectorQuery(item, options)); + } + vectorQueries = array; + continue; + } + if (property.NameEquals("vectorFilterMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vectorFilterMode = new VectorFilterMode(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SearchRequest( + count, + facets ?? new ChangeTrackingList(), + filter, + highlight, + highlightPostTag, + highlightPreTag, + minimumCoverage, + orderby, + queryType, + scoringStatistics, + sessionId, + scoringParameters ?? new ChangeTrackingList(), + scoringProfile, + search, + searchFields, + searchMode, + select, + skip, + top, + semanticConfiguration, + semanticErrorHandling, + semanticMaxWaitInMilliseconds, + semanticQuery, + answers, + captions, + vectorQueries ?? new ChangeTrackingList(), + vectorFilterMode, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchRequest)} does not support writing '{options.Format}' format."); + } + } + + SearchRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchRequest.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchRequest.cs new file mode 100644 index 000000000000..69b8ca6be41b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchRequest.cs @@ -0,0 +1,387 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + /// + /// Parameters for filtering, sorting, faceting, paging, and other search query + /// behaviors. + /// + public partial class SearchRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SearchRequest() + { + Facets = new ChangeTrackingList(); + ScoringParameters = new ChangeTrackingList(); + VectorQueries = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// A value that specifies whether to fetch the total count of results. Default is + /// false. Setting this value to true may have a performance impact. Note that the + /// count returned is an approximation. + /// + /// + /// The list of facet expressions to apply to the search query. Each facet + /// expression contains a field name, optionally followed by a comma-separated list + /// of name:value pairs. + /// + /// The OData $filter expression to apply to the search query. + /// + /// The comma-separated list of field names to use for hit highlights. Only + /// searchable fields can be used for hit highlighting. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. Default is </em>. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. Default is <em>. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by a search query in order for the query to be reported as a success. + /// This parameter can be useful for ensuring search availability even for services + /// with only one replica. The default is 100. + /// + /// + /// The comma-separated list of OData $orderby expressions by which to sort the + /// results. Each expression can be either a field name or a call to either the + /// geo.distance() or the search.score() functions. Each expression can be followed + /// by asc to indicate ascending, or desc to indicate descending. The default is + /// ascending order. Ties will be broken by the match scores of documents. If no + /// $orderby is specified, the default sort order is descending by document match + /// score. There can be at most 32 $orderby clauses. + /// + /// + /// A value that specifies the syntax of the search query. The default is 'simple'. + /// Use 'full' if your query uses the Lucene query syntax. + /// + /// + /// A value that specifies whether we want to calculate scoring statistics (such as + /// document frequency) globally for more consistent scoring, or locally, for lower + /// latency. The default is 'local'. Use 'global' to aggregate scoring statistics + /// globally before scoring. Using global scoring statistics can increase latency + /// of search queries. + /// + /// + /// A value to be used to create a sticky session, which can help getting more + /// consistent results. As long as the same sessionId is used, a best-effort + /// attempt will be made to target the same replica set. Be wary that reusing the + /// same sessionID values repeatedly can interfere with the load balancing of the + /// requests across replicas and adversely affect the performance of the search + /// service. The value used as sessionId cannot start with a '_' character. + /// + /// + /// The list of parameter values to be used in scoring functions (for example, + /// referencePointParameter) using the format name-values. For example, if the + /// scoring profile defines a function with a parameter called 'mylocation' the + /// parameter string would be "mylocation--122.2,44.8" (without the quotes). + /// + /// + /// The name of a scoring profile to evaluate match scores for matching documents + /// in order to sort the results. + /// + /// + /// A full-text search query expression; Use "*" or omit this parameter to match + /// all documents. + /// + /// + /// The comma-separated list of field names to which to scope the full-text search. + /// When using fielded search (fieldName:searchExpression) in a full Lucene query, + /// the field names of each fielded search expression take precedence over any + /// field names listed in this parameter. + /// + /// + /// A value that specifies whether any or all of the search terms must be matched + /// in order to count the document as a match. + /// + /// + /// The comma-separated list of fields to retrieve. If unspecified, all fields + /// marked as retrievable in the schema are included. + /// + /// + /// The number of search results to skip. This value cannot be greater than + /// 100,000. If you need to scan documents in sequence, but cannot use skip due to + /// this limitation, consider using orderby on a totally-ordered key and filter + /// with a range query instead. + /// + /// + /// The number of search results to retrieve. This can be used in conjunction with + /// $skip to implement client-side paging of search results. If results are + /// truncated due to server-side paging, the response will include a continuation + /// token that can be used to issue another Search request for the next page of + /// results. + /// + /// + /// The name of a semantic configuration that will be used when processing + /// documents for queries of type semantic. + /// + /// + /// Allows the user to choose whether a semantic call should fail completely + /// (default / current behavior), or to return partial results. + /// + /// + /// Allows the user to set an upper bound on the amount of time it takes for + /// semantic enrichment to finish processing before the request fails. + /// + /// + /// Allows setting a separate search query that will be solely used for semantic + /// reranking, semantic captions and semantic answers. Is useful for scenarios + /// where there is a need to use different queries between the base retrieval and + /// ranking phase, and the L2 semantic phase. + /// + /// + /// A value that specifies whether answers should be returned as part of the search + /// response. + /// + /// + /// A value that specifies whether captions should be returned as part of the + /// search response. + /// + /// + /// The query parameters for vector and hybrid search queries. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// + /// Determines whether or not filters are applied before or after the vector search + /// is performed. Default is 'preFilter' for new indexes. + /// + /// Keeps track of any properties unknown to the library. + internal SearchRequest(bool? count, IList facets, string filter, string highlight, string highlightPostTag, string highlightPreTag, double? minimumCoverage, string orderby, QueryType? queryType, ScoringStatistics? scoringStatistics, string sessionId, IList scoringParameters, string scoringProfile, string search, string searchFields, SearchMode? searchMode, string select, int? skip, int? top, string semanticConfiguration, SemanticErrorMode? semanticErrorHandling, int? semanticMaxWaitInMilliseconds, string semanticQuery, QueryAnswerType? answers, QueryCaptionType? captions, IList vectorQueries, VectorFilterMode? vectorFilterMode, IDictionary serializedAdditionalRawData) + { + Count = count; + Facets = facets; + Filter = filter; + Highlight = highlight; + HighlightPostTag = highlightPostTag; + HighlightPreTag = highlightPreTag; + MinimumCoverage = minimumCoverage; + Orderby = orderby; + QueryType = queryType; + ScoringStatistics = scoringStatistics; + SessionId = sessionId; + ScoringParameters = scoringParameters; + ScoringProfile = scoringProfile; + Search = search; + SearchFields = searchFields; + SearchMode = searchMode; + Select = select; + Skip = skip; + Top = top; + SemanticConfiguration = semanticConfiguration; + SemanticErrorHandling = semanticErrorHandling; + SemanticMaxWaitInMilliseconds = semanticMaxWaitInMilliseconds; + SemanticQuery = semanticQuery; + Answers = answers; + Captions = captions; + VectorQueries = vectorQueries; + VectorFilterMode = vectorFilterMode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// A value that specifies whether to fetch the total count of results. Default is + /// false. Setting this value to true may have a performance impact. Note that the + /// count returned is an approximation. + /// + public bool? Count { get; set; } + /// + /// The list of facet expressions to apply to the search query. Each facet + /// expression contains a field name, optionally followed by a comma-separated list + /// of name:value pairs. + /// + public IList Facets { get; } + /// The OData $filter expression to apply to the search query. + public string Filter { get; set; } + /// + /// The comma-separated list of field names to use for hit highlights. Only + /// searchable fields can be used for hit highlighting. + /// + public string Highlight { get; set; } + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. Default is </em>. + /// + public string HighlightPostTag { get; set; } + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. Default is <em>. + /// + public string HighlightPreTag { get; set; } + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by a search query in order for the query to be reported as a success. + /// This parameter can be useful for ensuring search availability even for services + /// with only one replica. The default is 100. + /// + public double? MinimumCoverage { get; set; } + /// + /// The comma-separated list of OData $orderby expressions by which to sort the + /// results. Each expression can be either a field name or a call to either the + /// geo.distance() or the search.score() functions. Each expression can be followed + /// by asc to indicate ascending, or desc to indicate descending. The default is + /// ascending order. Ties will be broken by the match scores of documents. If no + /// $orderby is specified, the default sort order is descending by document match + /// score. There can be at most 32 $orderby clauses. + /// + public string Orderby { get; set; } + /// + /// A value that specifies the syntax of the search query. The default is 'simple'. + /// Use 'full' if your query uses the Lucene query syntax. + /// + public QueryType? QueryType { get; set; } + /// + /// A value that specifies whether we want to calculate scoring statistics (such as + /// document frequency) globally for more consistent scoring, or locally, for lower + /// latency. The default is 'local'. Use 'global' to aggregate scoring statistics + /// globally before scoring. Using global scoring statistics can increase latency + /// of search queries. + /// + public ScoringStatistics? ScoringStatistics { get; set; } + /// + /// A value to be used to create a sticky session, which can help getting more + /// consistent results. As long as the same sessionId is used, a best-effort + /// attempt will be made to target the same replica set. Be wary that reusing the + /// same sessionID values repeatedly can interfere with the load balancing of the + /// requests across replicas and adversely affect the performance of the search + /// service. The value used as sessionId cannot start with a '_' character. + /// + public string SessionId { get; set; } + /// + /// The list of parameter values to be used in scoring functions (for example, + /// referencePointParameter) using the format name-values. For example, if the + /// scoring profile defines a function with a parameter called 'mylocation' the + /// parameter string would be "mylocation--122.2,44.8" (without the quotes). + /// + public IList ScoringParameters { get; } + /// + /// The name of a scoring profile to evaluate match scores for matching documents + /// in order to sort the results. + /// + public string ScoringProfile { get; set; } + /// + /// A full-text search query expression; Use "*" or omit this parameter to match + /// all documents. + /// + public string Search { get; set; } + /// + /// The comma-separated list of field names to which to scope the full-text search. + /// When using fielded search (fieldName:searchExpression) in a full Lucene query, + /// the field names of each fielded search expression take precedence over any + /// field names listed in this parameter. + /// + public string SearchFields { get; set; } + /// + /// A value that specifies whether any or all of the search terms must be matched + /// in order to count the document as a match. + /// + public SearchMode? SearchMode { get; set; } + /// + /// The comma-separated list of fields to retrieve. If unspecified, all fields + /// marked as retrievable in the schema are included. + /// + public string Select { get; set; } + /// + /// The number of search results to skip. This value cannot be greater than + /// 100,000. If you need to scan documents in sequence, but cannot use skip due to + /// this limitation, consider using orderby on a totally-ordered key and filter + /// with a range query instead. + /// + public int? Skip { get; set; } + /// + /// The number of search results to retrieve. This can be used in conjunction with + /// $skip to implement client-side paging of search results. If results are + /// truncated due to server-side paging, the response will include a continuation + /// token that can be used to issue another Search request for the next page of + /// results. + /// + public int? Top { get; set; } + /// + /// The name of a semantic configuration that will be used when processing + /// documents for queries of type semantic. + /// + public string SemanticConfiguration { get; set; } + /// + /// Allows the user to choose whether a semantic call should fail completely + /// (default / current behavior), or to return partial results. + /// + public SemanticErrorMode? SemanticErrorHandling { get; set; } + /// + /// Allows the user to set an upper bound on the amount of time it takes for + /// semantic enrichment to finish processing before the request fails. + /// + public int? SemanticMaxWaitInMilliseconds { get; set; } + /// + /// Allows setting a separate search query that will be solely used for semantic + /// reranking, semantic captions and semantic answers. Is useful for scenarios + /// where there is a need to use different queries between the base retrieval and + /// ranking phase, and the L2 semantic phase. + /// + public string SemanticQuery { get; set; } + /// + /// A value that specifies whether answers should be returned as part of the search + /// response. + /// + public QueryAnswerType? Answers { get; set; } + /// + /// A value that specifies whether captions should be returned as part of the + /// search response. + /// + public QueryCaptionType? Captions { get; set; } + /// + /// The query parameters for vector and hybrid search queries. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public IList VectorQueries { get; } + /// + /// Determines whether or not filters are applied before or after the vector search + /// is performed. Default is 'preFilter' for new indexes. + /// + public VectorFilterMode? VectorFilterMode { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchResult.Serialization.cs new file mode 100644 index 000000000000..e8d0e61fe9af --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchResult.Serialization.cs @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class SearchResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("@search.score"u8); + writer.WriteNumberValue(Score); + if (Optional.IsDefined(RerankerScore)) + { + writer.WritePropertyName("@search.rerankerScore"u8); + writer.WriteNumberValue(RerankerScore.Value); + } + if (Optional.IsCollectionDefined(Highlights)) + { + writer.WritePropertyName("@search.highlights"u8); + writer.WriteStartObject(); + foreach (var item in Highlights) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStartArray(); + foreach (var item0 in item.Value) + { + writer.WriteStringValue(item0); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(Captions)) + { + writer.WritePropertyName("@search.captions"u8); + writer.WriteStartArray(); + foreach (var item in Captions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + SearchResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SearchResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSearchResult(document.RootElement, options); + } + + internal static SearchResult DeserializeSearchResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double searchScore = default; + double? searchRerankerScore = default; + IReadOnlyDictionary> searchHighlights = default; + IReadOnlyList searchCaptions = default; + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@search.score"u8)) + { + searchScore = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("@search.rerankerScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + searchRerankerScore = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("@search.highlights"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary> dictionary = new Dictionary>(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dictionary.Add(property0.Name, array); + } + } + searchHighlights = dictionary; + continue; + } + if (property.NameEquals("@search.captions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(QueryCaptionResult.DeserializeQueryCaptionResult(item, options)); + } + searchCaptions = array; + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new SearchResult(searchScore, searchRerankerScore, searchHighlights ?? new ChangeTrackingDictionary>(), searchCaptions ?? new ChangeTrackingList(), additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SearchResult)} does not support writing '{options.Format}' format."); + } + } + + SearchResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SearchResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SearchResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSearchResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchResult.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchResult.cs new file mode 100644 index 000000000000..c1f9df1b6158 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SearchResult.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + /// Contains a document found by a search query, plus associated metadata. + public partial class SearchResult + { + /// Initializes a new instance of . + /// + /// The relevance score of the document compared to other documents returned by the + /// query. + /// + internal SearchResult(double score) + { + Score = score; + Highlights = new ChangeTrackingDictionary>(); + Captions = new ChangeTrackingList(); + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// + /// The relevance score of the document compared to other documents returned by the + /// query. + /// + /// + /// The relevance score computed by the semantic ranker for the top search results. + /// Search results are sorted by the RerankerScore first and then by the Score. + /// RerankerScore is only returned for queries of type 'semantic'. + /// + /// + /// Text fragments from the document that indicate the matching search terms, + /// organized by each applicable field; null if hit highlighting was not enabled + /// for the query. + /// + /// + /// Captions are the most representative passages from the document relatively to + /// the search query. They are often used as document summary. Captions are only + /// returned for queries of type 'semantic'. + /// + /// Additional Properties. + internal SearchResult(double score, double? rerankerScore, IReadOnlyDictionary> highlights, IReadOnlyList captions, IReadOnlyDictionary additionalProperties) + { + Score = score; + RerankerScore = rerankerScore; + Highlights = highlights; + Captions = captions; + AdditionalProperties = additionalProperties; + } + + /// Initializes a new instance of for deserialization. + internal SearchResult() + { + } + + /// + /// The relevance score of the document compared to other documents returned by the + /// query. + /// + public double Score { get; } + /// + /// The relevance score computed by the semantic ranker for the top search results. + /// Search results are sorted by the RerankerScore first and then by the Score. + /// RerankerScore is only returned for queries of type 'semantic'. + /// + public double? RerankerScore { get; } + /// + /// Text fragments from the document that indicate the matching search terms, + /// organized by each applicable field; null if hit highlighting was not enabled + /// for the query. + /// + public IReadOnlyDictionary> Highlights { get; } + /// + /// Captions are the most representative passages from the document relatively to + /// the search query. They are often used as document summary. Captions are only + /// returned for queries of type 'semantic'. + /// + public IReadOnlyList Captions { get; } + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IReadOnlyDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SemanticErrorMode.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SemanticErrorMode.cs new file mode 100644 index 000000000000..d7a02bbd09c7 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SemanticErrorMode.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Search +{ + /// + /// Allows the user to choose whether a semantic call should fail completely, or to + /// return partial results. + /// + public readonly partial struct SemanticErrorMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SemanticErrorMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PartialValue = "partial"; + private const string FailValue = "fail"; + + /// + /// If the semantic processing fails, partial results still return. The definition + /// of partial results depends on what semantic step failed and what was the reason + /// for failure. + /// + public static SemanticErrorMode Partial { get; } = new SemanticErrorMode(PartialValue); + /// + /// If there is an exception during the semantic processing step, the query will + /// fail and return the appropriate HTTP code depending on the error. + /// + public static SemanticErrorMode Fail { get; } = new SemanticErrorMode(FailValue); + /// Determines if two values are the same. + public static bool operator ==(SemanticErrorMode left, SemanticErrorMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SemanticErrorMode left, SemanticErrorMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SemanticErrorMode(string value) => new SemanticErrorMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SemanticErrorMode other && Equals(other); + /// + public bool Equals(SemanticErrorMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SemanticErrorReason.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SemanticErrorReason.cs new file mode 100644 index 000000000000..78b8db7713f1 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SemanticErrorReason.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Search +{ + /// Reason that a partial response was returned for a semantic ranking request. + public readonly partial struct SemanticErrorReason : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SemanticErrorReason(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MaxWaitExceededValue = "maxWaitExceeded"; + private const string CapacityOverloadedValue = "capacityOverloaded"; + private const string TransientValue = "transient"; + + /// + /// If `semanticMaxWaitInMilliseconds` was set and the semantic processing duration + /// exceeded that value. Only the base results were returned. + /// + public static SemanticErrorReason MaxWaitExceeded { get; } = new SemanticErrorReason(MaxWaitExceededValue); + /// The request was throttled. Only the base results were returned. + public static SemanticErrorReason CapacityOverloaded { get; } = new SemanticErrorReason(CapacityOverloadedValue); + /// At least one step of the semantic process failed. + public static SemanticErrorReason Transient { get; } = new SemanticErrorReason(TransientValue); + /// Determines if two values are the same. + public static bool operator ==(SemanticErrorReason left, SemanticErrorReason right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SemanticErrorReason left, SemanticErrorReason right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SemanticErrorReason(string value) => new SemanticErrorReason(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SemanticErrorReason other && Equals(other); + /// + public bool Equals(SemanticErrorReason other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SemanticSearchResultsType.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SemanticSearchResultsType.cs new file mode 100644 index 000000000000..c632e4575087 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SemanticSearchResultsType.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Search +{ + /// Type of partial response that was returned for a semantic ranking request. + public readonly partial struct SemanticSearchResultsType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SemanticSearchResultsType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BaseResultsValue = "baseResults"; + private const string RerankedResultsValue = "rerankedResults"; + + /// Results without any semantic enrichment or reranking. + public static SemanticSearchResultsType BaseResults { get; } = new SemanticSearchResultsType(BaseResultsValue); + /// + /// Results have been reranked with the reranker model and will include semantic + /// captions. They will not include any answers, answers highlights or caption + /// highlights. + /// + public static SemanticSearchResultsType RerankedResults { get; } = new SemanticSearchResultsType(RerankedResultsValue); + /// Determines if two values are the same. + public static bool operator ==(SemanticSearchResultsType left, SemanticSearchResultsType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SemanticSearchResultsType left, SemanticSearchResultsType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SemanticSearchResultsType(string value) => new SemanticSearchResultsType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SemanticSearchResultsType other && Equals(other); + /// + public bool Equals(SemanticSearchResultsType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestDocumentsResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestDocumentsResult.Serialization.cs new file mode 100644 index 000000000000..0fbab9a19bda --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestDocumentsResult.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class SuggestDocumentsResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SuggestDocumentsResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(Coverage)) + { + writer.WritePropertyName("@search.coverage"u8); + writer.WriteNumberValue(Coverage.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SuggestDocumentsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SuggestDocumentsResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSuggestDocumentsResult(document.RootElement, options); + } + + internal static SuggestDocumentsResult DeserializeSuggestDocumentsResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + double? searchCoverage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SuggestResult.DeserializeSuggestResult(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("@search.coverage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + searchCoverage = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SuggestDocumentsResult(value, searchCoverage, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SuggestDocumentsResult)} does not support writing '{options.Format}' format."); + } + } + + SuggestDocumentsResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSuggestDocumentsResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SuggestDocumentsResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SuggestDocumentsResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSuggestDocumentsResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestDocumentsResult.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestDocumentsResult.cs new file mode 100644 index 000000000000..1a2ad4860e24 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestDocumentsResult.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Search +{ + /// Response containing suggestion query results from an index. + public partial class SuggestDocumentsResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The sequence of results returned by the query. + /// is null. + internal SuggestDocumentsResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The sequence of results returned by the query. + /// + /// A value indicating the percentage of the index that was included in the query, + /// or null if minimumCoverage was not set in the request. + /// + /// Keeps track of any properties unknown to the library. + internal SuggestDocumentsResult(IReadOnlyList value, double? coverage, IDictionary serializedAdditionalRawData) + { + Value = value; + Coverage = coverage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SuggestDocumentsResult() + { + } + + /// The sequence of results returned by the query. + public IReadOnlyList Value { get; } + /// + /// A value indicating the percentage of the index that was included in the query, + /// or null if minimumCoverage was not set in the request. + /// + public double? Coverage { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestRequest.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestRequest.Serialization.cs new file mode 100644 index 000000000000..b97399bb199e --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestRequest.Serialization.cs @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class SuggestRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SuggestRequest)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Filter)) + { + writer.WritePropertyName("filter"u8); + writer.WriteStringValue(Filter); + } + if (Optional.IsDefined(Fuzzy)) + { + writer.WritePropertyName("fuzzy"u8); + writer.WriteBooleanValue(Fuzzy.Value); + } + if (Optional.IsDefined(HighlightPostTag)) + { + writer.WritePropertyName("highlightPostTag"u8); + writer.WriteStringValue(HighlightPostTag); + } + if (Optional.IsDefined(HighlightPreTag)) + { + writer.WritePropertyName("highlightPreTag"u8); + writer.WriteStringValue(HighlightPreTag); + } + if (Optional.IsDefined(MinimumCoverage)) + { + writer.WritePropertyName("minimumCoverage"u8); + writer.WriteNumberValue(MinimumCoverage.Value); + } + if (Optional.IsDefined(Orderby)) + { + writer.WritePropertyName("orderby"u8); + writer.WriteStringValue(Orderby); + } + writer.WritePropertyName("search"u8); + writer.WriteStringValue(Search); + if (Optional.IsDefined(SearchFields)) + { + writer.WritePropertyName("searchFields"u8); + writer.WriteStringValue(SearchFields); + } + if (Optional.IsDefined(Select)) + { + writer.WritePropertyName("select"u8); + writer.WriteStringValue(Select); + } + writer.WritePropertyName("suggesterName"u8); + writer.WriteStringValue(SuggesterName); + if (Optional.IsDefined(Top)) + { + writer.WritePropertyName("top"u8); + writer.WriteNumberValue(Top.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SuggestRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SuggestRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSuggestRequest(document.RootElement, options); + } + + internal static SuggestRequest DeserializeSuggestRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string filter = default; + bool? fuzzy = default; + string highlightPostTag = default; + string highlightPreTag = default; + double? minimumCoverage = default; + string orderby = default; + string search = default; + string searchFields = default; + string select = default; + string suggesterName = default; + int? top = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("filter"u8)) + { + filter = property.Value.GetString(); + continue; + } + if (property.NameEquals("fuzzy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fuzzy = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("highlightPostTag"u8)) + { + highlightPostTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("highlightPreTag"u8)) + { + highlightPreTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("minimumCoverage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minimumCoverage = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("orderby"u8)) + { + orderby = property.Value.GetString(); + continue; + } + if (property.NameEquals("search"u8)) + { + search = property.Value.GetString(); + continue; + } + if (property.NameEquals("searchFields"u8)) + { + searchFields = property.Value.GetString(); + continue; + } + if (property.NameEquals("select"u8)) + { + select = property.Value.GetString(); + continue; + } + if (property.NameEquals("suggesterName"u8)) + { + suggesterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("top"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + top = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SuggestRequest( + filter, + fuzzy, + highlightPostTag, + highlightPreTag, + minimumCoverage, + orderby, + search, + searchFields, + select, + suggesterName, + top, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SuggestRequest)} does not support writing '{options.Format}' format."); + } + } + + SuggestRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSuggestRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SuggestRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SuggestRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSuggestRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestRequest.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestRequest.cs new file mode 100644 index 000000000000..93c22bab1f2f --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestRequest.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + /// + /// Parameters for filtering, sorting, fuzzy matching, and other suggestions query + /// behaviors. + /// + public partial class SuggestRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// The search text to use to suggest documents. Must be at least 1 character, and + /// no more than 100 characters. + /// + /// + /// The name of the suggester as specified in the suggesters collection that's part + /// of the index definition. + /// + /// or is null. + public SuggestRequest(string search, string suggesterName) + { + Argument.AssertNotNull(search, nameof(search)); + Argument.AssertNotNull(suggesterName, nameof(suggesterName)); + + Search = search; + SuggesterName = suggesterName; + } + + /// Initializes a new instance of . + /// An OData expression that filters the documents considered for suggestions. + /// + /// A value indicating whether to use fuzzy matching for the suggestion query. + /// Default is false. When set to true, the query will find suggestions even if + /// there's a substituted or missing character in the search text. While this + /// provides a better experience in some scenarios, it comes at a performance cost + /// as fuzzy suggestion searches are slower and consume more resources. + /// + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. If omitted, hit highlighting of suggestions is disabled. + /// + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. If omitted, hit highlighting of suggestions is disabled. + /// + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by a suggestion query in order for the query to be reported as a + /// success. This parameter can be useful for ensuring search availability even for + /// services with only one replica. The default is 80. + /// + /// + /// The comma-separated list of OData $orderby expressions by which to sort the + /// results. Each expression can be either a field name or a call to either the + /// geo.distance() or the search.score() functions. Each expression can be followed + /// by asc to indicate ascending, or desc to indicate descending. The default is + /// ascending order. Ties will be broken by the match scores of documents. If no + /// $orderby is specified, the default sort order is descending by document match + /// score. There can be at most 32 $orderby clauses. + /// + /// + /// The search text to use to suggest documents. Must be at least 1 character, and + /// no more than 100 characters. + /// + /// + /// The comma-separated list of field names to search for the specified search + /// text. Target fields must be included in the specified suggester. + /// + /// + /// The comma-separated list of fields to retrieve. If unspecified, only the key + /// field will be included in the results. + /// + /// + /// The name of the suggester as specified in the suggesters collection that's part + /// of the index definition. + /// + /// + /// The number of suggestions to retrieve. This must be a value between 1 and 100. + /// The default is 5. + /// + /// Keeps track of any properties unknown to the library. + internal SuggestRequest(string filter, bool? fuzzy, string highlightPostTag, string highlightPreTag, double? minimumCoverage, string orderby, string search, string searchFields, string select, string suggesterName, int? top, IDictionary serializedAdditionalRawData) + { + Filter = filter; + Fuzzy = fuzzy; + HighlightPostTag = highlightPostTag; + HighlightPreTag = highlightPreTag; + MinimumCoverage = minimumCoverage; + Orderby = orderby; + Search = search; + SearchFields = searchFields; + Select = select; + SuggesterName = suggesterName; + Top = top; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SuggestRequest() + { + } + + /// An OData expression that filters the documents considered for suggestions. + public string Filter { get; set; } + /// + /// A value indicating whether to use fuzzy matching for the suggestion query. + /// Default is false. When set to true, the query will find suggestions even if + /// there's a substituted or missing character in the search text. While this + /// provides a better experience in some scenarios, it comes at a performance cost + /// as fuzzy suggestion searches are slower and consume more resources. + /// + public bool? Fuzzy { get; set; } + /// + /// A string tag that is appended to hit highlights. Must be set with + /// highlightPreTag. If omitted, hit highlighting of suggestions is disabled. + /// + public string HighlightPostTag { get; set; } + /// + /// A string tag that is prepended to hit highlights. Must be set with + /// highlightPostTag. If omitted, hit highlighting of suggestions is disabled. + /// + public string HighlightPreTag { get; set; } + /// + /// A number between 0 and 100 indicating the percentage of the index that must be + /// covered by a suggestion query in order for the query to be reported as a + /// success. This parameter can be useful for ensuring search availability even for + /// services with only one replica. The default is 80. + /// + public double? MinimumCoverage { get; set; } + /// + /// The comma-separated list of OData $orderby expressions by which to sort the + /// results. Each expression can be either a field name or a call to either the + /// geo.distance() or the search.score() functions. Each expression can be followed + /// by asc to indicate ascending, or desc to indicate descending. The default is + /// ascending order. Ties will be broken by the match scores of documents. If no + /// $orderby is specified, the default sort order is descending by document match + /// score. There can be at most 32 $orderby clauses. + /// + public string Orderby { get; set; } + /// + /// The search text to use to suggest documents. Must be at least 1 character, and + /// no more than 100 characters. + /// + public string Search { get; } + /// + /// The comma-separated list of field names to search for the specified search + /// text. Target fields must be included in the specified suggester. + /// + public string SearchFields { get; set; } + /// + /// The comma-separated list of fields to retrieve. If unspecified, only the key + /// field will be included in the results. + /// + public string Select { get; set; } + /// + /// The name of the suggester as specified in the suggesters collection that's part + /// of the index definition. + /// + public string SuggesterName { get; } + /// + /// The number of suggestions to retrieve. This must be a value between 1 and 100. + /// The default is 5. + /// + public int? Top { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestResult.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestResult.Serialization.cs new file mode 100644 index 000000000000..1817217b4587 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestResult.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class SuggestResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SuggestResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("@search.text"u8); + writer.WriteStringValue(Text); + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + SuggestResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SuggestResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSuggestResult(document.RootElement, options); + } + + internal static SuggestResult DeserializeSuggestResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string searchText = default; + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("@search.text"u8)) + { + searchText = property.Value.GetString(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new SuggestResult(searchText, additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SuggestResult)} does not support writing '{options.Format}' format."); + } + } + + SuggestResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSuggestResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SuggestResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SuggestResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSuggestResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestResult.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestResult.cs new file mode 100644 index 000000000000..7cb75fb5bf65 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/SuggestResult.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + /// + /// A result containing a document found by a suggestion query, plus associated + /// metadata. + /// + public partial class SuggestResult + { + /// Initializes a new instance of . + /// The text of the suggestion result. + /// is null. + internal SuggestResult(string text) + { + Argument.AssertNotNull(text, nameof(text)); + + Text = text; + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The text of the suggestion result. + /// Additional Properties. + internal SuggestResult(string text, IReadOnlyDictionary additionalProperties) + { + Text = text; + AdditionalProperties = additionalProperties; + } + + /// Initializes a new instance of for deserialization. + internal SuggestResult() + { + } + + /// The text of the suggestion result. + public string Text { get; } + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IReadOnlyDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/UnknownVectorQuery.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/UnknownVectorQuery.Serialization.cs new file mode 100644 index 000000000000..6fb06e5817a4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/UnknownVectorQuery.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + internal partial class UnknownVectorQuery : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorQuery)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + VectorQuery IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorQuery)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVectorQuery(document.RootElement, options); + } + + internal static UnknownVectorQuery DeserializeUnknownVectorQuery(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? k = default; + string fields = default; + bool? exhaustive = default; + double? oversampling = default; + float? weight = default; + VectorQueryKind kind = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("k"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + k = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("fields"u8)) + { + fields = property.Value.GetString(); + continue; + } + if (property.NameEquals("exhaustive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exhaustive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("oversampling"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + oversampling = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("weight"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + weight = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new VectorQueryKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownVectorQuery( + k, + fields, + exhaustive, + oversampling, + weight, + kind, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VectorQuery)} does not support writing '{options.Format}' format."); + } + } + + VectorQuery IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorQuery(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VectorQuery)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownVectorQuery FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownVectorQuery(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/UnknownVectorQuery.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/UnknownVectorQuery.cs new file mode 100644 index 000000000000..ebcdbb2acf9b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/UnknownVectorQuery.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + /// Unknown version of VectorQuery. + internal partial class UnknownVectorQuery : VectorQuery + { + /// Initializes a new instance of . + /// Number of nearest neighbors to return as top hits. + /// + /// Vector Fields of type Collection(Edm.Single) to be included in the vector + /// searched. + /// + /// + /// When true, triggers an exhaustive k-nearest neighbor search across all vectors + /// within the vector index. Useful for scenarios where exact matches are critical, + /// such as determining ground truth values. + /// + /// + /// Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' + /// parameter configured in the index definition. It can be set only when 'rerankWithOriginalVectors' + /// is true. This parameter is only permitted when a + /// compression method is used on the underlying vector field. + /// + /// + /// Relative weight of the vector query when compared to other vector query and/or + /// the text query within the same search request. This value is used when + /// combining the results of multiple ranking lists produced by the different + /// vector queries and/or the results retrieved through the text query. The higher + /// the weight, the higher the documents that matched that query will be in the + /// final ranking. Default is 1.0 and the value needs to be a positive number + /// larger than zero. + /// + /// Type of query. + /// Keeps track of any properties unknown to the library. + internal UnknownVectorQuery(int? k, string fields, bool? exhaustive, double? oversampling, float? weight, VectorQueryKind kind, IDictionary serializedAdditionalRawData) : base(k, fields, exhaustive, oversampling, weight, kind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownVectorQuery() + { + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorFilterMode.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorFilterMode.cs new file mode 100644 index 000000000000..3454a7ac3d3c --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorFilterMode.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Search.Documents.Search +{ + /// + /// Determines whether or not filters are applied before or after the vector search + /// is performed. + /// + public readonly partial struct VectorFilterMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VectorFilterMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PostFilterValue = "postFilter"; + private const string PreFilterValue = "preFilter"; + + /// + /// The filter will be applied after the candidate set of vector results is + /// returned. Depending on the filter selectivity, this can result in fewer results + /// than requested by the parameter 'k'. + /// + public static VectorFilterMode PostFilter { get; } = new VectorFilterMode(PostFilterValue); + /// The filter will be applied before the search query. + public static VectorFilterMode PreFilter { get; } = new VectorFilterMode(PreFilterValue); + /// Determines if two values are the same. + public static bool operator ==(VectorFilterMode left, VectorFilterMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VectorFilterMode left, VectorFilterMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VectorFilterMode(string value) => new VectorFilterMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VectorFilterMode other && Equals(other); + /// + public bool Equals(VectorFilterMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorQuery.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorQuery.Serialization.cs new file mode 100644 index 000000000000..ede7ef76cb1d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorQuery.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + [PersistableModelProxy(typeof(UnknownVectorQuery))] + public partial class VectorQuery : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorQuery)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(K)) + { + writer.WritePropertyName("k"u8); + writer.WriteNumberValue(K.Value); + } + if (Optional.IsDefined(Fields)) + { + writer.WritePropertyName("fields"u8); + writer.WriteStringValue(Fields); + } + if (Optional.IsDefined(Exhaustive)) + { + writer.WritePropertyName("exhaustive"u8); + writer.WriteBooleanValue(Exhaustive.Value); + } + if (Optional.IsDefined(Oversampling)) + { + writer.WritePropertyName("oversampling"u8); + writer.WriteNumberValue(Oversampling.Value); + } + if (Optional.IsDefined(Weight)) + { + writer.WritePropertyName("weight"u8); + writer.WriteNumberValue(Weight.Value); + } + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VectorQuery IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorQuery)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVectorQuery(document.RootElement, options); + } + + internal static VectorQuery DeserializeVectorQuery(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("kind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "text": return VectorizableTextQuery.DeserializeVectorizableTextQuery(element, options); + case "vector": return VectorizedQuery.DeserializeVectorizedQuery(element, options); + } + } + return UnknownVectorQuery.DeserializeUnknownVectorQuery(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VectorQuery)} does not support writing '{options.Format}' format."); + } + } + + VectorQuery IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorQuery(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VectorQuery)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static VectorQuery FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorQuery(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorQuery.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorQuery.cs new file mode 100644 index 000000000000..601c6baa0ed6 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorQuery.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + /// + /// The query parameters for vector and hybrid search queries. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class VectorQuery + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected VectorQuery() + { + } + + /// Initializes a new instance of . + /// Number of nearest neighbors to return as top hits. + /// + /// Vector Fields of type Collection(Edm.Single) to be included in the vector + /// searched. + /// + /// + /// When true, triggers an exhaustive k-nearest neighbor search across all vectors + /// within the vector index. Useful for scenarios where exact matches are critical, + /// such as determining ground truth values. + /// + /// + /// Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' + /// parameter configured in the index definition. It can be set only when 'rerankWithOriginalVectors' + /// is true. This parameter is only permitted when a + /// compression method is used on the underlying vector field. + /// + /// + /// Relative weight of the vector query when compared to other vector query and/or + /// the text query within the same search request. This value is used when + /// combining the results of multiple ranking lists produced by the different + /// vector queries and/or the results retrieved through the text query. The higher + /// the weight, the higher the documents that matched that query will be in the + /// final ranking. Default is 1.0 and the value needs to be a positive number + /// larger than zero. + /// + /// Type of query. + /// Keeps track of any properties unknown to the library. + internal VectorQuery(int? k, string fields, bool? exhaustive, double? oversampling, float? weight, VectorQueryKind kind, IDictionary serializedAdditionalRawData) + { + K = k; + Fields = fields; + Exhaustive = exhaustive; + Oversampling = oversampling; + Weight = weight; + Kind = kind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Number of nearest neighbors to return as top hits. + public int? K { get; set; } + /// + /// Vector Fields of type Collection(Edm.Single) to be included in the vector + /// searched. + /// + public string Fields { get; set; } + /// + /// When true, triggers an exhaustive k-nearest neighbor search across all vectors + /// within the vector index. Useful for scenarios where exact matches are critical, + /// such as determining ground truth values. + /// + public bool? Exhaustive { get; set; } + /// + /// Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' + /// parameter configured in the index definition. It can be set only when 'rerankWithOriginalVectors' + /// is true. This parameter is only permitted when a + /// compression method is used on the underlying vector field. + /// + public double? Oversampling { get; set; } + /// + /// Relative weight of the vector query when compared to other vector query and/or + /// the text query within the same search request. This value is used when + /// combining the results of multiple ranking lists produced by the different + /// vector queries and/or the results retrieved through the text query. The higher + /// the weight, the higher the documents that matched that query will be in the + /// final ranking. Default is 1.0 and the value needs to be a positive number + /// larger than zero. + /// + public float? Weight { get; set; } + /// Type of query. + internal VectorQueryKind Kind { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorQueryKind.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorQueryKind.cs new file mode 100644 index 000000000000..cdacdb856e5d --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorQueryKind.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.Search +{ + /// The kind of vector query being performed. + internal readonly partial struct VectorQueryKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VectorQueryKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string VectorValue = "vector"; + private const string TextValue = "text"; + + /// Vector query where a raw vector value is provided. + public static VectorQueryKind Vector { get; } = new VectorQueryKind(VectorValue); + /// Vector query where a text value that needs to be vectorized is provided. + public static VectorQueryKind Text { get; } = new VectorQueryKind(TextValue); + /// Determines if two values are the same. + public static bool operator ==(VectorQueryKind left, VectorQueryKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VectorQueryKind left, VectorQueryKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VectorQueryKind(string value) => new VectorQueryKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VectorQueryKind other && Equals(other); + /// + public bool Equals(VectorQueryKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorizableTextQuery.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorizableTextQuery.Serialization.cs new file mode 100644 index 000000000000..7775bff8c8fc --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorizableTextQuery.Serialization.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class VectorizableTextQuery : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorizableTextQuery)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + } + + VectorizableTextQuery IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorizableTextQuery)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVectorizableTextQuery(document.RootElement, options); + } + + internal static VectorizableTextQuery DeserializeVectorizableTextQuery(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string text = default; + int? k = default; + string fields = default; + bool? exhaustive = default; + double? oversampling = default; + float? weight = default; + VectorQueryKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("k"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + k = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("fields"u8)) + { + fields = property.Value.GetString(); + continue; + } + if (property.NameEquals("exhaustive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exhaustive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("oversampling"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + oversampling = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("weight"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + weight = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new VectorQueryKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VectorizableTextQuery( + k, + fields, + exhaustive, + oversampling, + weight, + kind, + serializedAdditionalRawData, + text); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VectorizableTextQuery)} does not support writing '{options.Format}' format."); + } + } + + VectorizableTextQuery IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorizableTextQuery(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VectorizableTextQuery)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new VectorizableTextQuery FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorizableTextQuery(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorizableTextQuery.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorizableTextQuery.cs new file mode 100644 index 000000000000..27a2a9337b29 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorizableTextQuery.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Search.Documents.Search +{ + /// + /// The query parameters to use for vector search when a text value that needs to + /// be vectorized is provided. + /// + public partial class VectorizableTextQuery : VectorQuery + { + /// Initializes a new instance of . + /// The text to be vectorized to perform a vector search query. + /// is null. + public VectorizableTextQuery(string text) + { + Argument.AssertNotNull(text, nameof(text)); + + Kind = VectorQueryKind.Text; + Text = text; + } + + /// Initializes a new instance of . + /// Number of nearest neighbors to return as top hits. + /// + /// Vector Fields of type Collection(Edm.Single) to be included in the vector + /// searched. + /// + /// + /// When true, triggers an exhaustive k-nearest neighbor search across all vectors + /// within the vector index. Useful for scenarios where exact matches are critical, + /// such as determining ground truth values. + /// + /// + /// Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' + /// parameter configured in the index definition. It can be set only when 'rerankWithOriginalVectors' + /// is true. This parameter is only permitted when a + /// compression method is used on the underlying vector field. + /// + /// + /// Relative weight of the vector query when compared to other vector query and/or + /// the text query within the same search request. This value is used when + /// combining the results of multiple ranking lists produced by the different + /// vector queries and/or the results retrieved through the text query. The higher + /// the weight, the higher the documents that matched that query will be in the + /// final ranking. Default is 1.0 and the value needs to be a positive number + /// larger than zero. + /// + /// Type of query. + /// Keeps track of any properties unknown to the library. + /// The text to be vectorized to perform a vector search query. + internal VectorizableTextQuery(int? k, string fields, bool? exhaustive, double? oversampling, float? weight, VectorQueryKind kind, IDictionary serializedAdditionalRawData, string text) : base(k, fields, exhaustive, oversampling, weight, kind, serializedAdditionalRawData) + { + Text = text; + } + + /// Initializes a new instance of for deserialization. + internal VectorizableTextQuery() + { + } + + /// The text to be vectorized to perform a vector search query. + public string Text { get; set; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorizedQuery.Serialization.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorizedQuery.Serialization.cs new file mode 100644 index 000000000000..3a4569ad4ed4 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorizedQuery.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Search.Documents.Search +{ + public partial class VectorizedQuery : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorizedQuery)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("vector"u8); + writer.WriteStartArray(); + foreach (var item in Vector) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + } + + VectorizedQuery IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VectorizedQuery)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVectorizedQuery(document.RootElement, options); + } + + internal static VectorizedQuery DeserializeVectorizedQuery(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList vector = default; + int? k = default; + string fields = default; + bool? exhaustive = default; + double? oversampling = default; + float? weight = default; + VectorQueryKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vector"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetSingle()); + } + vector = array; + continue; + } + if (property.NameEquals("k"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + k = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("fields"u8)) + { + fields = property.Value.GetString(); + continue; + } + if (property.NameEquals("exhaustive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exhaustive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("oversampling"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + oversampling = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("weight"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + weight = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new VectorQueryKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VectorizedQuery( + k, + fields, + exhaustive, + oversampling, + weight, + kind, + serializedAdditionalRawData, + vector); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VectorizedQuery)} does not support writing '{options.Format}' format."); + } + } + + VectorizedQuery IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorizedQuery(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VectorizedQuery)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new VectorizedQuery FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVectorizedQuery(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorizedQuery.cs b/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorizedQuery.cs new file mode 100644 index 000000000000..e3f396e8e9ef --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Generated/VectorizedQuery.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Search.Documents.Search +{ + /// + /// The query parameters to use for vector search when a raw vector value is + /// provided. + /// + public partial class VectorizedQuery : VectorQuery + { + /// Initializes a new instance of . + /// The vector representation of a search query. + /// is null. + public VectorizedQuery(IEnumerable vector) + { + Argument.AssertNotNull(vector, nameof(vector)); + + Kind = VectorQueryKind.Vector; + Vector = vector.ToList(); + } + + /// Initializes a new instance of . + /// Number of nearest neighbors to return as top hits. + /// + /// Vector Fields of type Collection(Edm.Single) to be included in the vector + /// searched. + /// + /// + /// When true, triggers an exhaustive k-nearest neighbor search across all vectors + /// within the vector index. Useful for scenarios where exact matches are critical, + /// such as determining ground truth values. + /// + /// + /// Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' + /// parameter configured in the index definition. It can be set only when 'rerankWithOriginalVectors' + /// is true. This parameter is only permitted when a + /// compression method is used on the underlying vector field. + /// + /// + /// Relative weight of the vector query when compared to other vector query and/or + /// the text query within the same search request. This value is used when + /// combining the results of multiple ranking lists produced by the different + /// vector queries and/or the results retrieved through the text query. The higher + /// the weight, the higher the documents that matched that query will be in the + /// final ranking. Default is 1.0 and the value needs to be a positive number + /// larger than zero. + /// + /// Type of query. + /// Keeps track of any properties unknown to the library. + /// The vector representation of a search query. + internal VectorizedQuery(int? k, string fields, bool? exhaustive, double? oversampling, float? weight, VectorQueryKind kind, IDictionary serializedAdditionalRawData, IList vector) : base(k, fields, exhaustive, oversampling, weight, kind, serializedAdditionalRawData) + { + Vector = vector; + } + + /// Initializes a new instance of for deserialization. + internal VectorizedQuery() + { + } + + /// The vector representation of a search query. + public IList Vector { get; } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/src/Properties/AssemblyInfo.cs b/sdk/search/Azure.Search.Documents.Search/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..b3a3f3dde80b --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.Search.Documents.Search.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Template")] diff --git a/sdk/search/Azure.Search.Documents.Search/tests/Azure.Search.Documents.Search.Tests.csproj b/sdk/search/Azure.Search.Documents.Search/tests/Azure.Search.Documents.Search.Tests.csproj new file mode 100644 index 000000000000..c2fd109558f1 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/tests/Azure.Search.Documents.Search.Tests.csproj @@ -0,0 +1,20 @@ + + + $(RequiredTargetFrameworks) + + $(NoWarn);CS1591 + + + + + + + + + + + + + + + diff --git a/sdk/search/Azure.Search.Documents.Search/tests/Generated/Samples/Samples_Documents.cs b/sdk/search/Azure.Search.Documents.Search/tests/Generated/Samples/Samples_Documents.cs new file mode 100644 index 000000000000..0b7fcc870f01 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/tests/Generated/Samples/Samples_Documents.cs @@ -0,0 +1,960 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Search.Documents.Search.Samples +{ + public partial class Samples_Documents + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_Count_SearchIndexCountDocuments() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = client.Count("myindex", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_Count_SearchIndexCountDocuments_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = await client.CountAsync("myindex", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_Count_SearchIndexCountDocuments_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = client.Count("myindex"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_Count_SearchIndexCountDocuments_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = await client.CountAsync("myindex"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_SearchGet_SearchIndexSearchDocumentsGet() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = client.SearchGet("myindex", "nice hotels", true, new string[] { "category,count:10,sort:count" }, "rating gt 10", new string[] { "title" }, "", "", 80, new string[] { "search.score() desc", "rating desc" }, "simple", null, "sp", new string[] { "title", "description" }, "any", "global", "mysessionid", new string[] { "docId", "title", "description" }, 100, 10, null, null, null, null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.score").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_SearchGet_SearchIndexSearchDocumentsGet_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = await client.SearchGetAsync("myindex", "nice hotels", true, new string[] { "category,count:10,sort:count" }, "rating gt 10", new string[] { "title" }, "", "", 80, new string[] { "search.score() desc", "rating desc" }, "simple", null, "sp", new string[] { "title", "description" }, "any", "global", "mysessionid", new string[] { "docId", "title", "description" }, 100, 10, null, null, null, null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.score").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_SearchGet_SearchIndexSearchDocumentsGet_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = client.SearchGet("myindex"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_SearchGet_SearchIndexSearchDocumentsGet_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = await client.SearchGetAsync("myindex"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_SearchGet_SearchIndexSearchDocumentsSemanticGet() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = client.SearchGet("myindex", "how do clouds form", true, null, null, null, "", "", null, null, "semantic", null, null, null, null, null, null, null, null, null, "my-semantic-config", "partial", 780, "extractive|count-3", "extractive|highlight-true", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.score").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_SearchGet_SearchIndexSearchDocumentsSemanticGet_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = await client.SearchGetAsync("myindex", "how do clouds form", true, null, null, null, "", "", null, null, "semantic", null, null, null, null, null, null, null, null, null, "my-semantic-config", "partial", 780, "extractive|count-3", "extractive|highlight-true", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.score").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_SearchGet_SearchIndexSearchDocumentsSemanticGet_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = client.SearchGet("myindex"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_SearchGet_SearchIndexSearchDocumentsSemanticGet_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = await client.SearchGetAsync("myindex"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_SearchPost_SearchIndexSearchDocumentsPost() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + using RequestContent content = RequestContent.Create(new + { + count = true, + facets = new object[] + { +"category,count:10,sort:count" + }, + filter = "rating gt 4.0", + highlight = "description", + highlightPostTag = "", + highlightPreTag = "", + orderby = "rating desc", + queryType = "simple", + scoringParameters = new object[] + { +"currentLocation--122.123,44.77233" + }, + scoringProfile = "sp", + search = "nice hotels", + searchFields = "category,description", + searchMode = "any", + sessionId = "mysessionid", + scoringStatistics = "global", + select = "hotelId,category,description", + skip = 0, + top = 10, + vectorQueries = new object[] + { +new +{ +kind = "vector", +vector = new object[] +{ +0.103F, +0.0712F, +0.0852F, +0.1547F, +0.1183F +}, +fields = "descriptionEmbedding", +k = 5, +exhaustive = true, +oversampling = 20, +weight = 2F, +} + }, + vectorFilterMode = "preFilter", + }); + Response response = client.SearchPost("myindex", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.score").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_SearchPost_SearchIndexSearchDocumentsPost_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + using RequestContent content = RequestContent.Create(new + { + count = true, + facets = new object[] + { +"category,count:10,sort:count" + }, + filter = "rating gt 4.0", + highlight = "description", + highlightPostTag = "", + highlightPreTag = "", + orderby = "rating desc", + queryType = "simple", + scoringParameters = new object[] + { +"currentLocation--122.123,44.77233" + }, + scoringProfile = "sp", + search = "nice hotels", + searchFields = "category,description", + searchMode = "any", + sessionId = "mysessionid", + scoringStatistics = "global", + select = "hotelId,category,description", + skip = 0, + top = 10, + vectorQueries = new object[] + { +new +{ +kind = "vector", +vector = new object[] +{ +0.103F, +0.0712F, +0.0852F, +0.1547F, +0.1183F +}, +fields = "descriptionEmbedding", +k = 5, +exhaustive = true, +oversampling = 20, +weight = 2F, +} + }, + vectorFilterMode = "preFilter", + }); + Response response = await client.SearchPostAsync("myindex", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.score").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_SearchPost_SearchIndexSearchDocumentsPost_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + SearchRequest searchRequest = new SearchRequest + { + Count = true, + Facets = { "category,count:10,sort:count" }, + Filter = "rating gt 4.0", + Highlight = "description", + HighlightPostTag = "", + HighlightPreTag = "", + Orderby = "rating desc", + QueryType = QueryType.Simple, + ScoringStatistics = ScoringStatistics.Global, + SessionId = "mysessionid", + ScoringParameters = { "currentLocation--122.123,44.77233" }, + ScoringProfile = "sp", + Search = "nice hotels", + SearchFields = "category,description", + SearchMode = SearchMode.Any, + Select = "hotelId,category,description", + Skip = 0, + Top = 10, + VectorQueries = {new VectorizedQuery(new float[]{0.103F, 0.0712F, 0.0852F, 0.1547F, 0.1183F}) +{ +K = 5, +Fields = "descriptionEmbedding", +Exhaustive = true, +Oversampling = 20, +Weight = 2F, +}}, + VectorFilterMode = VectorFilterMode.PreFilter, + }; + Response response = client.SearchPost("myindex", searchRequest); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_SearchPost_SearchIndexSearchDocumentsPost_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + SearchRequest searchRequest = new SearchRequest + { + Count = true, + Facets = { "category,count:10,sort:count" }, + Filter = "rating gt 4.0", + Highlight = "description", + HighlightPostTag = "", + HighlightPreTag = "", + Orderby = "rating desc", + QueryType = QueryType.Simple, + ScoringStatistics = ScoringStatistics.Global, + SessionId = "mysessionid", + ScoringParameters = { "currentLocation--122.123,44.77233" }, + ScoringProfile = "sp", + Search = "nice hotels", + SearchFields = "category,description", + SearchMode = SearchMode.Any, + Select = "hotelId,category,description", + Skip = 0, + Top = 10, + VectorQueries = {new VectorizedQuery(new float[]{0.103F, 0.0712F, 0.0852F, 0.1547F, 0.1183F}) +{ +K = 5, +Fields = "descriptionEmbedding", +Exhaustive = true, +Oversampling = 20, +Weight = 2F, +}}, + VectorFilterMode = VectorFilterMode.PreFilter, + }; + Response response = await client.SearchPostAsync("myindex", searchRequest); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_SearchPost_SearchIndexSearchDocumentsSemanticPost() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + using RequestContent content = RequestContent.Create(new + { + count = true, + highlightPostTag = "", + highlightPreTag = "", + queryType = "semantic", + search = "how do clouds form", + semanticConfiguration = "my-semantic-config", + answers = "extractive|count-3", + captions = "extractive|highlight-true", + semanticErrorHandling = "partial", + semanticMaxWaitInMilliseconds = 780, + }); + Response response = client.SearchPost("myindex", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.score").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_SearchPost_SearchIndexSearchDocumentsSemanticPost_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + using RequestContent content = RequestContent.Create(new + { + count = true, + highlightPostTag = "", + highlightPreTag = "", + queryType = "semantic", + search = "how do clouds form", + semanticConfiguration = "my-semantic-config", + answers = "extractive|count-3", + captions = "extractive|highlight-true", + semanticErrorHandling = "partial", + semanticMaxWaitInMilliseconds = 780, + }); + Response response = await client.SearchPostAsync("myindex", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.score").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_SearchPost_SearchIndexSearchDocumentsSemanticPost_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + SearchRequest searchRequest = new SearchRequest + { + Count = true, + HighlightPostTag = "", + HighlightPreTag = "", + QueryType = QueryType.Semantic, + Search = "how do clouds form", + SemanticConfiguration = "my-semantic-config", + SemanticErrorHandling = SemanticErrorMode.Partial, + SemanticMaxWaitInMilliseconds = 780, + Answers = new QueryAnswerType("extractive|count-3"), + Captions = new QueryCaptionType("extractive|highlight-true"), + }; + Response response = client.SearchPost("myindex", searchRequest); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_SearchPost_SearchIndexSearchDocumentsSemanticPost_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + SearchRequest searchRequest = new SearchRequest + { + Count = true, + HighlightPostTag = "", + HighlightPreTag = "", + QueryType = QueryType.Semantic, + Search = "how do clouds form", + SemanticConfiguration = "my-semantic-config", + SemanticErrorHandling = SemanticErrorMode.Partial, + SemanticMaxWaitInMilliseconds = 780, + Answers = new QueryAnswerType("extractive|count-3"), + Captions = new QueryCaptionType("extractive|highlight-true"), + }; + Response response = await client.SearchPostAsync("myindex", searchRequest); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_GetDocument_SearchIndexGetDocument() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = client.GetDocument("getdocumentexample", "1", new string[] { "docId", "title", "description" }, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_GetDocument_SearchIndexGetDocument_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = await client.GetDocumentAsync("getdocumentexample", "1", new string[] { "docId", "title", "description" }, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_GetDocument_SearchIndexGetDocument_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = client.GetDocument("getdocumentexample", "1"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_GetDocument_SearchIndexGetDocument_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = await client.GetDocumentAsync("getdocumentexample", "1"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_SuggestGet_SearchIndexSuggestDocumentsGet() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = client.SuggestGet("myindex", "hote", "sg", "rating gt 10", false, "", "", 80, new string[] { "search.score() desc", "rating desc" }, new string[] { "title" }, new string[] { "docId", "title", "description" }, 10, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.text").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_SuggestGet_SearchIndexSuggestDocumentsGet_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = await client.SuggestGetAsync("myindex", "hote", "sg", "rating gt 10", false, "", "", 80, new string[] { "search.score() desc", "rating desc" }, new string[] { "title" }, new string[] { "docId", "title", "description" }, 10, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.text").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_SuggestGet_SearchIndexSuggestDocumentsGet_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = client.SuggestGet("myindex", "hote", "sg"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_SuggestGet_SearchIndexSuggestDocumentsGet_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = await client.SuggestGetAsync("myindex", "hote", "sg"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_SuggestPost_SearchIndexSuggestDocumentsPost() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + using RequestContent content = RequestContent.Create(new + { + filter = "rating gt 4.0", + highlightPostTag = "", + highlightPreTag = "", + minimumCoverage = 80, + orderby = "rating desc", + search = "hote", + searchFields = "title", + select = "docId,title,description", + suggesterName = "sg", + top = 10, + }); + Response response = client.SuggestPost("myindex", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.text").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_SuggestPost_SearchIndexSuggestDocumentsPost_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + using RequestContent content = RequestContent.Create(new + { + filter = "rating gt 4.0", + highlightPostTag = "", + highlightPreTag = "", + minimumCoverage = 80, + orderby = "rating desc", + search = "hote", + searchFields = "title", + select = "docId,title,description", + suggesterName = "sg", + top = 10, + }); + Response response = await client.SuggestPostAsync("myindex", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("@search.text").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_SuggestPost_SearchIndexSuggestDocumentsPost_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + SuggestRequest suggestRequest = new SuggestRequest("hote", "sg") + { + Filter = "rating gt 4.0", + HighlightPostTag = "", + HighlightPreTag = "", + MinimumCoverage = 80, + Orderby = "rating desc", + SearchFields = "title", + Select = "docId,title,description", + Top = 10, + }; + Response response = client.SuggestPost("myindex", suggestRequest); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_SuggestPost_SearchIndexSuggestDocumentsPost_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + SuggestRequest suggestRequest = new SuggestRequest("hote", "sg") + { + Filter = "rating gt 4.0", + HighlightPostTag = "", + HighlightPreTag = "", + MinimumCoverage = 80, + Orderby = "rating desc", + SearchFields = "title", + Select = "docId,title,description", + Top = 10, + }; + Response response = await client.SuggestPostAsync("myindex", suggestRequest); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_Index_SearchIndexIndexDocuments() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + using RequestContent content = RequestContent.Create(new + { + value = new object[] + { +new Dictionary +{ +["@search.action"] = "upload" +}, +new Dictionary +{ +["@search.action"] = "merge" +}, +new Dictionary +{ +["@search.action"] = "mergeOrUpload" +}, +new Dictionary +{ +["@search.action"] = "delete" +} + }, + }); + Response response = client.Index("indexdocumentsexample", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("key").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("statusCode").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_Index_SearchIndexIndexDocuments_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + using RequestContent content = RequestContent.Create(new + { + value = new object[] + { +new Dictionary +{ +["@search.action"] = "upload" +}, +new Dictionary +{ +["@search.action"] = "merge" +}, +new Dictionary +{ +["@search.action"] = "mergeOrUpload" +}, +new Dictionary +{ +["@search.action"] = "delete" +} + }, + }); + Response response = await client.IndexAsync("indexdocumentsexample", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("key").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("statusCode").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_Index_SearchIndexIndexDocuments_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + IndexBatch batch = new IndexBatch(new IndexAction[] + { +new IndexAction +{ +ActionType = IndexActionType.Upload, +}, +new IndexAction +{ +ActionType = IndexActionType.Merge, +}, +new IndexAction +{ +ActionType = IndexActionType.MergeOrUpload, +}, +new IndexAction +{ +ActionType = IndexActionType.Delete, +} + }); + Response response = client.Index("indexdocumentsexample", batch); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_Index_SearchIndexIndexDocuments_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + IndexBatch batch = new IndexBatch(new IndexAction[] + { +new IndexAction +{ +ActionType = IndexActionType.Upload, +}, +new IndexAction +{ +ActionType = IndexActionType.Merge, +}, +new IndexAction +{ +ActionType = IndexActionType.MergeOrUpload, +}, +new IndexAction +{ +ActionType = IndexActionType.Delete, +} + }); + Response response = await client.IndexAsync("indexdocumentsexample", batch); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_AutocompleteGet_SearchIndexAutocompleteDocumentsGet() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = client.AutocompleteGet("myindex", "washington medic", "sg", "oneTerm", null, false, "", "", 80, new string[] { "title", "description" }, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("queryPlusText").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_AutocompleteGet_SearchIndexAutocompleteDocumentsGet_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = await client.AutocompleteGetAsync("myindex", "washington medic", "sg", "oneTerm", null, false, "", "", 80, new string[] { "title", "description" }, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("queryPlusText").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_AutocompleteGet_SearchIndexAutocompleteDocumentsGet_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = client.AutocompleteGet("myindex", "washington medic", "sg"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_AutocompleteGet_SearchIndexAutocompleteDocumentsGet_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + Response response = await client.AutocompleteGetAsync("myindex", "washington medic", "sg"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_AutocompletePost_SearchIndexAutocompleteDocumentsPost() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + using RequestContent content = RequestContent.Create(new + { + autocompleteMode = "oneTerm", + search = "washington medic", + suggesterName = "sg", + filter = "search.in(docId,'101,102,105')", + highlightPostTag = "", + highlightPreTag = "", + minimumCoverage = 80, + searchFields = "title,description", + top = 10, + }); + Response response = client.AutocompletePost("myindex", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("queryPlusText").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_AutocompletePost_SearchIndexAutocompleteDocumentsPost_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + using RequestContent content = RequestContent.Create(new + { + autocompleteMode = "oneTerm", + search = "washington medic", + suggesterName = "sg", + filter = "search.in(docId,'101,102,105')", + highlightPostTag = "", + highlightPreTag = "", + minimumCoverage = 80, + searchFields = "title,description", + top = 10, + }); + Response response = await client.AutocompletePostAsync("myindex", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("queryPlusText").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Documents_AutocompletePost_SearchIndexAutocompleteDocumentsPost_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + AutocompleteRequest autocompleteRequest = new AutocompleteRequest("washington medic", "sg") + { + AutocompleteMode = AutocompleteMode.OneTerm, + Filter = "search.in(docId,'101,102,105')", + HighlightPostTag = "", + HighlightPreTag = "", + MinimumCoverage = 80, + SearchFields = "title,description", + Top = 10, + }; + Response response = client.AutocompletePost("myindex", autocompleteRequest); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Documents_AutocompletePost_SearchIndexAutocompleteDocumentsPost_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + Documents client = new SearchClient(endpoint, credential).GetDocumentsClient(apiVersion: "2024-07-01"); + + AutocompleteRequest autocompleteRequest = new AutocompleteRequest("washington medic", "sg") + { + AutocompleteMode = AutocompleteMode.OneTerm, + Filter = "search.in(docId,'101,102,105')", + HighlightPostTag = "", + HighlightPreTag = "", + MinimumCoverage = 80, + SearchFields = "title,description", + Top = 10, + }; + Response response = await client.AutocompletePostAsync("myindex", autocompleteRequest); + } + } +} diff --git a/sdk/search/Azure.Search.Documents.Search/tsp-location.yaml b/sdk/search/Azure.Search.Documents.Search/tsp-location.yaml new file mode 100644 index 000000000000..ccb8adf43ea2 --- /dev/null +++ b/sdk/search/Azure.Search.Documents.Search/tsp-location.yaml @@ -0,0 +1,5 @@ +directory: specification/search/Azure.Search.Index +commit: 3b2e690eef322f0774065210f9d9a2939e0c1674 +repo: Azure/azure-rest-api-specs +additionalDirectories: +- specification/search/Azure.Search diff --git a/sdk/search/Azure.Search.Documents/Configuration.json b/sdk/search/Azure.Search.Documents/Configuration.json new file mode 100644 index 000000000000..e1acfd58f3cd --- /dev/null +++ b/sdk/search/Azure.Search.Documents/Configuration.json @@ -0,0 +1,12 @@ +{ + "output-folder": ".", + "namespace": "Azure.Search.Documents", + "library-name": "Azure.Search.Documents", + "flavor": "azure", + "use-model-reader-writer": true, + "shared-source-folders": [ + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Generator.Shared", + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Azure.Core.Shared" + ], + "model-namespace": false +} diff --git a/sdk/search/Azure.Search.Documents/src/autorest.md b/sdk/search/Azure.Search.Documents/src/autorest.md deleted file mode 100644 index 689c9034ba14..000000000000 --- a/sdk/search/Azure.Search.Documents/src/autorest.md +++ /dev/null @@ -1,551 +0,0 @@ -# Azure.Search.Documents Code Generation - -Run `dotnet build /t:GenerateCode` in the `src` directory to generate SDK code. - -See the [Contributing guidelines](https://github.com/Azure/azure-sdk-for-net/blob/fe0bf0e7e84a406ec2102c194ea05ccd5011a141/sdk/search/CONTRIBUTING.md) for more details. - -## AutoRest Configuration -> see https://aka.ms/autorest - -## Swagger Source(s) -```yaml -title: SearchServiceClient -input-file: - - https://github.com/Azure/azure-rest-api-specs/blob/8c53aa7023e66a9ec24ede6a9fad0ed730d62515/specification/search/data-plane/Azure.Search/preview/2025-03-01-preview/searchindex.json - - https://github.com/Azure/azure-rest-api-specs/blob/8c53aa7023e66a9ec24ede6a9fad0ed730d62515/specification/search/data-plane/Azure.Search/preview/2025-03-01-preview/searchservice.json -generation1-convenience-client: true -deserialize-null-collection-as-null-value: true -``` - -## Release hacks -We only want certain client methods for our search query client. -``` yaml -directive: -- remove-operation: Documents_AutocompleteGet -- remove-operation: Documents_SearchGet -- remove-operation: Documents_SuggestGet -``` - -### Suppress Abstract Base Class - -``` yaml -suppress-abstract-base-class: -- CharFilter -- CognitiveServicesAccount -- DataChangeDetectionPolicy -- DataDeletionDetectionPolicy -- LexicalAnalyzer -- LexicalNormalizer -- LexicalTokenizer -- ScoringFunction -- SearchIndexerDataIdentity -- SearchIndexerSkill -- Similarity -- TokenFilter -``` - - -## CodeGen hacks -These should eventually be fixed in the code generator. - -## Swagger hacks -These should eventually be fixed in the swagger files. -``` yaml -directive: - from: swagger-document - where: $.definitions.LexicalNormalizer - transform: > - $["discriminator"] = "@odata.type"; -``` - -## Renaming models after the AI Studio rebrand to AI Foundry -These should eventually be fixed in the swagger files. -```yaml -directive: -- from: "searchservice.json" - where: $.definitions.AIStudioModelCatalogName - transform: $["x-ms-enum"].name = "AIFoundryModelCatalogName"; -``` - -### Mark definitions as objects -The modeler warns about models without an explicit type. -``` yaml -directive: -- from: swagger-document - where: $.definitions.* - transform: > - if (typeof $.type === "undefined") { - $.type = "object"; - } -``` - -### Make Lookup Document behave a little friendlier -It's currently an empty object and adding Additional Properties will generate -a more useful model. -``` yaml -directive: -- from: swagger-document - where: $.paths["/docs('{key}')"].get.responses["200"].schema - transform: > - $.additionalProperties = true; -``` - -### Fix `SearchResult["@search.documentDebugInfo"]` -``` yaml -directive: - - from: searchindex.json - where: $.definitions.SearchResult.properties - transform: > - $["@search.documentDebugInfo"]["$ref"] = $["@search.documentDebugInfo"].items["$ref"]; - delete $["@search.documentDebugInfo"].type; - delete $["@search.documentDebugInfo"].items; -``` - -### Archboard feedback for 11.6.0 - -```yaml -directive: -- from: "searchservice.json" - where: $.definitions - transform: > - $.AzureOpenAIParameters["x-ms-client-name"] = "AzureOpenAIVectorizerParameters"; - $.AzureOpenAIParameters.properties.authIdentity["x-ms-client-name"] = "AuthenticationIdentity"; - $.AzureOpenAIParameters.properties.resourceUri["x-ms-client-name"] = "resourceUri"; - - $.VectorSearchVectorizer.properties.name["x-ms-client-name"] = "VectorizerName"; - $.AzureOpenAIVectorizer.properties.azureOpenAIParameters["x-ms-client-name"] = "Parameters"; - - $.ScalarQuantizationVectorSearchCompressionConfiguration["x-ms-client-name"] = "ScalarQuantizationCompression"; - $.BinaryQuantizationVectorSearchCompressionConfiguration["x-ms-client-name"] = "BinaryQuantizationCompression"; - $.VectorSearchCompressionConfiguration["x-ms-client-name"] = "VectorSearchCompression"; - $.VectorSearchCompressionConfiguration.properties.name["x-ms-client-name"] = "CompressionName"; - $.VectorSearchProfile.properties.compression["x-ms-client-name"] = "CompressionName"; - - $.OcrSkillLineEnding["x-ms-client-name"] = "OcrLineEnding"; - $.OcrSkillLineEnding["x-ms-enum"].name = "OcrLineEnding"; - - $.SearchIndexerDataUserAssignedIdentity.properties.userAssignedIdentity["x-ms-format"] = "arm-id"; - $.SearchIndexerIndexProjections["x-ms-client-name"] = "SearchIndexerIndexProjection"; - $.SearchIndexerSkillset.properties.indexProjections["x-ms-client-name"] = "indexProjection"; - - $.VectorSearchCompressionTargetDataType["x-ms-client-name"] = "VectorSearchCompressionTarget"; - $.VectorSearchCompressionTargetDataType["x-ms-enum"].name = "VectorSearchCompressionTarget"; - - $.WebApiVectorizer.properties.customWebApiParameters["x-ms-client-name"] = "Parameters"; - $.WebApiParameters["x-ms-client-name"] = "WebApiVectorizerParameters"; - $.WebApiParameters.properties.uri["x-ms-client-name"] = "uri"; -``` - -### Change VectorizableImageUrlQuery.Url type to Uri - -```yaml -directive: - from: swagger-document - where: $.definitions.VectorizableImageUrlQuery.properties.url - transform: $.format = "url" -``` - -### Set `hybridSearch` property to be type `HybridSearch` in SearchRequest - -``` yaml -directive: - - from: searchindex.json - where: $.definitions.SearchRequest.properties - transform: > - delete $.hybridSearch["type"]; - delete $.hybridSearch.items; - $.hybridSearch["$ref"] = "#/definitions/HybridSearch"; -``` - -### Enable `RawVectorQuery.vector` as embedding field - -```yaml -directive: -- from: searchindex.json - where: $.definitions.RawVectorQuery.properties.vector - transform: $["x-ms-embedding-vector"] = true; -``` - -### Make `VectorSearchAlgorithmKind` internal - -```yaml -directive: -- from: searchservice.json - where: $.definitions.VectorSearchAlgorithmKind - transform: $["x-accessibility"] = "internal" -``` - -### Make `VectorSearchCompressionKind` internal - -```yaml -directive: -- from: searchservice.json - where: $.definitions.VectorSearchCompressionKind - transform: $["x-accessibility"] = "internal" -``` - -### Make `VectorSearchCompressionKind` internal - -```yaml -directive: -- from: searchservice.json - where: $.definitions.VectorSearchCompressionKind - transform: $["x-accessibility"] = "internal" -``` - -### Make `VectorQueryKind` internal - -```yaml -directive: -- from: searchindex.json - where: $.definitions.VectorQueryKind - transform: $["x-accessibility"] = "internal" -``` - -### Make `VectorSearchVectorizerKind` internal - -```yaml -directive: -- from: searchservice.json - where: $.definitions.VectorSearchVectorizerKind - transform: $["x-accessibility"] = "internal" -``` - -### Make `VectorThresholdKind` internal - -```yaml -directive: -- from: searchindex.json - where: $.definitions.VectorThresholdKind - transform: $["x-accessibility"] = "internal" -``` - -### Rename `RawVectorQuery` to `VectorizedQuery` - -```yaml -directive: -- from: searchindex.json - where: $.definitions.RawVectorQuery - transform: $["x-ms-client-name"] = "VectorizedQuery"; -``` - -### Rename `AMLVectorizer` to `AzureMachineLearningVectorizer` - -```yaml -directive: -- from: searchservice.json - where: $.definitions.AMLVectorizer - transform: $["x-ms-client-name"] = "AzureMachineLearningVectorizer"; -``` - -### Rename `AMLParameters` to `AzureMachineLearningParameters` - -```yaml -directive: -- from: searchservice.json - where: $.definitions.AMLParameters - transform: $["x-ms-client-name"] = "AzureMachineLearningParameters"; -``` - -### Rename `ServiceLimits.maxStoragePerIndex` to `ServiceLimits.maxStoragePerIndexInBytes` - -```yaml -directive: -- from: searchservice.json - where: $.definitions.ServiceLimits - transform: $.properties.maxStoragePerIndex["x-ms-client-name"] = "maxStoragePerIndexInBytes"; -``` - -### Rename `PIIDetectionSkill.minimumPrecision` to `PIIDetectionSkill.MinPrecision` - -```yaml -directive: - - from: searchservice.json - where: $.definitions.PIIDetectionSkill - transform: $.properties.minimumPrecision["x-ms-client-name"] = "MinPrecision"; -``` - -### Rename `VectorQuery` property `K` - - Rename `VectorQuery` property `K` to `KNearestNeighborsCount` - -```yaml -directive: -- from: searchindex.json - where: $.definitions.VectorQuery.properties.k - transform: $["x-ms-client-name"] = "KNearestNeighborsCount"; -``` - -### Rename one of SearchMode definitions - -SearchMode is duplicated across swaggers. Rename one of them, even though it will be internalized. -This prevents the serializer from attempting to use undefined values until [Azure/autorest.csharp#583](https://github.com/Azure/autorest.csharp/issues/583) is fixed. - -```yaml -directive: -- from: searchservice.json - where: $.definitions.Suggester.properties.searchMode - transform: $["x-ms-enum"].name = "SuggesterMode"; -``` - -### Add nullable annotations - -``` yaml -directive: - from: swagger-document - where: $.definitions.SynonymMap - transform: > - $.properties.encryptionKey["x-nullable"] = true; -``` - -``` yaml -directive: - from: swagger-document - where: $.definitions.SearchField - transform: > - $.properties.indexAnalyzer["x-nullable"] = true; - $.properties.searchAnalyzer["x-nullable"] = true; - $.properties.analyzer["x-nullable"] = true; -``` - -``` yaml -directive: - from: swagger-document - where: $.definitions.ScoringProfile - transform: > - $.properties.text["x-nullable"] = true; - $.properties.functionAggregation["x-nullable"] = true; -``` - -``` yaml -directive: - from: swagger-document - where: $.definitions.SearchIndex - transform: > - $.properties.encryptionKey["x-nullable"] = true; - $.properties.corsOptions["x-nullable"] = true; -``` - -``` yaml -directive: - from: swagger-document - where: $.definitions.BM25Similarity - transform: > - $.properties.k1["x-nullable"] = true; - $.properties.b["x-nullable"] = true; -``` - -``` yaml -directive: - from: swagger-document - where: $.definitions.SearchIndexerDataSource - transform: > - $.properties.dataChangeDetectionPolicy["x-nullable"] = true; -``` - -``` yaml -directive: - from: swagger-document - where: $.definitions.SearchIndexerDataSource - transform: > - $.properties.dataDeletionDetectionPolicy["x-nullable"] = true; -``` - -``` yaml -directive: - from: swagger-document - where: $.definitions.SearchIndexer - transform: > - $.properties.disabled["x-nullable"] = true; - $.properties.schedule["x-nullable"] = true; - $.properties.parameters["x-nullable"] = true; -``` - -``` yaml -directive: - from: swagger-document - where: $.definitions.SearchIndexerStatus - transform: > - $.properties.lastResult["x-nullable"] = true; -``` - -``` yaml -directive: - from: swagger-document - where: $.definitions.TextTranslationSkill - transform: > - $.properties.suggestedFrom["x-nullable"] = true; -``` - -``` yaml -directive: - from: swagger-document - where: $.definitions.IndexingParameters - transform: > - $.properties.batchSize["x-nullable"] = true; - $.properties.maxFailedItems["x-nullable"] = true; - $.properties.maxFailedItemsPerBatch["x-nullable"] = true; -``` - -``` yaml -directive: - from: swagger-document - where: $.definitions.FieldMapping - transform: > - $.properties.mappingFunction["x-nullable"] = true; -``` - -``` yaml -directive: - from: swagger-document - where: $.definitions.IndexerExecutionResult - transform: > - $.properties.endTime["x-nullable"] = true; - $.properties.statusDetail["x-nullable"] = true; -``` - -``` yaml -directive: - from: swagger-document - where: $.definitions.CorsOptions - transform: > - $.properties.maxAgeInSeconds["x-nullable"] = true; -``` - -#### Skills - -``` yaml -directive: -- from: swagger-document - where: $.definitions.EntityRecognitionSkill - transform: > - $.properties.defaultLanguageCode["x-nullable"] = true; - -- from: swagger-document - where: $.definitions.ImageAnalysisSkill - transform: > - $.properties.defaultLanguageCode["x-nullable"] = true; - -- from: swagger-document - where: $.definitions.KeyPhraseExtractionSkill - transform: > - $.properties.defaultLanguageCode["x-nullable"] = true; - -- from: swagger-document - where: $.definitions.OcrSkill - transform: > - $.properties.defaultLanguageCode["x-nullable"] = true; - $.properties.detectOrientation["x-nullable"] = true; - -- from: swagger-document - where: $.definitions.SentimentSkill - transform: > - $.properties.defaultLanguageCode["x-nullable"] = true; - -- from: swagger-document - where: $.definitions.SplitSkill - transform: > - $.properties.defaultLanguageCode["x-nullable"] = true; - -- from: swagger-document - where: $.definitions.TextTranslationSkill - transform: > - $.properties.defaultFromLanguageCode["x-nullable"] = true; - -- from: swagger-document - where: $.definitions.WebApiSkill - transform: > - $.properties.httpHeaders["x-nullable"] = true; - $.properties.timeout["x-nullable"] = true; -``` - -## C# Customizations -Shape the swagger APIs to produce the best C# API possible. We can consider -fixing these in the swagger files if they would benefit other languages. - -### Property name changes -Change the name of some properties so they are properly CamelCased. -``` yaml -modelerfour: - naming: - override: - "@odata.type": ODataType -``` - -### Disable parameter grouping - -AutoRest C# supports parameter grouping now, temporary disabling to reduce the change size. - -``` yaml -modelerfour: - group-parameters: false -``` - -### Set odata.metadata Accept header in operations - -searchindex.json needs odata.metadata=none and searchservice.json needs odata.metadata=minimal in the Accept header. - -```yaml -directive: -- from: swagger-document - where: $.paths - transform: > - for (var path in $) { - for (var opName in $[path]) { - var accept = "application/json; odata.metadata="; - accept += path.startsWith("/docs") ? "none" : "minimal"; - - var op = $[path][opName]; - op.parameters.push({ - name: "Accept", - "in": "header", - required: true, - type: "string", - enum: [ accept ], - "x-ms-enum": { "modelAsString": false }, - "x-ms-parameter-location": "method" - }); - } - } - - return $; -``` - -### Move service models to Azure.Search.Documents.Indexes.Models - -Models in searchservice.json should be moved to Azure.Search.Documents.Indexes.Models. - -```yaml -directive: - from: searchservice.json - where: $.definitions.* - transform: > - $["x-namespace"] = "Azure.Search.Documents.Indexes.Models" -``` - -### Relocate x-ms-client-request-id parameter - -Remove the `x-ms-client-request-id` parameter from all methods and put it on the client. -This will be later removed when https://github.com/Azure/autorest.csharp/issues/782 is resolved. -Several attempts at just removing the parameter have caused downstream issues, so relocating it for now. - -```yaml -directive: - from: swagger-document - where: $.parameters.ClientRequestIdParameter - transform: $["x-ms-parameter-location"] = "client"; -``` - -## Seal single value enums - -Prevents the creation of single-value extensible enum in generated code. The following single-value enum will be generated as string constant. - -```yaml -directive: - from: swagger-document - where: $.parameters.PreferHeaderParameter - transform: > - $["x-ms-enum"] = { - "modelAsString": false - } -``` diff --git a/sdk/search/Azure.Search.Documents/tsp-location.yaml b/sdk/search/Azure.Search.Documents/tsp-location.yaml new file mode 100644 index 000000000000..64b522a7fd39 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/search/Azure.Search +commit: 3b2e690eef322f0774065210f9d9a2939e0c1674 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/search/Azure.Search.Documents/tspCodeModel.json b/sdk/search/Azure.Search.Documents/tspCodeModel.json new file mode 100644 index 000000000000..1a8adb72826b --- /dev/null +++ b/sdk/search/Azure.Search.Documents/tspCodeModel.json @@ -0,0 +1,68392 @@ +{ + "$id": "1", + "name": "Search", + "apiVersions": [ + "2024-07-01" + ], + "enums": [ + { + "$id": "2", + "kind": "enum", + "name": "QueryType", + "crossLanguageDefinitionId": "Search.QueryType", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "Simple", + "value": "simple", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Uses the simple query syntax for searches. Search text is interpreted using a\nsimple query language that allows for symbols such as +, * and \"\". Queries are\nevaluated across all searchable fields by default, unless the searchFields\nparameter is specified.", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "Full", + "value": "full", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Uses the full Lucene query syntax for searches. Search text is interpreted\nusing the Lucene query language which allows field-specific and weighted\nsearches, as well as other advanced features.", + "decorators": [] + }, + { + "$id": "8", + "kind": "enumvalue", + "name": "Semantic", + "value": "semantic", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Best suited for queries expressed in natural language as opposed to keywords.\nImproves precision of search results by re-ranking the top search results using\na ranking model trained on the Web corpus.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Specifies the syntax of the search query. The default is 'simple'. Use 'full'\nif your query uses the Lucene query syntax.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "10", + "kind": "enum", + "name": "SearchMode", + "crossLanguageDefinitionId": "Search.SearchMode", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "12", + "kind": "enumvalue", + "name": "Any", + "value": "any", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "doc": "Any of the search terms must be matched in order to count the document as a\nmatch.", + "decorators": [] + }, + { + "$id": "14", + "kind": "enumvalue", + "name": "All", + "value": "all", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "doc": "All of the search terms must be matched in order to count the document as a\nmatch.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Specifies whether any or all of the search terms must be matched in order to\ncount the document as a match.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "16", + "kind": "enum", + "name": "ScoringStatistics", + "crossLanguageDefinitionId": "Search.ScoringStatistics", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "18", + "kind": "enumvalue", + "name": "Local", + "value": "local", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "16" + }, + "doc": "The scoring statistics will be calculated locally for lower latency.", + "decorators": [] + }, + { + "$id": "20", + "kind": "enumvalue", + "name": "Global", + "value": "global", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "16" + }, + "doc": "The scoring statistics will be calculated globally for more consistent scoring.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "A value that specifies whether we want to calculate scoring statistics (such as\ndocument frequency) globally for more consistent scoring, or locally, for lower\nlatency. The default is 'local'. Use 'global' to aggregate scoring statistics\nglobally before scoring. Using global scoring statistics can increase latency\nof search queries.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "22", + "kind": "enum", + "name": "SemanticErrorMode", + "crossLanguageDefinitionId": "Search.SemanticErrorMode", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "24", + "kind": "enumvalue", + "name": "Partial", + "value": "partial", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "If the semantic processing fails, partial results still return. The definition\nof partial results depends on what semantic step failed and what was the reason\nfor failure.", + "decorators": [] + }, + { + "$id": "26", + "kind": "enumvalue", + "name": "Fail", + "value": "fail", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "If there is an exception during the semantic processing step, the query will\nfail and return the appropriate HTTP code depending on the error.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Allows the user to choose whether a semantic call should fail completely, or to\nreturn partial results.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "28", + "kind": "enum", + "name": "QueryAnswerType", + "crossLanguageDefinitionId": "Search.QueryAnswerType", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "30", + "kind": "enumvalue", + "name": "None", + "value": "none", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "28" + }, + "doc": "Do not return answers for the query.", + "decorators": [] + }, + { + "$id": "32", + "kind": "enumvalue", + "name": "Extractive", + "value": "extractive", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "28" + }, + "doc": "Extracts answer candidates from the contents of the documents returned in\nresponse to a query expressed as a question in natural language.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "This parameter is only valid if the query type is `semantic`. If set, the query\nreturns answers extracted from key passages in the highest ranked documents.\nThe number of answers returned can be configured by appending the pipe\ncharacter `|` followed by the `count-` option after the\nanswers parameter value, such as `extractive|count-3`. Default count is 1. The\nconfidence threshold can be configured by appending the pipe character `|`\nfollowed by the `threshold-` option after the answers\nparameter value, such as `extractive|threshold-0.9`. Default threshold is 0.7.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "34", + "kind": "enum", + "name": "QueryCaptionType", + "crossLanguageDefinitionId": "Search.QueryCaptionType", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "36", + "kind": "enumvalue", + "name": "None", + "value": "none", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "34" + }, + "doc": "Do not return captions for the query.", + "decorators": [] + }, + { + "$id": "38", + "kind": "enumvalue", + "name": "Extractive", + "value": "extractive", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "34" + }, + "doc": "Extracts captions from the matching documents that contain passages relevant to\nthe search query.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "This parameter is only valid if the query type is `semantic`. If set, the query\nreturns captions extracted from key passages in the highest ranked documents.\nWhen Captions is set to `extractive`, highlighting is enabled by default, and\ncan be configured by appending the pipe character `|` followed by the\n`highlight-` option, such as `extractive|highlight-true`. Defaults\nto `None`.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "40", + "kind": "enum", + "name": "VectorQueryKind", + "crossLanguageDefinitionId": "Search.VectorQueryKind", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "42", + "kind": "enumvalue", + "name": "Vector", + "value": "vector", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "40" + }, + "doc": "Vector query where a raw vector value is provided.", + "decorators": [] + }, + { + "$id": "44", + "kind": "enumvalue", + "name": "Text", + "value": "text", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "40" + }, + "doc": "Vector query where a text value that needs to be vectorized is provided.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The kind of vector query being performed.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "46", + "kind": "enum", + "name": "VectorFilterMode", + "crossLanguageDefinitionId": "Search.VectorFilterMode", + "valueType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "48", + "kind": "enumvalue", + "name": "PostFilter", + "value": "postFilter", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "46" + }, + "doc": "The filter will be applied after the candidate set of vector results is\nreturned. Depending on the filter selectivity, this can result in fewer results\nthan requested by the parameter 'k'.", + "decorators": [] + }, + { + "$id": "50", + "kind": "enumvalue", + "name": "PreFilter", + "value": "preFilter", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "46" + }, + "doc": "The filter will be applied before the search query.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Determines whether or not filters are applied before or after the vector search\nis performed.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "52", + "kind": "enum", + "name": "SemanticErrorReason", + "crossLanguageDefinitionId": "Search.SemanticErrorReason", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "54", + "kind": "enumvalue", + "name": "MaxWaitExceeded", + "value": "maxWaitExceeded", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "If `semanticMaxWaitInMilliseconds` was set and the semantic processing duration\nexceeded that value. Only the base results were returned.", + "decorators": [] + }, + { + "$id": "56", + "kind": "enumvalue", + "name": "CapacityOverloaded", + "value": "capacityOverloaded", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "The request was throttled. Only the base results were returned.", + "decorators": [] + }, + { + "$id": "58", + "kind": "enumvalue", + "name": "Transient", + "value": "transient", + "valueType": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "At least one step of the semantic process failed.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Reason that a partial response was returned for a semantic ranking request.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "60", + "kind": "enum", + "name": "SemanticSearchResultsType", + "crossLanguageDefinitionId": "Search.SemanticSearchResultsType", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "62", + "kind": "enumvalue", + "name": "BaseResults", + "value": "baseResults", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "60" + }, + "doc": "Results without any semantic enrichment or reranking.", + "decorators": [] + }, + { + "$id": "64", + "kind": "enumvalue", + "name": "RerankedResults", + "value": "rerankedResults", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "60" + }, + "doc": "Results have been reranked with the reranker model and will include semantic\ncaptions. They will not include any answers, answers highlights or caption\nhighlights.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Type of partial response that was returned for a semantic ranking request.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "66", + "kind": "enum", + "name": "IndexActionType", + "crossLanguageDefinitionId": "Search.IndexActionType", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "68", + "kind": "enumvalue", + "name": "Upload", + "value": "upload", + "valueType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "Inserts the document into the index if it is new and updates it if it exists.\nAll fields are replaced in the update case.", + "decorators": [] + }, + { + "$id": "70", + "kind": "enumvalue", + "name": "Merge", + "value": "merge", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "Merges the specified field values with an existing document. If the document\ndoes not exist, the merge will fail. Any field you specify in a merge will\nreplace the existing field in the document. This also applies to collections of\nprimitive and complex types.", + "decorators": [] + }, + { + "$id": "72", + "kind": "enumvalue", + "name": "MergeOrUpload", + "value": "mergeOrUpload", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "Behaves like merge if a document with the given key already exists in the\nindex. If the document does not exist, it behaves like upload with a new\ndocument.", + "decorators": [] + }, + { + "$id": "74", + "kind": "enumvalue", + "name": "Delete", + "value": "delete", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "Removes the specified document from the index. Any field you specify in a\ndelete operation other than the key field will be ignored. If you want to\nremove an individual field from a document, use merge instead and set the field\nexplicitly to null.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The operation to perform on a document in an indexing batch.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "76", + "kind": "enum", + "name": "AutocompleteMode", + "crossLanguageDefinitionId": "Search.AutocompleteMode", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "78", + "kind": "enumvalue", + "name": "OneTerm", + "value": "oneTerm", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "76" + }, + "doc": "Only one term is suggested. If the query has two terms, only the last term is\ncompleted. For example, if the input is 'washington medic', the suggested terms\ncould include 'medicaid', 'medicare', and 'medicine'.", + "decorators": [] + }, + { + "$id": "80", + "kind": "enumvalue", + "name": "TwoTerms", + "value": "twoTerms", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "76" + }, + "doc": "Matching two-term phrases in the index will be suggested. For example, if the\ninput is 'medic', the suggested terms could include 'medicare coverage' and 'medical assistant'.", + "decorators": [] + }, + { + "$id": "82", + "kind": "enumvalue", + "name": "OneTermWithContext", + "value": "oneTermWithContext", + "valueType": { + "$id": "83", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "76" + }, + "doc": "Completes the last term in a query with two or more terms, where the last two\nterms are a phrase that exists in the index. For example, if the input is 'washington medic', the suggested terms could include 'washington medicaid' and 'washington medical'.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms'\nto get shingles and 'oneTermWithContext' to use the current context in\nproducing autocomplete terms.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "84", + "kind": "enum", + "name": "SearchFieldDataType", + "crossLanguageDefinitionId": "Search.SearchFieldDataType", + "valueType": { + "$id": "85", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "86", + "kind": "enumvalue", + "name": "String", + "value": "Edm.String", + "valueType": { + "$id": "87", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "84" + }, + "doc": "Indicates that a field contains a string.", + "decorators": [] + }, + { + "$id": "88", + "kind": "enumvalue", + "name": "Int32", + "value": "Edm.Int32", + "valueType": { + "$id": "89", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "84" + }, + "doc": "Indicates that a field contains a 32-bit signed integer.", + "decorators": [] + }, + { + "$id": "90", + "kind": "enumvalue", + "name": "Int64", + "value": "Edm.Int64", + "valueType": { + "$id": "91", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "84" + }, + "doc": "Indicates that a field contains a 64-bit signed integer.", + "decorators": [] + }, + { + "$id": "92", + "kind": "enumvalue", + "name": "Double", + "value": "Edm.Double", + "valueType": { + "$id": "93", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "84" + }, + "doc": "Indicates that a field contains an IEEE double-precision floating point number.", + "decorators": [] + }, + { + "$id": "94", + "kind": "enumvalue", + "name": "Boolean", + "value": "Edm.Boolean", + "valueType": { + "$id": "95", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "84" + }, + "doc": "Indicates that a field contains a Boolean value (true or false).", + "decorators": [] + }, + { + "$id": "96", + "kind": "enumvalue", + "name": "DateTimeOffset", + "value": "Edm.DateTimeOffset", + "valueType": { + "$id": "97", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "84" + }, + "doc": "Indicates that a field contains a date/time value, including timezone\ninformation.", + "decorators": [] + }, + { + "$id": "98", + "kind": "enumvalue", + "name": "GeographyPoint", + "value": "Edm.GeographyPoint", + "valueType": { + "$id": "99", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "84" + }, + "doc": "Indicates that a field contains a geo-location in terms of longitude and\nlatitude.", + "decorators": [] + }, + { + "$id": "100", + "kind": "enumvalue", + "name": "Complex", + "value": "Edm.ComplexType", + "valueType": { + "$id": "101", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "84" + }, + "doc": "Indicates that a field contains one or more complex objects that in turn have\nsub-fields of other types.", + "decorators": [] + }, + { + "$id": "102", + "kind": "enumvalue", + "name": "Single", + "value": "Edm.Single", + "valueType": { + "$id": "103", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "84" + }, + "doc": "Indicates that a field contains a single-precision floating point number. This\nis only valid when used with Collection(Edm.Single).", + "decorators": [] + }, + { + "$id": "104", + "kind": "enumvalue", + "name": "Half", + "value": "Edm.Half", + "valueType": { + "$id": "105", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "84" + }, + "doc": "Indicates that a field contains a half-precision floating point number. This is\nonly valid when used with Collection(Edm.Half).", + "decorators": [] + }, + { + "$id": "106", + "kind": "enumvalue", + "name": "Int16", + "value": "Edm.Int16", + "valueType": { + "$id": "107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "84" + }, + "doc": "Indicates that a field contains a 16-bit signed integer. This is only valid\nwhen used with Collection(Edm.Int16).", + "decorators": [] + }, + { + "$id": "108", + "kind": "enumvalue", + "name": "SByte", + "value": "Edm.SByte", + "valueType": { + "$id": "109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "84" + }, + "doc": "Indicates that a field contains a 8-bit signed integer. This is only valid when\nused with Collection(Edm.SByte).", + "decorators": [] + }, + { + "$id": "110", + "kind": "enumvalue", + "name": "Byte", + "value": "Edm.Byte", + "valueType": { + "$id": "111", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "84" + }, + "doc": "Indicates that a field contains a 8-bit unsigned integer. This is only valid\nwhen used with Collection(Edm.Byte).", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Defines the data type of a field in a search index.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "112", + "kind": "enum", + "name": "LexicalAnalyzerName", + "crossLanguageDefinitionId": "Search.LexicalAnalyzerName", + "valueType": { + "$id": "113", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "114", + "kind": "enumvalue", + "name": "ArMicrosoft", + "value": "ar.microsoft", + "valueType": { + "$id": "115", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Arabic.", + "decorators": [] + }, + { + "$id": "116", + "kind": "enumvalue", + "name": "ArLucene", + "value": "ar.lucene", + "valueType": { + "$id": "117", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Arabic.", + "decorators": [] + }, + { + "$id": "118", + "kind": "enumvalue", + "name": "HyLucene", + "value": "hy.lucene", + "valueType": { + "$id": "119", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Armenian.", + "decorators": [] + }, + { + "$id": "120", + "kind": "enumvalue", + "name": "BnMicrosoft", + "value": "bn.microsoft", + "valueType": { + "$id": "121", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Bangla.", + "decorators": [] + }, + { + "$id": "122", + "kind": "enumvalue", + "name": "EuLucene", + "value": "eu.lucene", + "valueType": { + "$id": "123", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Basque.", + "decorators": [] + }, + { + "$id": "124", + "kind": "enumvalue", + "name": "BgMicrosoft", + "value": "bg.microsoft", + "valueType": { + "$id": "125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Bulgarian.", + "decorators": [] + }, + { + "$id": "126", + "kind": "enumvalue", + "name": "BgLucene", + "value": "bg.lucene", + "valueType": { + "$id": "127", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Bulgarian.", + "decorators": [] + }, + { + "$id": "128", + "kind": "enumvalue", + "name": "CaMicrosoft", + "value": "ca.microsoft", + "valueType": { + "$id": "129", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Catalan.", + "decorators": [] + }, + { + "$id": "130", + "kind": "enumvalue", + "name": "CaLucene", + "value": "ca.lucene", + "valueType": { + "$id": "131", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Catalan.", + "decorators": [] + }, + { + "$id": "132", + "kind": "enumvalue", + "name": "ZhHansMicrosoft", + "value": "zh-Hans.microsoft", + "valueType": { + "$id": "133", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Chinese (Simplified).", + "decorators": [] + }, + { + "$id": "134", + "kind": "enumvalue", + "name": "ZhHansLucene", + "value": "zh-Hans.lucene", + "valueType": { + "$id": "135", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Chinese (Simplified).", + "decorators": [] + }, + { + "$id": "136", + "kind": "enumvalue", + "name": "ZhHantMicrosoft", + "value": "zh-Hant.microsoft", + "valueType": { + "$id": "137", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Chinese (Traditional).", + "decorators": [] + }, + { + "$id": "138", + "kind": "enumvalue", + "name": "ZhHantLucene", + "value": "zh-Hant.lucene", + "valueType": { + "$id": "139", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Chinese (Traditional).", + "decorators": [] + }, + { + "$id": "140", + "kind": "enumvalue", + "name": "HrMicrosoft", + "value": "hr.microsoft", + "valueType": { + "$id": "141", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Croatian.", + "decorators": [] + }, + { + "$id": "142", + "kind": "enumvalue", + "name": "CsMicrosoft", + "value": "cs.microsoft", + "valueType": { + "$id": "143", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Czech.", + "decorators": [] + }, + { + "$id": "144", + "kind": "enumvalue", + "name": "CsLucene", + "value": "cs.lucene", + "valueType": { + "$id": "145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Czech.", + "decorators": [] + }, + { + "$id": "146", + "kind": "enumvalue", + "name": "DaMicrosoft", + "value": "da.microsoft", + "valueType": { + "$id": "147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Danish.", + "decorators": [] + }, + { + "$id": "148", + "kind": "enumvalue", + "name": "DaLucene", + "value": "da.lucene", + "valueType": { + "$id": "149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Danish.", + "decorators": [] + }, + { + "$id": "150", + "kind": "enumvalue", + "name": "NlMicrosoft", + "value": "nl.microsoft", + "valueType": { + "$id": "151", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Dutch.", + "decorators": [] + }, + { + "$id": "152", + "kind": "enumvalue", + "name": "NlLucene", + "value": "nl.lucene", + "valueType": { + "$id": "153", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Dutch.", + "decorators": [] + }, + { + "$id": "154", + "kind": "enumvalue", + "name": "EnMicrosoft", + "value": "en.microsoft", + "valueType": { + "$id": "155", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for English.", + "decorators": [] + }, + { + "$id": "156", + "kind": "enumvalue", + "name": "EnLucene", + "value": "en.lucene", + "valueType": { + "$id": "157", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for English.", + "decorators": [] + }, + { + "$id": "158", + "kind": "enumvalue", + "name": "EtMicrosoft", + "value": "et.microsoft", + "valueType": { + "$id": "159", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Estonian.", + "decorators": [] + }, + { + "$id": "160", + "kind": "enumvalue", + "name": "FiMicrosoft", + "value": "fi.microsoft", + "valueType": { + "$id": "161", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Finnish.", + "decorators": [] + }, + { + "$id": "162", + "kind": "enumvalue", + "name": "FiLucene", + "value": "fi.lucene", + "valueType": { + "$id": "163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Finnish.", + "decorators": [] + }, + { + "$id": "164", + "kind": "enumvalue", + "name": "FrMicrosoft", + "value": "fr.microsoft", + "valueType": { + "$id": "165", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for French.", + "decorators": [] + }, + { + "$id": "166", + "kind": "enumvalue", + "name": "FrLucene", + "value": "fr.lucene", + "valueType": { + "$id": "167", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for French.", + "decorators": [] + }, + { + "$id": "168", + "kind": "enumvalue", + "name": "GlLucene", + "value": "gl.lucene", + "valueType": { + "$id": "169", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Galician.", + "decorators": [] + }, + { + "$id": "170", + "kind": "enumvalue", + "name": "DeMicrosoft", + "value": "de.microsoft", + "valueType": { + "$id": "171", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for German.", + "decorators": [] + }, + { + "$id": "172", + "kind": "enumvalue", + "name": "DeLucene", + "value": "de.lucene", + "valueType": { + "$id": "173", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for German.", + "decorators": [] + }, + { + "$id": "174", + "kind": "enumvalue", + "name": "ElMicrosoft", + "value": "el.microsoft", + "valueType": { + "$id": "175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Greek.", + "decorators": [] + }, + { + "$id": "176", + "kind": "enumvalue", + "name": "ElLucene", + "value": "el.lucene", + "valueType": { + "$id": "177", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Greek.", + "decorators": [] + }, + { + "$id": "178", + "kind": "enumvalue", + "name": "GuMicrosoft", + "value": "gu.microsoft", + "valueType": { + "$id": "179", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Gujarati.", + "decorators": [] + }, + { + "$id": "180", + "kind": "enumvalue", + "name": "HeMicrosoft", + "value": "he.microsoft", + "valueType": { + "$id": "181", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Hebrew.", + "decorators": [] + }, + { + "$id": "182", + "kind": "enumvalue", + "name": "HiMicrosoft", + "value": "hi.microsoft", + "valueType": { + "$id": "183", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Hindi.", + "decorators": [] + }, + { + "$id": "184", + "kind": "enumvalue", + "name": "HiLucene", + "value": "hi.lucene", + "valueType": { + "$id": "185", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Hindi.", + "decorators": [] + }, + { + "$id": "186", + "kind": "enumvalue", + "name": "HuMicrosoft", + "value": "hu.microsoft", + "valueType": { + "$id": "187", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Hungarian.", + "decorators": [] + }, + { + "$id": "188", + "kind": "enumvalue", + "name": "HuLucene", + "value": "hu.lucene", + "valueType": { + "$id": "189", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Hungarian.", + "decorators": [] + }, + { + "$id": "190", + "kind": "enumvalue", + "name": "IsMicrosoft", + "value": "is.microsoft", + "valueType": { + "$id": "191", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Icelandic.", + "decorators": [] + }, + { + "$id": "192", + "kind": "enumvalue", + "name": "IdMicrosoft", + "value": "id.microsoft", + "valueType": { + "$id": "193", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Indonesian (Bahasa).", + "decorators": [] + }, + { + "$id": "194", + "kind": "enumvalue", + "name": "IdLucene", + "value": "id.lucene", + "valueType": { + "$id": "195", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Indonesian.", + "decorators": [] + }, + { + "$id": "196", + "kind": "enumvalue", + "name": "GaLucene", + "value": "ga.lucene", + "valueType": { + "$id": "197", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Irish.", + "decorators": [] + }, + { + "$id": "198", + "kind": "enumvalue", + "name": "ItMicrosoft", + "value": "it.microsoft", + "valueType": { + "$id": "199", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Italian.", + "decorators": [] + }, + { + "$id": "200", + "kind": "enumvalue", + "name": "ItLucene", + "value": "it.lucene", + "valueType": { + "$id": "201", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Italian.", + "decorators": [] + }, + { + "$id": "202", + "kind": "enumvalue", + "name": "JaMicrosoft", + "value": "ja.microsoft", + "valueType": { + "$id": "203", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Japanese.", + "decorators": [] + }, + { + "$id": "204", + "kind": "enumvalue", + "name": "JaLucene", + "value": "ja.lucene", + "valueType": { + "$id": "205", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Japanese.", + "decorators": [] + }, + { + "$id": "206", + "kind": "enumvalue", + "name": "KnMicrosoft", + "value": "kn.microsoft", + "valueType": { + "$id": "207", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Kannada.", + "decorators": [] + }, + { + "$id": "208", + "kind": "enumvalue", + "name": "KoMicrosoft", + "value": "ko.microsoft", + "valueType": { + "$id": "209", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Korean.", + "decorators": [] + }, + { + "$id": "210", + "kind": "enumvalue", + "name": "KoLucene", + "value": "ko.lucene", + "valueType": { + "$id": "211", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Korean.", + "decorators": [] + }, + { + "$id": "212", + "kind": "enumvalue", + "name": "LvMicrosoft", + "value": "lv.microsoft", + "valueType": { + "$id": "213", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Latvian.", + "decorators": [] + }, + { + "$id": "214", + "kind": "enumvalue", + "name": "LvLucene", + "value": "lv.lucene", + "valueType": { + "$id": "215", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Latvian.", + "decorators": [] + }, + { + "$id": "216", + "kind": "enumvalue", + "name": "LtMicrosoft", + "value": "lt.microsoft", + "valueType": { + "$id": "217", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Lithuanian.", + "decorators": [] + }, + { + "$id": "218", + "kind": "enumvalue", + "name": "MlMicrosoft", + "value": "ml.microsoft", + "valueType": { + "$id": "219", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Malayalam.", + "decorators": [] + }, + { + "$id": "220", + "kind": "enumvalue", + "name": "MsMicrosoft", + "value": "ms.microsoft", + "valueType": { + "$id": "221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Malay (Latin).", + "decorators": [] + }, + { + "$id": "222", + "kind": "enumvalue", + "name": "MrMicrosoft", + "value": "mr.microsoft", + "valueType": { + "$id": "223", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Marathi.", + "decorators": [] + }, + { + "$id": "224", + "kind": "enumvalue", + "name": "NbMicrosoft", + "value": "nb.microsoft", + "valueType": { + "$id": "225", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Norwegian (Bokmål).", + "decorators": [] + }, + { + "$id": "226", + "kind": "enumvalue", + "name": "NoLucene", + "value": "no.lucene", + "valueType": { + "$id": "227", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Norwegian.", + "decorators": [] + }, + { + "$id": "228", + "kind": "enumvalue", + "name": "FaLucene", + "value": "fa.lucene", + "valueType": { + "$id": "229", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Persian.", + "decorators": [] + }, + { + "$id": "230", + "kind": "enumvalue", + "name": "PlMicrosoft", + "value": "pl.microsoft", + "valueType": { + "$id": "231", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Polish.", + "decorators": [] + }, + { + "$id": "232", + "kind": "enumvalue", + "name": "PlLucene", + "value": "pl.lucene", + "valueType": { + "$id": "233", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Polish.", + "decorators": [] + }, + { + "$id": "234", + "kind": "enumvalue", + "name": "PtBrMicrosoft", + "value": "pt-BR.microsoft", + "valueType": { + "$id": "235", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Portuguese (Brazil).", + "decorators": [] + }, + { + "$id": "236", + "kind": "enumvalue", + "name": "PtBrLucene", + "value": "pt-BR.lucene", + "valueType": { + "$id": "237", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Portuguese (Brazil).", + "decorators": [] + }, + { + "$id": "238", + "kind": "enumvalue", + "name": "PtPtMicrosoft", + "value": "pt-PT.microsoft", + "valueType": { + "$id": "239", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Portuguese (Portugal).", + "decorators": [] + }, + { + "$id": "240", + "kind": "enumvalue", + "name": "PtPtLucene", + "value": "pt-PT.lucene", + "valueType": { + "$id": "241", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Portuguese (Portugal).", + "decorators": [] + }, + { + "$id": "242", + "kind": "enumvalue", + "name": "PaMicrosoft", + "value": "pa.microsoft", + "valueType": { + "$id": "243", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Punjabi.", + "decorators": [] + }, + { + "$id": "244", + "kind": "enumvalue", + "name": "RoMicrosoft", + "value": "ro.microsoft", + "valueType": { + "$id": "245", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Romanian.", + "decorators": [] + }, + { + "$id": "246", + "kind": "enumvalue", + "name": "RoLucene", + "value": "ro.lucene", + "valueType": { + "$id": "247", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Romanian.", + "decorators": [] + }, + { + "$id": "248", + "kind": "enumvalue", + "name": "RuMicrosoft", + "value": "ru.microsoft", + "valueType": { + "$id": "249", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Russian.", + "decorators": [] + }, + { + "$id": "250", + "kind": "enumvalue", + "name": "RuLucene", + "value": "ru.lucene", + "valueType": { + "$id": "251", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Russian.", + "decorators": [] + }, + { + "$id": "252", + "kind": "enumvalue", + "name": "SrCyrillicMicrosoft", + "value": "sr-cyrillic.microsoft", + "valueType": { + "$id": "253", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Serbian (Cyrillic).", + "decorators": [] + }, + { + "$id": "254", + "kind": "enumvalue", + "name": "SrLatinMicrosoft", + "value": "sr-latin.microsoft", + "valueType": { + "$id": "255", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Serbian (Latin).", + "decorators": [] + }, + { + "$id": "256", + "kind": "enumvalue", + "name": "SkMicrosoft", + "value": "sk.microsoft", + "valueType": { + "$id": "257", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Slovak.", + "decorators": [] + }, + { + "$id": "258", + "kind": "enumvalue", + "name": "SlMicrosoft", + "value": "sl.microsoft", + "valueType": { + "$id": "259", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Slovenian.", + "decorators": [] + }, + { + "$id": "260", + "kind": "enumvalue", + "name": "EsMicrosoft", + "value": "es.microsoft", + "valueType": { + "$id": "261", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Spanish.", + "decorators": [] + }, + { + "$id": "262", + "kind": "enumvalue", + "name": "EsLucene", + "value": "es.lucene", + "valueType": { + "$id": "263", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Spanish.", + "decorators": [] + }, + { + "$id": "264", + "kind": "enumvalue", + "name": "SvMicrosoft", + "value": "sv.microsoft", + "valueType": { + "$id": "265", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Swedish.", + "decorators": [] + }, + { + "$id": "266", + "kind": "enumvalue", + "name": "SvLucene", + "value": "sv.lucene", + "valueType": { + "$id": "267", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Swedish.", + "decorators": [] + }, + { + "$id": "268", + "kind": "enumvalue", + "name": "TaMicrosoft", + "value": "ta.microsoft", + "valueType": { + "$id": "269", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Tamil.", + "decorators": [] + }, + { + "$id": "270", + "kind": "enumvalue", + "name": "TeMicrosoft", + "value": "te.microsoft", + "valueType": { + "$id": "271", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Telugu.", + "decorators": [] + }, + { + "$id": "272", + "kind": "enumvalue", + "name": "ThMicrosoft", + "value": "th.microsoft", + "valueType": { + "$id": "273", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Thai.", + "decorators": [] + }, + { + "$id": "274", + "kind": "enumvalue", + "name": "ThLucene", + "value": "th.lucene", + "valueType": { + "$id": "275", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Thai.", + "decorators": [] + }, + { + "$id": "276", + "kind": "enumvalue", + "name": "TrMicrosoft", + "value": "tr.microsoft", + "valueType": { + "$id": "277", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Turkish.", + "decorators": [] + }, + { + "$id": "278", + "kind": "enumvalue", + "name": "TrLucene", + "value": "tr.lucene", + "valueType": { + "$id": "279", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Lucene analyzer for Turkish.", + "decorators": [] + }, + { + "$id": "280", + "kind": "enumvalue", + "name": "UkMicrosoft", + "value": "uk.microsoft", + "valueType": { + "$id": "281", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Ukrainian.", + "decorators": [] + }, + { + "$id": "282", + "kind": "enumvalue", + "name": "UrMicrosoft", + "value": "ur.microsoft", + "valueType": { + "$id": "283", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Urdu.", + "decorators": [] + }, + { + "$id": "284", + "kind": "enumvalue", + "name": "ViMicrosoft", + "value": "vi.microsoft", + "valueType": { + "$id": "285", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Microsoft analyzer for Vietnamese.", + "decorators": [] + }, + { + "$id": "286", + "kind": "enumvalue", + "name": "StandardLucene", + "value": "standard.lucene", + "valueType": { + "$id": "287", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Standard Lucene analyzer.", + "decorators": [] + }, + { + "$id": "288", + "kind": "enumvalue", + "name": "StandardAsciiFoldingLucene", + "value": "standardasciifolding.lucene", + "valueType": { + "$id": "289", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Standard ASCII Folding Lucene analyzer. See\nhttps://learn.microsoft.com/rest/api/searchservice/Custom-analyzers-in-Azure-Search#Analyzers", + "decorators": [] + }, + { + "$id": "290", + "kind": "enumvalue", + "name": "Keyword", + "value": "keyword", + "valueType": { + "$id": "291", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Treats the entire content of a field as a single token. This is useful for data\nlike zip codes, ids, and some product names. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/KeywordAnalyzer.html", + "decorators": [] + }, + { + "$id": "292", + "kind": "enumvalue", + "name": "Pattern", + "value": "pattern", + "valueType": { + "$id": "293", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Flexibly separates text into terms via a regular expression pattern. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/PatternAnalyzer.html", + "decorators": [] + }, + { + "$id": "294", + "kind": "enumvalue", + "name": "Simple", + "value": "simple", + "valueType": { + "$id": "295", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Divides text at non-letters and converts them to lower case. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/SimpleAnalyzer.html", + "decorators": [] + }, + { + "$id": "296", + "kind": "enumvalue", + "name": "Stop", + "value": "stop", + "valueType": { + "$id": "297", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "Divides text at non-letters; Applies the lowercase and stopword token filters.\nSee\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/StopAnalyzer.html", + "decorators": [] + }, + { + "$id": "298", + "kind": "enumvalue", + "name": "Whitespace", + "value": "whitespace", + "valueType": { + "$id": "299", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "doc": "An analyzer that uses the whitespace tokenizer. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/WhitespaceAnalyzer.html", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Defines the names of all text analyzers supported by the search engine.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "300", + "kind": "enum", + "name": "VectorEncodingFormat", + "crossLanguageDefinitionId": "Search.VectorEncodingFormat", + "valueType": { + "$id": "301", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "302", + "kind": "enumvalue", + "name": "PackedBit", + "value": "packedBit", + "valueType": { + "$id": "303", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "300" + }, + "doc": "Encoding format representing bits packed into a wider data type.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The encoding format for interpreting vector field contents.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "304", + "kind": "enum", + "name": "ScoringFunctionInterpolation", + "crossLanguageDefinitionId": "Search.ScoringFunctionInterpolation", + "valueType": { + "$id": "305", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "306", + "kind": "enumvalue", + "name": "Linear", + "value": "linear", + "valueType": { + "$id": "307", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "304" + }, + "doc": "Boosts scores by a linearly decreasing amount. This is the default\ninterpolation for scoring functions.", + "decorators": [] + }, + { + "$id": "308", + "kind": "enumvalue", + "name": "Constant", + "value": "constant", + "valueType": { + "$id": "309", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "304" + }, + "doc": "Boosts scores by a constant factor.", + "decorators": [] + }, + { + "$id": "310", + "kind": "enumvalue", + "name": "Quadratic", + "value": "quadratic", + "valueType": { + "$id": "311", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "304" + }, + "doc": "Boosts scores by an amount that decreases quadratically. Boosts decrease slowly\nfor higher scores, and more quickly as the scores decrease. This interpolation\noption is not allowed in tag scoring functions.", + "decorators": [] + }, + { + "$id": "312", + "kind": "enumvalue", + "name": "Logarithmic", + "value": "logarithmic", + "valueType": { + "$id": "313", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "304" + }, + "doc": "Boosts scores by an amount that decreases logarithmically. Boosts decrease\nquickly for higher scores, and more slowly as the scores decrease. This\ninterpolation option is not allowed in tag scoring functions.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Defines the function used to interpolate score boosting across a range of\ndocuments.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "314", + "kind": "enum", + "name": "ScoringFunctionAggregation", + "crossLanguageDefinitionId": "Search.ScoringFunctionAggregation", + "valueType": { + "$id": "315", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "316", + "kind": "enumvalue", + "name": "Sum", + "value": "sum", + "valueType": { + "$id": "317", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "314" + }, + "doc": "Boost scores by the sum of all scoring function results.", + "decorators": [] + }, + { + "$id": "318", + "kind": "enumvalue", + "name": "Average", + "value": "average", + "valueType": { + "$id": "319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "314" + }, + "doc": "Boost scores by the average of all scoring function results.", + "decorators": [] + }, + { + "$id": "320", + "kind": "enumvalue", + "name": "Minimum", + "value": "minimum", + "valueType": { + "$id": "321", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "314" + }, + "doc": "Boost scores by the minimum of all scoring function results.", + "decorators": [] + }, + { + "$id": "322", + "kind": "enumvalue", + "name": "Maximum", + "value": "maximum", + "valueType": { + "$id": "323", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "314" + }, + "doc": "Boost scores by the maximum of all scoring function results.", + "decorators": [] + }, + { + "$id": "324", + "kind": "enumvalue", + "name": "FirstMatching", + "value": "firstMatching", + "valueType": { + "$id": "325", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "314" + }, + "doc": "Boost scores using the first applicable scoring function in the scoring profile.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Defines the aggregation function used to combine the results of all the scoring\nfunctions in a scoring profile.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "326", + "kind": "enum", + "name": "SearchSuggester_searchMode", + "valueType": { + "$id": "327", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "328", + "kind": "enumvalue", + "name": "analyzingInfixMatching", + "value": "analyzingInfixMatching", + "doc": "analyzingInfixMatching", + "valueType": { + "$ref": "327" + }, + "enumType": { + "$ref": "326" + } + } + ], + "crossLanguageDefinitionId": "", + "namespace": "Azure.Search.Documents", + "doc": "The SearchSuggester_searchMode", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "329", + "kind": "enum", + "name": "LexicalTokenizerName", + "crossLanguageDefinitionId": "Search.LexicalTokenizerName", + "valueType": { + "$id": "330", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "331", + "kind": "enumvalue", + "name": "Classic", + "value": "classic", + "valueType": { + "$id": "332", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "329" + }, + "doc": "Grammar-based tokenizer that is suitable for processing most European-language\ndocuments. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/ClassicTokenizer.html", + "decorators": [] + }, + { + "$id": "333", + "kind": "enumvalue", + "name": "EdgeNGram", + "value": "edgeNGram", + "valueType": { + "$id": "334", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "329" + }, + "doc": "Tokenizes the input from an edge into n-grams of the given size(s). See\nhttps://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/EdgeNGramTokenizer.html", + "decorators": [] + }, + { + "$id": "335", + "kind": "enumvalue", + "name": "Keyword", + "value": "keyword_v2", + "valueType": { + "$id": "336", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "329" + }, + "doc": "Emits the entire input as a single token. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/KeywordTokenizer.html", + "decorators": [] + }, + { + "$id": "337", + "kind": "enumvalue", + "name": "Letter", + "value": "letter", + "valueType": { + "$id": "338", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "329" + }, + "doc": "Divides text at non-letters. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/LetterTokenizer.html", + "decorators": [] + }, + { + "$id": "339", + "kind": "enumvalue", + "name": "Lowercase", + "value": "lowercase", + "valueType": { + "$id": "340", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "329" + }, + "doc": "Divides text at non-letters and converts them to lower case. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/LowerCaseTokenizer.html", + "decorators": [] + }, + { + "$id": "341", + "kind": "enumvalue", + "name": "MicrosoftLanguageTokenizer", + "value": "microsoft_language_tokenizer", + "valueType": { + "$id": "342", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "329" + }, + "doc": "Divides text using language-specific rules.", + "decorators": [] + }, + { + "$id": "343", + "kind": "enumvalue", + "name": "MicrosoftLanguageStemmingTokenizer", + "value": "microsoft_language_stemming_tokenizer", + "valueType": { + "$id": "344", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "329" + }, + "doc": "Divides text using language-specific rules and reduces words to their base\nforms.", + "decorators": [] + }, + { + "$id": "345", + "kind": "enumvalue", + "name": "NGram", + "value": "nGram", + "valueType": { + "$id": "346", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "329" + }, + "doc": "Tokenizes the input into n-grams of the given size(s). See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/NGramTokenizer.html", + "decorators": [] + }, + { + "$id": "347", + "kind": "enumvalue", + "name": "PathHierarchy", + "value": "path_hierarchy_v2", + "valueType": { + "$id": "348", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "329" + }, + "doc": "Tokenizer for path-like hierarchies. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/path/PathHierarchyTokenizer.html", + "decorators": [] + }, + { + "$id": "349", + "kind": "enumvalue", + "name": "Pattern", + "value": "pattern", + "valueType": { + "$id": "350", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "329" + }, + "doc": "Tokenizer that uses regex pattern matching to construct distinct tokens. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/pattern/PatternTokenizer.html", + "decorators": [] + }, + { + "$id": "351", + "kind": "enumvalue", + "name": "Standard", + "value": "standard_v2", + "valueType": { + "$id": "352", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "329" + }, + "doc": "Standard Lucene analyzer; Composed of the standard tokenizer, lowercase filter\nand stop filter. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/StandardTokenizer.html", + "decorators": [] + }, + { + "$id": "353", + "kind": "enumvalue", + "name": "UaxUrlEmail", + "value": "uax_url_email", + "valueType": { + "$id": "354", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "329" + }, + "doc": "Tokenizes urls and emails as one token. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.html", + "decorators": [] + }, + { + "$id": "355", + "kind": "enumvalue", + "name": "Whitespace", + "value": "whitespace", + "valueType": { + "$id": "356", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "329" + }, + "doc": "Divides text at whitespace. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/WhitespaceTokenizer.html", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Defines the names of all tokenizers supported by the search engine.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "357", + "kind": "enum", + "name": "TokenFilterName", + "crossLanguageDefinitionId": "Search.TokenFilterName", + "valueType": { + "$id": "358", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "359", + "kind": "enumvalue", + "name": "ArabicNormalization", + "value": "arabic_normalization", + "valueType": { + "$id": "360", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "A token filter that applies the Arabic normalizer to normalize the orthography.\nSee\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ar/ArabicNormalizationFilter.html", + "decorators": [] + }, + { + "$id": "361", + "kind": "enumvalue", + "name": "Apostrophe", + "value": "apostrophe", + "valueType": { + "$id": "362", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Strips all characters after an apostrophe (including the apostrophe itself).\nSee\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/tr/ApostropheFilter.html", + "decorators": [] + }, + { + "$id": "363", + "kind": "enumvalue", + "name": "AsciiFolding", + "value": "asciifolding", + "valueType": { + "$id": "364", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Converts alphabetic, numeric, and symbolic Unicode characters which are not in\nthe first 127 ASCII characters (the \"Basic Latin\" Unicode block) into their\nASCII equivalents, if such equivalents exist. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/ASCIIFoldingFilter.html", + "decorators": [] + }, + { + "$id": "365", + "kind": "enumvalue", + "name": "CjkBigram", + "value": "cjk_bigram", + "valueType": { + "$id": "366", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Forms bigrams of CJK terms that are generated from the standard tokenizer. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/cjk/CJKBigramFilter.html", + "decorators": [] + }, + { + "$id": "367", + "kind": "enumvalue", + "name": "CjkWidth", + "value": "cjk_width", + "valueType": { + "$id": "368", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Normalizes CJK width differences. Folds fullwidth ASCII variants into the\nequivalent basic Latin, and half-width Katakana variants into the equivalent\nKana. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/cjk/CJKWidthFilter.html", + "decorators": [] + }, + { + "$id": "369", + "kind": "enumvalue", + "name": "Classic", + "value": "classic", + "valueType": { + "$id": "370", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Removes English possessives, and dots from acronyms. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/ClassicFilter.html", + "decorators": [] + }, + { + "$id": "371", + "kind": "enumvalue", + "name": "CommonGram", + "value": "common_grams", + "valueType": { + "$id": "372", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Construct bigrams for frequently occurring terms while indexing. Single terms\nare still indexed too, with bigrams overlaid. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/commongrams/CommonGramsFilter.html", + "decorators": [] + }, + { + "$id": "373", + "kind": "enumvalue", + "name": "EdgeNGram", + "value": "edgeNGram_v2", + "valueType": { + "$id": "374", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Generates n-grams of the given size(s) starting from the front or the back of\nan input token. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilter.html", + "decorators": [] + }, + { + "$id": "375", + "kind": "enumvalue", + "name": "Elision", + "value": "elision", + "valueType": { + "$id": "376", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Removes elisions. For example, \"l'avion\" (the plane) will be converted to\n\"avion\" (plane). See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/util/ElisionFilter.html", + "decorators": [] + }, + { + "$id": "377", + "kind": "enumvalue", + "name": "GermanNormalization", + "value": "german_normalization", + "valueType": { + "$id": "378", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Normalizes German characters according to the heuristics of the German2\nsnowball algorithm. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/de/GermanNormalizationFilter.html", + "decorators": [] + }, + { + "$id": "379", + "kind": "enumvalue", + "name": "HindiNormalization", + "value": "hindi_normalization", + "valueType": { + "$id": "380", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Normalizes text in Hindi to remove some differences in spelling variations. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/hi/HindiNormalizationFilter.html", + "decorators": [] + }, + { + "$id": "381", + "kind": "enumvalue", + "name": "IndicNormalization", + "value": "indic_normalization", + "valueType": { + "$id": "382", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Normalizes the Unicode representation of text in Indian languages. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/in/IndicNormalizationFilter.html", + "decorators": [] + }, + { + "$id": "383", + "kind": "enumvalue", + "name": "KeywordRepeat", + "value": "keyword_repeat", + "valueType": { + "$id": "384", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Emits each incoming token twice, once as keyword and once as non-keyword. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/KeywordRepeatFilter.html", + "decorators": [] + }, + { + "$id": "385", + "kind": "enumvalue", + "name": "KStem", + "value": "kstem", + "valueType": { + "$id": "386", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "A high-performance kstem filter for English. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/en/KStemFilter.html", + "decorators": [] + }, + { + "$id": "387", + "kind": "enumvalue", + "name": "Length", + "value": "length", + "valueType": { + "$id": "388", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Removes words that are too long or too short. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/LengthFilter.html", + "decorators": [] + }, + { + "$id": "389", + "kind": "enumvalue", + "name": "Limit", + "value": "limit", + "valueType": { + "$id": "390", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Limits the number of tokens while indexing. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/LimitTokenCountFilter.html", + "decorators": [] + }, + { + "$id": "391", + "kind": "enumvalue", + "name": "Lowercase", + "value": "lowercase", + "valueType": { + "$id": "392", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Normalizes token text to lower case. See\nhttps://lucene.apache.org/core/6_6_1/analyzers-common/org/apache/lucene/analysis/core/LowerCaseFilter.html", + "decorators": [] + }, + { + "$id": "393", + "kind": "enumvalue", + "name": "NGram", + "value": "nGram_v2", + "valueType": { + "$id": "394", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Generates n-grams of the given size(s). See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/NGramTokenFilter.html", + "decorators": [] + }, + { + "$id": "395", + "kind": "enumvalue", + "name": "PersianNormalization", + "value": "persian_normalization", + "valueType": { + "$id": "396", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Applies normalization for Persian. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/fa/PersianNormalizationFilter.html", + "decorators": [] + }, + { + "$id": "397", + "kind": "enumvalue", + "name": "Phonetic", + "value": "phonetic", + "valueType": { + "$id": "398", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Create tokens for phonetic matches. See\nhttps://lucene.apache.org/core/4_10_3/analyzers-phonetic/org/apache/lucene/analysis/phonetic/package-tree.html", + "decorators": [] + }, + { + "$id": "399", + "kind": "enumvalue", + "name": "PorterStem", + "value": "porter_stem", + "valueType": { + "$id": "400", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Uses the Porter stemming algorithm to transform the token stream. See\nhttp://tartarus.org/~martin/PorterStemmer", + "decorators": [] + }, + { + "$id": "401", + "kind": "enumvalue", + "name": "Reverse", + "value": "reverse", + "valueType": { + "$id": "402", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Reverses the token string. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/reverse/ReverseStringFilter.html", + "decorators": [] + }, + { + "$id": "403", + "kind": "enumvalue", + "name": "ScandinavianNormalization", + "value": "scandinavian_normalization", + "valueType": { + "$id": "404", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Normalizes use of the interchangeable Scandinavian characters. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/ScandinavianNormalizationFilter.html", + "decorators": [] + }, + { + "$id": "405", + "kind": "enumvalue", + "name": "ScandinavianFoldingNormalization", + "value": "scandinavian_folding", + "valueType": { + "$id": "406", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Folds Scandinavian characters åÅäæÄÆ->a and öÖøØ->o. It also\ndiscriminates against use of double vowels aa, ae, ao, oe and oo, leaving just\nthe first one. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/ScandinavianFoldingFilter.html", + "decorators": [] + }, + { + "$id": "407", + "kind": "enumvalue", + "name": "Shingle", + "value": "shingle", + "valueType": { + "$id": "408", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Creates combinations of tokens as a single token. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/shingle/ShingleFilter.html", + "decorators": [] + }, + { + "$id": "409", + "kind": "enumvalue", + "name": "Snowball", + "value": "snowball", + "valueType": { + "$id": "410", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "A filter that stems words using a Snowball-generated stemmer. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/snowball/SnowballFilter.html", + "decorators": [] + }, + { + "$id": "411", + "kind": "enumvalue", + "name": "SoraniNormalization", + "value": "sorani_normalization", + "valueType": { + "$id": "412", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Normalizes the Unicode representation of Sorani text. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ckb/SoraniNormalizationFilter.html", + "decorators": [] + }, + { + "$id": "413", + "kind": "enumvalue", + "name": "Stemmer", + "value": "stemmer", + "valueType": { + "$id": "414", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Language specific stemming filter. See\nhttps://learn.microsoft.com/rest/api/searchservice/Custom-analyzers-in-Azure-Search#TokenFilters", + "decorators": [] + }, + { + "$id": "415", + "kind": "enumvalue", + "name": "Stopwords", + "value": "stopwords", + "valueType": { + "$id": "416", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Removes stop words from a token stream. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/StopFilter.html", + "decorators": [] + }, + { + "$id": "417", + "kind": "enumvalue", + "name": "Trim", + "value": "trim", + "valueType": { + "$id": "418", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Trims leading and trailing whitespace from tokens. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/TrimFilter.html", + "decorators": [] + }, + { + "$id": "419", + "kind": "enumvalue", + "name": "Truncate", + "value": "truncate", + "valueType": { + "$id": "420", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Truncates the terms to a specific length. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilter.html", + "decorators": [] + }, + { + "$id": "421", + "kind": "enumvalue", + "name": "Unique", + "value": "unique", + "valueType": { + "$id": "422", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Filters out tokens with same text as the previous token. See\nhttp://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/RemoveDuplicatesTokenFilter.html", + "decorators": [] + }, + { + "$id": "423", + "kind": "enumvalue", + "name": "Uppercase", + "value": "uppercase", + "valueType": { + "$id": "424", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Normalizes token text to upper case. See\nhttps://lucene.apache.org/core/6_6_1/analyzers-common/org/apache/lucene/analysis/core/UpperCaseFilter.html", + "decorators": [] + }, + { + "$id": "425", + "kind": "enumvalue", + "name": "WordDelimiter", + "value": "word_delimiter", + "valueType": { + "$id": "426", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "357" + }, + "doc": "Splits words into subwords and performs optional transformations on subword\ngroups.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Defines the names of all token filters supported by the search engine.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "427", + "kind": "enum", + "name": "CharFilterName", + "crossLanguageDefinitionId": "Search.CharFilterName", + "valueType": { + "$id": "428", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "429", + "kind": "enumvalue", + "name": "HtmlStrip", + "value": "html_strip", + "valueType": { + "$id": "430", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "427" + }, + "doc": "A character filter that attempts to strip out HTML constructs. See\nhttps://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/charfilter/HTMLStripCharFilter.html", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Defines the names of all character filters supported by the search engine.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "431", + "kind": "enum", + "name": "RegexFlags", + "crossLanguageDefinitionId": "Search.RegexFlags", + "valueType": { + "$id": "432", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "433", + "kind": "enumvalue", + "name": "CanonEq", + "value": "CANON_EQ", + "valueType": { + "$id": "434", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "431" + }, + "doc": "Enables canonical equivalence.", + "decorators": [] + }, + { + "$id": "435", + "kind": "enumvalue", + "name": "CaseInsensitive", + "value": "CASE_INSENSITIVE", + "valueType": { + "$id": "436", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "431" + }, + "doc": "Enables case-insensitive matching.", + "decorators": [] + }, + { + "$id": "437", + "kind": "enumvalue", + "name": "Comments", + "value": "COMMENTS", + "valueType": { + "$id": "438", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "431" + }, + "doc": "Permits whitespace and comments in the pattern.", + "decorators": [] + }, + { + "$id": "439", + "kind": "enumvalue", + "name": "DotAll", + "value": "DOTALL", + "valueType": { + "$id": "440", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "431" + }, + "doc": "Enables dotall mode.", + "decorators": [] + }, + { + "$id": "441", + "kind": "enumvalue", + "name": "Literal", + "value": "LITERAL", + "valueType": { + "$id": "442", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "431" + }, + "doc": "Enables literal parsing of the pattern.", + "decorators": [] + }, + { + "$id": "443", + "kind": "enumvalue", + "name": "Multiline", + "value": "MULTILINE", + "valueType": { + "$id": "444", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "431" + }, + "doc": "Enables multiline mode.", + "decorators": [] + }, + { + "$id": "445", + "kind": "enumvalue", + "name": "UnicodeCase", + "value": "UNICODE_CASE", + "valueType": { + "$id": "446", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "431" + }, + "doc": "Enables Unicode-aware case folding.", + "decorators": [] + }, + { + "$id": "447", + "kind": "enumvalue", + "name": "UnixLines", + "value": "UNIX_LINES", + "valueType": { + "$id": "448", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "431" + }, + "doc": "Enables Unix lines mode.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Defines flags that can be combined to control how regular expressions are used\nin the pattern analyzer and pattern tokenizer.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "449", + "kind": "enum", + "name": "TokenCharacterKind", + "crossLanguageDefinitionId": "Search.TokenCharacterKind", + "valueType": { + "$id": "450", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "451", + "kind": "enumvalue", + "name": "Letter", + "value": "letter", + "valueType": { + "$id": "452", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "449" + }, + "doc": "Keeps letters in tokens.", + "decorators": [] + }, + { + "$id": "453", + "kind": "enumvalue", + "name": "Digit", + "value": "digit", + "valueType": { + "$id": "454", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "449" + }, + "doc": "Keeps digits in tokens.", + "decorators": [] + }, + { + "$id": "455", + "kind": "enumvalue", + "name": "Whitespace", + "value": "whitespace", + "valueType": { + "$id": "456", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "449" + }, + "doc": "Keeps whitespace in tokens.", + "decorators": [] + }, + { + "$id": "457", + "kind": "enumvalue", + "name": "Punctuation", + "value": "punctuation", + "valueType": { + "$id": "458", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "449" + }, + "doc": "Keeps punctuation in tokens.", + "decorators": [] + }, + { + "$id": "459", + "kind": "enumvalue", + "name": "Symbol", + "value": "symbol", + "valueType": { + "$id": "460", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "449" + }, + "doc": "Keeps symbols in tokens.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Represents classes of characters on which a token filter can operate.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "461", + "kind": "enum", + "name": "MicrosoftTokenizerLanguage", + "crossLanguageDefinitionId": "Search.MicrosoftTokenizerLanguage", + "valueType": { + "$id": "462", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "463", + "kind": "enumvalue", + "name": "Bangla", + "value": "bangla", + "valueType": { + "$id": "464", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Bangla.", + "decorators": [] + }, + { + "$id": "465", + "kind": "enumvalue", + "name": "Bulgarian", + "value": "bulgarian", + "valueType": { + "$id": "466", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Bulgarian.", + "decorators": [] + }, + { + "$id": "467", + "kind": "enumvalue", + "name": "Catalan", + "value": "catalan", + "valueType": { + "$id": "468", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Catalan.", + "decorators": [] + }, + { + "$id": "469", + "kind": "enumvalue", + "name": "ChineseSimplified", + "value": "chineseSimplified", + "valueType": { + "$id": "470", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Chinese (Simplified).", + "decorators": [] + }, + { + "$id": "471", + "kind": "enumvalue", + "name": "ChineseTraditional", + "value": "chineseTraditional", + "valueType": { + "$id": "472", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Chinese (Traditional).", + "decorators": [] + }, + { + "$id": "473", + "kind": "enumvalue", + "name": "Croatian", + "value": "croatian", + "valueType": { + "$id": "474", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Croatian.", + "decorators": [] + }, + { + "$id": "475", + "kind": "enumvalue", + "name": "Czech", + "value": "czech", + "valueType": { + "$id": "476", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Czech.", + "decorators": [] + }, + { + "$id": "477", + "kind": "enumvalue", + "name": "Danish", + "value": "danish", + "valueType": { + "$id": "478", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Danish.", + "decorators": [] + }, + { + "$id": "479", + "kind": "enumvalue", + "name": "Dutch", + "value": "dutch", + "valueType": { + "$id": "480", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Dutch.", + "decorators": [] + }, + { + "$id": "481", + "kind": "enumvalue", + "name": "English", + "value": "english", + "valueType": { + "$id": "482", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for English.", + "decorators": [] + }, + { + "$id": "483", + "kind": "enumvalue", + "name": "French", + "value": "french", + "valueType": { + "$id": "484", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for French.", + "decorators": [] + }, + { + "$id": "485", + "kind": "enumvalue", + "name": "German", + "value": "german", + "valueType": { + "$id": "486", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for German.", + "decorators": [] + }, + { + "$id": "487", + "kind": "enumvalue", + "name": "Greek", + "value": "greek", + "valueType": { + "$id": "488", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Greek.", + "decorators": [] + }, + { + "$id": "489", + "kind": "enumvalue", + "name": "Gujarati", + "value": "gujarati", + "valueType": { + "$id": "490", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Gujarati.", + "decorators": [] + }, + { + "$id": "491", + "kind": "enumvalue", + "name": "Hindi", + "value": "hindi", + "valueType": { + "$id": "492", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Hindi.", + "decorators": [] + }, + { + "$id": "493", + "kind": "enumvalue", + "name": "Icelandic", + "value": "icelandic", + "valueType": { + "$id": "494", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Icelandic.", + "decorators": [] + }, + { + "$id": "495", + "kind": "enumvalue", + "name": "Indonesian", + "value": "indonesian", + "valueType": { + "$id": "496", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Indonesian.", + "decorators": [] + }, + { + "$id": "497", + "kind": "enumvalue", + "name": "Italian", + "value": "italian", + "valueType": { + "$id": "498", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Italian.", + "decorators": [] + }, + { + "$id": "499", + "kind": "enumvalue", + "name": "Japanese", + "value": "japanese", + "valueType": { + "$id": "500", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Japanese.", + "decorators": [] + }, + { + "$id": "501", + "kind": "enumvalue", + "name": "Kannada", + "value": "kannada", + "valueType": { + "$id": "502", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Kannada.", + "decorators": [] + }, + { + "$id": "503", + "kind": "enumvalue", + "name": "Korean", + "value": "korean", + "valueType": { + "$id": "504", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Korean.", + "decorators": [] + }, + { + "$id": "505", + "kind": "enumvalue", + "name": "Malay", + "value": "malay", + "valueType": { + "$id": "506", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Malay.", + "decorators": [] + }, + { + "$id": "507", + "kind": "enumvalue", + "name": "Malayalam", + "value": "malayalam", + "valueType": { + "$id": "508", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Malayalam.", + "decorators": [] + }, + { + "$id": "509", + "kind": "enumvalue", + "name": "Marathi", + "value": "marathi", + "valueType": { + "$id": "510", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Marathi.", + "decorators": [] + }, + { + "$id": "511", + "kind": "enumvalue", + "name": "NorwegianBokmaal", + "value": "norwegianBokmaal", + "valueType": { + "$id": "512", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Norwegian (Bokmål).", + "decorators": [] + }, + { + "$id": "513", + "kind": "enumvalue", + "name": "Polish", + "value": "polish", + "valueType": { + "$id": "514", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Polish.", + "decorators": [] + }, + { + "$id": "515", + "kind": "enumvalue", + "name": "Portuguese", + "value": "portuguese", + "valueType": { + "$id": "516", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Portuguese.", + "decorators": [] + }, + { + "$id": "517", + "kind": "enumvalue", + "name": "PortugueseBrazilian", + "value": "portugueseBrazilian", + "valueType": { + "$id": "518", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Portuguese (Brazil).", + "decorators": [] + }, + { + "$id": "519", + "kind": "enumvalue", + "name": "Punjabi", + "value": "punjabi", + "valueType": { + "$id": "520", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Punjabi.", + "decorators": [] + }, + { + "$id": "521", + "kind": "enumvalue", + "name": "Romanian", + "value": "romanian", + "valueType": { + "$id": "522", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Romanian.", + "decorators": [] + }, + { + "$id": "523", + "kind": "enumvalue", + "name": "Russian", + "value": "russian", + "valueType": { + "$id": "524", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Russian.", + "decorators": [] + }, + { + "$id": "525", + "kind": "enumvalue", + "name": "SerbianCyrillic", + "value": "serbianCyrillic", + "valueType": { + "$id": "526", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Serbian (Cyrillic).", + "decorators": [] + }, + { + "$id": "527", + "kind": "enumvalue", + "name": "SerbianLatin", + "value": "serbianLatin", + "valueType": { + "$id": "528", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Serbian (Latin).", + "decorators": [] + }, + { + "$id": "529", + "kind": "enumvalue", + "name": "Slovenian", + "value": "slovenian", + "valueType": { + "$id": "530", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Slovenian.", + "decorators": [] + }, + { + "$id": "531", + "kind": "enumvalue", + "name": "Spanish", + "value": "spanish", + "valueType": { + "$id": "532", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Spanish.", + "decorators": [] + }, + { + "$id": "533", + "kind": "enumvalue", + "name": "Swedish", + "value": "swedish", + "valueType": { + "$id": "534", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Swedish.", + "decorators": [] + }, + { + "$id": "535", + "kind": "enumvalue", + "name": "Tamil", + "value": "tamil", + "valueType": { + "$id": "536", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Tamil.", + "decorators": [] + }, + { + "$id": "537", + "kind": "enumvalue", + "name": "Telugu", + "value": "telugu", + "valueType": { + "$id": "538", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Telugu.", + "decorators": [] + }, + { + "$id": "539", + "kind": "enumvalue", + "name": "Thai", + "value": "thai", + "valueType": { + "$id": "540", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Thai.", + "decorators": [] + }, + { + "$id": "541", + "kind": "enumvalue", + "name": "Ukrainian", + "value": "ukrainian", + "valueType": { + "$id": "542", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Ukrainian.", + "decorators": [] + }, + { + "$id": "543", + "kind": "enumvalue", + "name": "Urdu", + "value": "urdu", + "valueType": { + "$id": "544", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Urdu.", + "decorators": [] + }, + { + "$id": "545", + "kind": "enumvalue", + "name": "Vietnamese", + "value": "vietnamese", + "valueType": { + "$id": "546", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "461" + }, + "doc": "Selects the Microsoft tokenizer for Vietnamese.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Lists the languages supported by the Microsoft language tokenizer.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "547", + "kind": "enum", + "name": "MicrosoftStemmingTokenizerLanguage", + "crossLanguageDefinitionId": "Search.MicrosoftStemmingTokenizerLanguage", + "valueType": { + "$id": "548", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "549", + "kind": "enumvalue", + "name": "Arabic", + "value": "arabic", + "valueType": { + "$id": "550", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Arabic.", + "decorators": [] + }, + { + "$id": "551", + "kind": "enumvalue", + "name": "Bangla", + "value": "bangla", + "valueType": { + "$id": "552", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Bangla.", + "decorators": [] + }, + { + "$id": "553", + "kind": "enumvalue", + "name": "Bulgarian", + "value": "bulgarian", + "valueType": { + "$id": "554", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Bulgarian.", + "decorators": [] + }, + { + "$id": "555", + "kind": "enumvalue", + "name": "Catalan", + "value": "catalan", + "valueType": { + "$id": "556", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Catalan.", + "decorators": [] + }, + { + "$id": "557", + "kind": "enumvalue", + "name": "Croatian", + "value": "croatian", + "valueType": { + "$id": "558", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Croatian.", + "decorators": [] + }, + { + "$id": "559", + "kind": "enumvalue", + "name": "Czech", + "value": "czech", + "valueType": { + "$id": "560", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Czech.", + "decorators": [] + }, + { + "$id": "561", + "kind": "enumvalue", + "name": "Danish", + "value": "danish", + "valueType": { + "$id": "562", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Danish.", + "decorators": [] + }, + { + "$id": "563", + "kind": "enumvalue", + "name": "Dutch", + "value": "dutch", + "valueType": { + "$id": "564", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Dutch.", + "decorators": [] + }, + { + "$id": "565", + "kind": "enumvalue", + "name": "English", + "value": "english", + "valueType": { + "$id": "566", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for English.", + "decorators": [] + }, + { + "$id": "567", + "kind": "enumvalue", + "name": "Estonian", + "value": "estonian", + "valueType": { + "$id": "568", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Estonian.", + "decorators": [] + }, + { + "$id": "569", + "kind": "enumvalue", + "name": "Finnish", + "value": "finnish", + "valueType": { + "$id": "570", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Finnish.", + "decorators": [] + }, + { + "$id": "571", + "kind": "enumvalue", + "name": "French", + "value": "french", + "valueType": { + "$id": "572", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for French.", + "decorators": [] + }, + { + "$id": "573", + "kind": "enumvalue", + "name": "German", + "value": "german", + "valueType": { + "$id": "574", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for German.", + "decorators": [] + }, + { + "$id": "575", + "kind": "enumvalue", + "name": "Greek", + "value": "greek", + "valueType": { + "$id": "576", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Greek.", + "decorators": [] + }, + { + "$id": "577", + "kind": "enumvalue", + "name": "Gujarati", + "value": "gujarati", + "valueType": { + "$id": "578", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Gujarati.", + "decorators": [] + }, + { + "$id": "579", + "kind": "enumvalue", + "name": "Hebrew", + "value": "hebrew", + "valueType": { + "$id": "580", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Hebrew.", + "decorators": [] + }, + { + "$id": "581", + "kind": "enumvalue", + "name": "Hindi", + "value": "hindi", + "valueType": { + "$id": "582", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Hindi.", + "decorators": [] + }, + { + "$id": "583", + "kind": "enumvalue", + "name": "Hungarian", + "value": "hungarian", + "valueType": { + "$id": "584", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Hungarian.", + "decorators": [] + }, + { + "$id": "585", + "kind": "enumvalue", + "name": "Icelandic", + "value": "icelandic", + "valueType": { + "$id": "586", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Icelandic.", + "decorators": [] + }, + { + "$id": "587", + "kind": "enumvalue", + "name": "Indonesian", + "value": "indonesian", + "valueType": { + "$id": "588", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Indonesian.", + "decorators": [] + }, + { + "$id": "589", + "kind": "enumvalue", + "name": "Italian", + "value": "italian", + "valueType": { + "$id": "590", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Italian.", + "decorators": [] + }, + { + "$id": "591", + "kind": "enumvalue", + "name": "Kannada", + "value": "kannada", + "valueType": { + "$id": "592", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Kannada.", + "decorators": [] + }, + { + "$id": "593", + "kind": "enumvalue", + "name": "Latvian", + "value": "latvian", + "valueType": { + "$id": "594", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Latvian.", + "decorators": [] + }, + { + "$id": "595", + "kind": "enumvalue", + "name": "Lithuanian", + "value": "lithuanian", + "valueType": { + "$id": "596", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Lithuanian.", + "decorators": [] + }, + { + "$id": "597", + "kind": "enumvalue", + "name": "Malay", + "value": "malay", + "valueType": { + "$id": "598", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Malay.", + "decorators": [] + }, + { + "$id": "599", + "kind": "enumvalue", + "name": "Malayalam", + "value": "malayalam", + "valueType": { + "$id": "600", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Malayalam.", + "decorators": [] + }, + { + "$id": "601", + "kind": "enumvalue", + "name": "Marathi", + "value": "marathi", + "valueType": { + "$id": "602", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Marathi.", + "decorators": [] + }, + { + "$id": "603", + "kind": "enumvalue", + "name": "NorwegianBokmaal", + "value": "norwegianBokmaal", + "valueType": { + "$id": "604", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Norwegian (Bokmål).", + "decorators": [] + }, + { + "$id": "605", + "kind": "enumvalue", + "name": "Polish", + "value": "polish", + "valueType": { + "$id": "606", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Polish.", + "decorators": [] + }, + { + "$id": "607", + "kind": "enumvalue", + "name": "Portuguese", + "value": "portuguese", + "valueType": { + "$id": "608", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Portuguese.", + "decorators": [] + }, + { + "$id": "609", + "kind": "enumvalue", + "name": "PortugueseBrazilian", + "value": "portugueseBrazilian", + "valueType": { + "$id": "610", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Portuguese (Brazil).", + "decorators": [] + }, + { + "$id": "611", + "kind": "enumvalue", + "name": "Punjabi", + "value": "punjabi", + "valueType": { + "$id": "612", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Punjabi.", + "decorators": [] + }, + { + "$id": "613", + "kind": "enumvalue", + "name": "Romanian", + "value": "romanian", + "valueType": { + "$id": "614", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Romanian.", + "decorators": [] + }, + { + "$id": "615", + "kind": "enumvalue", + "name": "Russian", + "value": "russian", + "valueType": { + "$id": "616", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Russian.", + "decorators": [] + }, + { + "$id": "617", + "kind": "enumvalue", + "name": "SerbianCyrillic", + "value": "serbianCyrillic", + "valueType": { + "$id": "618", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Serbian (Cyrillic).", + "decorators": [] + }, + { + "$id": "619", + "kind": "enumvalue", + "name": "SerbianLatin", + "value": "serbianLatin", + "valueType": { + "$id": "620", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Serbian (Latin).", + "decorators": [] + }, + { + "$id": "621", + "kind": "enumvalue", + "name": "Slovak", + "value": "slovak", + "valueType": { + "$id": "622", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Slovak.", + "decorators": [] + }, + { + "$id": "623", + "kind": "enumvalue", + "name": "Slovenian", + "value": "slovenian", + "valueType": { + "$id": "624", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Slovenian.", + "decorators": [] + }, + { + "$id": "625", + "kind": "enumvalue", + "name": "Spanish", + "value": "spanish", + "valueType": { + "$id": "626", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Spanish.", + "decorators": [] + }, + { + "$id": "627", + "kind": "enumvalue", + "name": "Swedish", + "value": "swedish", + "valueType": { + "$id": "628", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Swedish.", + "decorators": [] + }, + { + "$id": "629", + "kind": "enumvalue", + "name": "Tamil", + "value": "tamil", + "valueType": { + "$id": "630", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Tamil.", + "decorators": [] + }, + { + "$id": "631", + "kind": "enumvalue", + "name": "Telugu", + "value": "telugu", + "valueType": { + "$id": "632", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Telugu.", + "decorators": [] + }, + { + "$id": "633", + "kind": "enumvalue", + "name": "Turkish", + "value": "turkish", + "valueType": { + "$id": "634", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Turkish.", + "decorators": [] + }, + { + "$id": "635", + "kind": "enumvalue", + "name": "Ukrainian", + "value": "ukrainian", + "valueType": { + "$id": "636", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Ukrainian.", + "decorators": [] + }, + { + "$id": "637", + "kind": "enumvalue", + "name": "Urdu", + "value": "urdu", + "valueType": { + "$id": "638", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "547" + }, + "doc": "Selects the Microsoft stemming tokenizer for Urdu.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Lists the languages supported by the Microsoft language stemming tokenizer.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "639", + "kind": "enum", + "name": "CjkBigramTokenFilterScripts", + "crossLanguageDefinitionId": "Search.CjkBigramTokenFilterScripts", + "valueType": { + "$id": "640", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "641", + "kind": "enumvalue", + "name": "Han", + "value": "han", + "valueType": { + "$id": "642", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "639" + }, + "doc": "Ignore Han script when forming bigrams of CJK terms.", + "decorators": [] + }, + { + "$id": "643", + "kind": "enumvalue", + "name": "Hiragana", + "value": "hiragana", + "valueType": { + "$id": "644", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "639" + }, + "doc": "Ignore Hiragana script when forming bigrams of CJK terms.", + "decorators": [] + }, + { + "$id": "645", + "kind": "enumvalue", + "name": "Katakana", + "value": "katakana", + "valueType": { + "$id": "646", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "639" + }, + "doc": "Ignore Katakana script when forming bigrams of CJK terms.", + "decorators": [] + }, + { + "$id": "647", + "kind": "enumvalue", + "name": "Hangul", + "value": "hangul", + "valueType": { + "$id": "648", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "639" + }, + "doc": "Ignore Hangul script when forming bigrams of CJK terms.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Scripts that can be ignored by CjkBigramTokenFilter.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "649", + "kind": "enum", + "name": "EdgeNGramTokenFilterSide", + "crossLanguageDefinitionId": "Search.EdgeNGramTokenFilterSide", + "valueType": { + "$id": "650", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "651", + "kind": "enumvalue", + "name": "Front", + "value": "front", + "valueType": { + "$id": "652", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "649" + }, + "doc": "Specifies that the n-gram should be generated from the front of the input.", + "decorators": [] + }, + { + "$id": "653", + "kind": "enumvalue", + "name": "Back", + "value": "back", + "valueType": { + "$id": "654", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "649" + }, + "doc": "Specifies that the n-gram should be generated from the back of the input.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Specifies which side of the input an n-gram should be generated from.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "655", + "kind": "enum", + "name": "PhoneticEncoder", + "crossLanguageDefinitionId": "Search.PhoneticEncoder", + "valueType": { + "$id": "656", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "657", + "kind": "enumvalue", + "name": "Metaphone", + "value": "metaphone", + "valueType": { + "$id": "658", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "655" + }, + "doc": "Encodes a token into a Metaphone value.", + "decorators": [] + }, + { + "$id": "659", + "kind": "enumvalue", + "name": "DoubleMetaphone", + "value": "doubleMetaphone", + "valueType": { + "$id": "660", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "655" + }, + "doc": "Encodes a token into a double metaphone value.", + "decorators": [] + }, + { + "$id": "661", + "kind": "enumvalue", + "name": "Soundex", + "value": "soundex", + "valueType": { + "$id": "662", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "655" + }, + "doc": "Encodes a token into a Soundex value.", + "decorators": [] + }, + { + "$id": "663", + "kind": "enumvalue", + "name": "RefinedSoundex", + "value": "refinedSoundex", + "valueType": { + "$id": "664", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "655" + }, + "doc": "Encodes a token into a Refined Soundex value.", + "decorators": [] + }, + { + "$id": "665", + "kind": "enumvalue", + "name": "Caverphone1", + "value": "caverphone1", + "valueType": { + "$id": "666", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "655" + }, + "doc": "Encodes a token into a Caverphone 1.0 value.", + "decorators": [] + }, + { + "$id": "667", + "kind": "enumvalue", + "name": "Caverphone2", + "value": "caverphone2", + "valueType": { + "$id": "668", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "655" + }, + "doc": "Encodes a token into a Caverphone 2.0 value.", + "decorators": [] + }, + { + "$id": "669", + "kind": "enumvalue", + "name": "Cologne", + "value": "cologne", + "valueType": { + "$id": "670", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "655" + }, + "doc": "Encodes a token into a Cologne Phonetic value.", + "decorators": [] + }, + { + "$id": "671", + "kind": "enumvalue", + "name": "Nysiis", + "value": "nysiis", + "valueType": { + "$id": "672", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "655" + }, + "doc": "Encodes a token into a NYSIIS value.", + "decorators": [] + }, + { + "$id": "673", + "kind": "enumvalue", + "name": "KoelnerPhonetik", + "value": "koelnerPhonetik", + "valueType": { + "$id": "674", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "655" + }, + "doc": "Encodes a token using the Kölner Phonetik algorithm.", + "decorators": [] + }, + { + "$id": "675", + "kind": "enumvalue", + "name": "HaasePhonetik", + "value": "haasePhonetik", + "valueType": { + "$id": "676", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "655" + }, + "doc": "Encodes a token using the Haase refinement of the Kölner Phonetik algorithm.", + "decorators": [] + }, + { + "$id": "677", + "kind": "enumvalue", + "name": "BeiderMorse", + "value": "beiderMorse", + "valueType": { + "$id": "678", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "655" + }, + "doc": "Encodes a token into a Beider-Morse value.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Identifies the type of phonetic encoder to use with a PhoneticTokenFilter.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "679", + "kind": "enum", + "name": "SnowballTokenFilterLanguage", + "crossLanguageDefinitionId": "Search.SnowballTokenFilterLanguage", + "valueType": { + "$id": "680", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "681", + "kind": "enumvalue", + "name": "Armenian", + "value": "armenian", + "valueType": { + "$id": "682", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for Armenian.", + "decorators": [] + }, + { + "$id": "683", + "kind": "enumvalue", + "name": "Basque", + "value": "basque", + "valueType": { + "$id": "684", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for Basque.", + "decorators": [] + }, + { + "$id": "685", + "kind": "enumvalue", + "name": "Catalan", + "value": "catalan", + "valueType": { + "$id": "686", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for Catalan.", + "decorators": [] + }, + { + "$id": "687", + "kind": "enumvalue", + "name": "Danish", + "value": "danish", + "valueType": { + "$id": "688", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for Danish.", + "decorators": [] + }, + { + "$id": "689", + "kind": "enumvalue", + "name": "Dutch", + "value": "dutch", + "valueType": { + "$id": "690", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for Dutch.", + "decorators": [] + }, + { + "$id": "691", + "kind": "enumvalue", + "name": "English", + "value": "english", + "valueType": { + "$id": "692", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for English.", + "decorators": [] + }, + { + "$id": "693", + "kind": "enumvalue", + "name": "Finnish", + "value": "finnish", + "valueType": { + "$id": "694", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for Finnish.", + "decorators": [] + }, + { + "$id": "695", + "kind": "enumvalue", + "name": "French", + "value": "french", + "valueType": { + "$id": "696", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for French.", + "decorators": [] + }, + { + "$id": "697", + "kind": "enumvalue", + "name": "German", + "value": "german", + "valueType": { + "$id": "698", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for German.", + "decorators": [] + }, + { + "$id": "699", + "kind": "enumvalue", + "name": "German2", + "value": "german2", + "valueType": { + "$id": "700", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer that uses the German variant\nalgorithm.", + "decorators": [] + }, + { + "$id": "701", + "kind": "enumvalue", + "name": "Hungarian", + "value": "hungarian", + "valueType": { + "$id": "702", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for Hungarian.", + "decorators": [] + }, + { + "$id": "703", + "kind": "enumvalue", + "name": "Italian", + "value": "italian", + "valueType": { + "$id": "704", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for Italian.", + "decorators": [] + }, + { + "$id": "705", + "kind": "enumvalue", + "name": "Kp", + "value": "kp", + "valueType": { + "$id": "706", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for Dutch that uses the\nKraaij-Pohlmann stemming algorithm.", + "decorators": [] + }, + { + "$id": "707", + "kind": "enumvalue", + "name": "Lovins", + "value": "lovins", + "valueType": { + "$id": "708", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for English that uses the Lovins\nstemming algorithm.", + "decorators": [] + }, + { + "$id": "709", + "kind": "enumvalue", + "name": "Norwegian", + "value": "norwegian", + "valueType": { + "$id": "710", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for Norwegian.", + "decorators": [] + }, + { + "$id": "711", + "kind": "enumvalue", + "name": "Porter", + "value": "porter", + "valueType": { + "$id": "712", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for English that uses the Porter\nstemming algorithm.", + "decorators": [] + }, + { + "$id": "713", + "kind": "enumvalue", + "name": "Portuguese", + "value": "portuguese", + "valueType": { + "$id": "714", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for Portuguese.", + "decorators": [] + }, + { + "$id": "715", + "kind": "enumvalue", + "name": "Romanian", + "value": "romanian", + "valueType": { + "$id": "716", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for Romanian.", + "decorators": [] + }, + { + "$id": "717", + "kind": "enumvalue", + "name": "Russian", + "value": "russian", + "valueType": { + "$id": "718", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for Russian.", + "decorators": [] + }, + { + "$id": "719", + "kind": "enumvalue", + "name": "Spanish", + "value": "spanish", + "valueType": { + "$id": "720", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for Spanish.", + "decorators": [] + }, + { + "$id": "721", + "kind": "enumvalue", + "name": "Swedish", + "value": "swedish", + "valueType": { + "$id": "722", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for Swedish.", + "decorators": [] + }, + { + "$id": "723", + "kind": "enumvalue", + "name": "Turkish", + "value": "turkish", + "valueType": { + "$id": "724", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "679" + }, + "doc": "Selects the Lucene Snowball stemming tokenizer for Turkish.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The language to use for a Snowball token filter.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "725", + "kind": "enum", + "name": "StemmerTokenFilterLanguage", + "crossLanguageDefinitionId": "Search.StemmerTokenFilterLanguage", + "valueType": { + "$id": "726", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "727", + "kind": "enumvalue", + "name": "Arabic", + "value": "arabic", + "valueType": { + "$id": "728", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Arabic.", + "decorators": [] + }, + { + "$id": "729", + "kind": "enumvalue", + "name": "Armenian", + "value": "armenian", + "valueType": { + "$id": "730", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Armenian.", + "decorators": [] + }, + { + "$id": "731", + "kind": "enumvalue", + "name": "Basque", + "value": "basque", + "valueType": { + "$id": "732", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Basque.", + "decorators": [] + }, + { + "$id": "733", + "kind": "enumvalue", + "name": "Brazilian", + "value": "brazilian", + "valueType": { + "$id": "734", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Portuguese (Brazil).", + "decorators": [] + }, + { + "$id": "735", + "kind": "enumvalue", + "name": "Bulgarian", + "value": "bulgarian", + "valueType": { + "$id": "736", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Bulgarian.", + "decorators": [] + }, + { + "$id": "737", + "kind": "enumvalue", + "name": "Catalan", + "value": "catalan", + "valueType": { + "$id": "738", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Catalan.", + "decorators": [] + }, + { + "$id": "739", + "kind": "enumvalue", + "name": "Czech", + "value": "czech", + "valueType": { + "$id": "740", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Czech.", + "decorators": [] + }, + { + "$id": "741", + "kind": "enumvalue", + "name": "Danish", + "value": "danish", + "valueType": { + "$id": "742", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Danish.", + "decorators": [] + }, + { + "$id": "743", + "kind": "enumvalue", + "name": "Dutch", + "value": "dutch", + "valueType": { + "$id": "744", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Dutch.", + "decorators": [] + }, + { + "$id": "745", + "kind": "enumvalue", + "name": "DutchKp", + "value": "dutchKp", + "valueType": { + "$id": "746", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Dutch that uses the Kraaij-Pohlmann\nstemming algorithm.", + "decorators": [] + }, + { + "$id": "747", + "kind": "enumvalue", + "name": "English", + "value": "english", + "valueType": { + "$id": "748", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for English.", + "decorators": [] + }, + { + "$id": "749", + "kind": "enumvalue", + "name": "LightEnglish", + "value": "lightEnglish", + "valueType": { + "$id": "750", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for English that does light stemming.", + "decorators": [] + }, + { + "$id": "751", + "kind": "enumvalue", + "name": "MinimalEnglish", + "value": "minimalEnglish", + "valueType": { + "$id": "752", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for English that does minimal stemming.", + "decorators": [] + }, + { + "$id": "753", + "kind": "enumvalue", + "name": "PossessiveEnglish", + "value": "possessiveEnglish", + "valueType": { + "$id": "754", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for English that removes trailing\npossessives from words.", + "decorators": [] + }, + { + "$id": "755", + "kind": "enumvalue", + "name": "Porter2", + "value": "porter2", + "valueType": { + "$id": "756", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for English that uses the Porter2\nstemming algorithm.", + "decorators": [] + }, + { + "$id": "757", + "kind": "enumvalue", + "name": "Lovins", + "value": "lovins", + "valueType": { + "$id": "758", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for English that uses the Lovins stemming\nalgorithm.", + "decorators": [] + }, + { + "$id": "759", + "kind": "enumvalue", + "name": "Finnish", + "value": "finnish", + "valueType": { + "$id": "760", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Finnish.", + "decorators": [] + }, + { + "$id": "761", + "kind": "enumvalue", + "name": "LightFinnish", + "value": "lightFinnish", + "valueType": { + "$id": "762", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Finnish that does light stemming.", + "decorators": [] + }, + { + "$id": "763", + "kind": "enumvalue", + "name": "French", + "value": "french", + "valueType": { + "$id": "764", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for French.", + "decorators": [] + }, + { + "$id": "765", + "kind": "enumvalue", + "name": "LightFrench", + "value": "lightFrench", + "valueType": { + "$id": "766", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for French that does light stemming.", + "decorators": [] + }, + { + "$id": "767", + "kind": "enumvalue", + "name": "MinimalFrench", + "value": "minimalFrench", + "valueType": { + "$id": "768", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for French that does minimal stemming.", + "decorators": [] + }, + { + "$id": "769", + "kind": "enumvalue", + "name": "Galician", + "value": "galician", + "valueType": { + "$id": "770", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Galician.", + "decorators": [] + }, + { + "$id": "771", + "kind": "enumvalue", + "name": "MinimalGalician", + "value": "minimalGalician", + "valueType": { + "$id": "772", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Galician that does minimal stemming.", + "decorators": [] + }, + { + "$id": "773", + "kind": "enumvalue", + "name": "German", + "value": "german", + "valueType": { + "$id": "774", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for German.", + "decorators": [] + }, + { + "$id": "775", + "kind": "enumvalue", + "name": "German2", + "value": "german2", + "valueType": { + "$id": "776", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer that uses the German variant algorithm.", + "decorators": [] + }, + { + "$id": "777", + "kind": "enumvalue", + "name": "LightGerman", + "value": "lightGerman", + "valueType": { + "$id": "778", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for German that does light stemming.", + "decorators": [] + }, + { + "$id": "779", + "kind": "enumvalue", + "name": "MinimalGerman", + "value": "minimalGerman", + "valueType": { + "$id": "780", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for German that does minimal stemming.", + "decorators": [] + }, + { + "$id": "781", + "kind": "enumvalue", + "name": "Greek", + "value": "greek", + "valueType": { + "$id": "782", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Greek.", + "decorators": [] + }, + { + "$id": "783", + "kind": "enumvalue", + "name": "Hindi", + "value": "hindi", + "valueType": { + "$id": "784", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Hindi.", + "decorators": [] + }, + { + "$id": "785", + "kind": "enumvalue", + "name": "Hungarian", + "value": "hungarian", + "valueType": { + "$id": "786", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Hungarian.", + "decorators": [] + }, + { + "$id": "787", + "kind": "enumvalue", + "name": "LightHungarian", + "value": "lightHungarian", + "valueType": { + "$id": "788", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Hungarian that does light stemming.", + "decorators": [] + }, + { + "$id": "789", + "kind": "enumvalue", + "name": "Indonesian", + "value": "indonesian", + "valueType": { + "$id": "790", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Indonesian.", + "decorators": [] + }, + { + "$id": "791", + "kind": "enumvalue", + "name": "Irish", + "value": "irish", + "valueType": { + "$id": "792", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Irish.", + "decorators": [] + }, + { + "$id": "793", + "kind": "enumvalue", + "name": "Italian", + "value": "italian", + "valueType": { + "$id": "794", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Italian.", + "decorators": [] + }, + { + "$id": "795", + "kind": "enumvalue", + "name": "LightItalian", + "value": "lightItalian", + "valueType": { + "$id": "796", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Italian that does light stemming.", + "decorators": [] + }, + { + "$id": "797", + "kind": "enumvalue", + "name": "Sorani", + "value": "sorani", + "valueType": { + "$id": "798", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Sorani.", + "decorators": [] + }, + { + "$id": "799", + "kind": "enumvalue", + "name": "Latvian", + "value": "latvian", + "valueType": { + "$id": "800", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Latvian.", + "decorators": [] + }, + { + "$id": "801", + "kind": "enumvalue", + "name": "Norwegian", + "value": "norwegian", + "valueType": { + "$id": "802", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Norwegian (Bokmål).", + "decorators": [] + }, + { + "$id": "803", + "kind": "enumvalue", + "name": "LightNorwegian", + "value": "lightNorwegian", + "valueType": { + "$id": "804", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Norwegian (Bokmål) that does light\nstemming.", + "decorators": [] + }, + { + "$id": "805", + "kind": "enumvalue", + "name": "MinimalNorwegian", + "value": "minimalNorwegian", + "valueType": { + "$id": "806", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Norwegian (Bokmål) that does minimal\nstemming.", + "decorators": [] + }, + { + "$id": "807", + "kind": "enumvalue", + "name": "LightNynorsk", + "value": "lightNynorsk", + "valueType": { + "$id": "808", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Norwegian (Nynorsk) that does light\nstemming.", + "decorators": [] + }, + { + "$id": "809", + "kind": "enumvalue", + "name": "MinimalNynorsk", + "value": "minimalNynorsk", + "valueType": { + "$id": "810", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Norwegian (Nynorsk) that does minimal\nstemming.", + "decorators": [] + }, + { + "$id": "811", + "kind": "enumvalue", + "name": "Portuguese", + "value": "portuguese", + "valueType": { + "$id": "812", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Portuguese.", + "decorators": [] + }, + { + "$id": "813", + "kind": "enumvalue", + "name": "LightPortuguese", + "value": "lightPortuguese", + "valueType": { + "$id": "814", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Portuguese that does light stemming.", + "decorators": [] + }, + { + "$id": "815", + "kind": "enumvalue", + "name": "MinimalPortuguese", + "value": "minimalPortuguese", + "valueType": { + "$id": "816", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Portuguese that does minimal stemming.", + "decorators": [] + }, + { + "$id": "817", + "kind": "enumvalue", + "name": "PortugueseRslp", + "value": "portugueseRslp", + "valueType": { + "$id": "818", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Portuguese that uses the RSLP\nstemming algorithm.", + "decorators": [] + }, + { + "$id": "819", + "kind": "enumvalue", + "name": "Romanian", + "value": "romanian", + "valueType": { + "$id": "820", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Romanian.", + "decorators": [] + }, + { + "$id": "821", + "kind": "enumvalue", + "name": "Russian", + "value": "russian", + "valueType": { + "$id": "822", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Russian.", + "decorators": [] + }, + { + "$id": "823", + "kind": "enumvalue", + "name": "LightRussian", + "value": "lightRussian", + "valueType": { + "$id": "824", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Russian that does light stemming.", + "decorators": [] + }, + { + "$id": "825", + "kind": "enumvalue", + "name": "Spanish", + "value": "spanish", + "valueType": { + "$id": "826", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Spanish.", + "decorators": [] + }, + { + "$id": "827", + "kind": "enumvalue", + "name": "LightSpanish", + "value": "lightSpanish", + "valueType": { + "$id": "828", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Spanish that does light stemming.", + "decorators": [] + }, + { + "$id": "829", + "kind": "enumvalue", + "name": "Swedish", + "value": "swedish", + "valueType": { + "$id": "830", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Swedish.", + "decorators": [] + }, + { + "$id": "831", + "kind": "enumvalue", + "name": "LightSwedish", + "value": "lightSwedish", + "valueType": { + "$id": "832", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Swedish that does light stemming.", + "decorators": [] + }, + { + "$id": "833", + "kind": "enumvalue", + "name": "Turkish", + "value": "turkish", + "valueType": { + "$id": "834", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "725" + }, + "doc": "Selects the Lucene stemming tokenizer for Turkish.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The language to use for a stemmer token filter.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "835", + "kind": "enum", + "name": "StopwordsList", + "crossLanguageDefinitionId": "Search.StopwordsList", + "valueType": { + "$id": "836", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "837", + "kind": "enumvalue", + "name": "Arabic", + "value": "arabic", + "valueType": { + "$id": "838", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Arabic.", + "decorators": [] + }, + { + "$id": "839", + "kind": "enumvalue", + "name": "Armenian", + "value": "armenian", + "valueType": { + "$id": "840", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Armenian.", + "decorators": [] + }, + { + "$id": "841", + "kind": "enumvalue", + "name": "Basque", + "value": "basque", + "valueType": { + "$id": "842", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Basque.", + "decorators": [] + }, + { + "$id": "843", + "kind": "enumvalue", + "name": "Brazilian", + "value": "brazilian", + "valueType": { + "$id": "844", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Portuguese (Brazil).", + "decorators": [] + }, + { + "$id": "845", + "kind": "enumvalue", + "name": "Bulgarian", + "value": "bulgarian", + "valueType": { + "$id": "846", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Bulgarian.", + "decorators": [] + }, + { + "$id": "847", + "kind": "enumvalue", + "name": "Catalan", + "value": "catalan", + "valueType": { + "$id": "848", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Catalan.", + "decorators": [] + }, + { + "$id": "849", + "kind": "enumvalue", + "name": "Czech", + "value": "czech", + "valueType": { + "$id": "850", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Czech.", + "decorators": [] + }, + { + "$id": "851", + "kind": "enumvalue", + "name": "Danish", + "value": "danish", + "valueType": { + "$id": "852", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Danish.", + "decorators": [] + }, + { + "$id": "853", + "kind": "enumvalue", + "name": "Dutch", + "value": "dutch", + "valueType": { + "$id": "854", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Dutch.", + "decorators": [] + }, + { + "$id": "855", + "kind": "enumvalue", + "name": "English", + "value": "english", + "valueType": { + "$id": "856", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for English.", + "decorators": [] + }, + { + "$id": "857", + "kind": "enumvalue", + "name": "Finnish", + "value": "finnish", + "valueType": { + "$id": "858", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Finnish.", + "decorators": [] + }, + { + "$id": "859", + "kind": "enumvalue", + "name": "French", + "value": "french", + "valueType": { + "$id": "860", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for French.", + "decorators": [] + }, + { + "$id": "861", + "kind": "enumvalue", + "name": "Galician", + "value": "galician", + "valueType": { + "$id": "862", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Galician.", + "decorators": [] + }, + { + "$id": "863", + "kind": "enumvalue", + "name": "German", + "value": "german", + "valueType": { + "$id": "864", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for German.", + "decorators": [] + }, + { + "$id": "865", + "kind": "enumvalue", + "name": "Greek", + "value": "greek", + "valueType": { + "$id": "866", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Greek.", + "decorators": [] + }, + { + "$id": "867", + "kind": "enumvalue", + "name": "Hindi", + "value": "hindi", + "valueType": { + "$id": "868", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Hindi.", + "decorators": [] + }, + { + "$id": "869", + "kind": "enumvalue", + "name": "Hungarian", + "value": "hungarian", + "valueType": { + "$id": "870", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Hungarian.", + "decorators": [] + }, + { + "$id": "871", + "kind": "enumvalue", + "name": "Indonesian", + "value": "indonesian", + "valueType": { + "$id": "872", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Indonesian.", + "decorators": [] + }, + { + "$id": "873", + "kind": "enumvalue", + "name": "Irish", + "value": "irish", + "valueType": { + "$id": "874", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Irish.", + "decorators": [] + }, + { + "$id": "875", + "kind": "enumvalue", + "name": "Italian", + "value": "italian", + "valueType": { + "$id": "876", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Italian.", + "decorators": [] + }, + { + "$id": "877", + "kind": "enumvalue", + "name": "Latvian", + "value": "latvian", + "valueType": { + "$id": "878", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Latvian.", + "decorators": [] + }, + { + "$id": "879", + "kind": "enumvalue", + "name": "Norwegian", + "value": "norwegian", + "valueType": { + "$id": "880", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Norwegian.", + "decorators": [] + }, + { + "$id": "881", + "kind": "enumvalue", + "name": "Persian", + "value": "persian", + "valueType": { + "$id": "882", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Persian.", + "decorators": [] + }, + { + "$id": "883", + "kind": "enumvalue", + "name": "Portuguese", + "value": "portuguese", + "valueType": { + "$id": "884", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Portuguese.", + "decorators": [] + }, + { + "$id": "885", + "kind": "enumvalue", + "name": "Romanian", + "value": "romanian", + "valueType": { + "$id": "886", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Romanian.", + "decorators": [] + }, + { + "$id": "887", + "kind": "enumvalue", + "name": "Russian", + "value": "russian", + "valueType": { + "$id": "888", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Russian.", + "decorators": [] + }, + { + "$id": "889", + "kind": "enumvalue", + "name": "Sorani", + "value": "sorani", + "valueType": { + "$id": "890", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Sorani.", + "decorators": [] + }, + { + "$id": "891", + "kind": "enumvalue", + "name": "Spanish", + "value": "spanish", + "valueType": { + "$id": "892", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Spanish.", + "decorators": [] + }, + { + "$id": "893", + "kind": "enumvalue", + "name": "Swedish", + "value": "swedish", + "valueType": { + "$id": "894", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Swedish.", + "decorators": [] + }, + { + "$id": "895", + "kind": "enumvalue", + "name": "Thai", + "value": "thai", + "valueType": { + "$id": "896", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Thai.", + "decorators": [] + }, + { + "$id": "897", + "kind": "enumvalue", + "name": "Turkish", + "value": "turkish", + "valueType": { + "$id": "898", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "835" + }, + "doc": "Selects the stopword list for Turkish.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Identifies a predefined list of language-specific stopwords.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "899", + "kind": "enum", + "name": "VectorSearchAlgorithmKind", + "crossLanguageDefinitionId": "Search.VectorSearchAlgorithmKind", + "valueType": { + "$id": "900", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "901", + "kind": "enumvalue", + "name": "Hnsw", + "value": "hnsw", + "valueType": { + "$id": "902", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "899" + }, + "doc": "HNSW (Hierarchical Navigable Small World), a type of approximate nearest\nneighbors algorithm.", + "decorators": [] + }, + { + "$id": "903", + "kind": "enumvalue", + "name": "ExhaustiveKnn", + "value": "exhaustiveKnn", + "valueType": { + "$id": "904", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "899" + }, + "doc": "Exhaustive KNN algorithm which will perform brute-force search.", + "decorators": [] + } + ], + "access": "public", + "namespace": "Azure.Search.Documents", + "doc": "The algorithm used for indexing and querying.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "905", + "kind": "enum", + "name": "VectorSearchAlgorithmMetric", + "crossLanguageDefinitionId": "Search.VectorSearchAlgorithmMetric", + "valueType": { + "$id": "906", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "907", + "kind": "enumvalue", + "name": "Cosine", + "value": "cosine", + "valueType": { + "$id": "908", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "905" + }, + "doc": "Measures the angle between vectors to quantify their similarity, disregarding\nmagnitude. The smaller the angle, the closer the similarity.", + "decorators": [] + }, + { + "$id": "909", + "kind": "enumvalue", + "name": "Euclidean", + "value": "euclidean", + "valueType": { + "$id": "910", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "905" + }, + "doc": "Computes the straight-line distance between vectors in a multi-dimensional\nspace. The smaller the distance, the closer the similarity.", + "decorators": [] + }, + { + "$id": "911", + "kind": "enumvalue", + "name": "DotProduct", + "value": "dotProduct", + "valueType": { + "$id": "912", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "905" + }, + "doc": "Calculates the sum of element-wise products to gauge alignment and magnitude\nsimilarity. The larger and more positive, the closer the similarity.", + "decorators": [] + }, + { + "$id": "913", + "kind": "enumvalue", + "name": "Hamming", + "value": "hamming", + "valueType": { + "$id": "914", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "905" + }, + "doc": "Only applicable to bit-packed binary data types. Determines dissimilarity by\ncounting differing positions in binary vectors. The fewer differences, the\ncloser the similarity.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The similarity metric to use for vector comparisons. It is recommended to\nchoose the same similarity metric as the embedding model was trained on.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "915", + "kind": "enum", + "name": "VectorSearchVectorizerKind", + "crossLanguageDefinitionId": "Search.VectorSearchVectorizerKind", + "valueType": { + "$id": "916", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "917", + "kind": "enumvalue", + "name": "AzureOpenAI", + "value": "azureOpenAI", + "valueType": { + "$id": "918", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "915" + }, + "doc": "Generate embeddings using an Azure OpenAI resource at query time.", + "decorators": [] + }, + { + "$id": "919", + "kind": "enumvalue", + "name": "CustomWebApi", + "value": "customWebApi", + "valueType": { + "$id": "920", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "915" + }, + "doc": "Generate embeddings using a custom web endpoint at query time.", + "decorators": [] + } + ], + "access": "public", + "namespace": "Azure.Search.Documents", + "doc": "The vectorization method to be used during query time.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "921", + "kind": "enum", + "name": "AzureOpenAIModelName", + "crossLanguageDefinitionId": "Search.AzureOpenAIModelName", + "valueType": { + "$id": "922", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "923", + "kind": "enumvalue", + "name": "TextEmbeddingAda002", + "value": "text-embedding-ada-002", + "valueType": { + "$id": "924", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "921" + }, + "doc": "TextEmbeddingAda002 model.", + "decorators": [] + }, + { + "$id": "925", + "kind": "enumvalue", + "name": "TextEmbedding3Large", + "value": "text-embedding-3-large", + "valueType": { + "$id": "926", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "921" + }, + "doc": "TextEmbedding3Large model.", + "decorators": [] + }, + { + "$id": "927", + "kind": "enumvalue", + "name": "TextEmbedding3Small", + "value": "text-embedding-3-small", + "valueType": { + "$id": "928", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "921" + }, + "doc": "TextEmbedding3Small model.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The Azure Open AI model name that will be called.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "929", + "kind": "enum", + "name": "VectorSearchCompressionKind", + "crossLanguageDefinitionId": "Search.VectorSearchCompressionKind", + "valueType": { + "$id": "930", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "931", + "kind": "enumvalue", + "name": "ScalarQuantization", + "value": "scalarQuantization", + "valueType": { + "$id": "932", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "929" + }, + "doc": "Scalar Quantization, a type of compression method. In scalar quantization, the\noriginal vectors values are compressed to a narrower type by discretizing and\nrepresenting each component of a vector using a reduced set of quantized\nvalues, thereby reducing the overall data size.", + "decorators": [] + }, + { + "$id": "933", + "kind": "enumvalue", + "name": "BinaryQuantization", + "value": "binaryQuantization", + "valueType": { + "$id": "934", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "929" + }, + "doc": "Binary Quantization, a type of compression method. In binary quantization, the\noriginal vectors values are compressed to the narrower binary type by discretizing\nand representing each component of a vector using binary values,\nthereby reducing the overall data size.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The compression method used for indexing and querying.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "935", + "kind": "enum", + "name": "VectorSearchCompressionTarget", + "crossLanguageDefinitionId": "Search.VectorSearchCompressionTarget", + "valueType": { + "$id": "936", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "937", + "kind": "enumvalue", + "name": "Int8", + "value": "int8", + "valueType": { + "$id": "938", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "935" + }, + "doc": "8-bit signed integer.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The quantized data type of compressed vector values.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "939", + "kind": "enum", + "name": "SynonymMap_format", + "valueType": { + "$id": "940", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "941", + "kind": "enumvalue", + "name": "solr", + "value": "solr", + "doc": "solr", + "valueType": { + "$ref": "940" + }, + "enumType": { + "$ref": "939" + } + } + ], + "crossLanguageDefinitionId": "", + "namespace": "Azure.Search.Documents", + "doc": "The SynonymMap_format", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "942", + "kind": "enum", + "name": "KeyPhraseExtractionSkillLanguage", + "crossLanguageDefinitionId": "Search.KeyPhraseExtractionSkillLanguage", + "valueType": { + "$id": "943", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "944", + "kind": "enumvalue", + "name": "da", + "value": "da", + "valueType": { + "$id": "945", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "942" + }, + "doc": "Danish", + "decorators": [] + }, + { + "$id": "946", + "kind": "enumvalue", + "name": "nl", + "value": "nl", + "valueType": { + "$id": "947", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "942" + }, + "doc": "Dutch", + "decorators": [] + }, + { + "$id": "948", + "kind": "enumvalue", + "name": "en", + "value": "en", + "valueType": { + "$id": "949", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "942" + }, + "doc": "English", + "decorators": [] + }, + { + "$id": "950", + "kind": "enumvalue", + "name": "fi", + "value": "fi", + "valueType": { + "$id": "951", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "942" + }, + "doc": "Finnish", + "decorators": [] + }, + { + "$id": "952", + "kind": "enumvalue", + "name": "fr", + "value": "fr", + "valueType": { + "$id": "953", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "942" + }, + "doc": "French", + "decorators": [] + }, + { + "$id": "954", + "kind": "enumvalue", + "name": "de", + "value": "de", + "valueType": { + "$id": "955", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "942" + }, + "doc": "German", + "decorators": [] + }, + { + "$id": "956", + "kind": "enumvalue", + "name": "it", + "value": "it", + "valueType": { + "$id": "957", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "942" + }, + "doc": "Italian", + "decorators": [] + }, + { + "$id": "958", + "kind": "enumvalue", + "name": "ja", + "value": "ja", + "valueType": { + "$id": "959", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "942" + }, + "doc": "Japanese", + "decorators": [] + }, + { + "$id": "960", + "kind": "enumvalue", + "name": "ko", + "value": "ko", + "valueType": { + "$id": "961", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "942" + }, + "doc": "Korean", + "decorators": [] + }, + { + "$id": "962", + "kind": "enumvalue", + "name": "no", + "value": "no", + "valueType": { + "$id": "963", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "942" + }, + "doc": "Norwegian (Bokmaal)", + "decorators": [] + }, + { + "$id": "964", + "kind": "enumvalue", + "name": "pl", + "value": "pl", + "valueType": { + "$id": "965", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "942" + }, + "doc": "Polish", + "decorators": [] + }, + { + "$id": "966", + "kind": "enumvalue", + "name": "pt-PT", + "value": "pt-PT", + "valueType": { + "$id": "967", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "942" + }, + "doc": "Portuguese (Portugal)", + "decorators": [] + }, + { + "$id": "968", + "kind": "enumvalue", + "name": "pt-BR", + "value": "pt-BR", + "valueType": { + "$id": "969", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "942" + }, + "doc": "Portuguese (Brazil)", + "decorators": [] + }, + { + "$id": "970", + "kind": "enumvalue", + "name": "ru", + "value": "ru", + "valueType": { + "$id": "971", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "942" + }, + "doc": "Russian", + "decorators": [] + }, + { + "$id": "972", + "kind": "enumvalue", + "name": "es", + "value": "es", + "valueType": { + "$id": "973", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "942" + }, + "doc": "Spanish", + "decorators": [] + }, + { + "$id": "974", + "kind": "enumvalue", + "name": "sv", + "value": "sv", + "valueType": { + "$id": "975", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "942" + }, + "doc": "Swedish", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The language codes supported for input text by KeyPhraseExtractionSkill.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "976", + "kind": "enum", + "name": "OcrSkillLanguage", + "crossLanguageDefinitionId": "Search.OcrSkillLanguage", + "valueType": { + "$id": "977", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "978", + "kind": "enumvalue", + "name": "af", + "value": "af", + "valueType": { + "$id": "979", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Afrikaans", + "decorators": [] + }, + { + "$id": "980", + "kind": "enumvalue", + "name": "sq", + "value": "sq", + "valueType": { + "$id": "981", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Albanian", + "decorators": [] + }, + { + "$id": "982", + "kind": "enumvalue", + "name": "anp", + "value": "anp", + "valueType": { + "$id": "983", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Angika (Devanagiri)", + "decorators": [] + }, + { + "$id": "984", + "kind": "enumvalue", + "name": "ar", + "value": "ar", + "valueType": { + "$id": "985", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Arabic", + "decorators": [] + }, + { + "$id": "986", + "kind": "enumvalue", + "name": "ast", + "value": "ast", + "valueType": { + "$id": "987", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Asturian", + "decorators": [] + }, + { + "$id": "988", + "kind": "enumvalue", + "name": "awa", + "value": "awa", + "valueType": { + "$id": "989", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Awadhi-Hindi (Devanagiri)", + "decorators": [] + }, + { + "$id": "990", + "kind": "enumvalue", + "name": "az", + "value": "az", + "valueType": { + "$id": "991", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Azerbaijani (Latin)", + "decorators": [] + }, + { + "$id": "992", + "kind": "enumvalue", + "name": "bfy", + "value": "bfy", + "valueType": { + "$id": "993", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Bagheli", + "decorators": [] + }, + { + "$id": "994", + "kind": "enumvalue", + "name": "eu", + "value": "eu", + "valueType": { + "$id": "995", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Basque", + "decorators": [] + }, + { + "$id": "996", + "kind": "enumvalue", + "name": "be", + "value": "be", + "valueType": { + "$id": "997", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Belarusian (Cyrillic and Latin)", + "decorators": [] + }, + { + "$id": "998", + "kind": "enumvalue", + "name": "be-cyrl", + "value": "be-cyrl", + "valueType": { + "$id": "999", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Belarusian (Cyrillic)", + "decorators": [] + }, + { + "$id": "1000", + "kind": "enumvalue", + "name": "be-latn", + "value": "be-latn", + "valueType": { + "$id": "1001", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Belarusian (Latin)", + "decorators": [] + }, + { + "$id": "1002", + "kind": "enumvalue", + "name": "bho", + "value": "bho", + "valueType": { + "$id": "1003", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Bhojpuri-Hindi (Devanagiri)", + "decorators": [] + }, + { + "$id": "1004", + "kind": "enumvalue", + "name": "bi", + "value": "bi", + "valueType": { + "$id": "1005", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Bislama", + "decorators": [] + }, + { + "$id": "1006", + "kind": "enumvalue", + "name": "brx", + "value": "brx", + "valueType": { + "$id": "1007", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Bodo (Devanagiri)", + "decorators": [] + }, + { + "$id": "1008", + "kind": "enumvalue", + "name": "bs", + "value": "bs", + "valueType": { + "$id": "1009", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Bosnian Latin", + "decorators": [] + }, + { + "$id": "1010", + "kind": "enumvalue", + "name": "bra", + "value": "bra", + "valueType": { + "$id": "1011", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Brajbha", + "decorators": [] + }, + { + "$id": "1012", + "kind": "enumvalue", + "name": "br", + "value": "br", + "valueType": { + "$id": "1013", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Breton", + "decorators": [] + }, + { + "$id": "1014", + "kind": "enumvalue", + "name": "bg", + "value": "bg", + "valueType": { + "$id": "1015", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Bulgarian", + "decorators": [] + }, + { + "$id": "1016", + "kind": "enumvalue", + "name": "bns", + "value": "bns", + "valueType": { + "$id": "1017", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Bundeli", + "decorators": [] + }, + { + "$id": "1018", + "kind": "enumvalue", + "name": "bua", + "value": "bua", + "valueType": { + "$id": "1019", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Buryat (Cyrillic)", + "decorators": [] + }, + { + "$id": "1020", + "kind": "enumvalue", + "name": "ca", + "value": "ca", + "valueType": { + "$id": "1021", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Catalan", + "decorators": [] + }, + { + "$id": "1022", + "kind": "enumvalue", + "name": "ceb", + "value": "ceb", + "valueType": { + "$id": "1023", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Cebuano", + "decorators": [] + }, + { + "$id": "1024", + "kind": "enumvalue", + "name": "rab", + "value": "rab", + "valueType": { + "$id": "1025", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Chamling", + "decorators": [] + }, + { + "$id": "1026", + "kind": "enumvalue", + "name": "ch", + "value": "ch", + "valueType": { + "$id": "1027", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Chamorro", + "decorators": [] + }, + { + "$id": "1028", + "kind": "enumvalue", + "name": "hne", + "value": "hne", + "valueType": { + "$id": "1029", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Chhattisgarhi (Devanagiri)", + "decorators": [] + }, + { + "$id": "1030", + "kind": "enumvalue", + "name": "zh-Hans", + "value": "zh-Hans", + "valueType": { + "$id": "1031", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Chinese Simplified", + "decorators": [] + }, + { + "$id": "1032", + "kind": "enumvalue", + "name": "zh-Hant", + "value": "zh-Hant", + "valueType": { + "$id": "1033", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Chinese Traditional", + "decorators": [] + }, + { + "$id": "1034", + "kind": "enumvalue", + "name": "kw", + "value": "kw", + "valueType": { + "$id": "1035", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Cornish", + "decorators": [] + }, + { + "$id": "1036", + "kind": "enumvalue", + "name": "co", + "value": "co", + "valueType": { + "$id": "1037", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Corsican", + "decorators": [] + }, + { + "$id": "1038", + "kind": "enumvalue", + "name": "crh", + "value": "crh", + "valueType": { + "$id": "1039", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Crimean Tatar (Latin)", + "decorators": [] + }, + { + "$id": "1040", + "kind": "enumvalue", + "name": "hr", + "value": "hr", + "valueType": { + "$id": "1041", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Croatian", + "decorators": [] + }, + { + "$id": "1042", + "kind": "enumvalue", + "name": "cs", + "value": "cs", + "valueType": { + "$id": "1043", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Czech", + "decorators": [] + }, + { + "$id": "1044", + "kind": "enumvalue", + "name": "da", + "value": "da", + "valueType": { + "$id": "1045", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Danish", + "decorators": [] + }, + { + "$id": "1046", + "kind": "enumvalue", + "name": "prs", + "value": "prs", + "valueType": { + "$id": "1047", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Dari", + "decorators": [] + }, + { + "$id": "1048", + "kind": "enumvalue", + "name": "dhi", + "value": "dhi", + "valueType": { + "$id": "1049", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Dhimal (Devanagiri)", + "decorators": [] + }, + { + "$id": "1050", + "kind": "enumvalue", + "name": "doi", + "value": "doi", + "valueType": { + "$id": "1051", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Dogri (Devanagiri)", + "decorators": [] + }, + { + "$id": "1052", + "kind": "enumvalue", + "name": "nl", + "value": "nl", + "valueType": { + "$id": "1053", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Dutch", + "decorators": [] + }, + { + "$id": "1054", + "kind": "enumvalue", + "name": "en", + "value": "en", + "valueType": { + "$id": "1055", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "English", + "decorators": [] + }, + { + "$id": "1056", + "kind": "enumvalue", + "name": "myv", + "value": "myv", + "valueType": { + "$id": "1057", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Erzya (Cyrillic)", + "decorators": [] + }, + { + "$id": "1058", + "kind": "enumvalue", + "name": "et", + "value": "et", + "valueType": { + "$id": "1059", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Estonian", + "decorators": [] + }, + { + "$id": "1060", + "kind": "enumvalue", + "name": "fo", + "value": "fo", + "valueType": { + "$id": "1061", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Faroese", + "decorators": [] + }, + { + "$id": "1062", + "kind": "enumvalue", + "name": "fj", + "value": "fj", + "valueType": { + "$id": "1063", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Fijian", + "decorators": [] + }, + { + "$id": "1064", + "kind": "enumvalue", + "name": "fil", + "value": "fil", + "valueType": { + "$id": "1065", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Filipino", + "decorators": [] + }, + { + "$id": "1066", + "kind": "enumvalue", + "name": "fi", + "value": "fi", + "valueType": { + "$id": "1067", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Finnish", + "decorators": [] + }, + { + "$id": "1068", + "kind": "enumvalue", + "name": "fr", + "value": "fr", + "valueType": { + "$id": "1069", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "French", + "decorators": [] + }, + { + "$id": "1070", + "kind": "enumvalue", + "name": "fur", + "value": "fur", + "valueType": { + "$id": "1071", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Frulian", + "decorators": [] + }, + { + "$id": "1072", + "kind": "enumvalue", + "name": "gag", + "value": "gag", + "valueType": { + "$id": "1073", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Gagauz (Latin)", + "decorators": [] + }, + { + "$id": "1074", + "kind": "enumvalue", + "name": "gl", + "value": "gl", + "valueType": { + "$id": "1075", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Galician", + "decorators": [] + }, + { + "$id": "1076", + "kind": "enumvalue", + "name": "de", + "value": "de", + "valueType": { + "$id": "1077", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "German", + "decorators": [] + }, + { + "$id": "1078", + "kind": "enumvalue", + "name": "gil", + "value": "gil", + "valueType": { + "$id": "1079", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Gilbertese", + "decorators": [] + }, + { + "$id": "1080", + "kind": "enumvalue", + "name": "gon", + "value": "gon", + "valueType": { + "$id": "1081", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Gondi (Devanagiri)", + "decorators": [] + }, + { + "$id": "1082", + "kind": "enumvalue", + "name": "el", + "value": "el", + "valueType": { + "$id": "1083", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Greek", + "decorators": [] + }, + { + "$id": "1084", + "kind": "enumvalue", + "name": "kl", + "value": "kl", + "valueType": { + "$id": "1085", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Greenlandic", + "decorators": [] + }, + { + "$id": "1086", + "kind": "enumvalue", + "name": "gvr", + "value": "gvr", + "valueType": { + "$id": "1087", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Gurung (Devanagiri)", + "decorators": [] + }, + { + "$id": "1088", + "kind": "enumvalue", + "name": "ht", + "value": "ht", + "valueType": { + "$id": "1089", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Haitian Creole", + "decorators": [] + }, + { + "$id": "1090", + "kind": "enumvalue", + "name": "hlb", + "value": "hlb", + "valueType": { + "$id": "1091", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Halbi (Devanagiri)", + "decorators": [] + }, + { + "$id": "1092", + "kind": "enumvalue", + "name": "hni", + "value": "hni", + "valueType": { + "$id": "1093", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Hani", + "decorators": [] + }, + { + "$id": "1094", + "kind": "enumvalue", + "name": "bgc", + "value": "bgc", + "valueType": { + "$id": "1095", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Haryanvi", + "decorators": [] + }, + { + "$id": "1096", + "kind": "enumvalue", + "name": "haw", + "value": "haw", + "valueType": { + "$id": "1097", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Hawaiian", + "decorators": [] + }, + { + "$id": "1098", + "kind": "enumvalue", + "name": "hi", + "value": "hi", + "valueType": { + "$id": "1099", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Hindi", + "decorators": [] + }, + { + "$id": "1100", + "kind": "enumvalue", + "name": "mww", + "value": "mww", + "valueType": { + "$id": "1101", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Hmong Daw (Latin)", + "decorators": [] + }, + { + "$id": "1102", + "kind": "enumvalue", + "name": "hoc", + "value": "hoc", + "valueType": { + "$id": "1103", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Ho (Devanagiri)", + "decorators": [] + }, + { + "$id": "1104", + "kind": "enumvalue", + "name": "hu", + "value": "hu", + "valueType": { + "$id": "1105", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Hungarian", + "decorators": [] + }, + { + "$id": "1106", + "kind": "enumvalue", + "name": "is", + "value": "is", + "valueType": { + "$id": "1107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Icelandic", + "decorators": [] + }, + { + "$id": "1108", + "kind": "enumvalue", + "name": "smn", + "value": "smn", + "valueType": { + "$id": "1109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Inari Sami", + "decorators": [] + }, + { + "$id": "1110", + "kind": "enumvalue", + "name": "id", + "value": "id", + "valueType": { + "$id": "1111", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Indonesian", + "decorators": [] + }, + { + "$id": "1112", + "kind": "enumvalue", + "name": "ia", + "value": "ia", + "valueType": { + "$id": "1113", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Interlingua", + "decorators": [] + }, + { + "$id": "1114", + "kind": "enumvalue", + "name": "iu", + "value": "iu", + "valueType": { + "$id": "1115", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Inuktitut (Latin)", + "decorators": [] + }, + { + "$id": "1116", + "kind": "enumvalue", + "name": "ga", + "value": "ga", + "valueType": { + "$id": "1117", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Irish", + "decorators": [] + }, + { + "$id": "1118", + "kind": "enumvalue", + "name": "it", + "value": "it", + "valueType": { + "$id": "1119", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Italian", + "decorators": [] + }, + { + "$id": "1120", + "kind": "enumvalue", + "name": "ja", + "value": "ja", + "valueType": { + "$id": "1121", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Japanese", + "decorators": [] + }, + { + "$id": "1122", + "kind": "enumvalue", + "name": "Jns", + "value": "Jns", + "valueType": { + "$id": "1123", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Jaunsari (Devanagiri)", + "decorators": [] + }, + { + "$id": "1124", + "kind": "enumvalue", + "name": "jv", + "value": "jv", + "valueType": { + "$id": "1125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Javanese", + "decorators": [] + }, + { + "$id": "1126", + "kind": "enumvalue", + "name": "kea", + "value": "kea", + "valueType": { + "$id": "1127", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Kabuverdianu", + "decorators": [] + }, + { + "$id": "1128", + "kind": "enumvalue", + "name": "kac", + "value": "kac", + "valueType": { + "$id": "1129", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Kachin (Latin)", + "decorators": [] + }, + { + "$id": "1130", + "kind": "enumvalue", + "name": "xnr", + "value": "xnr", + "valueType": { + "$id": "1131", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Kangri (Devanagiri)", + "decorators": [] + }, + { + "$id": "1132", + "kind": "enumvalue", + "name": "krc", + "value": "krc", + "valueType": { + "$id": "1133", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Karachay-Balkar", + "decorators": [] + }, + { + "$id": "1134", + "kind": "enumvalue", + "name": "kaa-cyrl", + "value": "kaa-cyrl", + "valueType": { + "$id": "1135", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Kara-Kalpak (Cyrillic)", + "decorators": [] + }, + { + "$id": "1136", + "kind": "enumvalue", + "name": "kaa", + "value": "kaa", + "valueType": { + "$id": "1137", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Kara-Kalpak (Latin)", + "decorators": [] + }, + { + "$id": "1138", + "kind": "enumvalue", + "name": "csb", + "value": "csb", + "valueType": { + "$id": "1139", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Kashubian", + "decorators": [] + }, + { + "$id": "1140", + "kind": "enumvalue", + "name": "kk-cyrl", + "value": "kk-cyrl", + "valueType": { + "$id": "1141", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Kazakh (Cyrillic)", + "decorators": [] + }, + { + "$id": "1142", + "kind": "enumvalue", + "name": "kk-latn", + "value": "kk-latn", + "valueType": { + "$id": "1143", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Kazakh (Latin)", + "decorators": [] + }, + { + "$id": "1144", + "kind": "enumvalue", + "name": "klr", + "value": "klr", + "valueType": { + "$id": "1145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Khaling", + "decorators": [] + }, + { + "$id": "1146", + "kind": "enumvalue", + "name": "kha", + "value": "kha", + "valueType": { + "$id": "1147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Khasi", + "decorators": [] + }, + { + "$id": "1148", + "kind": "enumvalue", + "name": "quc", + "value": "quc", + "valueType": { + "$id": "1149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "K'iche'", + "decorators": [] + }, + { + "$id": "1150", + "kind": "enumvalue", + "name": "ko", + "value": "ko", + "valueType": { + "$id": "1151", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Korean", + "decorators": [] + }, + { + "$id": "1152", + "kind": "enumvalue", + "name": "kfq", + "value": "kfq", + "valueType": { + "$id": "1153", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Korku", + "decorators": [] + }, + { + "$id": "1154", + "kind": "enumvalue", + "name": "kpy", + "value": "kpy", + "valueType": { + "$id": "1155", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Koryak", + "decorators": [] + }, + { + "$id": "1156", + "kind": "enumvalue", + "name": "kos", + "value": "kos", + "valueType": { + "$id": "1157", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Kosraean", + "decorators": [] + }, + { + "$id": "1158", + "kind": "enumvalue", + "name": "kum", + "value": "kum", + "valueType": { + "$id": "1159", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Kumyk (Cyrillic)", + "decorators": [] + }, + { + "$id": "1160", + "kind": "enumvalue", + "name": "ku-arab", + "value": "ku-arab", + "valueType": { + "$id": "1161", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Kurdish (Arabic)", + "decorators": [] + }, + { + "$id": "1162", + "kind": "enumvalue", + "name": "ku-latn", + "value": "ku-latn", + "valueType": { + "$id": "1163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Kurdish (Latin)", + "decorators": [] + }, + { + "$id": "1164", + "kind": "enumvalue", + "name": "kru", + "value": "kru", + "valueType": { + "$id": "1165", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Kurukh (Devanagiri)", + "decorators": [] + }, + { + "$id": "1166", + "kind": "enumvalue", + "name": "ky", + "value": "ky", + "valueType": { + "$id": "1167", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Kyrgyz (Cyrillic)", + "decorators": [] + }, + { + "$id": "1168", + "kind": "enumvalue", + "name": "lkt", + "value": "lkt", + "valueType": { + "$id": "1169", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Lakota", + "decorators": [] + }, + { + "$id": "1170", + "kind": "enumvalue", + "name": "la", + "value": "la", + "valueType": { + "$id": "1171", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Latin", + "decorators": [] + }, + { + "$id": "1172", + "kind": "enumvalue", + "name": "lt", + "value": "lt", + "valueType": { + "$id": "1173", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Lithuanian", + "decorators": [] + }, + { + "$id": "1174", + "kind": "enumvalue", + "name": "dsb", + "value": "dsb", + "valueType": { + "$id": "1175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Lower Sorbian", + "decorators": [] + }, + { + "$id": "1176", + "kind": "enumvalue", + "name": "smj", + "value": "smj", + "valueType": { + "$id": "1177", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Lule Sami", + "decorators": [] + }, + { + "$id": "1178", + "kind": "enumvalue", + "name": "lb", + "value": "lb", + "valueType": { + "$id": "1179", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Luxembourgish", + "decorators": [] + }, + { + "$id": "1180", + "kind": "enumvalue", + "name": "bfz", + "value": "bfz", + "valueType": { + "$id": "1181", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Mahasu Pahari (Devanagiri)", + "decorators": [] + }, + { + "$id": "1182", + "kind": "enumvalue", + "name": "ms", + "value": "ms", + "valueType": { + "$id": "1183", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Malay (Latin)", + "decorators": [] + }, + { + "$id": "1184", + "kind": "enumvalue", + "name": "mt", + "value": "mt", + "valueType": { + "$id": "1185", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Maltese", + "decorators": [] + }, + { + "$id": "1186", + "kind": "enumvalue", + "name": "kmj", + "value": "kmj", + "valueType": { + "$id": "1187", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Malto (Devanagiri)", + "decorators": [] + }, + { + "$id": "1188", + "kind": "enumvalue", + "name": "gv", + "value": "gv", + "valueType": { + "$id": "1189", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Manx", + "decorators": [] + }, + { + "$id": "1190", + "kind": "enumvalue", + "name": "mi", + "value": "mi", + "valueType": { + "$id": "1191", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Maori", + "decorators": [] + }, + { + "$id": "1192", + "kind": "enumvalue", + "name": "mr", + "value": "mr", + "valueType": { + "$id": "1193", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Marathi", + "decorators": [] + }, + { + "$id": "1194", + "kind": "enumvalue", + "name": "mn", + "value": "mn", + "valueType": { + "$id": "1195", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Mongolian (Cyrillic)", + "decorators": [] + }, + { + "$id": "1196", + "kind": "enumvalue", + "name": "cnr-cyrl", + "value": "cnr-cyrl", + "valueType": { + "$id": "1197", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Montenegrin (Cyrillic)", + "decorators": [] + }, + { + "$id": "1198", + "kind": "enumvalue", + "name": "cnr-latn", + "value": "cnr-latn", + "valueType": { + "$id": "1199", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Montenegrin (Latin)", + "decorators": [] + }, + { + "$id": "1200", + "kind": "enumvalue", + "name": "nap", + "value": "nap", + "valueType": { + "$id": "1201", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Neapolitan", + "decorators": [] + }, + { + "$id": "1202", + "kind": "enumvalue", + "name": "ne", + "value": "ne", + "valueType": { + "$id": "1203", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Nepali", + "decorators": [] + }, + { + "$id": "1204", + "kind": "enumvalue", + "name": "niu", + "value": "niu", + "valueType": { + "$id": "1205", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Niuean", + "decorators": [] + }, + { + "$id": "1206", + "kind": "enumvalue", + "name": "nog", + "value": "nog", + "valueType": { + "$id": "1207", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Nogay", + "decorators": [] + }, + { + "$id": "1208", + "kind": "enumvalue", + "name": "sme", + "value": "sme", + "valueType": { + "$id": "1209", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Northern Sami (Latin)", + "decorators": [] + }, + { + "$id": "1210", + "kind": "enumvalue", + "name": "nb", + "value": "nb", + "valueType": { + "$id": "1211", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Norwegian", + "decorators": [] + }, + { + "$id": "1212", + "kind": "enumvalue", + "name": "no", + "value": "no", + "valueType": { + "$id": "1213", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Norwegian", + "decorators": [] + }, + { + "$id": "1214", + "kind": "enumvalue", + "name": "oc", + "value": "oc", + "valueType": { + "$id": "1215", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Occitan", + "decorators": [] + }, + { + "$id": "1216", + "kind": "enumvalue", + "name": "os", + "value": "os", + "valueType": { + "$id": "1217", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Ossetic", + "decorators": [] + }, + { + "$id": "1218", + "kind": "enumvalue", + "name": "ps", + "value": "ps", + "valueType": { + "$id": "1219", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Pashto", + "decorators": [] + }, + { + "$id": "1220", + "kind": "enumvalue", + "name": "fa", + "value": "fa", + "valueType": { + "$id": "1221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Persian", + "decorators": [] + }, + { + "$id": "1222", + "kind": "enumvalue", + "name": "pl", + "value": "pl", + "valueType": { + "$id": "1223", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Polish", + "decorators": [] + }, + { + "$id": "1224", + "kind": "enumvalue", + "name": "pt", + "value": "pt", + "valueType": { + "$id": "1225", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Portuguese", + "decorators": [] + }, + { + "$id": "1226", + "kind": "enumvalue", + "name": "pa", + "value": "pa", + "valueType": { + "$id": "1227", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Punjabi (Arabic)", + "decorators": [] + }, + { + "$id": "1228", + "kind": "enumvalue", + "name": "ksh", + "value": "ksh", + "valueType": { + "$id": "1229", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Ripuarian", + "decorators": [] + }, + { + "$id": "1230", + "kind": "enumvalue", + "name": "ro", + "value": "ro", + "valueType": { + "$id": "1231", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Romanian", + "decorators": [] + }, + { + "$id": "1232", + "kind": "enumvalue", + "name": "rm", + "value": "rm", + "valueType": { + "$id": "1233", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Romansh", + "decorators": [] + }, + { + "$id": "1234", + "kind": "enumvalue", + "name": "ru", + "value": "ru", + "valueType": { + "$id": "1235", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Russian", + "decorators": [] + }, + { + "$id": "1236", + "kind": "enumvalue", + "name": "sck", + "value": "sck", + "valueType": { + "$id": "1237", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Sadri (Devanagiri)", + "decorators": [] + }, + { + "$id": "1238", + "kind": "enumvalue", + "name": "sm", + "value": "sm", + "valueType": { + "$id": "1239", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Samoan (Latin)", + "decorators": [] + }, + { + "$id": "1240", + "kind": "enumvalue", + "name": "sa", + "value": "sa", + "valueType": { + "$id": "1241", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Sanskrit (Devanagiri)", + "decorators": [] + }, + { + "$id": "1242", + "kind": "enumvalue", + "name": "sat", + "value": "sat", + "valueType": { + "$id": "1243", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Santali (Devanagiri)", + "decorators": [] + }, + { + "$id": "1244", + "kind": "enumvalue", + "name": "sco", + "value": "sco", + "valueType": { + "$id": "1245", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Scots", + "decorators": [] + }, + { + "$id": "1246", + "kind": "enumvalue", + "name": "gd", + "value": "gd", + "valueType": { + "$id": "1247", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Scottish Gaelic", + "decorators": [] + }, + { + "$id": "1248", + "kind": "enumvalue", + "name": "sr", + "value": "sr", + "valueType": { + "$id": "1249", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Serbian (Latin)", + "decorators": [] + }, + { + "$id": "1250", + "kind": "enumvalue", + "name": "sr-Cyrl", + "value": "sr-Cyrl", + "valueType": { + "$id": "1251", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Serbian (Cyrillic)", + "decorators": [] + }, + { + "$id": "1252", + "kind": "enumvalue", + "name": "sr-Latn", + "value": "sr-Latn", + "valueType": { + "$id": "1253", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Serbian (Latin)", + "decorators": [] + }, + { + "$id": "1254", + "kind": "enumvalue", + "name": "xsr", + "value": "xsr", + "valueType": { + "$id": "1255", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Sherpa (Devanagiri)", + "decorators": [] + }, + { + "$id": "1256", + "kind": "enumvalue", + "name": "srx", + "value": "srx", + "valueType": { + "$id": "1257", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Sirmauri (Devanagiri)", + "decorators": [] + }, + { + "$id": "1258", + "kind": "enumvalue", + "name": "sms", + "value": "sms", + "valueType": { + "$id": "1259", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Skolt Sami", + "decorators": [] + }, + { + "$id": "1260", + "kind": "enumvalue", + "name": "sk", + "value": "sk", + "valueType": { + "$id": "1261", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Slovak", + "decorators": [] + }, + { + "$id": "1262", + "kind": "enumvalue", + "name": "sl", + "value": "sl", + "valueType": { + "$id": "1263", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Slovenian", + "decorators": [] + }, + { + "$id": "1264", + "kind": "enumvalue", + "name": "so", + "value": "so", + "valueType": { + "$id": "1265", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Somali (Arabic)", + "decorators": [] + }, + { + "$id": "1266", + "kind": "enumvalue", + "name": "sma", + "value": "sma", + "valueType": { + "$id": "1267", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Southern Sami", + "decorators": [] + }, + { + "$id": "1268", + "kind": "enumvalue", + "name": "es", + "value": "es", + "valueType": { + "$id": "1269", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Spanish", + "decorators": [] + }, + { + "$id": "1270", + "kind": "enumvalue", + "name": "sw", + "value": "sw", + "valueType": { + "$id": "1271", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Swahili (Latin)", + "decorators": [] + }, + { + "$id": "1272", + "kind": "enumvalue", + "name": "sv", + "value": "sv", + "valueType": { + "$id": "1273", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Swedish", + "decorators": [] + }, + { + "$id": "1274", + "kind": "enumvalue", + "name": "tg", + "value": "tg", + "valueType": { + "$id": "1275", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Tajik (Cyrillic)", + "decorators": [] + }, + { + "$id": "1276", + "kind": "enumvalue", + "name": "tt", + "value": "tt", + "valueType": { + "$id": "1277", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Tatar (Latin)", + "decorators": [] + }, + { + "$id": "1278", + "kind": "enumvalue", + "name": "tet", + "value": "tet", + "valueType": { + "$id": "1279", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Tetum", + "decorators": [] + }, + { + "$id": "1280", + "kind": "enumvalue", + "name": "thf", + "value": "thf", + "valueType": { + "$id": "1281", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Thangmi", + "decorators": [] + }, + { + "$id": "1282", + "kind": "enumvalue", + "name": "to", + "value": "to", + "valueType": { + "$id": "1283", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Tongan", + "decorators": [] + }, + { + "$id": "1284", + "kind": "enumvalue", + "name": "tr", + "value": "tr", + "valueType": { + "$id": "1285", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Turkish", + "decorators": [] + }, + { + "$id": "1286", + "kind": "enumvalue", + "name": "tk", + "value": "tk", + "valueType": { + "$id": "1287", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Turkmen (Latin)", + "decorators": [] + }, + { + "$id": "1288", + "kind": "enumvalue", + "name": "tyv", + "value": "tyv", + "valueType": { + "$id": "1289", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Tuvan", + "decorators": [] + }, + { + "$id": "1290", + "kind": "enumvalue", + "name": "hsb", + "value": "hsb", + "valueType": { + "$id": "1291", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Upper Sorbian", + "decorators": [] + }, + { + "$id": "1292", + "kind": "enumvalue", + "name": "ur", + "value": "ur", + "valueType": { + "$id": "1293", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Urdu", + "decorators": [] + }, + { + "$id": "1294", + "kind": "enumvalue", + "name": "ug", + "value": "ug", + "valueType": { + "$id": "1295", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Uyghur (Arabic)", + "decorators": [] + }, + { + "$id": "1296", + "kind": "enumvalue", + "name": "uz-arab", + "value": "uz-arab", + "valueType": { + "$id": "1297", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Uzbek (Arabic)", + "decorators": [] + }, + { + "$id": "1298", + "kind": "enumvalue", + "name": "uz-cyrl", + "value": "uz-cyrl", + "valueType": { + "$id": "1299", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Uzbek (Cyrillic)", + "decorators": [] + }, + { + "$id": "1300", + "kind": "enumvalue", + "name": "uz", + "value": "uz", + "valueType": { + "$id": "1301", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Uzbek (Latin)", + "decorators": [] + }, + { + "$id": "1302", + "kind": "enumvalue", + "name": "vo", + "value": "vo", + "valueType": { + "$id": "1303", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Volapük", + "decorators": [] + }, + { + "$id": "1304", + "kind": "enumvalue", + "name": "wae", + "value": "wae", + "valueType": { + "$id": "1305", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Walser", + "decorators": [] + }, + { + "$id": "1306", + "kind": "enumvalue", + "name": "cy", + "value": "cy", + "valueType": { + "$id": "1307", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Welsh", + "decorators": [] + }, + { + "$id": "1308", + "kind": "enumvalue", + "name": "fy", + "value": "fy", + "valueType": { + "$id": "1309", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Western Frisian", + "decorators": [] + }, + { + "$id": "1310", + "kind": "enumvalue", + "name": "yua", + "value": "yua", + "valueType": { + "$id": "1311", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Yucatec Maya", + "decorators": [] + }, + { + "$id": "1312", + "kind": "enumvalue", + "name": "za", + "value": "za", + "valueType": { + "$id": "1313", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Zhuang", + "decorators": [] + }, + { + "$id": "1314", + "kind": "enumvalue", + "name": "zu", + "value": "zu", + "valueType": { + "$id": "1315", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Zulu", + "decorators": [] + }, + { + "$id": "1316", + "kind": "enumvalue", + "name": "unk", + "value": "unk", + "valueType": { + "$id": "1317", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "976" + }, + "doc": "Unknown (All)", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The language codes supported for input by OcrSkill.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1318", + "kind": "enum", + "name": "OcrLineEnding", + "crossLanguageDefinitionId": "Search.OcrLineEnding", + "valueType": { + "$id": "1319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1320", + "kind": "enumvalue", + "name": "Space", + "value": "space", + "valueType": { + "$id": "1321", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1318" + }, + "doc": "Lines are separated by a single space character.", + "decorators": [] + }, + { + "$id": "1322", + "kind": "enumvalue", + "name": "CarriageReturn", + "value": "carriageReturn", + "valueType": { + "$id": "1323", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1318" + }, + "doc": "Lines are separated by a carriage return ('\\r') character.", + "decorators": [] + }, + { + "$id": "1324", + "kind": "enumvalue", + "name": "LineFeed", + "value": "lineFeed", + "valueType": { + "$id": "1325", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1318" + }, + "doc": "Lines are separated by a single line feed ('\\n') character.", + "decorators": [] + }, + { + "$id": "1326", + "kind": "enumvalue", + "name": "CarriageReturnLineFeed", + "value": "carriageReturnLineFeed", + "valueType": { + "$id": "1327", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1318" + }, + "doc": "Lines are separated by a carriage return and a line feed ('\\r\\n') character.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Defines the sequence of characters to use between the lines of text recognized\nby the OCR skill. The default value is \"space\".", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1328", + "kind": "enum", + "name": "ImageAnalysisSkillLanguage", + "crossLanguageDefinitionId": "Search.ImageAnalysisSkillLanguage", + "valueType": { + "$id": "1329", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1330", + "kind": "enumvalue", + "name": "ar", + "value": "ar", + "valueType": { + "$id": "1331", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Arabic", + "decorators": [] + }, + { + "$id": "1332", + "kind": "enumvalue", + "name": "az", + "value": "az", + "valueType": { + "$id": "1333", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Azerbaijani", + "decorators": [] + }, + { + "$id": "1334", + "kind": "enumvalue", + "name": "bg", + "value": "bg", + "valueType": { + "$id": "1335", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Bulgarian", + "decorators": [] + }, + { + "$id": "1336", + "kind": "enumvalue", + "name": "bs", + "value": "bs", + "valueType": { + "$id": "1337", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Bosnian Latin", + "decorators": [] + }, + { + "$id": "1338", + "kind": "enumvalue", + "name": "ca", + "value": "ca", + "valueType": { + "$id": "1339", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Catalan", + "decorators": [] + }, + { + "$id": "1340", + "kind": "enumvalue", + "name": "cs", + "value": "cs", + "valueType": { + "$id": "1341", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Czech", + "decorators": [] + }, + { + "$id": "1342", + "kind": "enumvalue", + "name": "cy", + "value": "cy", + "valueType": { + "$id": "1343", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Welsh", + "decorators": [] + }, + { + "$id": "1344", + "kind": "enumvalue", + "name": "da", + "value": "da", + "valueType": { + "$id": "1345", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Danish", + "decorators": [] + }, + { + "$id": "1346", + "kind": "enumvalue", + "name": "de", + "value": "de", + "valueType": { + "$id": "1347", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "German", + "decorators": [] + }, + { + "$id": "1348", + "kind": "enumvalue", + "name": "el", + "value": "el", + "valueType": { + "$id": "1349", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Greek", + "decorators": [] + }, + { + "$id": "1350", + "kind": "enumvalue", + "name": "en", + "value": "en", + "valueType": { + "$id": "1351", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "English", + "decorators": [] + }, + { + "$id": "1352", + "kind": "enumvalue", + "name": "es", + "value": "es", + "valueType": { + "$id": "1353", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Spanish", + "decorators": [] + }, + { + "$id": "1354", + "kind": "enumvalue", + "name": "et", + "value": "et", + "valueType": { + "$id": "1355", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Estonian", + "decorators": [] + }, + { + "$id": "1356", + "kind": "enumvalue", + "name": "eu", + "value": "eu", + "valueType": { + "$id": "1357", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Basque", + "decorators": [] + }, + { + "$id": "1358", + "kind": "enumvalue", + "name": "fi", + "value": "fi", + "valueType": { + "$id": "1359", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Finnish", + "decorators": [] + }, + { + "$id": "1360", + "kind": "enumvalue", + "name": "fr", + "value": "fr", + "valueType": { + "$id": "1361", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "French", + "decorators": [] + }, + { + "$id": "1362", + "kind": "enumvalue", + "name": "ga", + "value": "ga", + "valueType": { + "$id": "1363", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Irish", + "decorators": [] + }, + { + "$id": "1364", + "kind": "enumvalue", + "name": "gl", + "value": "gl", + "valueType": { + "$id": "1365", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Galician", + "decorators": [] + }, + { + "$id": "1366", + "kind": "enumvalue", + "name": "he", + "value": "he", + "valueType": { + "$id": "1367", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Hebrew", + "decorators": [] + }, + { + "$id": "1368", + "kind": "enumvalue", + "name": "hi", + "value": "hi", + "valueType": { + "$id": "1369", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Hindi", + "decorators": [] + }, + { + "$id": "1370", + "kind": "enumvalue", + "name": "hr", + "value": "hr", + "valueType": { + "$id": "1371", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Croatian", + "decorators": [] + }, + { + "$id": "1372", + "kind": "enumvalue", + "name": "hu", + "value": "hu", + "valueType": { + "$id": "1373", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Hungarian", + "decorators": [] + }, + { + "$id": "1374", + "kind": "enumvalue", + "name": "id", + "value": "id", + "valueType": { + "$id": "1375", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Indonesian", + "decorators": [] + }, + { + "$id": "1376", + "kind": "enumvalue", + "name": "it", + "value": "it", + "valueType": { + "$id": "1377", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Italian", + "decorators": [] + }, + { + "$id": "1378", + "kind": "enumvalue", + "name": "ja", + "value": "ja", + "valueType": { + "$id": "1379", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Japanese", + "decorators": [] + }, + { + "$id": "1380", + "kind": "enumvalue", + "name": "kk", + "value": "kk", + "valueType": { + "$id": "1381", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Kazakh", + "decorators": [] + }, + { + "$id": "1382", + "kind": "enumvalue", + "name": "ko", + "value": "ko", + "valueType": { + "$id": "1383", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Korean", + "decorators": [] + }, + { + "$id": "1384", + "kind": "enumvalue", + "name": "lt", + "value": "lt", + "valueType": { + "$id": "1385", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Lithuanian", + "decorators": [] + }, + { + "$id": "1386", + "kind": "enumvalue", + "name": "lv", + "value": "lv", + "valueType": { + "$id": "1387", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Latvian", + "decorators": [] + }, + { + "$id": "1388", + "kind": "enumvalue", + "name": "mk", + "value": "mk", + "valueType": { + "$id": "1389", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Macedonian", + "decorators": [] + }, + { + "$id": "1390", + "kind": "enumvalue", + "name": "ms", + "value": "ms", + "valueType": { + "$id": "1391", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Malay Malaysia", + "decorators": [] + }, + { + "$id": "1392", + "kind": "enumvalue", + "name": "nb", + "value": "nb", + "valueType": { + "$id": "1393", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Norwegian (Bokmal)", + "decorators": [] + }, + { + "$id": "1394", + "kind": "enumvalue", + "name": "nl", + "value": "nl", + "valueType": { + "$id": "1395", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Dutch", + "decorators": [] + }, + { + "$id": "1396", + "kind": "enumvalue", + "name": "pl", + "value": "pl", + "valueType": { + "$id": "1397", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Polish", + "decorators": [] + }, + { + "$id": "1398", + "kind": "enumvalue", + "name": "prs", + "value": "prs", + "valueType": { + "$id": "1399", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Dari", + "decorators": [] + }, + { + "$id": "1400", + "kind": "enumvalue", + "name": "pt-BR", + "value": "pt-BR", + "valueType": { + "$id": "1401", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Portuguese-Brazil", + "decorators": [] + }, + { + "$id": "1402", + "kind": "enumvalue", + "name": "pt", + "value": "pt", + "valueType": { + "$id": "1403", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Portuguese-Portugal", + "decorators": [] + }, + { + "$id": "1404", + "kind": "enumvalue", + "name": "pt-PT", + "value": "pt-PT", + "valueType": { + "$id": "1405", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Portuguese-Portugal", + "decorators": [] + }, + { + "$id": "1406", + "kind": "enumvalue", + "name": "ro", + "value": "ro", + "valueType": { + "$id": "1407", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Romanian", + "decorators": [] + }, + { + "$id": "1408", + "kind": "enumvalue", + "name": "ru", + "value": "ru", + "valueType": { + "$id": "1409", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Russian", + "decorators": [] + }, + { + "$id": "1410", + "kind": "enumvalue", + "name": "sk", + "value": "sk", + "valueType": { + "$id": "1411", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Slovak", + "decorators": [] + }, + { + "$id": "1412", + "kind": "enumvalue", + "name": "sl", + "value": "sl", + "valueType": { + "$id": "1413", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Slovenian", + "decorators": [] + }, + { + "$id": "1414", + "kind": "enumvalue", + "name": "sr-Cyrl", + "value": "sr-Cyrl", + "valueType": { + "$id": "1415", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Serbian - Cyrillic RS", + "decorators": [] + }, + { + "$id": "1416", + "kind": "enumvalue", + "name": "sr-Latn", + "value": "sr-Latn", + "valueType": { + "$id": "1417", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Serbian - Latin RS", + "decorators": [] + }, + { + "$id": "1418", + "kind": "enumvalue", + "name": "sv", + "value": "sv", + "valueType": { + "$id": "1419", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Swedish", + "decorators": [] + }, + { + "$id": "1420", + "kind": "enumvalue", + "name": "th", + "value": "th", + "valueType": { + "$id": "1421", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Thai", + "decorators": [] + }, + { + "$id": "1422", + "kind": "enumvalue", + "name": "tr", + "value": "tr", + "valueType": { + "$id": "1423", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Turkish", + "decorators": [] + }, + { + "$id": "1424", + "kind": "enumvalue", + "name": "uk", + "value": "uk", + "valueType": { + "$id": "1425", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Ukrainian", + "decorators": [] + }, + { + "$id": "1426", + "kind": "enumvalue", + "name": "vi", + "value": "vi", + "valueType": { + "$id": "1427", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Vietnamese", + "decorators": [] + }, + { + "$id": "1428", + "kind": "enumvalue", + "name": "zh", + "value": "zh", + "valueType": { + "$id": "1429", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Chinese Simplified", + "decorators": [] + }, + { + "$id": "1430", + "kind": "enumvalue", + "name": "zh-Hans", + "value": "zh-Hans", + "valueType": { + "$id": "1431", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Chinese Simplified", + "decorators": [] + }, + { + "$id": "1432", + "kind": "enumvalue", + "name": "zh-Hant", + "value": "zh-Hant", + "valueType": { + "$id": "1433", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1328" + }, + "doc": "Chinese Traditional", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The language codes supported for input by ImageAnalysisSkill.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1434", + "kind": "enum", + "name": "VisualFeature", + "crossLanguageDefinitionId": "Search.VisualFeature", + "valueType": { + "$id": "1435", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1436", + "kind": "enumvalue", + "name": "Adult", + "value": "adult", + "valueType": { + "$id": "1437", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1434" + }, + "doc": "Visual features recognized as adult persons.", + "decorators": [] + }, + { + "$id": "1438", + "kind": "enumvalue", + "name": "Brands", + "value": "brands", + "valueType": { + "$id": "1439", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1434" + }, + "doc": "Visual features recognized as commercial brands.", + "decorators": [] + }, + { + "$id": "1440", + "kind": "enumvalue", + "name": "Categories", + "value": "categories", + "valueType": { + "$id": "1441", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1434" + }, + "doc": "Categories.", + "decorators": [] + }, + { + "$id": "1442", + "kind": "enumvalue", + "name": "Description", + "value": "description", + "valueType": { + "$id": "1443", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1434" + }, + "doc": "Description.", + "decorators": [] + }, + { + "$id": "1444", + "kind": "enumvalue", + "name": "Faces", + "value": "faces", + "valueType": { + "$id": "1445", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1434" + }, + "doc": "Visual features recognized as people faces.", + "decorators": [] + }, + { + "$id": "1446", + "kind": "enumvalue", + "name": "Objects", + "value": "objects", + "valueType": { + "$id": "1447", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1434" + }, + "doc": "Visual features recognized as objects.", + "decorators": [] + }, + { + "$id": "1448", + "kind": "enumvalue", + "name": "Tags", + "value": "tags", + "valueType": { + "$id": "1449", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1434" + }, + "doc": "Tags.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The strings indicating what visual feature types to return.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1450", + "kind": "enum", + "name": "ImageDetail", + "crossLanguageDefinitionId": "Search.ImageDetail", + "valueType": { + "$id": "1451", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1452", + "kind": "enumvalue", + "name": "Celebrities", + "value": "celebrities", + "valueType": { + "$id": "1453", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1450" + }, + "doc": "Details recognized as celebrities.", + "decorators": [] + }, + { + "$id": "1454", + "kind": "enumvalue", + "name": "Landmarks", + "value": "landmarks", + "valueType": { + "$id": "1455", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1450" + }, + "doc": "Details recognized as landmarks.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "A string indicating which domain-specific details to return.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1456", + "kind": "enum", + "name": "EntityCategory", + "crossLanguageDefinitionId": "Search.EntityCategory", + "valueType": { + "$id": "1457", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1458", + "kind": "enumvalue", + "name": "Location", + "value": "location", + "valueType": { + "$id": "1459", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1456" + }, + "doc": "Entities describing a physical location.", + "decorators": [] + }, + { + "$id": "1460", + "kind": "enumvalue", + "name": "Organization", + "value": "organization", + "valueType": { + "$id": "1461", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1456" + }, + "doc": "Entities describing an organization.", + "decorators": [] + }, + { + "$id": "1462", + "kind": "enumvalue", + "name": "Person", + "value": "person", + "valueType": { + "$id": "1463", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1456" + }, + "doc": "Entities describing a person.", + "decorators": [] + }, + { + "$id": "1464", + "kind": "enumvalue", + "name": "Quantity", + "value": "quantity", + "valueType": { + "$id": "1465", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1456" + }, + "doc": "Entities describing a quantity.", + "decorators": [] + }, + { + "$id": "1466", + "kind": "enumvalue", + "name": "Datetime", + "value": "datetime", + "valueType": { + "$id": "1467", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1456" + }, + "doc": "Entities describing a date and time.", + "decorators": [] + }, + { + "$id": "1468", + "kind": "enumvalue", + "name": "Url", + "value": "url", + "valueType": { + "$id": "1469", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1456" + }, + "doc": "Entities describing a URL.", + "decorators": [] + }, + { + "$id": "1470", + "kind": "enumvalue", + "name": "Email", + "value": "email", + "valueType": { + "$id": "1471", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1456" + }, + "doc": "Entities describing an email address.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "A string indicating what entity categories to return.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1472", + "kind": "enum", + "name": "EntityRecognitionSkillLanguage", + "crossLanguageDefinitionId": "Search.EntityRecognitionSkillLanguage", + "valueType": { + "$id": "1473", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1474", + "kind": "enumvalue", + "name": "ar", + "value": "ar", + "valueType": { + "$id": "1475", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Arabic", + "decorators": [] + }, + { + "$id": "1476", + "kind": "enumvalue", + "name": "cs", + "value": "cs", + "valueType": { + "$id": "1477", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Czech", + "decorators": [] + }, + { + "$id": "1478", + "kind": "enumvalue", + "name": "zh-Hans", + "value": "zh-Hans", + "valueType": { + "$id": "1479", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Chinese-Simplified", + "decorators": [] + }, + { + "$id": "1480", + "kind": "enumvalue", + "name": "zh-Hant", + "value": "zh-Hant", + "valueType": { + "$id": "1481", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Chinese-Traditional", + "decorators": [] + }, + { + "$id": "1482", + "kind": "enumvalue", + "name": "da", + "value": "da", + "valueType": { + "$id": "1483", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Danish", + "decorators": [] + }, + { + "$id": "1484", + "kind": "enumvalue", + "name": "nl", + "value": "nl", + "valueType": { + "$id": "1485", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Dutch", + "decorators": [] + }, + { + "$id": "1486", + "kind": "enumvalue", + "name": "en", + "value": "en", + "valueType": { + "$id": "1487", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "English", + "decorators": [] + }, + { + "$id": "1488", + "kind": "enumvalue", + "name": "fi", + "value": "fi", + "valueType": { + "$id": "1489", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Finnish", + "decorators": [] + }, + { + "$id": "1490", + "kind": "enumvalue", + "name": "fr", + "value": "fr", + "valueType": { + "$id": "1491", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "French", + "decorators": [] + }, + { + "$id": "1492", + "kind": "enumvalue", + "name": "de", + "value": "de", + "valueType": { + "$id": "1493", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "German", + "decorators": [] + }, + { + "$id": "1494", + "kind": "enumvalue", + "name": "el", + "value": "el", + "valueType": { + "$id": "1495", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Greek", + "decorators": [] + }, + { + "$id": "1496", + "kind": "enumvalue", + "name": "hu", + "value": "hu", + "valueType": { + "$id": "1497", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Hungarian", + "decorators": [] + }, + { + "$id": "1498", + "kind": "enumvalue", + "name": "it", + "value": "it", + "valueType": { + "$id": "1499", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Italian", + "decorators": [] + }, + { + "$id": "1500", + "kind": "enumvalue", + "name": "ja", + "value": "ja", + "valueType": { + "$id": "1501", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Japanese", + "decorators": [] + }, + { + "$id": "1502", + "kind": "enumvalue", + "name": "ko", + "value": "ko", + "valueType": { + "$id": "1503", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Korean", + "decorators": [] + }, + { + "$id": "1504", + "kind": "enumvalue", + "name": "no", + "value": "no", + "valueType": { + "$id": "1505", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Norwegian (Bokmaal)", + "decorators": [] + }, + { + "$id": "1506", + "kind": "enumvalue", + "name": "pl", + "value": "pl", + "valueType": { + "$id": "1507", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Polish", + "decorators": [] + }, + { + "$id": "1508", + "kind": "enumvalue", + "name": "pt-PT", + "value": "pt-PT", + "valueType": { + "$id": "1509", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Portuguese (Portugal)", + "decorators": [] + }, + { + "$id": "1510", + "kind": "enumvalue", + "name": "pt-BR", + "value": "pt-BR", + "valueType": { + "$id": "1511", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Portuguese (Brazil)", + "decorators": [] + }, + { + "$id": "1512", + "kind": "enumvalue", + "name": "ru", + "value": "ru", + "valueType": { + "$id": "1513", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Russian", + "decorators": [] + }, + { + "$id": "1514", + "kind": "enumvalue", + "name": "es", + "value": "es", + "valueType": { + "$id": "1515", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Spanish", + "decorators": [] + }, + { + "$id": "1516", + "kind": "enumvalue", + "name": "sv", + "value": "sv", + "valueType": { + "$id": "1517", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Swedish", + "decorators": [] + }, + { + "$id": "1518", + "kind": "enumvalue", + "name": "tr", + "value": "tr", + "valueType": { + "$id": "1519", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1472" + }, + "doc": "Turkish", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Deprecated. The language codes supported for input text by\nEntityRecognitionSkill.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1520", + "kind": "enum", + "name": "SentimentSkillLanguage", + "crossLanguageDefinitionId": "Search.SentimentSkillLanguage", + "valueType": { + "$id": "1521", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1522", + "kind": "enumvalue", + "name": "da", + "value": "da", + "valueType": { + "$id": "1523", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1520" + }, + "doc": "Danish", + "decorators": [] + }, + { + "$id": "1524", + "kind": "enumvalue", + "name": "nl", + "value": "nl", + "valueType": { + "$id": "1525", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1520" + }, + "doc": "Dutch", + "decorators": [] + }, + { + "$id": "1526", + "kind": "enumvalue", + "name": "en", + "value": "en", + "valueType": { + "$id": "1527", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1520" + }, + "doc": "English", + "decorators": [] + }, + { + "$id": "1528", + "kind": "enumvalue", + "name": "fi", + "value": "fi", + "valueType": { + "$id": "1529", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1520" + }, + "doc": "Finnish", + "decorators": [] + }, + { + "$id": "1530", + "kind": "enumvalue", + "name": "fr", + "value": "fr", + "valueType": { + "$id": "1531", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1520" + }, + "doc": "French", + "decorators": [] + }, + { + "$id": "1532", + "kind": "enumvalue", + "name": "de", + "value": "de", + "valueType": { + "$id": "1533", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1520" + }, + "doc": "German", + "decorators": [] + }, + { + "$id": "1534", + "kind": "enumvalue", + "name": "el", + "value": "el", + "valueType": { + "$id": "1535", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1520" + }, + "doc": "Greek", + "decorators": [] + }, + { + "$id": "1536", + "kind": "enumvalue", + "name": "it", + "value": "it", + "valueType": { + "$id": "1537", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1520" + }, + "doc": "Italian", + "decorators": [] + }, + { + "$id": "1538", + "kind": "enumvalue", + "name": "no", + "value": "no", + "valueType": { + "$id": "1539", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1520" + }, + "doc": "Norwegian (Bokmaal)", + "decorators": [] + }, + { + "$id": "1540", + "kind": "enumvalue", + "name": "pl", + "value": "pl", + "valueType": { + "$id": "1541", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1520" + }, + "doc": "Polish", + "decorators": [] + }, + { + "$id": "1542", + "kind": "enumvalue", + "name": "pt-PT", + "value": "pt-PT", + "valueType": { + "$id": "1543", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1520" + }, + "doc": "Portuguese (Portugal)", + "decorators": [] + }, + { + "$id": "1544", + "kind": "enumvalue", + "name": "ru", + "value": "ru", + "valueType": { + "$id": "1545", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1520" + }, + "doc": "Russian", + "decorators": [] + }, + { + "$id": "1546", + "kind": "enumvalue", + "name": "es", + "value": "es", + "valueType": { + "$id": "1547", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1520" + }, + "doc": "Spanish", + "decorators": [] + }, + { + "$id": "1548", + "kind": "enumvalue", + "name": "sv", + "value": "sv", + "valueType": { + "$id": "1549", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1520" + }, + "doc": "Swedish", + "decorators": [] + }, + { + "$id": "1550", + "kind": "enumvalue", + "name": "tr", + "value": "tr", + "valueType": { + "$id": "1551", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1520" + }, + "doc": "Turkish", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Deprecated. The language codes supported for input text by SentimentSkill.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1552", + "kind": "enum", + "name": "PIIDetectionSkillMaskingMode", + "crossLanguageDefinitionId": "Search.PIIDetectionSkillMaskingMode", + "valueType": { + "$id": "1553", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1554", + "kind": "enumvalue", + "name": "None", + "value": "none", + "valueType": { + "$id": "1555", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1552" + }, + "doc": "No masking occurs and the maskedText output will not be returned.", + "decorators": [] + }, + { + "$id": "1556", + "kind": "enumvalue", + "name": "Replace", + "value": "replace", + "valueType": { + "$id": "1557", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1552" + }, + "doc": "Replaces the detected entities with the character given in the maskingCharacter\nparameter. The character will be repeated to the length of the detected entity\nso that the offsets will correctly correspond to both the input text as well as\nthe output maskedText.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "A string indicating what maskingMode to use to mask the personal information\ndetected in the input text.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1558", + "kind": "enum", + "name": "SplitSkillLanguage", + "crossLanguageDefinitionId": "Search.SplitSkillLanguage", + "valueType": { + "$id": "1559", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1560", + "kind": "enumvalue", + "name": "am", + "value": "am", + "valueType": { + "$id": "1561", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Amharic", + "decorators": [] + }, + { + "$id": "1562", + "kind": "enumvalue", + "name": "bs", + "value": "bs", + "valueType": { + "$id": "1563", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Bosnian", + "decorators": [] + }, + { + "$id": "1564", + "kind": "enumvalue", + "name": "cs", + "value": "cs", + "valueType": { + "$id": "1565", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Czech", + "decorators": [] + }, + { + "$id": "1566", + "kind": "enumvalue", + "name": "da", + "value": "da", + "valueType": { + "$id": "1567", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Danish", + "decorators": [] + }, + { + "$id": "1568", + "kind": "enumvalue", + "name": "de", + "value": "de", + "valueType": { + "$id": "1569", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "German", + "decorators": [] + }, + { + "$id": "1570", + "kind": "enumvalue", + "name": "en", + "value": "en", + "valueType": { + "$id": "1571", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "English", + "decorators": [] + }, + { + "$id": "1572", + "kind": "enumvalue", + "name": "es", + "value": "es", + "valueType": { + "$id": "1573", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Spanish", + "decorators": [] + }, + { + "$id": "1574", + "kind": "enumvalue", + "name": "et", + "value": "et", + "valueType": { + "$id": "1575", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Estonian", + "decorators": [] + }, + { + "$id": "1576", + "kind": "enumvalue", + "name": "fi", + "value": "fi", + "valueType": { + "$id": "1577", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Finnish", + "decorators": [] + }, + { + "$id": "1578", + "kind": "enumvalue", + "name": "fr", + "value": "fr", + "valueType": { + "$id": "1579", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "French", + "decorators": [] + }, + { + "$id": "1580", + "kind": "enumvalue", + "name": "he", + "value": "he", + "valueType": { + "$id": "1581", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Hebrew", + "decorators": [] + }, + { + "$id": "1582", + "kind": "enumvalue", + "name": "hi", + "value": "hi", + "valueType": { + "$id": "1583", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Hindi", + "decorators": [] + }, + { + "$id": "1584", + "kind": "enumvalue", + "name": "hr", + "value": "hr", + "valueType": { + "$id": "1585", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Croatian", + "decorators": [] + }, + { + "$id": "1586", + "kind": "enumvalue", + "name": "hu", + "value": "hu", + "valueType": { + "$id": "1587", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Hungarian", + "decorators": [] + }, + { + "$id": "1588", + "kind": "enumvalue", + "name": "id", + "value": "id", + "valueType": { + "$id": "1589", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Indonesian", + "decorators": [] + }, + { + "$id": "1590", + "kind": "enumvalue", + "name": "is", + "value": "is", + "valueType": { + "$id": "1591", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Icelandic", + "decorators": [] + }, + { + "$id": "1592", + "kind": "enumvalue", + "name": "it", + "value": "it", + "valueType": { + "$id": "1593", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Italian", + "decorators": [] + }, + { + "$id": "1594", + "kind": "enumvalue", + "name": "ja", + "value": "ja", + "valueType": { + "$id": "1595", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Japanese", + "decorators": [] + }, + { + "$id": "1596", + "kind": "enumvalue", + "name": "ko", + "value": "ko", + "valueType": { + "$id": "1597", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Korean", + "decorators": [] + }, + { + "$id": "1598", + "kind": "enumvalue", + "name": "lv", + "value": "lv", + "valueType": { + "$id": "1599", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Latvian", + "decorators": [] + }, + { + "$id": "1600", + "kind": "enumvalue", + "name": "nb", + "value": "nb", + "valueType": { + "$id": "1601", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Norwegian", + "decorators": [] + }, + { + "$id": "1602", + "kind": "enumvalue", + "name": "nl", + "value": "nl", + "valueType": { + "$id": "1603", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Dutch", + "decorators": [] + }, + { + "$id": "1604", + "kind": "enumvalue", + "name": "pl", + "value": "pl", + "valueType": { + "$id": "1605", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Polish", + "decorators": [] + }, + { + "$id": "1606", + "kind": "enumvalue", + "name": "pt", + "value": "pt", + "valueType": { + "$id": "1607", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Portuguese (Portugal)", + "decorators": [] + }, + { + "$id": "1608", + "kind": "enumvalue", + "name": "pt-br", + "value": "pt-br", + "valueType": { + "$id": "1609", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Portuguese (Brazil)", + "decorators": [] + }, + { + "$id": "1610", + "kind": "enumvalue", + "name": "ru", + "value": "ru", + "valueType": { + "$id": "1611", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Russian", + "decorators": [] + }, + { + "$id": "1612", + "kind": "enumvalue", + "name": "sk", + "value": "sk", + "valueType": { + "$id": "1613", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Slovak", + "decorators": [] + }, + { + "$id": "1614", + "kind": "enumvalue", + "name": "sl", + "value": "sl", + "valueType": { + "$id": "1615", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Slovenian", + "decorators": [] + }, + { + "$id": "1616", + "kind": "enumvalue", + "name": "sr", + "value": "sr", + "valueType": { + "$id": "1617", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Serbian", + "decorators": [] + }, + { + "$id": "1618", + "kind": "enumvalue", + "name": "sv", + "value": "sv", + "valueType": { + "$id": "1619", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Swedish", + "decorators": [] + }, + { + "$id": "1620", + "kind": "enumvalue", + "name": "tr", + "value": "tr", + "valueType": { + "$id": "1621", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Turkish", + "decorators": [] + }, + { + "$id": "1622", + "kind": "enumvalue", + "name": "ur", + "value": "ur", + "valueType": { + "$id": "1623", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Urdu", + "decorators": [] + }, + { + "$id": "1624", + "kind": "enumvalue", + "name": "zh", + "value": "zh", + "valueType": { + "$id": "1625", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1558" + }, + "doc": "Chinese (Simplified)", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The language codes supported for input text by SplitSkill.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1626", + "kind": "enum", + "name": "TextSplitMode", + "crossLanguageDefinitionId": "Search.TextSplitMode", + "valueType": { + "$id": "1627", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1628", + "kind": "enumvalue", + "name": "Pages", + "value": "pages", + "valueType": { + "$id": "1629", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1626" + }, + "doc": "Split the text into individual pages.", + "decorators": [] + }, + { + "$id": "1630", + "kind": "enumvalue", + "name": "Sentences", + "value": "sentences", + "valueType": { + "$id": "1631", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1626" + }, + "doc": "Split the text into individual sentences.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "A value indicating which split mode to perform.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1632", + "kind": "enum", + "name": "CustomEntityLookupSkillLanguage", + "crossLanguageDefinitionId": "Search.CustomEntityLookupSkillLanguage", + "valueType": { + "$id": "1633", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1634", + "kind": "enumvalue", + "name": "da", + "value": "da", + "valueType": { + "$id": "1635", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1632" + }, + "doc": "Danish", + "decorators": [] + }, + { + "$id": "1636", + "kind": "enumvalue", + "name": "de", + "value": "de", + "valueType": { + "$id": "1637", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1632" + }, + "doc": "German", + "decorators": [] + }, + { + "$id": "1638", + "kind": "enumvalue", + "name": "en", + "value": "en", + "valueType": { + "$id": "1639", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1632" + }, + "doc": "English", + "decorators": [] + }, + { + "$id": "1640", + "kind": "enumvalue", + "name": "es", + "value": "es", + "valueType": { + "$id": "1641", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1632" + }, + "doc": "Spanish", + "decorators": [] + }, + { + "$id": "1642", + "kind": "enumvalue", + "name": "fi", + "value": "fi", + "valueType": { + "$id": "1643", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1632" + }, + "doc": "Finnish", + "decorators": [] + }, + { + "$id": "1644", + "kind": "enumvalue", + "name": "fr", + "value": "fr", + "valueType": { + "$id": "1645", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1632" + }, + "doc": "French", + "decorators": [] + }, + { + "$id": "1646", + "kind": "enumvalue", + "name": "it", + "value": "it", + "valueType": { + "$id": "1647", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1632" + }, + "doc": "Italian", + "decorators": [] + }, + { + "$id": "1648", + "kind": "enumvalue", + "name": "ko", + "value": "ko", + "valueType": { + "$id": "1649", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1632" + }, + "doc": "Korean", + "decorators": [] + }, + { + "$id": "1650", + "kind": "enumvalue", + "name": "pt", + "value": "pt", + "valueType": { + "$id": "1651", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1632" + }, + "doc": "Portuguese", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The language codes supported for input text by CustomEntityLookupSkill.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1652", + "kind": "enum", + "name": "TextTranslationSkillLanguage", + "crossLanguageDefinitionId": "Search.TextTranslationSkillLanguage", + "valueType": { + "$id": "1653", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1654", + "kind": "enumvalue", + "name": "af", + "value": "af", + "valueType": { + "$id": "1655", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Afrikaans", + "decorators": [] + }, + { + "$id": "1656", + "kind": "enumvalue", + "name": "ar", + "value": "ar", + "valueType": { + "$id": "1657", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Arabic", + "decorators": [] + }, + { + "$id": "1658", + "kind": "enumvalue", + "name": "bn", + "value": "bn", + "valueType": { + "$id": "1659", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Bangla", + "decorators": [] + }, + { + "$id": "1660", + "kind": "enumvalue", + "name": "bs", + "value": "bs", + "valueType": { + "$id": "1661", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Bosnian (Latin)", + "decorators": [] + }, + { + "$id": "1662", + "kind": "enumvalue", + "name": "bg", + "value": "bg", + "valueType": { + "$id": "1663", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Bulgarian", + "decorators": [] + }, + { + "$id": "1664", + "kind": "enumvalue", + "name": "yue", + "value": "yue", + "valueType": { + "$id": "1665", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Cantonese (Traditional)", + "decorators": [] + }, + { + "$id": "1666", + "kind": "enumvalue", + "name": "ca", + "value": "ca", + "valueType": { + "$id": "1667", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Catalan", + "decorators": [] + }, + { + "$id": "1668", + "kind": "enumvalue", + "name": "zh-Hans", + "value": "zh-Hans", + "valueType": { + "$id": "1669", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Chinese Simplified", + "decorators": [] + }, + { + "$id": "1670", + "kind": "enumvalue", + "name": "zh-Hant", + "value": "zh-Hant", + "valueType": { + "$id": "1671", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Chinese Traditional", + "decorators": [] + }, + { + "$id": "1672", + "kind": "enumvalue", + "name": "hr", + "value": "hr", + "valueType": { + "$id": "1673", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Croatian", + "decorators": [] + }, + { + "$id": "1674", + "kind": "enumvalue", + "name": "cs", + "value": "cs", + "valueType": { + "$id": "1675", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Czech", + "decorators": [] + }, + { + "$id": "1676", + "kind": "enumvalue", + "name": "da", + "value": "da", + "valueType": { + "$id": "1677", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Danish", + "decorators": [] + }, + { + "$id": "1678", + "kind": "enumvalue", + "name": "nl", + "value": "nl", + "valueType": { + "$id": "1679", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Dutch", + "decorators": [] + }, + { + "$id": "1680", + "kind": "enumvalue", + "name": "en", + "value": "en", + "valueType": { + "$id": "1681", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "English", + "decorators": [] + }, + { + "$id": "1682", + "kind": "enumvalue", + "name": "et", + "value": "et", + "valueType": { + "$id": "1683", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Estonian", + "decorators": [] + }, + { + "$id": "1684", + "kind": "enumvalue", + "name": "fj", + "value": "fj", + "valueType": { + "$id": "1685", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Fijian", + "decorators": [] + }, + { + "$id": "1686", + "kind": "enumvalue", + "name": "fil", + "value": "fil", + "valueType": { + "$id": "1687", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Filipino", + "decorators": [] + }, + { + "$id": "1688", + "kind": "enumvalue", + "name": "fi", + "value": "fi", + "valueType": { + "$id": "1689", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Finnish", + "decorators": [] + }, + { + "$id": "1690", + "kind": "enumvalue", + "name": "fr", + "value": "fr", + "valueType": { + "$id": "1691", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "French", + "decorators": [] + }, + { + "$id": "1692", + "kind": "enumvalue", + "name": "de", + "value": "de", + "valueType": { + "$id": "1693", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "German", + "decorators": [] + }, + { + "$id": "1694", + "kind": "enumvalue", + "name": "el", + "value": "el", + "valueType": { + "$id": "1695", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Greek", + "decorators": [] + }, + { + "$id": "1696", + "kind": "enumvalue", + "name": "ht", + "value": "ht", + "valueType": { + "$id": "1697", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Haitian Creole", + "decorators": [] + }, + { + "$id": "1698", + "kind": "enumvalue", + "name": "he", + "value": "he", + "valueType": { + "$id": "1699", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Hebrew", + "decorators": [] + }, + { + "$id": "1700", + "kind": "enumvalue", + "name": "hi", + "value": "hi", + "valueType": { + "$id": "1701", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Hindi", + "decorators": [] + }, + { + "$id": "1702", + "kind": "enumvalue", + "name": "mww", + "value": "mww", + "valueType": { + "$id": "1703", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Hmong Daw", + "decorators": [] + }, + { + "$id": "1704", + "kind": "enumvalue", + "name": "hu", + "value": "hu", + "valueType": { + "$id": "1705", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Hungarian", + "decorators": [] + }, + { + "$id": "1706", + "kind": "enumvalue", + "name": "is", + "value": "is", + "valueType": { + "$id": "1707", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Icelandic", + "decorators": [] + }, + { + "$id": "1708", + "kind": "enumvalue", + "name": "id", + "value": "id", + "valueType": { + "$id": "1709", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Indonesian", + "decorators": [] + }, + { + "$id": "1710", + "kind": "enumvalue", + "name": "it", + "value": "it", + "valueType": { + "$id": "1711", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Italian", + "decorators": [] + }, + { + "$id": "1712", + "kind": "enumvalue", + "name": "ja", + "value": "ja", + "valueType": { + "$id": "1713", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Japanese", + "decorators": [] + }, + { + "$id": "1714", + "kind": "enumvalue", + "name": "sw", + "value": "sw", + "valueType": { + "$id": "1715", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Kiswahili", + "decorators": [] + }, + { + "$id": "1716", + "kind": "enumvalue", + "name": "tlh", + "value": "tlh", + "valueType": { + "$id": "1717", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Klingon", + "decorators": [] + }, + { + "$id": "1718", + "kind": "enumvalue", + "name": "tlh-Latn", + "value": "tlh-Latn", + "valueType": { + "$id": "1719", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Klingon (Latin script)", + "decorators": [] + }, + { + "$id": "1720", + "kind": "enumvalue", + "name": "tlh-Piqd", + "value": "tlh-Piqd", + "valueType": { + "$id": "1721", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Klingon (Klingon script)", + "decorators": [] + }, + { + "$id": "1722", + "kind": "enumvalue", + "name": "ko", + "value": "ko", + "valueType": { + "$id": "1723", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Korean", + "decorators": [] + }, + { + "$id": "1724", + "kind": "enumvalue", + "name": "lv", + "value": "lv", + "valueType": { + "$id": "1725", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Latvian", + "decorators": [] + }, + { + "$id": "1726", + "kind": "enumvalue", + "name": "lt", + "value": "lt", + "valueType": { + "$id": "1727", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Lithuanian", + "decorators": [] + }, + { + "$id": "1728", + "kind": "enumvalue", + "name": "mg", + "value": "mg", + "valueType": { + "$id": "1729", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Malagasy", + "decorators": [] + }, + { + "$id": "1730", + "kind": "enumvalue", + "name": "ms", + "value": "ms", + "valueType": { + "$id": "1731", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Malay", + "decorators": [] + }, + { + "$id": "1732", + "kind": "enumvalue", + "name": "mt", + "value": "mt", + "valueType": { + "$id": "1733", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Maltese", + "decorators": [] + }, + { + "$id": "1734", + "kind": "enumvalue", + "name": "nb", + "value": "nb", + "valueType": { + "$id": "1735", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Norwegian", + "decorators": [] + }, + { + "$id": "1736", + "kind": "enumvalue", + "name": "fa", + "value": "fa", + "valueType": { + "$id": "1737", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Persian", + "decorators": [] + }, + { + "$id": "1738", + "kind": "enumvalue", + "name": "pl", + "value": "pl", + "valueType": { + "$id": "1739", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Polish", + "decorators": [] + }, + { + "$id": "1740", + "kind": "enumvalue", + "name": "pt", + "value": "pt", + "valueType": { + "$id": "1741", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Portuguese", + "decorators": [] + }, + { + "$id": "1742", + "kind": "enumvalue", + "name": "pt-br", + "value": "pt-br", + "valueType": { + "$id": "1743", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Portuguese (Brazil)", + "decorators": [] + }, + { + "$id": "1744", + "kind": "enumvalue", + "name": "pt-PT", + "value": "pt-PT", + "valueType": { + "$id": "1745", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Portuguese (Portugal)", + "decorators": [] + }, + { + "$id": "1746", + "kind": "enumvalue", + "name": "otq", + "value": "otq", + "valueType": { + "$id": "1747", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Queretaro Otomi", + "decorators": [] + }, + { + "$id": "1748", + "kind": "enumvalue", + "name": "ro", + "value": "ro", + "valueType": { + "$id": "1749", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Romanian", + "decorators": [] + }, + { + "$id": "1750", + "kind": "enumvalue", + "name": "ru", + "value": "ru", + "valueType": { + "$id": "1751", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Russian", + "decorators": [] + }, + { + "$id": "1752", + "kind": "enumvalue", + "name": "sm", + "value": "sm", + "valueType": { + "$id": "1753", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Samoan", + "decorators": [] + }, + { + "$id": "1754", + "kind": "enumvalue", + "name": "sr-Cyrl", + "value": "sr-Cyrl", + "valueType": { + "$id": "1755", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Serbian (Cyrillic)", + "decorators": [] + }, + { + "$id": "1756", + "kind": "enumvalue", + "name": "sr-Latn", + "value": "sr-Latn", + "valueType": { + "$id": "1757", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Serbian (Latin)", + "decorators": [] + }, + { + "$id": "1758", + "kind": "enumvalue", + "name": "sk", + "value": "sk", + "valueType": { + "$id": "1759", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Slovak", + "decorators": [] + }, + { + "$id": "1760", + "kind": "enumvalue", + "name": "sl", + "value": "sl", + "valueType": { + "$id": "1761", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Slovenian", + "decorators": [] + }, + { + "$id": "1762", + "kind": "enumvalue", + "name": "es", + "value": "es", + "valueType": { + "$id": "1763", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Spanish", + "decorators": [] + }, + { + "$id": "1764", + "kind": "enumvalue", + "name": "sv", + "value": "sv", + "valueType": { + "$id": "1765", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Swedish", + "decorators": [] + }, + { + "$id": "1766", + "kind": "enumvalue", + "name": "ty", + "value": "ty", + "valueType": { + "$id": "1767", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Tahitian", + "decorators": [] + }, + { + "$id": "1768", + "kind": "enumvalue", + "name": "ta", + "value": "ta", + "valueType": { + "$id": "1769", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Tamil", + "decorators": [] + }, + { + "$id": "1770", + "kind": "enumvalue", + "name": "te", + "value": "te", + "valueType": { + "$id": "1771", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Telugu", + "decorators": [] + }, + { + "$id": "1772", + "kind": "enumvalue", + "name": "th", + "value": "th", + "valueType": { + "$id": "1773", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Thai", + "decorators": [] + }, + { + "$id": "1774", + "kind": "enumvalue", + "name": "to", + "value": "to", + "valueType": { + "$id": "1775", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Tongan", + "decorators": [] + }, + { + "$id": "1776", + "kind": "enumvalue", + "name": "tr", + "value": "tr", + "valueType": { + "$id": "1777", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Turkish", + "decorators": [] + }, + { + "$id": "1778", + "kind": "enumvalue", + "name": "uk", + "value": "uk", + "valueType": { + "$id": "1779", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Ukrainian", + "decorators": [] + }, + { + "$id": "1780", + "kind": "enumvalue", + "name": "ur", + "value": "ur", + "valueType": { + "$id": "1781", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Urdu", + "decorators": [] + }, + { + "$id": "1782", + "kind": "enumvalue", + "name": "vi", + "value": "vi", + "valueType": { + "$id": "1783", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Vietnamese", + "decorators": [] + }, + { + "$id": "1784", + "kind": "enumvalue", + "name": "cy", + "value": "cy", + "valueType": { + "$id": "1785", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Welsh", + "decorators": [] + }, + { + "$id": "1786", + "kind": "enumvalue", + "name": "yua", + "value": "yua", + "valueType": { + "$id": "1787", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Yucatec Maya", + "decorators": [] + }, + { + "$id": "1788", + "kind": "enumvalue", + "name": "ga", + "value": "ga", + "valueType": { + "$id": "1789", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Irish", + "decorators": [] + }, + { + "$id": "1790", + "kind": "enumvalue", + "name": "kn", + "value": "kn", + "valueType": { + "$id": "1791", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Kannada", + "decorators": [] + }, + { + "$id": "1792", + "kind": "enumvalue", + "name": "mi", + "value": "mi", + "valueType": { + "$id": "1793", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Maori", + "decorators": [] + }, + { + "$id": "1794", + "kind": "enumvalue", + "name": "ml", + "value": "ml", + "valueType": { + "$id": "1795", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Malayalam", + "decorators": [] + }, + { + "$id": "1796", + "kind": "enumvalue", + "name": "pa", + "value": "pa", + "valueType": { + "$id": "1797", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1652" + }, + "doc": "Punjabi", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The language codes supported for input text by TextTranslationSkill.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1798", + "kind": "enum", + "name": "IndexProjectionMode", + "crossLanguageDefinitionId": "Search.IndexProjectionMode", + "valueType": { + "$id": "1799", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1800", + "kind": "enumvalue", + "name": "SkipIndexingParentDocuments", + "value": "skipIndexingParentDocuments", + "valueType": { + "$id": "1801", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1798" + }, + "doc": "The source document will be skipped from writing into the indexer's target\nindex.", + "decorators": [] + }, + { + "$id": "1802", + "kind": "enumvalue", + "name": "IncludeIndexingParentDocuments", + "value": "includeIndexingParentDocuments", + "valueType": { + "$id": "1803", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1798" + }, + "doc": "The source document will be written into the indexer's target index. This is\nthe default pattern.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Defines behavior of the index projections in relation to the rest of the\nindexer.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1804", + "kind": "enum", + "name": "BlobIndexerParsingMode", + "crossLanguageDefinitionId": "Search.BlobIndexerParsingMode", + "valueType": { + "$id": "1805", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1806", + "kind": "enumvalue", + "name": "Default", + "value": "default", + "valueType": { + "$id": "1807", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1804" + }, + "doc": "Set to default for normal file processing.", + "decorators": [] + }, + { + "$id": "1808", + "kind": "enumvalue", + "name": "Text", + "value": "text", + "valueType": { + "$id": "1809", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1804" + }, + "doc": "Set to text to improve indexing performance on plain text files in blob storage.", + "decorators": [] + }, + { + "$id": "1810", + "kind": "enumvalue", + "name": "DelimitedText", + "value": "delimitedText", + "valueType": { + "$id": "1811", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1804" + }, + "doc": "Set to delimitedText when blobs are plain CSV files.", + "decorators": [] + }, + { + "$id": "1812", + "kind": "enumvalue", + "name": "Json", + "value": "json", + "valueType": { + "$id": "1813", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1804" + }, + "doc": "Set to json to extract structured content from JSON files.", + "decorators": [] + }, + { + "$id": "1814", + "kind": "enumvalue", + "name": "JsonArray", + "value": "jsonArray", + "valueType": { + "$id": "1815", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1804" + }, + "doc": "Set to jsonArray to extract individual elements of a JSON array as separate\ndocuments.", + "decorators": [] + }, + { + "$id": "1816", + "kind": "enumvalue", + "name": "JsonLines", + "value": "jsonLines", + "valueType": { + "$id": "1817", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1804" + }, + "doc": "Set to jsonLines to extract individual JSON entities, separated by a new line,\nas separate documents.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Represents the parsing mode for indexing from an Azure blob data source.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1818", + "kind": "enum", + "name": "BlobIndexerDataToExtract", + "crossLanguageDefinitionId": "Search.BlobIndexerDataToExtract", + "valueType": { + "$id": "1819", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1820", + "kind": "enumvalue", + "name": "StorageMetadata", + "value": "storageMetadata", + "valueType": { + "$id": "1821", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1818" + }, + "doc": "Indexes just the standard blob properties and user-specified metadata.", + "decorators": [] + }, + { + "$id": "1822", + "kind": "enumvalue", + "name": "AllMetadata", + "value": "allMetadata", + "valueType": { + "$id": "1823", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1818" + }, + "doc": "Extracts metadata provided by the Azure blob storage subsystem and the\ncontent-type specific metadata (for example, metadata unique to just .png files\nare indexed).", + "decorators": [] + }, + { + "$id": "1824", + "kind": "enumvalue", + "name": "ContentAndMetadata", + "value": "contentAndMetadata", + "valueType": { + "$id": "1825", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1818" + }, + "doc": "Extracts all metadata and textual content from each blob.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Specifies the data to extract from Azure blob storage and tells the indexer\nwhich data to extract from image content when \"imageAction\" is set to a value\nother than \"none\". This applies to embedded image content in a .PDF or other\napplication, or image files such as .jpg and .png, in Azure blobs.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1826", + "kind": "enum", + "name": "BlobIndexerImageAction", + "crossLanguageDefinitionId": "Search.BlobIndexerImageAction", + "valueType": { + "$id": "1827", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1828", + "kind": "enumvalue", + "name": "None", + "value": "none", + "valueType": { + "$id": "1829", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1826" + }, + "doc": "Ignores embedded images or image files in the data set. This is the default.", + "decorators": [] + }, + { + "$id": "1830", + "kind": "enumvalue", + "name": "GenerateNormalizedImages", + "value": "generateNormalizedImages", + "valueType": { + "$id": "1831", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1826" + }, + "doc": "Extracts text from images (for example, the word \"STOP\" from a traffic stop\nsign), and embeds it into the content field. This action requires that\n\"dataToExtract\" is set to \"contentAndMetadata\". A normalized image refers to\nadditional processing resulting in uniform image output, sized and rotated to\npromote consistent rendering when you include images in visual search results.\nThis information is generated for each image when you use this option.", + "decorators": [] + }, + { + "$id": "1832", + "kind": "enumvalue", + "name": "GenerateNormalizedImagePerPage", + "value": "generateNormalizedImagePerPage", + "valueType": { + "$id": "1833", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1826" + }, + "doc": "Extracts text from images (for example, the word \"STOP\" from a traffic stop\nsign), and embeds it into the content field, but treats PDF files differently\nin that each page will be rendered as an image and normalized accordingly,\ninstead of extracting embedded images. Non-PDF file types will be treated the\nsame as if \"generateNormalizedImages\" was set.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Determines how to process embedded images and image files in Azure blob\nstorage. Setting the \"imageAction\" configuration to any value other than\n\"none\" requires that a skillset also be attached to that indexer.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1834", + "kind": "enum", + "name": "BlobIndexerPDFTextRotationAlgorithm", + "crossLanguageDefinitionId": "Search.BlobIndexerPDFTextRotationAlgorithm", + "valueType": { + "$id": "1835", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1836", + "kind": "enumvalue", + "name": "None", + "value": "none", + "valueType": { + "$id": "1837", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1834" + }, + "doc": "Leverages normal text extraction. This is the default.", + "decorators": [] + }, + { + "$id": "1838", + "kind": "enumvalue", + "name": "DetectAngles", + "value": "detectAngles", + "valueType": { + "$id": "1839", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1834" + }, + "doc": "May produce better and more readable text extraction from PDF files that have\nrotated text within them. Note that there may be a small performance speed\nimpact when this parameter is used. This parameter only applies to PDF files,\nand only to PDFs with embedded text. If the rotated text appears within an\nembedded image in the PDF, this parameter does not apply.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Determines algorithm for text extraction from PDF files in Azure blob storage.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1840", + "kind": "enum", + "name": "IndexerExecutionEnvironment", + "crossLanguageDefinitionId": "Search.IndexerExecutionEnvironment", + "valueType": { + "$id": "1841", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1842", + "kind": "enumvalue", + "name": "standard", + "value": "standard", + "valueType": { + "$id": "1843", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1840" + }, + "doc": "Indicates that the search service can determine where the indexer should\nexecute. This is the default environment when nothing is specified and is the\nrecommended value.", + "decorators": [] + }, + { + "$id": "1844", + "kind": "enumvalue", + "name": "private", + "value": "private", + "valueType": { + "$id": "1845", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1840" + }, + "doc": "Indicates that the indexer should run with the environment provisioned\nspecifically for the search service. This should only be specified as the\nexecution environment if the indexer needs to access resources securely over\nshared private link resources.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Specifies the environment in which the indexer should execute.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1846", + "kind": "enum", + "name": "IndexerStatus", + "crossLanguageDefinitionId": "Search.IndexerStatus", + "valueType": { + "$id": "1847", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1848", + "kind": "enumvalue", + "name": "Unknown", + "value": "unknown", + "valueType": { + "$id": "1849", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1846" + }, + "doc": "Indicates that the indexer is in an unknown state.", + "decorators": [] + }, + { + "$id": "1850", + "kind": "enumvalue", + "name": "Error", + "value": "error", + "valueType": { + "$id": "1851", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1846" + }, + "doc": "Indicates that the indexer experienced an error that cannot be corrected\nwithout human intervention.", + "decorators": [] + }, + { + "$id": "1852", + "kind": "enumvalue", + "name": "Running", + "value": "running", + "valueType": { + "$id": "1853", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1846" + }, + "doc": "Indicates that the indexer is running normally.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Represents the overall indexer status.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "1854", + "kind": "enum", + "name": "IndexerExecutionStatus", + "crossLanguageDefinitionId": "Search.IndexerExecutionStatus", + "valueType": { + "$id": "1855", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1856", + "kind": "enumvalue", + "name": "TransientFailure", + "value": "transientFailure", + "valueType": { + "$id": "1857", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1854" + }, + "doc": "An indexer invocation has failed, but the failure may be transient. Indexer\ninvocations will continue per schedule.", + "decorators": [] + }, + { + "$id": "1858", + "kind": "enumvalue", + "name": "Success", + "value": "success", + "valueType": { + "$id": "1859", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1854" + }, + "doc": "Indexer execution completed successfully.", + "decorators": [] + }, + { + "$id": "1860", + "kind": "enumvalue", + "name": "InProgress", + "value": "inProgress", + "valueType": { + "$id": "1861", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1854" + }, + "doc": "Indexer execution is in progress.", + "decorators": [] + }, + { + "$id": "1862", + "kind": "enumvalue", + "name": "Reset", + "value": "reset", + "valueType": { + "$id": "1863", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1854" + }, + "doc": "Indexer has been reset.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Represents the status of an individual indexer execution.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "1864", + "kind": "enum", + "name": "SearchIndexerDataSourceType", + "crossLanguageDefinitionId": "Search.SearchIndexerDataSourceType", + "valueType": { + "$id": "1865", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1866", + "kind": "enumvalue", + "name": "AzureSql", + "value": "azuresql", + "valueType": { + "$id": "1867", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1864" + }, + "doc": "Indicates an Azure SQL datasource.", + "decorators": [] + }, + { + "$id": "1868", + "kind": "enumvalue", + "name": "CosmosDb", + "value": "cosmosdb", + "valueType": { + "$id": "1869", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1864" + }, + "doc": "Indicates a CosmosDB datasource.", + "decorators": [] + }, + { + "$id": "1870", + "kind": "enumvalue", + "name": "AzureBlob", + "value": "azureblob", + "valueType": { + "$id": "1871", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1864" + }, + "doc": "Indicates an Azure Blob datasource.", + "decorators": [] + }, + { + "$id": "1872", + "kind": "enumvalue", + "name": "AzureTable", + "value": "azuretable", + "valueType": { + "$id": "1873", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1864" + }, + "doc": "Indicates an Azure Table datasource.", + "decorators": [] + }, + { + "$id": "1874", + "kind": "enumvalue", + "name": "MySql", + "value": "mysql", + "valueType": { + "$id": "1875", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1864" + }, + "doc": "Indicates a MySql datasource.", + "decorators": [] + }, + { + "$id": "1876", + "kind": "enumvalue", + "name": "AdlsGen2", + "value": "adlsgen2", + "valueType": { + "$id": "1877", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1864" + }, + "doc": "Indicates an ADLS Gen2 datasource.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "Defines the type of a datasource.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "1878", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Search.Versions", + "valueType": { + "$id": "1879", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1880", + "kind": "enumvalue", + "name": "v2024_07_01", + "value": "2024-07-01", + "valueType": { + "$id": "1881", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "1878" + }, + "doc": "The 2024-07-01 API version.", + "decorators": [] + } + ], + "namespace": "Azure.Search.Documents", + "doc": "The available API versions.", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + } + ], + "models": [ + { + "$id": "1882", + "kind": "model", + "name": "SearchServiceStatistics", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchServiceStatistics", + "usage": "Output,Json", + "doc": "Response from a get service statistics request. If successful, it includes\nservice level counters and limits.", + "decorators": [], + "properties": [ + { + "$id": "1883", + "kind": "property", + "name": "counters", + "serializedName": "counters", + "doc": "Service level resource counters.", + "type": { + "$id": "1884", + "kind": "model", + "name": "SearchServiceCounters", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchServiceCounters", + "usage": "Output,Json", + "doc": "Represents service-level resource counters and quotas.", + "decorators": [], + "properties": [ + { + "$id": "1885", + "kind": "property", + "name": "documentCounter", + "serializedName": "documentCount", + "doc": "Total number of documents across all indexes in the service.", + "type": { + "$id": "1886", + "kind": "model", + "name": "ResourceCounter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ResourceCounter", + "usage": "Output,Json", + "doc": "Represents a resource's usage and quota.", + "decorators": [], + "properties": [ + { + "$id": "1887", + "kind": "property", + "name": "usage", + "serializedName": "usage", + "doc": "The resource usage amount.", + "type": { + "$id": "1888", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ResourceCounter.usage", + "serializationOptions": { + "$id": "1889", + "json": { + "$id": "1890", + "name": "usage" + } + } + }, + { + "$id": "1891", + "kind": "property", + "name": "quota", + "serializedName": "quota", + "doc": "The resource amount quota.", + "type": { + "$id": "1892", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ResourceCounter.quota", + "serializationOptions": { + "$id": "1893", + "json": { + "$id": "1894", + "name": "quota" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchServiceCounters.documentCount", + "serializationOptions": { + "$id": "1895", + "json": { + "$id": "1896", + "name": "documentCount" + } + } + }, + { + "$id": "1897", + "kind": "property", + "name": "indexCounter", + "serializedName": "indexesCount", + "doc": "Total number of indexes.", + "type": { + "$ref": "1886" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchServiceCounters.indexesCount", + "serializationOptions": { + "$id": "1898", + "json": { + "$id": "1899", + "name": "indexesCount" + } + } + }, + { + "$id": "1900", + "kind": "property", + "name": "indexerCounter", + "serializedName": "indexersCount", + "doc": "Total number of indexers.", + "type": { + "$ref": "1886" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchServiceCounters.indexersCount", + "serializationOptions": { + "$id": "1901", + "json": { + "$id": "1902", + "name": "indexersCount" + } + } + }, + { + "$id": "1903", + "kind": "property", + "name": "dataSourceCounter", + "serializedName": "dataSourcesCount", + "doc": "Total number of data sources.", + "type": { + "$ref": "1886" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchServiceCounters.dataSourcesCount", + "serializationOptions": { + "$id": "1904", + "json": { + "$id": "1905", + "name": "dataSourcesCount" + } + } + }, + { + "$id": "1906", + "kind": "property", + "name": "storageSizeCounter", + "serializedName": "storageSize", + "doc": "Total size of used storage in bytes.", + "type": { + "$ref": "1886" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchServiceCounters.storageSize", + "serializationOptions": { + "$id": "1907", + "json": { + "$id": "1908", + "name": "storageSize" + } + } + }, + { + "$id": "1909", + "kind": "property", + "name": "synonymMapCounter", + "serializedName": "synonymMaps", + "doc": "Total number of synonym maps.", + "type": { + "$ref": "1886" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchServiceCounters.synonymMaps", + "serializationOptions": { + "$id": "1910", + "json": { + "$id": "1911", + "name": "synonymMaps" + } + } + }, + { + "$id": "1912", + "kind": "property", + "name": "skillsetCounter", + "serializedName": "skillsetCount", + "doc": "Total number of skillsets.", + "type": { + "$ref": "1886" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchServiceCounters.skillsetCount", + "serializationOptions": { + "$id": "1913", + "json": { + "$id": "1914", + "name": "skillsetCount" + } + } + }, + { + "$id": "1915", + "kind": "property", + "name": "vectorIndexSizeCounter", + "serializedName": "vectorIndexSize", + "doc": "Total memory consumption of all vector indexes within the service, in bytes.", + "type": { + "$ref": "1886" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchServiceCounters.vectorIndexSize", + "serializationOptions": { + "$id": "1916", + "json": { + "$id": "1917", + "name": "vectorIndexSize" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchServiceStatistics.counters", + "serializationOptions": { + "$id": "1918", + "json": { + "$id": "1919", + "name": "counters" + } + } + }, + { + "$id": "1920", + "kind": "property", + "name": "limits", + "serializedName": "limits", + "doc": "Service level general limits.", + "type": { + "$id": "1921", + "kind": "model", + "name": "SearchServiceLimits", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchServiceLimits", + "usage": "Output,Json", + "doc": "Represents various service level limits.", + "decorators": [], + "properties": [ + { + "$id": "1922", + "kind": "property", + "name": "maxFieldsPerIndex", + "serializedName": "maxFieldsPerIndex", + "doc": "The maximum allowed fields per index.", + "type": { + "$id": "1923", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchServiceLimits.maxFieldsPerIndex", + "serializationOptions": { + "$id": "1924", + "json": { + "$id": "1925", + "name": "maxFieldsPerIndex" + } + } + }, + { + "$id": "1926", + "kind": "property", + "name": "maxFieldNestingDepthPerIndex", + "serializedName": "maxFieldNestingDepthPerIndex", + "doc": "The maximum depth which you can nest sub-fields in an index, including the\ntop-level complex field. For example, a/b/c has a nesting depth of 3.", + "type": { + "$id": "1927", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchServiceLimits.maxFieldNestingDepthPerIndex", + "serializationOptions": { + "$id": "1928", + "json": { + "$id": "1929", + "name": "maxFieldNestingDepthPerIndex" + } + } + }, + { + "$id": "1930", + "kind": "property", + "name": "maxComplexCollectionFieldsPerIndex", + "serializedName": "maxComplexCollectionFieldsPerIndex", + "doc": "The maximum number of fields of type Collection(Edm.ComplexType) allowed in an\nindex.", + "type": { + "$id": "1931", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchServiceLimits.maxComplexCollectionFieldsPerIndex", + "serializationOptions": { + "$id": "1932", + "json": { + "$id": "1933", + "name": "maxComplexCollectionFieldsPerIndex" + } + } + }, + { + "$id": "1934", + "kind": "property", + "name": "maxComplexObjectsInCollectionsPerDocument", + "serializedName": "maxComplexObjectsInCollectionsPerDocument", + "doc": "The maximum number of objects in complex collections allowed per document.", + "type": { + "$id": "1935", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchServiceLimits.maxComplexObjectsInCollectionsPerDocument", + "serializationOptions": { + "$id": "1936", + "json": { + "$id": "1937", + "name": "maxComplexObjectsInCollectionsPerDocument" + } + } + }, + { + "$id": "1938", + "kind": "property", + "name": "maxStoragePerIndexInBytes", + "serializedName": "maxStoragePerIndex", + "doc": "The maximum amount of storage in bytes allowed per index.", + "type": { + "$id": "1939", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchServiceLimits.maxStoragePerIndex", + "serializationOptions": { + "$id": "1940", + "json": { + "$id": "1941", + "name": "maxStoragePerIndex" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchServiceStatistics.limits", + "serializationOptions": { + "$id": "1942", + "json": { + "$id": "1943", + "name": "limits" + } + } + } + ] + }, + { + "$ref": "1884" + }, + { + "$ref": "1886" + }, + { + "$ref": "1921" + }, + { + "$id": "1944", + "kind": "model", + "name": "ErrorResponse", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ErrorResponse", + "usage": "Error,Json,Exception", + "doc": "Common error response for all Azure Resource Manager APIs to return error\ndetails for failed operations. (This also follows the OData error response\nformat.).", + "decorators": [], + "properties": [ + { + "$id": "1945", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error object.", + "type": { + "$id": "1946", + "kind": "model", + "name": "ErrorDetail", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ErrorDetail", + "usage": "Json,Exception", + "doc": "The error detail.", + "decorators": [], + "properties": [ + { + "$id": "1947", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "1948", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ErrorDetail.code", + "serializationOptions": { + "$id": "1949", + "json": { + "$id": "1950", + "name": "code" + } + } + }, + { + "$id": "1951", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "1952", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ErrorDetail.message", + "serializationOptions": { + "$id": "1953", + "json": { + "$id": "1954", + "name": "message" + } + } + }, + { + "$id": "1955", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The error target.", + "type": { + "$id": "1956", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ErrorDetail.target", + "serializationOptions": { + "$id": "1957", + "json": { + "$id": "1958", + "name": "target" + } + } + }, + { + "$id": "1959", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "The error details.", + "type": { + "$id": "1960", + "kind": "array", + "name": "ArrayErrorDetail", + "valueType": { + "$ref": "1946" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ErrorDetail.details", + "serializationOptions": { + "$id": "1961", + "json": { + "$id": "1962", + "name": "details" + } + } + }, + { + "$id": "1963", + "kind": "property", + "name": "additionalInfo", + "serializedName": "additionalInfo", + "doc": "The error additional info.", + "type": { + "$id": "1964", + "kind": "array", + "name": "ArrayErrorAdditionalInfo", + "valueType": { + "$id": "1965", + "kind": "model", + "name": "ErrorAdditionalInfo", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ErrorAdditionalInfo", + "usage": "Json,Exception", + "doc": "The resource management error additional info.", + "decorators": [], + "properties": [ + { + "$id": "1966", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The additional info type.", + "type": { + "$id": "1967", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ErrorAdditionalInfo.type", + "serializationOptions": { + "$id": "1968", + "json": { + "$id": "1969", + "name": "type" + } + } + }, + { + "$id": "1970", + "kind": "property", + "name": "info", + "serializedName": "info", + "doc": "The additional info.", + "type": { + "$id": "1971", + "kind": "dict", + "keyType": { + "$id": "1972", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1973", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ErrorAdditionalInfo.info", + "serializationOptions": { + "$id": "1974", + "json": { + "$id": "1975", + "name": "info" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ErrorDetail.additionalInfo", + "serializationOptions": { + "$id": "1976", + "json": { + "$id": "1977", + "name": "additionalInfo" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ErrorResponse.error", + "serializationOptions": { + "$id": "1978", + "json": { + "$id": "1979", + "name": "error" + } + } + } + ] + }, + { + "$ref": "1946" + }, + { + "$ref": "1965" + }, + { + "$id": "1980", + "kind": "model", + "name": "SearchDocumentsResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchDocumentsResult", + "usage": "Output,Json", + "doc": "Response containing search results from an index.", + "decorators": [], + "properties": [ + { + "$id": "1981", + "kind": "property", + "name": "count", + "serializedName": "@odata.count", + "doc": "The total count of results found by the search operation, or null if the count\nwas not requested. If present, the count may be greater than the number of\nresults in this response. This can happen if you use the $top or $skip\nparameters, or if the query can't return all the requested documents in a\nsingle response.", + "type": { + "$id": "1982", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchDocumentsResult.count", + "serializationOptions": { + "$id": "1983", + "json": { + "$id": "1984", + "name": "@odata.count" + } + } + }, + { + "$id": "1985", + "kind": "property", + "name": "coverage", + "serializedName": "@search.coverage", + "doc": "A value indicating the percentage of the index that was included in the query,\nor null if minimumCoverage was not specified in the request.", + "type": { + "$id": "1986", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchDocumentsResult.coverage", + "serializationOptions": { + "$id": "1987", + "json": { + "$id": "1988", + "name": "@search.coverage" + } + } + }, + { + "$id": "1989", + "kind": "property", + "name": "facets", + "serializedName": "@search.facets", + "doc": "The facet query results for the search operation, organized as a collection of\nbuckets for each faceted field; null if the query did not include any facet\nexpressions.", + "type": { + "$id": "1990", + "kind": "dict", + "keyType": { + "$id": "1991", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1992", + "kind": "array", + "name": "ArrayFacetResult", + "valueType": { + "$id": "1993", + "kind": "model", + "name": "FacetResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.FacetResult", + "usage": "Output,Json", + "doc": "A single bucket of a facet query result. Reports the number of documents with a\nfield value falling within a particular range or having a particular value or\ninterval.", + "decorators": [], + "additionalProperties": { + "$id": "1994", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "properties": [ + { + "$id": "1995", + "kind": "property", + "name": "count", + "serializedName": "count", + "doc": "The approximate count of documents falling within the bucket described by this\nfacet.", + "type": { + "$id": "1996", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.FacetResult.count", + "serializationOptions": { + "$id": "1997", + "json": { + "$id": "1998", + "name": "count" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchDocumentsResult.facets", + "serializationOptions": { + "$id": "1999", + "json": { + "$id": "2000", + "name": "@search.facets" + } + } + }, + { + "$id": "2001", + "kind": "property", + "name": "answers", + "serializedName": "@search.answers", + "doc": "The answers query results for the search operation; null if the answers query\nparameter was not specified or set to 'none'.", + "type": { + "$id": "2002", + "kind": "array", + "name": "ArrayQueryAnswerResult", + "valueType": { + "$id": "2003", + "kind": "model", + "name": "QueryAnswerResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.QueryAnswerResult", + "usage": "Output,Json", + "doc": "An answer is a text passage extracted from the contents of the most relevant\ndocuments that matched the query. Answers are extracted from the top search\nresults. Answer candidates are scored and the top answers are selected.", + "decorators": [], + "additionalProperties": { + "$id": "2004", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "properties": [ + { + "$id": "2005", + "kind": "property", + "name": "score", + "serializedName": "score", + "doc": "The score value represents how relevant the answer is to the query relative to\nother answers returned for the query.", + "type": { + "$id": "2006", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.QueryAnswerResult.score", + "serializationOptions": { + "$id": "2007", + "json": { + "$id": "2008", + "name": "score" + } + } + }, + { + "$id": "2009", + "kind": "property", + "name": "key", + "serializedName": "key", + "doc": "The key of the document the answer was extracted from.", + "type": { + "$id": "2010", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.QueryAnswerResult.key", + "serializationOptions": { + "$id": "2011", + "json": { + "$id": "2012", + "name": "key" + } + } + }, + { + "$id": "2013", + "kind": "property", + "name": "text", + "serializedName": "text", + "doc": "The text passage extracted from the document contents as the answer.", + "type": { + "$id": "2014", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.QueryAnswerResult.text", + "serializationOptions": { + "$id": "2015", + "json": { + "$id": "2016", + "name": "text" + } + } + }, + { + "$id": "2017", + "kind": "property", + "name": "highlights", + "serializedName": "highlights", + "doc": "Same text passage as in the Text property with highlighted text phrases most\nrelevant to the query.", + "type": { + "$id": "2018", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.QueryAnswerResult.highlights", + "serializationOptions": { + "$id": "2019", + "json": { + "$id": "2020", + "name": "highlights" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchDocumentsResult.answers", + "serializationOptions": { + "$id": "2021", + "json": { + "$id": "2022", + "name": "@search.answers" + } + } + }, + { + "$id": "2023", + "kind": "property", + "name": "nextPageParameters", + "serializedName": "@search.nextPageParameters", + "doc": "Continuation JSON payload returned when the query can't return all the\nrequested results in a single response. You can use this JSON along with", + "type": { + "$id": "2024", + "kind": "model", + "name": "SearchRequest", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchRequest", + "usage": "Input,Output,Json", + "doc": "Parameters for filtering, sorting, faceting, paging, and other search query\nbehaviors.", + "decorators": [], + "properties": [ + { + "$id": "2025", + "kind": "property", + "name": "includeTotalResultCount", + "serializedName": "count", + "doc": "A value that specifies whether to fetch the total count of results. Default is\nfalse. Setting this value to true may have a performance impact. Note that the\ncount returned is an approximation.", + "type": { + "$id": "2026", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.count", + "serializationOptions": { + "$id": "2027", + "json": { + "$id": "2028", + "name": "count" + } + } + }, + { + "$id": "2029", + "kind": "property", + "name": "facets", + "serializedName": "facets", + "doc": "The list of facet expressions to apply to the search query. Each facet\nexpression contains a field name, optionally followed by a comma-separated list\nof name:value pairs.", + "type": { + "$id": "2030", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "2031", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.facets", + "serializationOptions": { + "$id": "2032", + "json": { + "$id": "2033", + "name": "facets" + } + } + }, + { + "$id": "2034", + "kind": "property", + "name": "filter", + "serializedName": "filter", + "doc": "The OData $filter expression to apply to the search query.", + "type": { + "$id": "2035", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.filter", + "serializationOptions": { + "$id": "2036", + "json": { + "$id": "2037", + "name": "filter" + } + } + }, + { + "$id": "2038", + "kind": "property", + "name": "highlightFields", + "serializedName": "highlight", + "doc": "The comma-separated list of field names to use for hit highlights. Only\nsearchable fields can be used for hit highlighting.", + "type": { + "$id": "2039", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.highlight", + "serializationOptions": { + "$id": "2040", + "json": { + "$id": "2041", + "name": "highlight" + } + } + }, + { + "$id": "2042", + "kind": "property", + "name": "highlightPostTag", + "serializedName": "highlightPostTag", + "doc": "A string tag that is appended to hit highlights. Must be set with\nhighlightPreTag. Default is </em>.", + "type": { + "$id": "2043", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.highlightPostTag", + "serializationOptions": { + "$id": "2044", + "json": { + "$id": "2045", + "name": "highlightPostTag" + } + } + }, + { + "$id": "2046", + "kind": "property", + "name": "highlightPreTag", + "serializedName": "highlightPreTag", + "doc": "A string tag that is prepended to hit highlights. Must be set with\nhighlightPostTag. Default is <em>.", + "type": { + "$id": "2047", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.highlightPreTag", + "serializationOptions": { + "$id": "2048", + "json": { + "$id": "2049", + "name": "highlightPreTag" + } + } + }, + { + "$id": "2050", + "kind": "property", + "name": "minimumCoverage", + "serializedName": "minimumCoverage", + "doc": "A number between 0 and 100 indicating the percentage of the index that must be\ncovered by a search query in order for the query to be reported as a success.\nThis parameter can be useful for ensuring search availability even for services\nwith only one replica. The default is 100.", + "type": { + "$id": "2051", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.minimumCoverage", + "serializationOptions": { + "$id": "2052", + "json": { + "$id": "2053", + "name": "minimumCoverage" + } + } + }, + { + "$id": "2054", + "kind": "property", + "name": "orderBy", + "serializedName": "orderby", + "doc": "The comma-separated list of OData $orderby expressions by which to sort the\nresults. Each expression can be either a field name or a call to either the\ngeo.distance() or the search.score() functions. Each expression can be followed\nby asc to indicate ascending, or desc to indicate descending. The default is\nascending order. Ties will be broken by the match scores of documents. If no\n$orderby is specified, the default sort order is descending by document match\nscore. There can be at most 32 $orderby clauses.", + "type": { + "$id": "2055", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.orderby", + "serializationOptions": { + "$id": "2056", + "json": { + "$id": "2057", + "name": "orderby" + } + } + }, + { + "$id": "2058", + "kind": "property", + "name": "queryType", + "serializedName": "queryType", + "doc": "A value that specifies the syntax of the search query. The default is 'simple'.\nUse 'full' if your query uses the Lucene query syntax.", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.queryType", + "serializationOptions": { + "$id": "2059", + "json": { + "$id": "2060", + "name": "queryType" + } + } + }, + { + "$id": "2061", + "kind": "property", + "name": "scoringStatistics", + "serializedName": "scoringStatistics", + "doc": "A value that specifies whether we want to calculate scoring statistics (such as\ndocument frequency) globally for more consistent scoring, or locally, for lower\nlatency. The default is 'local'. Use 'global' to aggregate scoring statistics\nglobally before scoring. Using global scoring statistics can increase latency\nof search queries.", + "type": { + "$ref": "16" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.scoringStatistics", + "serializationOptions": { + "$id": "2062", + "json": { + "$id": "2063", + "name": "scoringStatistics" + } + } + }, + { + "$id": "2064", + "kind": "property", + "name": "sessionId", + "serializedName": "sessionId", + "doc": "A value to be used to create a sticky session, which can help getting more\nconsistent results. As long as the same sessionId is used, a best-effort\nattempt will be made to target the same replica set. Be wary that reusing the\nsame sessionID values repeatedly can interfere with the load balancing of the\nrequests across replicas and adversely affect the performance of the search\nservice. The value used as sessionId cannot start with a '_' character.", + "type": { + "$id": "2065", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.sessionId", + "serializationOptions": { + "$id": "2066", + "json": { + "$id": "2067", + "name": "sessionId" + } + } + }, + { + "$id": "2068", + "kind": "property", + "name": "scoringParameters", + "serializedName": "scoringParameters", + "doc": "The list of parameter values to be used in scoring functions (for example,\nreferencePointParameter) using the format name-values. For example, if the\nscoring profile defines a function with a parameter called 'mylocation' the\nparameter string would be \"mylocation--122.2,44.8\" (without the quotes).", + "type": { + "$id": "2069", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "2070", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.scoringParameters", + "serializationOptions": { + "$id": "2071", + "json": { + "$id": "2072", + "name": "scoringParameters" + } + } + }, + { + "$id": "2073", + "kind": "property", + "name": "scoringProfile", + "serializedName": "scoringProfile", + "doc": "The name of a scoring profile to evaluate match scores for matching documents\nin order to sort the results.", + "type": { + "$id": "2074", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.scoringProfile", + "serializationOptions": { + "$id": "2075", + "json": { + "$id": "2076", + "name": "scoringProfile" + } + } + }, + { + "$id": "2077", + "kind": "property", + "name": "searchText", + "serializedName": "search", + "doc": "A full-text search query expression; Use \"*\" or omit this parameter to match\nall documents.", + "type": { + "$id": "2078", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.search", + "serializationOptions": { + "$id": "2079", + "json": { + "$id": "2080", + "name": "search" + } + } + }, + { + "$id": "2081", + "kind": "property", + "name": "searchFields", + "serializedName": "searchFields", + "doc": "The comma-separated list of field names to which to scope the full-text search.\nWhen using fielded search (fieldName:searchExpression) in a full Lucene query,\nthe field names of each fielded search expression take precedence over any\nfield names listed in this parameter.", + "type": { + "$id": "2082", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.searchFields", + "serializationOptions": { + "$id": "2083", + "json": { + "$id": "2084", + "name": "searchFields" + } + } + }, + { + "$id": "2085", + "kind": "property", + "name": "searchMode", + "serializedName": "searchMode", + "doc": "A value that specifies whether any or all of the search terms must be matched\nin order to count the document as a match.", + "type": { + "$ref": "10" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.searchMode", + "serializationOptions": { + "$id": "2086", + "json": { + "$id": "2087", + "name": "searchMode" + } + } + }, + { + "$id": "2088", + "kind": "property", + "name": "select", + "serializedName": "select", + "doc": "The comma-separated list of fields to retrieve. If unspecified, all fields\nmarked as retrievable in the schema are included.", + "type": { + "$id": "2089", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.select", + "serializationOptions": { + "$id": "2090", + "json": { + "$id": "2091", + "name": "select" + } + } + }, + { + "$id": "2092", + "kind": "property", + "name": "skip", + "serializedName": "skip", + "doc": "The number of search results to skip. This value cannot be greater than\n100,000. If you need to scan documents in sequence, but cannot use skip due to\nthis limitation, consider using orderby on a totally-ordered key and filter\nwith a range query instead.", + "type": { + "$id": "2093", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.skip", + "serializationOptions": { + "$id": "2094", + "json": { + "$id": "2095", + "name": "skip" + } + } + }, + { + "$id": "2096", + "kind": "property", + "name": "top", + "serializedName": "top", + "doc": "The number of search results to retrieve. This can be used in conjunction with\n$skip to implement client-side paging of search results. If results are\ntruncated due to server-side paging, the response will include a continuation\ntoken that can be used to issue another Search request for the next page of\nresults.", + "type": { + "$id": "2097", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.top", + "serializationOptions": { + "$id": "2098", + "json": { + "$id": "2099", + "name": "top" + } + } + }, + { + "$id": "2100", + "kind": "property", + "name": "semanticConfiguration", + "serializedName": "semanticConfiguration", + "doc": "The name of a semantic configuration that will be used when processing\ndocuments for queries of type semantic.", + "type": { + "$id": "2101", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.semanticConfiguration", + "serializationOptions": { + "$id": "2102", + "json": { + "$id": "2103", + "name": "semanticConfiguration" + } + } + }, + { + "$id": "2104", + "kind": "property", + "name": "semanticErrorHandling", + "serializedName": "semanticErrorHandling", + "doc": "Allows the user to choose whether a semantic call should fail completely\n(default / current behavior), or to return partial results.", + "type": { + "$ref": "22" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.semanticErrorHandling", + "serializationOptions": { + "$id": "2105", + "json": { + "$id": "2106", + "name": "semanticErrorHandling" + } + } + }, + { + "$id": "2107", + "kind": "property", + "name": "semanticMaxWaitInMilliseconds", + "serializedName": "semanticMaxWaitInMilliseconds", + "doc": "Allows the user to set an upper bound on the amount of time it takes for\nsemantic enrichment to finish processing before the request fails.", + "type": { + "$id": "2108", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.semanticMaxWaitInMilliseconds", + "serializationOptions": { + "$id": "2109", + "json": { + "$id": "2110", + "name": "semanticMaxWaitInMilliseconds" + } + } + }, + { + "$id": "2111", + "kind": "property", + "name": "semanticQuery", + "serializedName": "semanticQuery", + "doc": "Allows setting a separate search query that will be solely used for semantic\nreranking, semantic captions and semantic answers. Is useful for scenarios\nwhere there is a need to use different queries between the base retrieval and\nranking phase, and the L2 semantic phase.", + "type": { + "$id": "2112", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.semanticQuery", + "serializationOptions": { + "$id": "2113", + "json": { + "$id": "2114", + "name": "semanticQuery" + } + } + }, + { + "$id": "2115", + "kind": "property", + "name": "answers", + "serializedName": "answers", + "doc": "A value that specifies whether answers should be returned as part of the search\nresponse.", + "type": { + "$ref": "28" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.answers", + "serializationOptions": { + "$id": "2116", + "json": { + "$id": "2117", + "name": "answers" + } + } + }, + { + "$id": "2118", + "kind": "property", + "name": "captions", + "serializedName": "captions", + "doc": "A value that specifies whether captions should be returned as part of the\nsearch response.", + "type": { + "$ref": "34" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.captions", + "serializationOptions": { + "$id": "2119", + "json": { + "$id": "2120", + "name": "captions" + } + } + }, + { + "$id": "2121", + "kind": "property", + "name": "vectorQueries", + "serializedName": "vectorQueries", + "doc": "The query parameters for vector and hybrid search queries.", + "type": { + "$id": "2122", + "kind": "array", + "name": "ArrayVectorQuery", + "valueType": { + "$id": "2123", + "kind": "model", + "name": "VectorQuery", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.VectorQuery", + "usage": "Input,Output,Json", + "doc": "The query parameters for vector and hybrid search queries.", + "decorators": [], + "discriminatorProperty": { + "$id": "2124", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Type of query.", + "type": { + "$ref": "40" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorQuery.kind", + "serializationOptions": { + "$id": "2125", + "json": { + "$id": "2126", + "name": "kind" + } + } + }, + "properties": [ + { + "$id": "2127", + "kind": "property", + "name": "kNearestNeighbors", + "serializedName": "k", + "doc": "Number of nearest neighbors to return as top hits.", + "type": { + "$id": "2128", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorQuery.k", + "serializationOptions": { + "$id": "2129", + "json": { + "$id": "2130", + "name": "k" + } + } + }, + { + "$id": "2131", + "kind": "property", + "name": "fields", + "serializedName": "fields", + "doc": "Vector Fields of type Collection(Edm.Single) to be included in the vector\nsearched.", + "type": { + "$id": "2132", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorQuery.fields", + "serializationOptions": { + "$id": "2133", + "json": { + "$id": "2134", + "name": "fields" + } + } + }, + { + "$id": "2135", + "kind": "property", + "name": "exhaustive", + "serializedName": "exhaustive", + "doc": "When true, triggers an exhaustive k-nearest neighbor search across all vectors\nwithin the vector index. Useful for scenarios where exact matches are critical,\nsuch as determining ground truth values.", + "type": { + "$id": "2136", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorQuery.exhaustive", + "serializationOptions": { + "$id": "2137", + "json": { + "$id": "2138", + "name": "exhaustive" + } + } + }, + { + "$id": "2139", + "kind": "property", + "name": "oversampling", + "serializedName": "oversampling", + "doc": "Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling'\nparameter configured in the index definition. It can be set only when 'rerankWithOriginalVectors'\nis true. This parameter is only permitted when a\ncompression method is used on the underlying vector field.", + "type": { + "$id": "2140", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorQuery.oversampling", + "serializationOptions": { + "$id": "2141", + "json": { + "$id": "2142", + "name": "oversampling" + } + } + }, + { + "$id": "2143", + "kind": "property", + "name": "weight", + "serializedName": "weight", + "doc": "Relative weight of the vector query when compared to other vector query and/or\nthe text query within the same search request. This value is used when\ncombining the results of multiple ranking lists produced by the different\nvector queries and/or the results retrieved through the text query. The higher\nthe weight, the higher the documents that matched that query will be in the\nfinal ranking. Default is 1.0 and the value needs to be a positive number\nlarger than zero.", + "type": { + "$id": "2144", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorQuery.weight", + "serializationOptions": { + "$id": "2145", + "json": { + "$id": "2146", + "name": "weight" + } + } + }, + { + "$ref": "2124" + } + ], + "discriminatedSubtypes": { + "$id": "2147", + "vector": { + "$id": "2148", + "kind": "model", + "name": "VectorizedQuery", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.VectorizedQuery", + "usage": "Input,Output,Json", + "doc": "The query parameters to use for vector search when a raw vector value is\nprovided.", + "discriminatorValue": "vector", + "decorators": [], + "baseModel": { + "$ref": "2123" + }, + "properties": [ + { + "$id": "2149", + "kind": "property", + "name": "vector", + "serializedName": "vector", + "doc": "The vector representation of a search query.", + "type": { + "$id": "2150", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "2151", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorizedQuery.vector", + "serializationOptions": { + "$id": "2152", + "json": { + "$id": "2153", + "name": "vector" + } + } + }, + { + "$id": "2154", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "The kind of vector query being performed.", + "type": { + "$id": "2155", + "kind": "constant", + "valueType": { + "$id": "2156", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "vector", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorizedQuery.kind", + "serializationOptions": { + "$id": "2157", + "json": { + "$id": "2158", + "name": "kind" + } + } + } + ] + }, + "text": { + "$id": "2159", + "kind": "model", + "name": "VectorizableTextQuery", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.VectorizableTextQuery", + "usage": "Input,Output,Json", + "doc": "The query parameters to use for vector search when a text value that needs to\nbe vectorized is provided.", + "discriminatorValue": "text", + "decorators": [], + "baseModel": { + "$ref": "2123" + }, + "properties": [ + { + "$id": "2160", + "kind": "property", + "name": "text", + "serializedName": "text", + "doc": "The text to be vectorized to perform a vector search query.", + "type": { + "$id": "2161", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorizableTextQuery.text", + "serializationOptions": { + "$id": "2162", + "json": { + "$id": "2163", + "name": "text" + } + } + }, + { + "$id": "2164", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "The kind of vector query being performed.", + "type": { + "$id": "2165", + "kind": "constant", + "valueType": { + "$id": "2166", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "text", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorizableTextQuery.kind", + "serializationOptions": { + "$id": "2167", + "json": { + "$id": "2168", + "name": "kind" + } + } + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.vectorQueries", + "serializationOptions": { + "$id": "2169", + "json": { + "$id": "2170", + "name": "vectorQueries" + } + } + }, + { + "$id": "2171", + "kind": "property", + "name": "vectorFilterMode", + "serializedName": "vectorFilterMode", + "doc": "Determines whether or not filters are applied before or after the vector search\nis performed. Default is 'preFilter' for new indexes.", + "type": { + "$ref": "46" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchRequest.vectorFilterMode", + "serializationOptions": { + "$id": "2172", + "json": { + "$id": "2173", + "name": "vectorFilterMode" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchDocumentsResult.nextPageParameters", + "serializationOptions": { + "$id": "2174", + "json": { + "$id": "2175", + "name": "@search.nextPageParameters" + } + } + }, + { + "$id": "2176", + "kind": "property", + "name": "results", + "serializedName": "value", + "doc": "The sequence of results returned by the query.", + "type": { + "$id": "2177", + "kind": "array", + "name": "ArraySearchResult", + "valueType": { + "$id": "2178", + "kind": "model", + "name": "SearchResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchResult", + "usage": "Output,Json", + "doc": "Contains a document found by a search query, plus associated metadata.", + "decorators": [], + "additionalProperties": { + "$id": "2179", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "properties": [ + { + "$id": "2180", + "kind": "property", + "name": "score", + "serializedName": "@search.score", + "doc": "The relevance score of the document compared to other documents returned by the\nquery.", + "type": { + "$id": "2181", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchResult.score", + "serializationOptions": { + "$id": "2182", + "json": { + "$id": "2183", + "name": "@search.score" + } + } + }, + { + "$id": "2184", + "kind": "property", + "name": "rerankerScore", + "serializedName": "@search.rerankerScore", + "doc": "The relevance score computed by the semantic ranker for the top search results.\nSearch results are sorted by the RerankerScore first and then by the Score.\nRerankerScore is only returned for queries of type 'semantic'.", + "type": { + "$id": "2185", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchResult.rerankerScore", + "serializationOptions": { + "$id": "2186", + "json": { + "$id": "2187", + "name": "@search.rerankerScore" + } + } + }, + { + "$id": "2188", + "kind": "property", + "name": "highlights", + "serializedName": "@search.highlights", + "doc": "Text fragments from the document that indicate the matching search terms,\norganized by each applicable field; null if hit highlighting was not enabled\nfor the query.", + "type": { + "$id": "2189", + "kind": "dict", + "keyType": { + "$id": "2190", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "2191", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "2192", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchResult.highlights", + "serializationOptions": { + "$id": "2193", + "json": { + "$id": "2194", + "name": "@search.highlights" + } + } + }, + { + "$id": "2195", + "kind": "property", + "name": "captions", + "serializedName": "@search.captions", + "doc": "Captions are the most representative passages from the document relatively to\nthe search query. They are often used as document summary. Captions are only\nreturned for queries of type 'semantic'.", + "type": { + "$id": "2196", + "kind": "array", + "name": "ArrayQueryCaptionResult", + "valueType": { + "$id": "2197", + "kind": "model", + "name": "QueryCaptionResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.QueryCaptionResult", + "usage": "Output,Json", + "doc": "Captions are the most representative passages from the document relatively to\nthe search query. They are often used as document summary. Captions are only\nreturned for queries of type `semantic`.", + "decorators": [], + "additionalProperties": { + "$id": "2198", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "properties": [ + { + "$id": "2199", + "kind": "property", + "name": "text", + "serializedName": "text", + "doc": "A representative text passage extracted from the document most relevant to the\nsearch query.", + "type": { + "$id": "2200", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.QueryCaptionResult.text", + "serializationOptions": { + "$id": "2201", + "json": { + "$id": "2202", + "name": "text" + } + } + }, + { + "$id": "2203", + "kind": "property", + "name": "highlights", + "serializedName": "highlights", + "doc": "Same text passage as in the Text property with highlighted phrases most\nrelevant to the query.", + "type": { + "$id": "2204", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.QueryCaptionResult.highlights", + "serializationOptions": { + "$id": "2205", + "json": { + "$id": "2206", + "name": "highlights" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchResult.captions", + "serializationOptions": { + "$id": "2207", + "json": { + "$id": "2208", + "name": "@search.captions" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchDocumentsResult.value", + "serializationOptions": { + "$id": "2209", + "json": { + "$id": "2210", + "name": "value" + } + } + }, + { + "$id": "2211", + "kind": "property", + "name": "nextLink", + "serializedName": "@odata.nextLink", + "doc": "Continuation URL returned when the query can't return all the requested results\nin a single response. You can use this URL to formulate another GET or POST\nSearch request to get the next part of the search response. Make sure to use\nthe same verb (GET or POST) as the request that produced this response.", + "type": { + "$id": "2212", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchDocumentsResult.nextLink", + "serializationOptions": { + "$id": "2213", + "json": { + "$id": "2214", + "name": "@odata.nextLink" + } + } + }, + { + "$id": "2215", + "kind": "property", + "name": "semanticPartialResponseReason", + "serializedName": "@search.semanticPartialResponseReason", + "doc": "Reason that a partial response was returned for a semantic ranking request.", + "type": { + "$ref": "52" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchDocumentsResult.semanticPartialResponseReason", + "serializationOptions": { + "$id": "2216", + "json": { + "$id": "2217", + "name": "@search.semanticPartialResponseReason" + } + } + }, + { + "$id": "2218", + "kind": "property", + "name": "semanticPartialResponseType", + "serializedName": "@search.semanticPartialResponseType", + "doc": "Type of partial response that was returned for a semantic ranking request.", + "type": { + "$ref": "60" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchDocumentsResult.semanticPartialResponseType", + "serializationOptions": { + "$id": "2219", + "json": { + "$id": "2220", + "name": "@search.semanticPartialResponseType" + } + } + } + ] + }, + { + "$ref": "1993" + }, + { + "$ref": "2003" + }, + { + "$ref": "2024" + }, + { + "$ref": "2123" + }, + { + "$ref": "2148" + }, + { + "$ref": "2159" + }, + { + "$ref": "2178" + }, + { + "$ref": "2197" + }, + { + "$id": "2221", + "kind": "model", + "name": "LookupDocument", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.LookupDocument", + "usage": "Output,Json", + "doc": "A document retrieved via a document lookup operation.", + "decorators": [], + "additionalProperties": { + "$id": "2222", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "properties": [] + }, + { + "$id": "2223", + "kind": "model", + "name": "SuggestDocumentsResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SuggestDocumentsResult", + "usage": "Output,Json", + "doc": "Response containing suggestion query results from an index.", + "decorators": [], + "properties": [ + { + "$id": "2224", + "kind": "property", + "name": "results", + "serializedName": "value", + "doc": "The sequence of results returned by the query.", + "type": { + "$id": "2225", + "kind": "array", + "name": "ArraySuggestResult", + "valueType": { + "$id": "2226", + "kind": "model", + "name": "SuggestResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SuggestResult", + "usage": "Output,Json", + "doc": "A result containing a document found by a suggestion query, plus associated\nmetadata.", + "decorators": [], + "additionalProperties": { + "$id": "2227", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "properties": [ + { + "$id": "2228", + "kind": "property", + "name": "text", + "serializedName": "@search.text", + "doc": "The text of the suggestion result.", + "type": { + "$id": "2229", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SuggestResult.text", + "serializationOptions": { + "$id": "2230", + "json": { + "$id": "2231", + "name": "@search.text" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SuggestDocumentsResult.value", + "serializationOptions": { + "$id": "2232", + "json": { + "$id": "2233", + "name": "value" + } + } + }, + { + "$id": "2234", + "kind": "property", + "name": "coverage", + "serializedName": "@search.coverage", + "doc": "A value indicating the percentage of the index that was included in the query,\nor null if minimumCoverage was not set in the request.", + "type": { + "$id": "2235", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SuggestDocumentsResult.coverage", + "serializationOptions": { + "$id": "2236", + "json": { + "$id": "2237", + "name": "@search.coverage" + } + } + } + ] + }, + { + "$ref": "2226" + }, + { + "$id": "2238", + "kind": "model", + "name": "SuggestRequest", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SuggestRequest", + "usage": "Input,Json", + "doc": "Parameters for filtering, sorting, fuzzy matching, and other suggestions query\nbehaviors.", + "decorators": [], + "properties": [ + { + "$id": "2239", + "kind": "property", + "name": "filter", + "serializedName": "filter", + "doc": "An OData expression that filters the documents considered for suggestions.", + "type": { + "$id": "2240", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SuggestRequest.filter", + "serializationOptions": { + "$id": "2241", + "json": { + "$id": "2242", + "name": "filter" + } + } + }, + { + "$id": "2243", + "kind": "property", + "name": "useFuzzyMatching", + "serializedName": "fuzzy", + "doc": "A value indicating whether to use fuzzy matching for the suggestion query.\nDefault is false. When set to true, the query will find suggestions even if\nthere's a substituted or missing character in the search text. While this\nprovides a better experience in some scenarios, it comes at a performance cost\nas fuzzy suggestion searches are slower and consume more resources.", + "type": { + "$id": "2244", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SuggestRequest.fuzzy", + "serializationOptions": { + "$id": "2245", + "json": { + "$id": "2246", + "name": "fuzzy" + } + } + }, + { + "$id": "2247", + "kind": "property", + "name": "highlightPostTag", + "serializedName": "highlightPostTag", + "doc": "A string tag that is appended to hit highlights. Must be set with\nhighlightPreTag. If omitted, hit highlighting of suggestions is disabled.", + "type": { + "$id": "2248", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SuggestRequest.highlightPostTag", + "serializationOptions": { + "$id": "2249", + "json": { + "$id": "2250", + "name": "highlightPostTag" + } + } + }, + { + "$id": "2251", + "kind": "property", + "name": "highlightPreTag", + "serializedName": "highlightPreTag", + "doc": "A string tag that is prepended to hit highlights. Must be set with\nhighlightPostTag. If omitted, hit highlighting of suggestions is disabled.", + "type": { + "$id": "2252", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SuggestRequest.highlightPreTag", + "serializationOptions": { + "$id": "2253", + "json": { + "$id": "2254", + "name": "highlightPreTag" + } + } + }, + { + "$id": "2255", + "kind": "property", + "name": "minimumCoverage", + "serializedName": "minimumCoverage", + "doc": "A number between 0 and 100 indicating the percentage of the index that must be\ncovered by a suggestion query in order for the query to be reported as a\nsuccess. This parameter can be useful for ensuring search availability even for\nservices with only one replica. The default is 80.", + "type": { + "$id": "2256", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SuggestRequest.minimumCoverage", + "serializationOptions": { + "$id": "2257", + "json": { + "$id": "2258", + "name": "minimumCoverage" + } + } + }, + { + "$id": "2259", + "kind": "property", + "name": "orderBy", + "serializedName": "orderby", + "doc": "The comma-separated list of OData $orderby expressions by which to sort the\nresults. Each expression can be either a field name or a call to either the\ngeo.distance() or the search.score() functions. Each expression can be followed\nby asc to indicate ascending, or desc to indicate descending. The default is\nascending order. Ties will be broken by the match scores of documents. If no\n$orderby is specified, the default sort order is descending by document match\nscore. There can be at most 32 $orderby clauses.", + "type": { + "$id": "2260", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SuggestRequest.orderby", + "serializationOptions": { + "$id": "2261", + "json": { + "$id": "2262", + "name": "orderby" + } + } + }, + { + "$id": "2263", + "kind": "property", + "name": "searchText", + "serializedName": "search", + "doc": "The search text to use to suggest documents. Must be at least 1 character, and\nno more than 100 characters.", + "type": { + "$id": "2264", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SuggestRequest.search", + "serializationOptions": { + "$id": "2265", + "json": { + "$id": "2266", + "name": "search" + } + } + }, + { + "$id": "2267", + "kind": "property", + "name": "searchFields", + "serializedName": "searchFields", + "doc": "The comma-separated list of field names to search for the specified search\ntext. Target fields must be included in the specified suggester.", + "type": { + "$id": "2268", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SuggestRequest.searchFields", + "serializationOptions": { + "$id": "2269", + "json": { + "$id": "2270", + "name": "searchFields" + } + } + }, + { + "$id": "2271", + "kind": "property", + "name": "select", + "serializedName": "select", + "doc": "The comma-separated list of fields to retrieve. If unspecified, only the key\nfield will be included in the results.", + "type": { + "$id": "2272", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SuggestRequest.select", + "serializationOptions": { + "$id": "2273", + "json": { + "$id": "2274", + "name": "select" + } + } + }, + { + "$id": "2275", + "kind": "property", + "name": "suggesterName", + "serializedName": "suggesterName", + "doc": "The name of the suggester as specified in the suggesters collection that's part\nof the index definition.", + "type": { + "$id": "2276", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SuggestRequest.suggesterName", + "serializationOptions": { + "$id": "2277", + "json": { + "$id": "2278", + "name": "suggesterName" + } + } + }, + { + "$id": "2279", + "kind": "property", + "name": "top", + "serializedName": "top", + "doc": "The number of suggestions to retrieve. This must be a value between 1 and 100.\nThe default is 5.", + "type": { + "$id": "2280", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SuggestRequest.top", + "serializationOptions": { + "$id": "2281", + "json": { + "$id": "2282", + "name": "top" + } + } + } + ] + }, + { + "$id": "2283", + "kind": "model", + "name": "IndexBatch", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.IndexBatch", + "usage": "Input,Json", + "doc": "Contains a batch of document write actions to send to the index.", + "decorators": [], + "properties": [ + { + "$id": "2284", + "kind": "property", + "name": "actions", + "serializedName": "value", + "doc": "The actions in the batch.", + "type": { + "$id": "2285", + "kind": "array", + "name": "ArrayIndexAction", + "valueType": { + "$id": "2286", + "kind": "model", + "name": "IndexAction", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.IndexAction", + "usage": "Input,Json", + "doc": "Represents an index action that operates on a document.", + "decorators": [], + "additionalProperties": { + "$id": "2287", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "properties": [ + { + "$id": "2288", + "kind": "property", + "name": "actionType", + "serializedName": "@search.action", + "doc": "The operation to perform on a document in an indexing batch.", + "type": { + "$ref": "66" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexAction.actionType", + "serializationOptions": { + "$id": "2289", + "json": { + "$id": "2290", + "name": "@search.action" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexBatch.value", + "serializationOptions": { + "$id": "2291", + "json": { + "$id": "2292", + "name": "value" + } + } + } + ] + }, + { + "$ref": "2286" + }, + { + "$id": "2293", + "kind": "model", + "name": "IndexDocumentsResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.IndexDocumentsResult", + "usage": "Output,Json", + "doc": "Response containing the status of operations for all documents in the indexing\nrequest.", + "decorators": [], + "properties": [ + { + "$id": "2294", + "kind": "property", + "name": "results", + "serializedName": "value", + "doc": "The list of status information for each document in the indexing request.", + "type": { + "$id": "2295", + "kind": "array", + "name": "ArrayIndexingResult", + "valueType": { + "$id": "2296", + "kind": "model", + "name": "IndexingResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.IndexingResult", + "usage": "Output,Json", + "doc": "Status of an indexing operation for a single document.", + "decorators": [], + "properties": [ + { + "$id": "2297", + "kind": "property", + "name": "key", + "serializedName": "key", + "doc": "The key of a document that was in the indexing request.", + "type": { + "$id": "2298", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingResult.key", + "serializationOptions": { + "$id": "2299", + "json": { + "$id": "2300", + "name": "key" + } + } + }, + { + "$id": "2301", + "kind": "property", + "name": "errorMessage", + "serializedName": "errorMessage", + "doc": "The error message explaining why the indexing operation failed for the document\nidentified by the key; null if indexing succeeded.", + "type": { + "$id": "2302", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingResult.errorMessage", + "serializationOptions": { + "$id": "2303", + "json": { + "$id": "2304", + "name": "errorMessage" + } + } + }, + { + "$id": "2305", + "kind": "property", + "name": "succeeded", + "serializedName": "status", + "doc": "A value indicating whether the indexing operation succeeded for the document\nidentified by the key.", + "type": { + "$id": "2306", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingResult.status", + "serializationOptions": { + "$id": "2307", + "json": { + "$id": "2308", + "name": "status" + } + } + }, + { + "$id": "2309", + "kind": "property", + "name": "statusCode", + "serializedName": "statusCode", + "doc": "The status code of the indexing operation. Possible values include: 200 for a\nsuccessful update or delete, 201 for successful document creation, 400 for a\nmalformed input document, 404 for document not found, 409 for a version\nconflict, 422 when the index is temporarily unavailable, or 503 for when the\nservice is too busy.", + "type": { + "$id": "2310", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingResult.statusCode", + "serializationOptions": { + "$id": "2311", + "json": { + "$id": "2312", + "name": "statusCode" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexDocumentsResult.value", + "serializationOptions": { + "$id": "2313", + "json": { + "$id": "2314", + "name": "value" + } + } + } + ] + }, + { + "$ref": "2296" + }, + { + "$id": "2315", + "kind": "model", + "name": "AutocompleteResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.AutocompleteResult", + "usage": "Output,Json", + "doc": "The result of Autocomplete query.", + "decorators": [], + "properties": [ + { + "$id": "2316", + "kind": "property", + "name": "coverage", + "serializedName": "@search.coverage", + "doc": "A value indicating the percentage of the index that was considered by the\nautocomplete request, or null if minimumCoverage was not specified in the\nrequest.", + "type": { + "$id": "2317", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AutocompleteResult.coverage", + "serializationOptions": { + "$id": "2318", + "json": { + "$id": "2319", + "name": "@search.coverage" + } + } + }, + { + "$id": "2320", + "kind": "property", + "name": "results", + "serializedName": "value", + "doc": "The list of returned Autocompleted items.", + "type": { + "$id": "2321", + "kind": "array", + "name": "ArrayAutocompleteItem", + "valueType": { + "$id": "2322", + "kind": "model", + "name": "AutocompleteItem", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.AutocompleteItem", + "usage": "Output,Json", + "doc": "The result of Autocomplete requests.", + "decorators": [], + "properties": [ + { + "$id": "2323", + "kind": "property", + "name": "text", + "serializedName": "text", + "doc": "The completed term.", + "type": { + "$id": "2324", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AutocompleteItem.text", + "serializationOptions": { + "$id": "2325", + "json": { + "$id": "2326", + "name": "text" + } + } + }, + { + "$id": "2327", + "kind": "property", + "name": "queryPlusText", + "serializedName": "queryPlusText", + "doc": "The query along with the completed term.", + "type": { + "$id": "2328", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AutocompleteItem.queryPlusText", + "serializationOptions": { + "$id": "2329", + "json": { + "$id": "2330", + "name": "queryPlusText" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AutocompleteResult.value", + "serializationOptions": { + "$id": "2331", + "json": { + "$id": "2332", + "name": "value" + } + } + } + ] + }, + { + "$ref": "2322" + }, + { + "$id": "2333", + "kind": "model", + "name": "AutocompleteRequest", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.AutocompleteRequest", + "usage": "Input,Json", + "doc": "Parameters for fuzzy matching, and other autocomplete query behaviors.", + "decorators": [], + "properties": [ + { + "$id": "2334", + "kind": "property", + "name": "searchText", + "serializedName": "search", + "doc": "The search text on which to base autocomplete results.", + "type": { + "$id": "2335", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AutocompleteRequest.search", + "serializationOptions": { + "$id": "2336", + "json": { + "$id": "2337", + "name": "search" + } + } + }, + { + "$id": "2338", + "kind": "property", + "name": "autocompleteMode", + "serializedName": "autocompleteMode", + "doc": "Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms'\nto get shingles and 'oneTermWithContext' to use the current context while\nproducing auto-completed terms.", + "type": { + "$ref": "76" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AutocompleteRequest.autocompleteMode", + "serializationOptions": { + "$id": "2339", + "json": { + "$id": "2340", + "name": "autocompleteMode" + } + } + }, + { + "$id": "2341", + "kind": "property", + "name": "filter", + "serializedName": "filter", + "doc": "An OData expression that filters the documents used to produce completed terms\nfor the Autocomplete result.", + "type": { + "$id": "2342", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AutocompleteRequest.filter", + "serializationOptions": { + "$id": "2343", + "json": { + "$id": "2344", + "name": "filter" + } + } + }, + { + "$id": "2345", + "kind": "property", + "name": "useFuzzyMatching", + "serializedName": "fuzzy", + "doc": "A value indicating whether to use fuzzy matching for the autocomplete query.\nDefault is false. When set to true, the query will autocomplete terms even if\nthere's a substituted or missing character in the search text. While this\nprovides a better experience in some scenarios, it comes at a performance cost\nas fuzzy autocomplete queries are slower and consume more resources.", + "type": { + "$id": "2346", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AutocompleteRequest.fuzzy", + "serializationOptions": { + "$id": "2347", + "json": { + "$id": "2348", + "name": "fuzzy" + } + } + }, + { + "$id": "2349", + "kind": "property", + "name": "highlightPostTag", + "serializedName": "highlightPostTag", + "doc": "A string tag that is appended to hit highlights. Must be set with\nhighlightPreTag. If omitted, hit highlighting is disabled.", + "type": { + "$id": "2350", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AutocompleteRequest.highlightPostTag", + "serializationOptions": { + "$id": "2351", + "json": { + "$id": "2352", + "name": "highlightPostTag" + } + } + }, + { + "$id": "2353", + "kind": "property", + "name": "highlightPreTag", + "serializedName": "highlightPreTag", + "doc": "A string tag that is prepended to hit highlights. Must be set with\nhighlightPostTag. If omitted, hit highlighting is disabled.", + "type": { + "$id": "2354", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AutocompleteRequest.highlightPreTag", + "serializationOptions": { + "$id": "2355", + "json": { + "$id": "2356", + "name": "highlightPreTag" + } + } + }, + { + "$id": "2357", + "kind": "property", + "name": "minimumCoverage", + "serializedName": "minimumCoverage", + "doc": "A number between 0 and 100 indicating the percentage of the index that must be\ncovered by an autocomplete query in order for the query to be reported as a\nsuccess. This parameter can be useful for ensuring search availability even for\nservices with only one replica. The default is 80.", + "type": { + "$id": "2358", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AutocompleteRequest.minimumCoverage", + "serializationOptions": { + "$id": "2359", + "json": { + "$id": "2360", + "name": "minimumCoverage" + } + } + }, + { + "$id": "2361", + "kind": "property", + "name": "searchFields", + "serializedName": "searchFields", + "doc": "The comma-separated list of field names to consider when querying for\nauto-completed terms. Target fields must be included in the specified\nsuggester.", + "type": { + "$id": "2362", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AutocompleteRequest.searchFields", + "serializationOptions": { + "$id": "2363", + "json": { + "$id": "2364", + "name": "searchFields" + } + } + }, + { + "$id": "2365", + "kind": "property", + "name": "suggesterName", + "serializedName": "suggesterName", + "doc": "The name of the suggester as specified in the suggesters collection that's part\nof the index definition.", + "type": { + "$id": "2366", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AutocompleteRequest.suggesterName", + "serializationOptions": { + "$id": "2367", + "json": { + "$id": "2368", + "name": "suggesterName" + } + } + }, + { + "$id": "2369", + "kind": "property", + "name": "top", + "serializedName": "top", + "doc": "The number of auto-completed terms to retrieve. This must be a value between 1\nand 100. The default is 5.", + "type": { + "$id": "2370", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AutocompleteRequest.top", + "serializationOptions": { + "$id": "2371", + "json": { + "$id": "2372", + "name": "top" + } + } + } + ] + }, + { + "$id": "2373", + "kind": "model", + "name": "SearchIndex", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndex", + "usage": "Input,Output,Json", + "doc": "Represents a search index definition, which describes the fields and search\nbehavior of an index.", + "decorators": [], + "properties": [ + { + "$id": "2374", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the index.", + "type": { + "$id": "2375", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndex.name", + "serializationOptions": { + "$id": "2376", + "json": { + "$id": "2377", + "name": "name" + } + } + }, + { + "$id": "2378", + "kind": "property", + "name": "fields", + "serializedName": "fields", + "doc": "The fields of the index.", + "type": { + "$id": "2379", + "kind": "array", + "name": "ArraySearchField", + "valueType": { + "$id": "2380", + "kind": "model", + "name": "SearchField", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchField", + "usage": "Input,Output,Json", + "doc": "Represents a field in an index definition, which describes the name, data type,\nand search behavior of a field.", + "decorators": [], + "properties": [ + { + "$id": "2381", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the field, which must be unique within the fields collection of the\nindex or parent field.", + "type": { + "$id": "2382", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.name", + "serializationOptions": { + "$id": "2383", + "json": { + "$id": "2384", + "name": "name" + } + } + }, + { + "$id": "2385", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The data type of the field.", + "type": { + "$ref": "84" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.type", + "serializationOptions": { + "$id": "2386", + "json": { + "$id": "2387", + "name": "type" + } + } + }, + { + "$id": "2388", + "kind": "property", + "name": "key", + "serializedName": "key", + "doc": "A value indicating whether the field uniquely identifies documents in the\nindex. Exactly one top-level field in each index must be chosen as the key\nfield and it must be of type Edm.String. Key fields can be used to look up\ndocuments directly and update or delete specific documents. Default is false\nfor simple fields and null for complex fields.", + "type": { + "$id": "2389", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.key", + "serializationOptions": { + "$id": "2390", + "json": { + "$id": "2391", + "name": "key" + } + } + }, + { + "$id": "2392", + "kind": "property", + "name": "retrievable", + "serializedName": "retrievable", + "doc": "A value indicating whether the field can be returned in a search result. You\ncan disable this option if you want to use a field (for example, margin) as a\nfilter, sorting, or scoring mechanism but do not want the field to be visible\nto the end user. This property must be true for key fields, and it must be null\nfor complex fields. This property can be changed on existing fields. Enabling\nthis property does not cause any increase in index storage requirements.\nDefault is true for simple fields, false for vector fields, and null for\ncomplex fields.", + "type": { + "$id": "2393", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.retrievable", + "serializationOptions": { + "$id": "2394", + "json": { + "$id": "2395", + "name": "retrievable" + } + } + }, + { + "$id": "2396", + "kind": "property", + "name": "stored", + "serializedName": "stored", + "doc": "An immutable value indicating whether the field will be persisted separately on\ndisk to be returned in a search result. You can disable this option if you\ndon't plan to return the field contents in a search response to save on storage\noverhead. This can only be set during index creation and only for vector\nfields. This property cannot be changed for existing fields or set as false for\nnew fields. If this property is set as false, the property 'retrievable' must\nalso be set to false. This property must be true or unset for key fields, for\nnew fields, and for non-vector fields, and it must be null for complex fields.\nDisabling this property will reduce index storage requirements. The default is\ntrue for vector fields.", + "type": { + "$id": "2397", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.stored", + "serializationOptions": { + "$id": "2398", + "json": { + "$id": "2399", + "name": "stored" + } + } + }, + { + "$id": "2400", + "kind": "property", + "name": "searchable", + "serializedName": "searchable", + "doc": "A value indicating whether the field is full-text searchable. This means it\nwill undergo analysis such as word-breaking during indexing. If you set a\nsearchable field to a value like \"sunny day\", internally it will be split into\nthe individual tokens \"sunny\" and \"day\". This enables full-text searches for\nthese terms. Fields of type Edm.String or Collection(Edm.String) are searchable\nby default. This property must be false for simple fields of other non-string\ndata types, and it must be null for complex fields. Note: searchable fields\nconsume extra space in your index to accommodate additional tokenized versions\nof the field value for full-text searches. If you want to save space in your\nindex and you don't need a field to be included in searches, set searchable to\nfalse.", + "type": { + "$id": "2401", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.searchable", + "serializationOptions": { + "$id": "2402", + "json": { + "$id": "2403", + "name": "searchable" + } + } + }, + { + "$id": "2404", + "kind": "property", + "name": "filterable", + "serializedName": "filterable", + "doc": "A value indicating whether to enable the field to be referenced in $filter\nqueries. filterable differs from searchable in how strings are handled. Fields\nof type Edm.String or Collection(Edm.String) that are filterable do not undergo\nword-breaking, so comparisons are for exact matches only. For example, if you\nset such a field f to \"sunny day\", $filter=f eq 'sunny' will find no matches,\nbut $filter=f eq 'sunny day' will. This property must be null for complex\nfields. Default is true for simple fields and null for complex fields.", + "type": { + "$id": "2405", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.filterable", + "serializationOptions": { + "$id": "2406", + "json": { + "$id": "2407", + "name": "filterable" + } + } + }, + { + "$id": "2408", + "kind": "property", + "name": "sortable", + "serializedName": "sortable", + "doc": "A value indicating whether to enable the field to be referenced in $orderby\nexpressions. By default, the search engine sorts results by score, but in many\nexperiences users will want to sort by fields in the documents. A simple field\ncan be sortable only if it is single-valued (it has a single value in the scope\nof the parent document). Simple collection fields cannot be sortable, since\nthey are multi-valued. Simple sub-fields of complex collections are also\nmulti-valued, and therefore cannot be sortable. This is true whether it's an\nimmediate parent field, or an ancestor field, that's the complex collection.\nComplex fields cannot be sortable and the sortable property must be null for\nsuch fields. The default for sortable is true for single-valued simple fields,\nfalse for multi-valued simple fields, and null for complex fields.", + "type": { + "$id": "2409", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.sortable", + "serializationOptions": { + "$id": "2410", + "json": { + "$id": "2411", + "name": "sortable" + } + } + }, + { + "$id": "2412", + "kind": "property", + "name": "facetable", + "serializedName": "facetable", + "doc": "A value indicating whether to enable the field to be referenced in facet\nqueries. Typically used in a presentation of search results that includes hit\ncount by category (for example, search for digital cameras and see hits by\nbrand, by megapixels, by price, and so on). This property must be null for\ncomplex fields. Fields of type Edm.GeographyPoint or\nCollection(Edm.GeographyPoint) cannot be facetable. Default is true for all\nother simple fields.", + "type": { + "$id": "2413", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.facetable", + "serializationOptions": { + "$id": "2414", + "json": { + "$id": "2415", + "name": "facetable" + } + } + }, + { + "$id": "2416", + "kind": "property", + "name": "analyzer", + "serializedName": "analyzer", + "doc": "The name of the analyzer to use for the field. This option can be used only\nwith searchable fields and it can't be set together with either searchAnalyzer\nor indexAnalyzer. Once the analyzer is chosen, it cannot be changed for the\nfield. Must be null for complex fields.", + "type": { + "$ref": "112" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.analyzer", + "serializationOptions": { + "$id": "2417", + "json": { + "$id": "2418", + "name": "analyzer" + } + } + }, + { + "$id": "2419", + "kind": "property", + "name": "searchAnalyzer", + "serializedName": "searchAnalyzer", + "doc": "The name of the analyzer used at search time for the field. This option can be\nused only with searchable fields. It must be set together with indexAnalyzer\nand it cannot be set together with the analyzer option. This property cannot be\nset to the name of a language analyzer; use the analyzer property instead if\nyou need a language analyzer. This analyzer can be updated on an existing\nfield. Must be null for complex fields.", + "type": { + "$ref": "112" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.searchAnalyzer", + "serializationOptions": { + "$id": "2420", + "json": { + "$id": "2421", + "name": "searchAnalyzer" + } + } + }, + { + "$id": "2422", + "kind": "property", + "name": "indexAnalyzer", + "serializedName": "indexAnalyzer", + "doc": "The name of the analyzer used at indexing time for the field. This option can\nbe used only with searchable fields. It must be set together with\nsearchAnalyzer and it cannot be set together with the analyzer option. This\nproperty cannot be set to the name of a language analyzer; use the analyzer\nproperty instead if you need a language analyzer. Once the analyzer is chosen,\nit cannot be changed for the field. Must be null for complex fields.", + "type": { + "$ref": "112" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.indexAnalyzer", + "serializationOptions": { + "$id": "2423", + "json": { + "$id": "2424", + "name": "indexAnalyzer" + } + } + }, + { + "$id": "2425", + "kind": "property", + "name": "vectorSearchDimensions", + "serializedName": "dimensions", + "doc": "The dimensionality of the vector field.", + "type": { + "$id": "2426", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.dimensions", + "serializationOptions": { + "$id": "2427", + "json": { + "$id": "2428", + "name": "dimensions" + } + } + }, + { + "$id": "2429", + "kind": "property", + "name": "vectorSearchProfileName", + "serializedName": "vectorSearchProfile", + "doc": "The name of the vector search profile that specifies the algorithm and\nvectorizer to use when searching the vector field.", + "type": { + "$id": "2430", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.vectorSearchProfile", + "serializationOptions": { + "$id": "2431", + "json": { + "$id": "2432", + "name": "vectorSearchProfile" + } + } + }, + { + "$id": "2433", + "kind": "property", + "name": "vectorEncodingFormat", + "serializedName": "vectorEncoding", + "doc": "The encoding format to interpret the field contents.", + "type": { + "$ref": "300" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.vectorEncoding", + "serializationOptions": { + "$id": "2434", + "json": { + "$id": "2435", + "name": "vectorEncoding" + } + } + }, + { + "$id": "2436", + "kind": "property", + "name": "synonymMaps", + "serializedName": "synonymMaps", + "doc": "A list of the names of synonym maps to associate with this field. This option\ncan be used only with searchable fields. Currently only one synonym map per\nfield is supported. Assigning a synonym map to a field ensures that query terms\ntargeting that field are expanded at query-time using the rules in the synonym\nmap. This attribute can be changed on existing fields. Must be null or an empty\ncollection for complex fields.", + "type": { + "$id": "2437", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "2438", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.synonymMaps", + "serializationOptions": { + "$id": "2439", + "json": { + "$id": "2440", + "name": "synonymMaps" + } + } + }, + { + "$id": "2441", + "kind": "property", + "name": "fields", + "serializedName": "fields", + "doc": "A list of sub-fields if this is a field of type Edm.ComplexType or\nCollection(Edm.ComplexType). Must be null or empty for simple fields.", + "type": { + "$id": "2442", + "kind": "array", + "name": "ArraySearchField", + "valueType": { + "$ref": "2380" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchField.fields", + "serializationOptions": { + "$id": "2443", + "json": { + "$id": "2444", + "name": "fields" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndex.fields", + "serializationOptions": { + "$id": "2445", + "json": { + "$id": "2446", + "name": "fields" + } + } + }, + { + "$id": "2447", + "kind": "property", + "name": "scoringProfiles", + "serializedName": "scoringProfiles", + "doc": "The scoring profiles for the index.", + "type": { + "$id": "2448", + "kind": "array", + "name": "ArrayScoringProfile", + "valueType": { + "$id": "2449", + "kind": "model", + "name": "ScoringProfile", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ScoringProfile", + "usage": "Input,Output,Json", + "doc": "Defines parameters for a search index that influence scoring in search queries.", + "decorators": [], + "properties": [ + { + "$id": "2450", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the scoring profile.", + "type": { + "$id": "2451", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ScoringProfile.name", + "serializationOptions": { + "$id": "2452", + "json": { + "$id": "2453", + "name": "name" + } + } + }, + { + "$id": "2454", + "kind": "property", + "name": "textWeights", + "serializedName": "text", + "doc": "Parameters that boost scoring based on text matches in certain index fields.", + "type": { + "$id": "2455", + "kind": "model", + "name": "TextWeights", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.TextWeights", + "usage": "Input,Output,Json", + "doc": "Defines weights on index fields for which matches should boost scoring in\nsearch queries.", + "decorators": [], + "properties": [ + { + "$id": "2456", + "kind": "property", + "name": "weights", + "serializedName": "weights", + "doc": "The dictionary of per-field weights to boost document scoring. The keys are\nfield names and the values are the weights for each field.", + "type": { + "$id": "2457", + "kind": "dict", + "keyType": { + "$id": "2458", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "2459", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.TextWeights.weights", + "serializationOptions": { + "$id": "2460", + "json": { + "$id": "2461", + "name": "weights" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ScoringProfile.text", + "serializationOptions": { + "$id": "2462", + "json": { + "$id": "2463", + "name": "text" + } + } + }, + { + "$id": "2464", + "kind": "property", + "name": "functions", + "serializedName": "functions", + "doc": "The collection of functions that influence the scoring of documents.", + "type": { + "$id": "2465", + "kind": "array", + "name": "ArrayScoringFunction", + "valueType": { + "$id": "2466", + "kind": "model", + "name": "ScoringFunction", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ScoringFunction", + "usage": "Input,Output,Json", + "doc": "Base type for functions that can modify document scores during ranking.", + "decorators": [], + "discriminatorProperty": { + "$id": "2467", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Type of ScoringFunction.", + "type": { + "$id": "2468", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ScoringFunction.type", + "serializationOptions": { + "$id": "2469", + "json": { + "$id": "2470", + "name": "type" + } + } + }, + "properties": [ + { + "$id": "2471", + "kind": "property", + "name": "fieldName", + "serializedName": "fieldName", + "doc": "The name of the field used as input to the scoring function.", + "type": { + "$id": "2472", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ScoringFunction.fieldName", + "serializationOptions": { + "$id": "2473", + "json": { + "$id": "2474", + "name": "fieldName" + } + } + }, + { + "$id": "2475", + "kind": "property", + "name": "boost", + "serializedName": "boost", + "doc": "A multiplier for the raw score. Must be a positive number not equal to 1.0.", + "type": { + "$id": "2476", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ScoringFunction.boost", + "serializationOptions": { + "$id": "2477", + "json": { + "$id": "2478", + "name": "boost" + } + } + }, + { + "$id": "2479", + "kind": "property", + "name": "interpolation", + "serializedName": "interpolation", + "doc": "A value indicating how boosting will be interpolated across document scores;\ndefaults to \"Linear\".", + "type": { + "$ref": "304" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ScoringFunction.interpolation", + "serializationOptions": { + "$id": "2480", + "json": { + "$id": "2481", + "name": "interpolation" + } + } + }, + { + "$ref": "2467" + } + ], + "discriminatedSubtypes": { + "$id": "2482", + "distance": { + "$id": "2483", + "kind": "model", + "name": "DistanceScoringFunction", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.DistanceScoringFunction", + "usage": "Input,Output,Json", + "doc": "Defines a function that boosts scores based on distance from a geographic\nlocation.", + "discriminatorValue": "distance", + "decorators": [], + "baseModel": { + "$ref": "2466" + }, + "properties": [ + { + "$id": "2484", + "kind": "property", + "name": "parameters", + "serializedName": "distance", + "doc": "Parameter values for the distance scoring function.", + "type": { + "$id": "2485", + "kind": "model", + "name": "DistanceScoringParameters", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.DistanceScoringParameters", + "usage": "Input,Output,Json", + "doc": "Provides parameter values to a distance scoring function.", + "decorators": [], + "properties": [ + { + "$id": "2486", + "kind": "property", + "name": "referencePointParameter", + "serializedName": "referencePointParameter", + "doc": "The name of the parameter passed in search queries to specify the reference\nlocation.", + "type": { + "$id": "2487", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DistanceScoringParameters.referencePointParameter", + "serializationOptions": { + "$id": "2488", + "json": { + "$id": "2489", + "name": "referencePointParameter" + } + } + }, + { + "$id": "2490", + "kind": "property", + "name": "boostingDistance", + "serializedName": "boostingDistance", + "doc": "The distance in kilometers from the reference location where the boosting range\nends.", + "type": { + "$id": "2491", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DistanceScoringParameters.boostingDistance", + "serializationOptions": { + "$id": "2492", + "json": { + "$id": "2493", + "name": "boostingDistance" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DistanceScoringFunction.distance", + "serializationOptions": { + "$id": "2494", + "json": { + "$id": "2495", + "name": "distance" + } + } + }, + { + "$id": "2496", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Indicates the type of function to use. Valid values include magnitude,\nfreshness, distance, and tag. The function type must be lower case.", + "type": { + "$id": "2497", + "kind": "constant", + "valueType": { + "$id": "2498", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "distance", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DistanceScoringFunction.type", + "serializationOptions": { + "$id": "2499", + "json": { + "$id": "2500", + "name": "type" + } + } + } + ] + }, + "freshness": { + "$id": "2501", + "kind": "model", + "name": "FreshnessScoringFunction", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.FreshnessScoringFunction", + "usage": "Input,Output,Json", + "doc": "Defines a function that boosts scores based on the value of a date-time field.", + "discriminatorValue": "freshness", + "decorators": [], + "baseModel": { + "$ref": "2466" + }, + "properties": [ + { + "$id": "2502", + "kind": "property", + "name": "parameters", + "serializedName": "freshness", + "doc": "Parameter values for the freshness scoring function.", + "type": { + "$id": "2503", + "kind": "model", + "name": "FreshnessScoringParameters", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.FreshnessScoringParameters", + "usage": "Input,Output,Json", + "doc": "Provides parameter values to a freshness scoring function.", + "decorators": [], + "properties": [ + { + "$id": "2504", + "kind": "property", + "name": "boostingDuration", + "serializedName": "boostingDuration", + "doc": "The expiration period after which boosting will stop for a particular document.", + "type": { + "$id": "2505", + "kind": "duration", + "name": "duration", + "encode": "ISO8601", + "wireType": { + "$id": "2506", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.duration", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.FreshnessScoringParameters.boostingDuration", + "serializationOptions": { + "$id": "2507", + "json": { + "$id": "2508", + "name": "boostingDuration" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.FreshnessScoringFunction.freshness", + "serializationOptions": { + "$id": "2509", + "json": { + "$id": "2510", + "name": "freshness" + } + } + }, + { + "$id": "2511", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Indicates the type of function to use. Valid values include magnitude,\nfreshness, distance, and tag. The function type must be lower case.", + "type": { + "$id": "2512", + "kind": "constant", + "valueType": { + "$id": "2513", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "freshness", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.FreshnessScoringFunction.type", + "serializationOptions": { + "$id": "2514", + "json": { + "$id": "2515", + "name": "type" + } + } + } + ] + }, + "magnitude": { + "$id": "2516", + "kind": "model", + "name": "MagnitudeScoringFunction", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.MagnitudeScoringFunction", + "usage": "Input,Output,Json", + "doc": "Defines a function that boosts scores based on the magnitude of a numeric field.", + "discriminatorValue": "magnitude", + "decorators": [], + "baseModel": { + "$ref": "2466" + }, + "properties": [ + { + "$id": "2517", + "kind": "property", + "name": "parameters", + "serializedName": "magnitude", + "doc": "Parameter values for the magnitude scoring function.", + "type": { + "$id": "2518", + "kind": "model", + "name": "MagnitudeScoringParameters", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.MagnitudeScoringParameters", + "usage": "Input,Output,Json", + "doc": "Provides parameter values to a magnitude scoring function.", + "decorators": [], + "properties": [ + { + "$id": "2519", + "kind": "property", + "name": "boostingRangeStart", + "serializedName": "boostingRangeStart", + "doc": "The field value at which boosting starts.", + "type": { + "$id": "2520", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MagnitudeScoringParameters.boostingRangeStart", + "serializationOptions": { + "$id": "2521", + "json": { + "$id": "2522", + "name": "boostingRangeStart" + } + } + }, + { + "$id": "2523", + "kind": "property", + "name": "boostingRangeEnd", + "serializedName": "boostingRangeEnd", + "doc": "The field value at which boosting ends.", + "type": { + "$id": "2524", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MagnitudeScoringParameters.boostingRangeEnd", + "serializationOptions": { + "$id": "2525", + "json": { + "$id": "2526", + "name": "boostingRangeEnd" + } + } + }, + { + "$id": "2527", + "kind": "property", + "name": "shouldBoostBeyondRangeByConstant", + "serializedName": "constantBoostBeyondRange", + "doc": "A value indicating whether to apply a constant boost for field values beyond\nthe range end value; default is false.", + "type": { + "$id": "2528", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MagnitudeScoringParameters.constantBoostBeyondRange", + "serializationOptions": { + "$id": "2529", + "json": { + "$id": "2530", + "name": "constantBoostBeyondRange" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MagnitudeScoringFunction.magnitude", + "serializationOptions": { + "$id": "2531", + "json": { + "$id": "2532", + "name": "magnitude" + } + } + }, + { + "$id": "2533", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Indicates the type of function to use. Valid values include magnitude,\nfreshness, distance, and tag. The function type must be lower case.", + "type": { + "$id": "2534", + "kind": "constant", + "valueType": { + "$id": "2535", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "magnitude", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MagnitudeScoringFunction.type", + "serializationOptions": { + "$id": "2536", + "json": { + "$id": "2537", + "name": "type" + } + } + } + ] + }, + "tag": { + "$id": "2538", + "kind": "model", + "name": "TagScoringFunction", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.TagScoringFunction", + "usage": "Input,Output,Json", + "doc": "Defines a function that boosts scores of documents with string values matching\na given list of tags.", + "discriminatorValue": "tag", + "decorators": [], + "baseModel": { + "$ref": "2466" + }, + "properties": [ + { + "$id": "2539", + "kind": "property", + "name": "parameters", + "serializedName": "tag", + "doc": "Parameter values for the tag scoring function.", + "type": { + "$id": "2540", + "kind": "model", + "name": "TagScoringParameters", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.TagScoringParameters", + "usage": "Input,Output,Json", + "doc": "Provides parameter values to a tag scoring function.", + "decorators": [], + "properties": [ + { + "$id": "2541", + "kind": "property", + "name": "tagsParameter", + "serializedName": "tagsParameter", + "doc": "The name of the parameter passed in search queries to specify the list of tags\nto compare against the target field.", + "type": { + "$id": "2542", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.TagScoringParameters.tagsParameter", + "serializationOptions": { + "$id": "2543", + "json": { + "$id": "2544", + "name": "tagsParameter" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.TagScoringFunction.tag", + "serializationOptions": { + "$id": "2545", + "json": { + "$id": "2546", + "name": "tag" + } + } + }, + { + "$id": "2547", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Indicates the type of function to use. Valid values include magnitude,\nfreshness, distance, and tag. The function type must be lower case.", + "type": { + "$id": "2548", + "kind": "constant", + "valueType": { + "$id": "2549", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "tag", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.TagScoringFunction.type", + "serializationOptions": { + "$id": "2550", + "json": { + "$id": "2551", + "name": "type" + } + } + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ScoringProfile.functions", + "serializationOptions": { + "$id": "2552", + "json": { + "$id": "2553", + "name": "functions" + } + } + }, + { + "$id": "2554", + "kind": "property", + "name": "functionAggregation", + "serializedName": "functionAggregation", + "doc": "A value indicating how the results of individual scoring functions should be\ncombined. Defaults to \"Sum\". Ignored if there are no scoring functions.", + "type": { + "$ref": "314" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ScoringProfile.functionAggregation", + "serializationOptions": { + "$id": "2555", + "json": { + "$id": "2556", + "name": "functionAggregation" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndex.scoringProfiles", + "serializationOptions": { + "$id": "2557", + "json": { + "$id": "2558", + "name": "scoringProfiles" + } + } + }, + { + "$id": "2559", + "kind": "property", + "name": "defaultScoringProfile", + "serializedName": "defaultScoringProfile", + "doc": "The name of the scoring profile to use if none is specified in the query. If\nthis property is not set and no scoring profile is specified in the query, then\ndefault scoring (tf-idf) will be used.", + "type": { + "$id": "2560", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndex.defaultScoringProfile", + "serializationOptions": { + "$id": "2561", + "json": { + "$id": "2562", + "name": "defaultScoringProfile" + } + } + }, + { + "$id": "2563", + "kind": "property", + "name": "corsOptions", + "serializedName": "corsOptions", + "doc": "Options to control Cross-Origin Resource Sharing (CORS) for the index.", + "type": { + "$id": "2564", + "kind": "model", + "name": "CorsOptions", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.CorsOptions", + "usage": "Input,Output,Json", + "doc": "Defines options to control Cross-Origin Resource Sharing (CORS) for an index.", + "decorators": [], + "properties": [ + { + "$id": "2565", + "kind": "property", + "name": "allowedOrigins", + "serializedName": "allowedOrigins", + "doc": "The list of origins from which JavaScript code will be granted access to your\nindex. Can contain a list of hosts of the form\n{protocol}://{fully-qualified-domain-name}[:{port#}], or a single '*' to allow\nall origins (not recommended).", + "type": { + "$id": "2566", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "2567", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CorsOptions.allowedOrigins", + "serializationOptions": { + "$id": "2568", + "json": { + "$id": "2569", + "name": "allowedOrigins" + } + } + }, + { + "$id": "2570", + "kind": "property", + "name": "maxAgeInSeconds", + "serializedName": "maxAgeInSeconds", + "doc": "The duration for which browsers should cache CORS preflight responses. Defaults\nto 5 minutes.", + "type": { + "$id": "2571", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CorsOptions.maxAgeInSeconds", + "serializationOptions": { + "$id": "2572", + "json": { + "$id": "2573", + "name": "maxAgeInSeconds" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndex.corsOptions", + "serializationOptions": { + "$id": "2574", + "json": { + "$id": "2575", + "name": "corsOptions" + } + } + }, + { + "$id": "2576", + "kind": "property", + "name": "suggesters", + "serializedName": "suggesters", + "doc": "The suggesters for the index.", + "type": { + "$id": "2577", + "kind": "array", + "name": "ArraySearchSuggester", + "valueType": { + "$id": "2578", + "kind": "model", + "name": "SearchSuggester", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchSuggester", + "usage": "Input,Output,Json", + "doc": "Defines how the Suggest API should apply to a group of fields in the index.", + "decorators": [], + "properties": [ + { + "$id": "2579", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the suggester.", + "type": { + "$id": "2580", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchSuggester.name", + "serializationOptions": { + "$id": "2581", + "json": { + "$id": "2582", + "name": "name" + } + } + }, + { + "$id": "2583", + "kind": "property", + "name": "searchMode", + "serializedName": "searchMode", + "doc": "A value indicating the capabilities of the suggester.", + "type": { + "$id": "2584", + "kind": "constant", + "valueType": { + "$ref": "326" + }, + "value": "analyzingInfixMatching", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchSuggester.searchMode", + "serializationOptions": { + "$id": "2585", + "json": { + "$id": "2586", + "name": "searchMode" + } + } + }, + { + "$id": "2587", + "kind": "property", + "name": "sourceFields", + "serializedName": "sourceFields", + "doc": "The list of field names to which the suggester applies. Each field must be\nsearchable.", + "type": { + "$id": "2588", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "2589", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchSuggester.sourceFields", + "serializationOptions": { + "$id": "2590", + "json": { + "$id": "2591", + "name": "sourceFields" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndex.suggesters", + "serializationOptions": { + "$id": "2592", + "json": { + "$id": "2593", + "name": "suggesters" + } + } + }, + { + "$id": "2594", + "kind": "property", + "name": "analyzers", + "serializedName": "analyzers", + "doc": "The analyzers for the index.", + "type": { + "$id": "2595", + "kind": "array", + "name": "ArrayLexicalAnalyzer", + "valueType": { + "$id": "2596", + "kind": "model", + "name": "LexicalAnalyzer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.LexicalAnalyzer", + "usage": "Input,Output,Json", + "doc": "Base type for analyzers.", + "decorators": [], + "discriminatorProperty": { + "$id": "2597", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "The discriminator for derived types.", + "type": { + "$id": "2598", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LexicalAnalyzer.@odata.type", + "serializationOptions": { + "$id": "2599", + "json": { + "$id": "2600", + "name": "@odata.type" + } + } + }, + "properties": [ + { + "$ref": "2597" + }, + { + "$id": "2601", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the analyzer. It must only contain letters, digits, spaces, dashes\nor underscores, can only start and end with alphanumeric characters, and is\nlimited to 128 characters.", + "type": { + "$id": "2602", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LexicalAnalyzer.name", + "serializationOptions": { + "$id": "2603", + "json": { + "$id": "2604", + "name": "name" + } + } + } + ], + "discriminatedSubtypes": { + "$id": "2605", + "#Microsoft.Azure.Search.CustomAnalyzer": { + "$id": "2606", + "kind": "model", + "name": "CustomAnalyzer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.CustomAnalyzer", + "usage": "Input,Output,Json", + "doc": "Allows you to take control over the process of converting text into\nindexable/searchable tokens. It's a user-defined configuration consisting of a\nsingle predefined tokenizer and one or more filters. The tokenizer is\nresponsible for breaking text into tokens, and the filters for modifying tokens\nemitted by the tokenizer.", + "discriminatorValue": "#Microsoft.Azure.Search.CustomAnalyzer", + "decorators": [], + "baseModel": { + "$ref": "2596" + }, + "properties": [ + { + "$id": "2607", + "kind": "property", + "name": "tokenizer", + "serializedName": "tokenizer", + "doc": "The name of the tokenizer to use to divide continuous text into a sequence of\ntokens, such as breaking a sentence into words.", + "type": { + "$ref": "329" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomAnalyzer.tokenizer", + "serializationOptions": { + "$id": "2608", + "json": { + "$id": "2609", + "name": "tokenizer" + } + } + }, + { + "$id": "2610", + "kind": "property", + "name": "tokenFilters", + "serializedName": "tokenFilters", + "doc": "A list of token filters used to filter out or modify the tokens generated by a\ntokenizer. For example, you can specify a lowercase filter that converts all\ncharacters to lowercase. The filters are run in the order in which they are\nlisted.", + "type": { + "$id": "2611", + "kind": "array", + "name": "ArrayTokenFilterName", + "valueType": { + "$ref": "357" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomAnalyzer.tokenFilters", + "serializationOptions": { + "$id": "2612", + "json": { + "$id": "2613", + "name": "tokenFilters" + } + } + }, + { + "$id": "2614", + "kind": "property", + "name": "charFilters", + "serializedName": "charFilters", + "doc": "A list of character filters used to prepare input text before it is processed\nby the tokenizer. For instance, they can replace certain characters or symbols.\nThe filters are run in the order in which they are listed.", + "type": { + "$id": "2615", + "kind": "array", + "name": "ArrayCharFilterName", + "valueType": { + "$ref": "427" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomAnalyzer.charFilters", + "serializationOptions": { + "$id": "2616", + "json": { + "$id": "2617", + "name": "charFilters" + } + } + }, + { + "$id": "2618", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of analyzer.", + "type": { + "$id": "2619", + "kind": "constant", + "valueType": { + "$id": "2620", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.CustomAnalyzer", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomAnalyzer.@odata.type", + "serializationOptions": { + "$id": "2621", + "json": { + "$id": "2622", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.PatternAnalyzer": { + "$id": "2623", + "kind": "model", + "name": "PatternAnalyzer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.PatternAnalyzer", + "usage": "Input,Output,Json", + "doc": "Flexibly separates text into terms via a regular expression pattern. This\nanalyzer is implemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.PatternAnalyzer", + "decorators": [], + "baseModel": { + "$ref": "2596" + }, + "properties": [ + { + "$id": "2624", + "kind": "property", + "name": "lowerCaseTerms", + "serializedName": "lowercase", + "doc": "A value indicating whether terms should be lower-cased. Default is true.", + "type": { + "$id": "2625", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternAnalyzer.lowercase", + "serializationOptions": { + "$id": "2626", + "json": { + "$id": "2627", + "name": "lowercase" + } + } + }, + { + "$id": "2628", + "kind": "property", + "name": "pattern", + "serializedName": "pattern", + "doc": "A regular expression pattern to match token separators. Default is an\nexpression that matches one or more non-word characters.", + "type": { + "$id": "2629", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternAnalyzer.pattern", + "serializationOptions": { + "$id": "2630", + "json": { + "$id": "2631", + "name": "pattern" + } + } + }, + { + "$id": "2632", + "kind": "property", + "name": "flags", + "serializedName": "flags", + "doc": "Regular expression flags.", + "type": { + "$ref": "431" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternAnalyzer.flags", + "serializationOptions": { + "$id": "2633", + "json": { + "$id": "2634", + "name": "flags" + } + } + }, + { + "$id": "2635", + "kind": "property", + "name": "stopwords", + "serializedName": "stopwords", + "doc": "A list of stopwords.", + "type": { + "$id": "2636", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "2637", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternAnalyzer.stopwords", + "serializationOptions": { + "$id": "2638", + "json": { + "$id": "2639", + "name": "stopwords" + } + } + }, + { + "$id": "2640", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of analyzer.", + "type": { + "$id": "2641", + "kind": "constant", + "valueType": { + "$id": "2642", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.PatternAnalyzer", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternAnalyzer.@odata.type", + "serializationOptions": { + "$id": "2643", + "json": { + "$id": "2644", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.StandardAnalyzer": { + "$id": "2645", + "kind": "model", + "name": "LuceneStandardAnalyzer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.LuceneStandardAnalyzer", + "usage": "Input,Output,Json", + "doc": "Standard Apache Lucene analyzer; Composed of the standard tokenizer, lowercase\nfilter and stop filter.", + "discriminatorValue": "#Microsoft.Azure.Search.StandardAnalyzer", + "decorators": [], + "baseModel": { + "$ref": "2596" + }, + "properties": [ + { + "$id": "2646", + "kind": "property", + "name": "maxTokenLength", + "serializedName": "maxTokenLength", + "doc": "The maximum token length. Default is 255. Tokens longer than the maximum length\nare split. The maximum token length that can be used is 300 characters.", + "type": { + "$id": "2647", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LuceneStandardAnalyzer.maxTokenLength", + "serializationOptions": { + "$id": "2648", + "json": { + "$id": "2649", + "name": "maxTokenLength" + } + } + }, + { + "$id": "2650", + "kind": "property", + "name": "stopwords", + "serializedName": "stopwords", + "doc": "A list of stopwords.", + "type": { + "$id": "2651", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "2652", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LuceneStandardAnalyzer.stopwords", + "serializationOptions": { + "$id": "2653", + "json": { + "$id": "2654", + "name": "stopwords" + } + } + }, + { + "$id": "2655", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of analyzer.", + "type": { + "$id": "2656", + "kind": "constant", + "valueType": { + "$id": "2657", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.StandardAnalyzer", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LuceneStandardAnalyzer.@odata.type", + "serializationOptions": { + "$id": "2658", + "json": { + "$id": "2659", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.StopAnalyzer": { + "$id": "2660", + "kind": "model", + "name": "StopAnalyzer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.StopAnalyzer", + "usage": "Input,Output,Json", + "doc": "Divides text at non-letters; Applies the lowercase and stopword token filters.\nThis analyzer is implemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.StopAnalyzer", + "decorators": [], + "baseModel": { + "$ref": "2596" + }, + "properties": [ + { + "$id": "2661", + "kind": "property", + "name": "stopwords", + "serializedName": "stopwords", + "doc": "A list of stopwords.", + "type": { + "$id": "2662", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "2663", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.StopAnalyzer.stopwords", + "serializationOptions": { + "$id": "2664", + "json": { + "$id": "2665", + "name": "stopwords" + } + } + }, + { + "$id": "2666", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of analyzer.", + "type": { + "$id": "2667", + "kind": "constant", + "valueType": { + "$id": "2668", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.StopAnalyzer", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.StopAnalyzer.@odata.type", + "serializationOptions": { + "$id": "2669", + "json": { + "$id": "2670", + "name": "@odata.type" + } + } + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndex.analyzers", + "serializationOptions": { + "$id": "2671", + "json": { + "$id": "2672", + "name": "analyzers" + } + } + }, + { + "$id": "2673", + "kind": "property", + "name": "tokenizers", + "serializedName": "tokenizers", + "doc": "The tokenizers for the index.", + "type": { + "$id": "2674", + "kind": "array", + "name": "ArrayLexicalTokenizer", + "valueType": { + "$id": "2675", + "kind": "model", + "name": "LexicalTokenizer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.LexicalTokenizer", + "usage": "Input,Output,Json", + "doc": "Base type for tokenizers.", + "decorators": [], + "discriminatorProperty": { + "$id": "2676", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "The discriminator for derived types.", + "type": { + "$id": "2677", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LexicalTokenizer.@odata.type", + "serializationOptions": { + "$id": "2678", + "json": { + "$id": "2679", + "name": "@odata.type" + } + } + }, + "properties": [ + { + "$ref": "2676" + }, + { + "$id": "2680", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the tokenizer. It must only contain letters, digits, spaces, dashes\nor underscores, can only start and end with alphanumeric characters, and is\nlimited to 128 characters.", + "type": { + "$id": "2681", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LexicalTokenizer.name", + "serializationOptions": { + "$id": "2682", + "json": { + "$id": "2683", + "name": "name" + } + } + } + ], + "discriminatedSubtypes": { + "$id": "2684", + "#Microsoft.Azure.Search.ClassicTokenizer": { + "$id": "2685", + "kind": "model", + "name": "ClassicTokenizer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ClassicTokenizer", + "usage": "Input,Output,Json", + "doc": "Grammar-based tokenizer that is suitable for processing most European-language\ndocuments. This tokenizer is implemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.ClassicTokenizer", + "decorators": [], + "baseModel": { + "$ref": "2675" + }, + "properties": [ + { + "$id": "2686", + "kind": "property", + "name": "maxTokenLength", + "serializedName": "maxTokenLength", + "doc": "The maximum token length. Default is 255. Tokens longer than the maximum length\nare split. The maximum token length that can be used is 300 characters.", + "type": { + "$id": "2687", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ClassicTokenizer.maxTokenLength", + "serializationOptions": { + "$id": "2688", + "json": { + "$id": "2689", + "name": "maxTokenLength" + } + } + }, + { + "$id": "2690", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of tokenizer.", + "type": { + "$id": "2691", + "kind": "constant", + "valueType": { + "$id": "2692", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.ClassicTokenizer", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ClassicTokenizer.@odata.type", + "serializationOptions": { + "$id": "2693", + "json": { + "$id": "2694", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.EdgeNGramTokenizer": { + "$id": "2695", + "kind": "model", + "name": "EdgeNGramTokenizer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.EdgeNGramTokenizer", + "usage": "Input,Output,Json", + "doc": "Tokenizes the input from an edge into n-grams of the given size(s). This\ntokenizer is implemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.EdgeNGramTokenizer", + "decorators": [], + "baseModel": { + "$ref": "2675" + }, + "properties": [ + { + "$id": "2696", + "kind": "property", + "name": "minGram", + "serializedName": "minGram", + "doc": "The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the\nvalue of maxGram.", + "type": { + "$id": "2697", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EdgeNGramTokenizer.minGram", + "serializationOptions": { + "$id": "2698", + "json": { + "$id": "2699", + "name": "minGram" + } + } + }, + { + "$id": "2700", + "kind": "property", + "name": "maxGram", + "serializedName": "maxGram", + "doc": "The maximum n-gram length. Default is 2. Maximum is 300.", + "type": { + "$id": "2701", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EdgeNGramTokenizer.maxGram", + "serializationOptions": { + "$id": "2702", + "json": { + "$id": "2703", + "name": "maxGram" + } + } + }, + { + "$id": "2704", + "kind": "property", + "name": "tokenChars", + "serializedName": "tokenChars", + "doc": "Character classes to keep in the tokens.", + "type": { + "$id": "2705", + "kind": "array", + "name": "ArrayTokenCharacterKind", + "valueType": { + "$ref": "449" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EdgeNGramTokenizer.tokenChars", + "serializationOptions": { + "$id": "2706", + "json": { + "$id": "2707", + "name": "tokenChars" + } + } + }, + { + "$id": "2708", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of tokenizer.", + "type": { + "$id": "2709", + "kind": "constant", + "valueType": { + "$id": "2710", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.EdgeNGramTokenizer", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EdgeNGramTokenizer.@odata.type", + "serializationOptions": { + "$id": "2711", + "json": { + "$id": "2712", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.KeywordTokenizerV2": { + "$id": "2713", + "kind": "model", + "name": "KeywordTokenizerV2", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.KeywordTokenizerV2", + "usage": "Input,Output,Json", + "doc": "Emits the entire input as a single token. This tokenizer is implemented using\nApache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.KeywordTokenizerV2", + "decorators": [], + "baseModel": { + "$ref": "2675" + }, + "properties": [ + { + "$id": "2714", + "kind": "property", + "name": "maxTokenLength", + "serializedName": "maxTokenLength", + "doc": "The maximum token length. Default is 256. Tokens longer than the maximum length\nare split. The maximum token length that can be used is 300 characters.", + "type": { + "$id": "2715", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.KeywordTokenizerV2.maxTokenLength", + "serializationOptions": { + "$id": "2716", + "json": { + "$id": "2717", + "name": "maxTokenLength" + } + } + }, + { + "$id": "2718", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of tokenizer.", + "type": { + "$id": "2719", + "kind": "constant", + "valueType": { + "$id": "2720", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.KeywordTokenizerV2", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.KeywordTokenizerV2.@odata.type", + "serializationOptions": { + "$id": "2721", + "json": { + "$id": "2722", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.MicrosoftLanguageTokenizer": { + "$id": "2723", + "kind": "model", + "name": "MicrosoftLanguageTokenizer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.MicrosoftLanguageTokenizer", + "usage": "Input,Output,Json", + "doc": "Divides text using language-specific rules.", + "discriminatorValue": "#Microsoft.Azure.Search.MicrosoftLanguageTokenizer", + "decorators": [], + "baseModel": { + "$ref": "2675" + }, + "properties": [ + { + "$id": "2724", + "kind": "property", + "name": "maxTokenLength", + "serializedName": "maxTokenLength", + "doc": "The maximum token length. Tokens longer than the maximum length are split.\nMaximum token length that can be used is 300 characters. Tokens longer than 300\ncharacters are first split into tokens of length 300 and then each of those\ntokens is split based on the max token length set. Default is 255.", + "type": { + "$id": "2725", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MicrosoftLanguageTokenizer.maxTokenLength", + "serializationOptions": { + "$id": "2726", + "json": { + "$id": "2727", + "name": "maxTokenLength" + } + } + }, + { + "$id": "2728", + "kind": "property", + "name": "isSearchTokenizer", + "serializedName": "isSearchTokenizer", + "doc": "A value indicating how the tokenizer is used. Set to true if used as the search\ntokenizer, set to false if used as the indexing tokenizer. Default is false.", + "type": { + "$id": "2729", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MicrosoftLanguageTokenizer.isSearchTokenizer", + "serializationOptions": { + "$id": "2730", + "json": { + "$id": "2731", + "name": "isSearchTokenizer" + } + } + }, + { + "$id": "2732", + "kind": "property", + "name": "language", + "serializedName": "language", + "doc": "The language to use. The default is English.", + "type": { + "$ref": "461" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MicrosoftLanguageTokenizer.language", + "serializationOptions": { + "$id": "2733", + "json": { + "$id": "2734", + "name": "language" + } + } + }, + { + "$id": "2735", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of tokenizer.", + "type": { + "$id": "2736", + "kind": "constant", + "valueType": { + "$id": "2737", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.MicrosoftLanguageTokenizer", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MicrosoftLanguageTokenizer.@odata.type", + "serializationOptions": { + "$id": "2738", + "json": { + "$id": "2739", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer": { + "$id": "2740", + "kind": "model", + "name": "MicrosoftLanguageStemmingTokenizer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.MicrosoftLanguageStemmingTokenizer", + "usage": "Input,Output,Json", + "doc": "Divides text using language-specific rules and reduces words to their base\nforms.", + "discriminatorValue": "#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer", + "decorators": [], + "baseModel": { + "$ref": "2675" + }, + "properties": [ + { + "$id": "2741", + "kind": "property", + "name": "maxTokenLength", + "serializedName": "maxTokenLength", + "doc": "The maximum token length. Tokens longer than the maximum length are split.\nMaximum token length that can be used is 300 characters. Tokens longer than 300\ncharacters are first split into tokens of length 300 and then each of those\ntokens is split based on the max token length set. Default is 255.", + "type": { + "$id": "2742", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MicrosoftLanguageStemmingTokenizer.maxTokenLength", + "serializationOptions": { + "$id": "2743", + "json": { + "$id": "2744", + "name": "maxTokenLength" + } + } + }, + { + "$id": "2745", + "kind": "property", + "name": "isSearchTokenizer", + "serializedName": "isSearchTokenizer", + "doc": "A value indicating how the tokenizer is used. Set to true if used as the search\ntokenizer, set to false if used as the indexing tokenizer. Default is false.", + "type": { + "$id": "2746", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MicrosoftLanguageStemmingTokenizer.isSearchTokenizer", + "serializationOptions": { + "$id": "2747", + "json": { + "$id": "2748", + "name": "isSearchTokenizer" + } + } + }, + { + "$id": "2749", + "kind": "property", + "name": "language", + "serializedName": "language", + "doc": "The language to use. The default is English.", + "type": { + "$ref": "547" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MicrosoftLanguageStemmingTokenizer.language", + "serializationOptions": { + "$id": "2750", + "json": { + "$id": "2751", + "name": "language" + } + } + }, + { + "$id": "2752", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of tokenizer.", + "type": { + "$id": "2753", + "kind": "constant", + "valueType": { + "$id": "2754", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MicrosoftLanguageStemmingTokenizer.@odata.type", + "serializationOptions": { + "$id": "2755", + "json": { + "$id": "2756", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.NGramTokenizer": { + "$id": "2757", + "kind": "model", + "name": "NGramTokenizer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.NGramTokenizer", + "usage": "Input,Output,Json", + "doc": "Tokenizes the input into n-grams of the given size(s). This tokenizer is\nimplemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.NGramTokenizer", + "decorators": [], + "baseModel": { + "$ref": "2675" + }, + "properties": [ + { + "$id": "2758", + "kind": "property", + "name": "minGram", + "serializedName": "minGram", + "doc": "The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the\nvalue of maxGram.", + "type": { + "$id": "2759", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.NGramTokenizer.minGram", + "serializationOptions": { + "$id": "2760", + "json": { + "$id": "2761", + "name": "minGram" + } + } + }, + { + "$id": "2762", + "kind": "property", + "name": "maxGram", + "serializedName": "maxGram", + "doc": "The maximum n-gram length. Default is 2. Maximum is 300.", + "type": { + "$id": "2763", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.NGramTokenizer.maxGram", + "serializationOptions": { + "$id": "2764", + "json": { + "$id": "2765", + "name": "maxGram" + } + } + }, + { + "$id": "2766", + "kind": "property", + "name": "tokenChars", + "serializedName": "tokenChars", + "doc": "Character classes to keep in the tokens.", + "type": { + "$id": "2767", + "kind": "array", + "name": "ArrayTokenCharacterKind", + "valueType": { + "$ref": "449" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.NGramTokenizer.tokenChars", + "serializationOptions": { + "$id": "2768", + "json": { + "$id": "2769", + "name": "tokenChars" + } + } + }, + { + "$id": "2770", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of tokenizer.", + "type": { + "$id": "2771", + "kind": "constant", + "valueType": { + "$id": "2772", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.NGramTokenizer", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.NGramTokenizer.@odata.type", + "serializationOptions": { + "$id": "2773", + "json": { + "$id": "2774", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.PathHierarchyTokenizerV2": { + "$id": "2775", + "kind": "model", + "name": "PathHierarchyTokenizerV2", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.PathHierarchyTokenizerV2", + "usage": "Input,Output,Json", + "doc": "Tokenizer for path-like hierarchies. This tokenizer is implemented using Apache\nLucene.", + "discriminatorValue": "#Microsoft.Azure.Search.PathHierarchyTokenizerV2", + "decorators": [], + "baseModel": { + "$ref": "2675" + }, + "properties": [ + { + "$id": "2776", + "kind": "property", + "name": "delimiter", + "serializedName": "delimiter", + "doc": "The delimiter character to use. Default is \"/\".", + "type": { + "$id": "2777", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PathHierarchyTokenizerV2.delimiter", + "serializationOptions": { + "$id": "2778", + "json": { + "$id": "2779", + "name": "delimiter" + } + } + }, + { + "$id": "2780", + "kind": "property", + "name": "replacement", + "serializedName": "replacement", + "doc": "A value that, if set, replaces the delimiter character. Default is \"/\".", + "type": { + "$id": "2781", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PathHierarchyTokenizerV2.replacement", + "serializationOptions": { + "$id": "2782", + "json": { + "$id": "2783", + "name": "replacement" + } + } + }, + { + "$id": "2784", + "kind": "property", + "name": "maxTokenLength", + "serializedName": "maxTokenLength", + "doc": "The maximum token length. Default and maximum is 300.", + "type": { + "$id": "2785", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PathHierarchyTokenizerV2.maxTokenLength", + "serializationOptions": { + "$id": "2786", + "json": { + "$id": "2787", + "name": "maxTokenLength" + } + } + }, + { + "$id": "2788", + "kind": "property", + "name": "reverseTokenOrder", + "serializedName": "reverse", + "doc": "A value indicating whether to generate tokens in reverse order. Default is\nfalse.", + "type": { + "$id": "2789", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PathHierarchyTokenizerV2.reverse", + "serializationOptions": { + "$id": "2790", + "json": { + "$id": "2791", + "name": "reverse" + } + } + }, + { + "$id": "2792", + "kind": "property", + "name": "numberOfTokensToSkip", + "serializedName": "skip", + "doc": "The number of initial tokens to skip. Default is 0.", + "type": { + "$id": "2793", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PathHierarchyTokenizerV2.skip", + "serializationOptions": { + "$id": "2794", + "json": { + "$id": "2795", + "name": "skip" + } + } + }, + { + "$id": "2796", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of tokenizer.", + "type": { + "$id": "2797", + "kind": "constant", + "valueType": { + "$id": "2798", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.PathHierarchyTokenizerV2", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PathHierarchyTokenizerV2.@odata.type", + "serializationOptions": { + "$id": "2799", + "json": { + "$id": "2800", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.PatternTokenizer": { + "$id": "2801", + "kind": "model", + "name": "PatternTokenizer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.PatternTokenizer", + "usage": "Input,Output,Json", + "doc": "Tokenizer that uses regex pattern matching to construct distinct tokens. This\ntokenizer is implemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.PatternTokenizer", + "decorators": [], + "baseModel": { + "$ref": "2675" + }, + "properties": [ + { + "$id": "2802", + "kind": "property", + "name": "pattern", + "serializedName": "pattern", + "doc": "A regular expression pattern to match token separators. Default is an\nexpression that matches one or more non-word characters.", + "type": { + "$id": "2803", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternTokenizer.pattern", + "serializationOptions": { + "$id": "2804", + "json": { + "$id": "2805", + "name": "pattern" + } + } + }, + { + "$id": "2806", + "kind": "property", + "name": "flags", + "serializedName": "flags", + "doc": "Regular expression flags.", + "type": { + "$ref": "431" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternTokenizer.flags", + "serializationOptions": { + "$id": "2807", + "json": { + "$id": "2808", + "name": "flags" + } + } + }, + { + "$id": "2809", + "kind": "property", + "name": "group", + "serializedName": "group", + "doc": "The zero-based ordinal of the matching group in the regular expression pattern\nto extract into tokens. Use -1 if you want to use the entire pattern to split\nthe input into tokens, irrespective of matching groups. Default is -1.", + "type": { + "$id": "2810", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternTokenizer.group", + "serializationOptions": { + "$id": "2811", + "json": { + "$id": "2812", + "name": "group" + } + } + }, + { + "$id": "2813", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of tokenizer.", + "type": { + "$id": "2814", + "kind": "constant", + "valueType": { + "$id": "2815", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.PatternTokenizer", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternTokenizer.@odata.type", + "serializationOptions": { + "$id": "2816", + "json": { + "$id": "2817", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.StandardTokenizerV2": { + "$id": "2818", + "kind": "model", + "name": "LuceneStandardTokenizerV2", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.LuceneStandardTokenizerV2", + "usage": "Input,Output,Json", + "doc": "Breaks text following the Unicode Text Segmentation rules. This tokenizer is\nimplemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.StandardTokenizerV2", + "decorators": [], + "baseModel": { + "$ref": "2675" + }, + "properties": [ + { + "$id": "2819", + "kind": "property", + "name": "maxTokenLength", + "serializedName": "maxTokenLength", + "doc": "The maximum token length. Default is 255. Tokens longer than the maximum length\nare split. The maximum token length that can be used is 300 characters.", + "type": { + "$id": "2820", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LuceneStandardTokenizerV2.maxTokenLength", + "serializationOptions": { + "$id": "2821", + "json": { + "$id": "2822", + "name": "maxTokenLength" + } + } + }, + { + "$id": "2823", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of tokenizer.", + "type": { + "$id": "2824", + "kind": "constant", + "valueType": { + "$id": "2825", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.StandardTokenizerV2", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LuceneStandardTokenizerV2.@odata.type", + "serializationOptions": { + "$id": "2826", + "json": { + "$id": "2827", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.UaxUrlEmailTokenizer": { + "$id": "2828", + "kind": "model", + "name": "UaxUrlEmailTokenizer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.UaxUrlEmailTokenizer", + "usage": "Input,Output,Json", + "doc": "Tokenizes urls and emails as one token. This tokenizer is implemented using\nApache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.UaxUrlEmailTokenizer", + "decorators": [], + "baseModel": { + "$ref": "2675" + }, + "properties": [ + { + "$id": "2829", + "kind": "property", + "name": "maxTokenLength", + "serializedName": "maxTokenLength", + "doc": "The maximum token length. Default is 255. Tokens longer than the maximum length\nare split. The maximum token length that can be used is 300 characters.", + "type": { + "$id": "2830", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.UaxUrlEmailTokenizer.maxTokenLength", + "serializationOptions": { + "$id": "2831", + "json": { + "$id": "2832", + "name": "maxTokenLength" + } + } + }, + { + "$id": "2833", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of tokenizer.", + "type": { + "$id": "2834", + "kind": "constant", + "valueType": { + "$id": "2835", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.UaxUrlEmailTokenizer", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.UaxUrlEmailTokenizer.@odata.type", + "serializationOptions": { + "$id": "2836", + "json": { + "$id": "2837", + "name": "@odata.type" + } + } + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndex.tokenizers", + "serializationOptions": { + "$id": "2838", + "json": { + "$id": "2839", + "name": "tokenizers" + } + } + }, + { + "$id": "2840", + "kind": "property", + "name": "tokenFilters", + "serializedName": "tokenFilters", + "doc": "The token filters for the index.", + "type": { + "$id": "2841", + "kind": "array", + "name": "ArrayTokenFilter", + "valueType": { + "$id": "2842", + "kind": "model", + "name": "TokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.TokenFilter", + "usage": "Input,Output,Json", + "doc": "Base type for token filters.", + "decorators": [], + "discriminatorProperty": { + "$id": "2843", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "The discriminator for derived types.", + "type": { + "$id": "2844", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.TokenFilter.@odata.type", + "serializationOptions": { + "$id": "2845", + "json": { + "$id": "2846", + "name": "@odata.type" + } + } + }, + "properties": [ + { + "$ref": "2843" + }, + { + "$id": "2847", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the token filter. It must only contain letters, digits, spaces,\ndashes or underscores, can only start and end with alphanumeric characters, and\nis limited to 128 characters.", + "type": { + "$id": "2848", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.TokenFilter.name", + "serializationOptions": { + "$id": "2849", + "json": { + "$id": "2850", + "name": "name" + } + } + } + ], + "discriminatedSubtypes": { + "$id": "2851", + "#Microsoft.Azure.Search.AsciiFoldingTokenFilter": { + "$id": "2852", + "kind": "model", + "name": "AsciiFoldingTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.AsciiFoldingTokenFilter", + "usage": "Input,Output,Json", + "doc": "Converts alphabetic, numeric, and symbolic Unicode characters which are not in\nthe first 127 ASCII characters (the \"Basic Latin\" Unicode block) into their\nASCII equivalents, if such equivalents exist. This token filter is implemented\nusing Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.AsciiFoldingTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "2853", + "kind": "property", + "name": "preserveOriginal", + "serializedName": "preserveOriginal", + "doc": "A value indicating whether the original token will be kept. Default is false.", + "type": { + "$id": "2854", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AsciiFoldingTokenFilter.preserveOriginal", + "serializationOptions": { + "$id": "2855", + "json": { + "$id": "2856", + "name": "preserveOriginal" + } + } + }, + { + "$id": "2857", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "2858", + "kind": "constant", + "valueType": { + "$id": "2859", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.AsciiFoldingTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AsciiFoldingTokenFilter.@odata.type", + "serializationOptions": { + "$id": "2860", + "json": { + "$id": "2861", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.CjkBigramTokenFilter": { + "$id": "2862", + "kind": "model", + "name": "CjkBigramTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.CjkBigramTokenFilter", + "usage": "Input,Output,Json", + "doc": "Forms bigrams of CJK terms that are generated from the standard tokenizer. This\ntoken filter is implemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.CjkBigramTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "2863", + "kind": "property", + "name": "ignoreScripts", + "serializedName": "ignoreScripts", + "doc": "The scripts to ignore.", + "type": { + "$id": "2864", + "kind": "array", + "name": "ArrayCjkBigramTokenFilterScripts", + "valueType": { + "$ref": "639" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CjkBigramTokenFilter.ignoreScripts", + "serializationOptions": { + "$id": "2865", + "json": { + "$id": "2866", + "name": "ignoreScripts" + } + } + }, + { + "$id": "2867", + "kind": "property", + "name": "outputUnigrams", + "serializedName": "outputUnigrams", + "doc": "A value indicating whether to output both unigrams and bigrams (if true), or\njust bigrams (if false). Default is false.", + "type": { + "$id": "2868", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CjkBigramTokenFilter.outputUnigrams", + "serializationOptions": { + "$id": "2869", + "json": { + "$id": "2870", + "name": "outputUnigrams" + } + } + }, + { + "$id": "2871", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "2872", + "kind": "constant", + "valueType": { + "$id": "2873", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.CjkBigramTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CjkBigramTokenFilter.@odata.type", + "serializationOptions": { + "$id": "2874", + "json": { + "$id": "2875", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.CommonGramTokenFilter": { + "$id": "2876", + "kind": "model", + "name": "CommonGramTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.CommonGramTokenFilter", + "usage": "Input,Output,Json", + "doc": "Construct bigrams for frequently occurring terms while indexing. Single terms\nare still indexed too, with bigrams overlaid. This token filter is implemented\nusing Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.CommonGramTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "2877", + "kind": "property", + "name": "commonWords", + "serializedName": "commonWords", + "doc": "The set of common words.", + "type": { + "$id": "2878", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "2879", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CommonGramTokenFilter.commonWords", + "serializationOptions": { + "$id": "2880", + "json": { + "$id": "2881", + "name": "commonWords" + } + } + }, + { + "$id": "2882", + "kind": "property", + "name": "ignoreCase", + "serializedName": "ignoreCase", + "doc": "A value indicating whether common words matching will be case insensitive.\nDefault is false.", + "type": { + "$id": "2883", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CommonGramTokenFilter.ignoreCase", + "serializationOptions": { + "$id": "2884", + "json": { + "$id": "2885", + "name": "ignoreCase" + } + } + }, + { + "$id": "2886", + "kind": "property", + "name": "useQueryMode", + "serializedName": "queryMode", + "doc": "A value that indicates whether the token filter is in query mode. When in query\nmode, the token filter generates bigrams and then removes common words and\nsingle terms followed by a common word. Default is false.", + "type": { + "$id": "2887", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CommonGramTokenFilter.queryMode", + "serializationOptions": { + "$id": "2888", + "json": { + "$id": "2889", + "name": "queryMode" + } + } + }, + { + "$id": "2890", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "2891", + "kind": "constant", + "valueType": { + "$id": "2892", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.CommonGramTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CommonGramTokenFilter.@odata.type", + "serializationOptions": { + "$id": "2893", + "json": { + "$id": "2894", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter": { + "$id": "2895", + "kind": "model", + "name": "DictionaryDecompounderTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.DictionaryDecompounderTokenFilter", + "usage": "Input,Output,Json", + "doc": "Decomposes compound words found in many Germanic languages. This token filter\nis implemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "2896", + "kind": "property", + "name": "wordList", + "serializedName": "wordList", + "doc": "The list of words to match against.", + "type": { + "$id": "2897", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "2898", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DictionaryDecompounderTokenFilter.wordList", + "serializationOptions": { + "$id": "2899", + "json": { + "$id": "2900", + "name": "wordList" + } + } + }, + { + "$id": "2901", + "kind": "property", + "name": "minWordSize", + "serializedName": "minWordSize", + "doc": "The minimum word size. Only words longer than this get processed. Default is 5.\nMaximum is 300.", + "type": { + "$id": "2902", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DictionaryDecompounderTokenFilter.minWordSize", + "serializationOptions": { + "$id": "2903", + "json": { + "$id": "2904", + "name": "minWordSize" + } + } + }, + { + "$id": "2905", + "kind": "property", + "name": "minSubwordSize", + "serializedName": "minSubwordSize", + "doc": "The minimum subword size. Only subwords longer than this are outputted. Default\nis 2. Maximum is 300.", + "type": { + "$id": "2906", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DictionaryDecompounderTokenFilter.minSubwordSize", + "serializationOptions": { + "$id": "2907", + "json": { + "$id": "2908", + "name": "minSubwordSize" + } + } + }, + { + "$id": "2909", + "kind": "property", + "name": "maxSubwordSize", + "serializedName": "maxSubwordSize", + "doc": "The maximum subword size. Only subwords shorter than this are outputted.\nDefault is 15. Maximum is 300.", + "type": { + "$id": "2910", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DictionaryDecompounderTokenFilter.maxSubwordSize", + "serializationOptions": { + "$id": "2911", + "json": { + "$id": "2912", + "name": "maxSubwordSize" + } + } + }, + { + "$id": "2913", + "kind": "property", + "name": "onlyLongestMatch", + "serializedName": "onlyLongestMatch", + "doc": "A value indicating whether to add only the longest matching subword to the\noutput. Default is false.", + "type": { + "$id": "2914", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DictionaryDecompounderTokenFilter.onlyLongestMatch", + "serializationOptions": { + "$id": "2915", + "json": { + "$id": "2916", + "name": "onlyLongestMatch" + } + } + }, + { + "$id": "2917", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "2918", + "kind": "constant", + "valueType": { + "$id": "2919", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DictionaryDecompounderTokenFilter.@odata.type", + "serializationOptions": { + "$id": "2920", + "json": { + "$id": "2921", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.EdgeNGramTokenFilterV2": { + "$id": "2922", + "kind": "model", + "name": "EdgeNGramTokenFilterV2", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.EdgeNGramTokenFilterV2", + "usage": "Input,Output,Json", + "doc": "Generates n-grams of the given size(s) starting from the front or the back of\nan input token. This token filter is implemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.EdgeNGramTokenFilterV2", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "2923", + "kind": "property", + "name": "minGram", + "serializedName": "minGram", + "doc": "The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the\nvalue of maxGram.", + "type": { + "$id": "2924", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EdgeNGramTokenFilterV2.minGram", + "serializationOptions": { + "$id": "2925", + "json": { + "$id": "2926", + "name": "minGram" + } + } + }, + { + "$id": "2927", + "kind": "property", + "name": "maxGram", + "serializedName": "maxGram", + "doc": "The maximum n-gram length. Default is 2. Maximum is 300.", + "type": { + "$id": "2928", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EdgeNGramTokenFilterV2.maxGram", + "serializationOptions": { + "$id": "2929", + "json": { + "$id": "2930", + "name": "maxGram" + } + } + }, + { + "$id": "2931", + "kind": "property", + "name": "side", + "serializedName": "side", + "doc": "Specifies which side of the input the n-gram should be generated from. Default\nis \"front\".", + "type": { + "$ref": "649" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EdgeNGramTokenFilterV2.side", + "serializationOptions": { + "$id": "2932", + "json": { + "$id": "2933", + "name": "side" + } + } + }, + { + "$id": "2934", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "2935", + "kind": "constant", + "valueType": { + "$id": "2936", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.EdgeNGramTokenFilterV2", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EdgeNGramTokenFilterV2.@odata.type", + "serializationOptions": { + "$id": "2937", + "json": { + "$id": "2938", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.ElisionTokenFilter": { + "$id": "2939", + "kind": "model", + "name": "ElisionTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ElisionTokenFilter", + "usage": "Input,Output,Json", + "doc": "Removes elisions. For example, \"l'avion\" (the plane) will be converted to\n\"avion\" (plane). This token filter is implemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.ElisionTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "2940", + "kind": "property", + "name": "articles", + "serializedName": "articles", + "doc": "The set of articles to remove.", + "type": { + "$id": "2941", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "2942", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ElisionTokenFilter.articles", + "serializationOptions": { + "$id": "2943", + "json": { + "$id": "2944", + "name": "articles" + } + } + }, + { + "$id": "2945", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "2946", + "kind": "constant", + "valueType": { + "$id": "2947", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.ElisionTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ElisionTokenFilter.@odata.type", + "serializationOptions": { + "$id": "2948", + "json": { + "$id": "2949", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.KeepTokenFilter": { + "$id": "2950", + "kind": "model", + "name": "KeepTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.KeepTokenFilter", + "usage": "Input,Output,Json", + "doc": "A token filter that only keeps tokens with text contained in a specified list\nof words. This token filter is implemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.KeepTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "2951", + "kind": "property", + "name": "keepWords", + "serializedName": "keepWords", + "doc": "The list of words to keep.", + "type": { + "$id": "2952", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "2953", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.KeepTokenFilter.keepWords", + "serializationOptions": { + "$id": "2954", + "json": { + "$id": "2955", + "name": "keepWords" + } + } + }, + { + "$id": "2956", + "kind": "property", + "name": "lowerCaseKeepWords", + "serializedName": "keepWordsCase", + "doc": "A value indicating whether to lower case all words first. Default is false.", + "type": { + "$id": "2957", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.KeepTokenFilter.keepWordsCase", + "serializationOptions": { + "$id": "2958", + "json": { + "$id": "2959", + "name": "keepWordsCase" + } + } + }, + { + "$id": "2960", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "2961", + "kind": "constant", + "valueType": { + "$id": "2962", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.KeepTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.KeepTokenFilter.@odata.type", + "serializationOptions": { + "$id": "2963", + "json": { + "$id": "2964", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.KeywordMarkerTokenFilter": { + "$id": "2965", + "kind": "model", + "name": "KeywordMarkerTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.KeywordMarkerTokenFilter", + "usage": "Input,Output,Json", + "doc": "Marks terms as keywords. This token filter is implemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.KeywordMarkerTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "2966", + "kind": "property", + "name": "keywords", + "serializedName": "keywords", + "doc": "A list of words to mark as keywords.", + "type": { + "$id": "2967", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "2968", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.KeywordMarkerTokenFilter.keywords", + "serializationOptions": { + "$id": "2969", + "json": { + "$id": "2970", + "name": "keywords" + } + } + }, + { + "$id": "2971", + "kind": "property", + "name": "ignoreCase", + "serializedName": "ignoreCase", + "doc": "A value indicating whether to ignore case. If true, all words are converted to\nlower case first. Default is false.", + "type": { + "$id": "2972", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.KeywordMarkerTokenFilter.ignoreCase", + "serializationOptions": { + "$id": "2973", + "json": { + "$id": "2974", + "name": "ignoreCase" + } + } + }, + { + "$id": "2975", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "2976", + "kind": "constant", + "valueType": { + "$id": "2977", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.KeywordMarkerTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.KeywordMarkerTokenFilter.@odata.type", + "serializationOptions": { + "$id": "2978", + "json": { + "$id": "2979", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.LengthTokenFilter": { + "$id": "2980", + "kind": "model", + "name": "LengthTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.LengthTokenFilter", + "usage": "Input,Output,Json", + "doc": "Removes words that are too long or too short. This token filter is implemented\nusing Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.LengthTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "2981", + "kind": "property", + "name": "minLength", + "serializedName": "min", + "doc": "The minimum length in characters. Default is 0. Maximum is 300. Must be less\nthan the value of max.", + "type": { + "$id": "2982", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LengthTokenFilter.min", + "serializationOptions": { + "$id": "2983", + "json": { + "$id": "2984", + "name": "min" + } + } + }, + { + "$id": "2985", + "kind": "property", + "name": "maxLength", + "serializedName": "max", + "doc": "The maximum length in characters. Default and maximum is 300.", + "type": { + "$id": "2986", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LengthTokenFilter.max", + "serializationOptions": { + "$id": "2987", + "json": { + "$id": "2988", + "name": "max" + } + } + }, + { + "$id": "2989", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "2990", + "kind": "constant", + "valueType": { + "$id": "2991", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.LengthTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LengthTokenFilter.@odata.type", + "serializationOptions": { + "$id": "2992", + "json": { + "$id": "2993", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.LimitTokenFilter": { + "$id": "2994", + "kind": "model", + "name": "LimitTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.LimitTokenFilter", + "usage": "Input,Output,Json", + "doc": "Limits the number of tokens while indexing. This token filter is implemented\nusing Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.LimitTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "2995", + "kind": "property", + "name": "maxTokenCount", + "serializedName": "maxTokenCount", + "doc": "The maximum number of tokens to produce. Default is 1.", + "type": { + "$id": "2996", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LimitTokenFilter.maxTokenCount", + "serializationOptions": { + "$id": "2997", + "json": { + "$id": "2998", + "name": "maxTokenCount" + } + } + }, + { + "$id": "2999", + "kind": "property", + "name": "consumeAllTokens", + "serializedName": "consumeAllTokens", + "doc": "A value indicating whether all tokens from the input must be consumed even if\nmaxTokenCount is reached. Default is false.", + "type": { + "$id": "3000", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LimitTokenFilter.consumeAllTokens", + "serializationOptions": { + "$id": "3001", + "json": { + "$id": "3002", + "name": "consumeAllTokens" + } + } + }, + { + "$id": "3003", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "3004", + "kind": "constant", + "valueType": { + "$id": "3005", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.LimitTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LimitTokenFilter.@odata.type", + "serializationOptions": { + "$id": "3006", + "json": { + "$id": "3007", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.NGramTokenFilterV2": { + "$id": "3008", + "kind": "model", + "name": "NGramTokenFilterV2", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.NGramTokenFilterV2", + "usage": "Input,Output,Json", + "doc": "Generates n-grams of the given size(s). This token filter is implemented using\nApache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.NGramTokenFilterV2", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "3009", + "kind": "property", + "name": "minGram", + "serializedName": "minGram", + "doc": "The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the\nvalue of maxGram.", + "type": { + "$id": "3010", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.NGramTokenFilterV2.minGram", + "serializationOptions": { + "$id": "3011", + "json": { + "$id": "3012", + "name": "minGram" + } + } + }, + { + "$id": "3013", + "kind": "property", + "name": "maxGram", + "serializedName": "maxGram", + "doc": "The maximum n-gram length. Default is 2. Maximum is 300.", + "type": { + "$id": "3014", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.NGramTokenFilterV2.maxGram", + "serializationOptions": { + "$id": "3015", + "json": { + "$id": "3016", + "name": "maxGram" + } + } + }, + { + "$id": "3017", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "3018", + "kind": "constant", + "valueType": { + "$id": "3019", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.NGramTokenFilterV2", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.NGramTokenFilterV2.@odata.type", + "serializationOptions": { + "$id": "3020", + "json": { + "$id": "3021", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.PatternCaptureTokenFilter": { + "$id": "3022", + "kind": "model", + "name": "PatternCaptureTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.PatternCaptureTokenFilter", + "usage": "Input,Output,Json", + "doc": "Uses Java regexes to emit multiple tokens - one for each capture group in one\nor more patterns. This token filter is implemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.PatternCaptureTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "3023", + "kind": "property", + "name": "patterns", + "serializedName": "patterns", + "doc": "A list of patterns to match against each token.", + "type": { + "$id": "3024", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "3025", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternCaptureTokenFilter.patterns", + "serializationOptions": { + "$id": "3026", + "json": { + "$id": "3027", + "name": "patterns" + } + } + }, + { + "$id": "3028", + "kind": "property", + "name": "preserveOriginal", + "serializedName": "preserveOriginal", + "doc": "A value indicating whether to return the original token even if one of the\npatterns matches. Default is true.", + "type": { + "$id": "3029", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternCaptureTokenFilter.preserveOriginal", + "serializationOptions": { + "$id": "3030", + "json": { + "$id": "3031", + "name": "preserveOriginal" + } + } + }, + { + "$id": "3032", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "3033", + "kind": "constant", + "valueType": { + "$id": "3034", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.PatternCaptureTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternCaptureTokenFilter.@odata.type", + "serializationOptions": { + "$id": "3035", + "json": { + "$id": "3036", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.PatternReplaceTokenFilter": { + "$id": "3037", + "kind": "model", + "name": "PatternReplaceTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.PatternReplaceTokenFilter", + "usage": "Input,Output,Json", + "doc": "A character filter that replaces characters in the input string. It uses a\nregular expression to identify character sequences to preserve and a\nreplacement pattern to identify characters to replace. For example, given the\ninput text \"aa bb aa bb\", pattern \"(aa)\\s+(bb)\", and replacement \"$1#$2\", the\nresult would be \"aa#bb aa#bb\". This token filter is implemented using Apache\nLucene.", + "discriminatorValue": "#Microsoft.Azure.Search.PatternReplaceTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "3038", + "kind": "property", + "name": "pattern", + "serializedName": "pattern", + "doc": "A regular expression pattern.", + "type": { + "$id": "3039", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternReplaceTokenFilter.pattern", + "serializationOptions": { + "$id": "3040", + "json": { + "$id": "3041", + "name": "pattern" + } + } + }, + { + "$id": "3042", + "kind": "property", + "name": "replacement", + "serializedName": "replacement", + "doc": "The replacement text.", + "type": { + "$id": "3043", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternReplaceTokenFilter.replacement", + "serializationOptions": { + "$id": "3044", + "json": { + "$id": "3045", + "name": "replacement" + } + } + }, + { + "$id": "3046", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "3047", + "kind": "constant", + "valueType": { + "$id": "3048", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.PatternReplaceTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternReplaceTokenFilter.@odata.type", + "serializationOptions": { + "$id": "3049", + "json": { + "$id": "3050", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.PhoneticTokenFilter": { + "$id": "3051", + "kind": "model", + "name": "PhoneticTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.PhoneticTokenFilter", + "usage": "Input,Output,Json", + "doc": "Create tokens for phonetic matches. This token filter is implemented using\nApache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.PhoneticTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "3052", + "kind": "property", + "name": "encoder", + "serializedName": "encoder", + "doc": "The phonetic encoder to use. Default is \"metaphone\".", + "type": { + "$ref": "655" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PhoneticTokenFilter.encoder", + "serializationOptions": { + "$id": "3053", + "json": { + "$id": "3054", + "name": "encoder" + } + } + }, + { + "$id": "3055", + "kind": "property", + "name": "replaceOriginalTokens", + "serializedName": "replace", + "doc": "A value indicating whether encoded tokens should replace original tokens. If\nfalse, encoded tokens are added as synonyms. Default is true.", + "type": { + "$id": "3056", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PhoneticTokenFilter.replace", + "serializationOptions": { + "$id": "3057", + "json": { + "$id": "3058", + "name": "replace" + } + } + }, + { + "$id": "3059", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "3060", + "kind": "constant", + "valueType": { + "$id": "3061", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.PhoneticTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PhoneticTokenFilter.@odata.type", + "serializationOptions": { + "$id": "3062", + "json": { + "$id": "3063", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.ShingleTokenFilter": { + "$id": "3064", + "kind": "model", + "name": "ShingleTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ShingleTokenFilter", + "usage": "Input,Output,Json", + "doc": "Creates combinations of tokens as a single token. This token filter is\nimplemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.ShingleTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "3065", + "kind": "property", + "name": "maxShingleSize", + "serializedName": "maxShingleSize", + "doc": "The maximum shingle size. Default and minimum value is 2.", + "type": { + "$id": "3066", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ShingleTokenFilter.maxShingleSize", + "serializationOptions": { + "$id": "3067", + "json": { + "$id": "3068", + "name": "maxShingleSize" + } + } + }, + { + "$id": "3069", + "kind": "property", + "name": "minShingleSize", + "serializedName": "minShingleSize", + "doc": "The minimum shingle size. Default and minimum value is 2. Must be less than the\nvalue of maxShingleSize.", + "type": { + "$id": "3070", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ShingleTokenFilter.minShingleSize", + "serializationOptions": { + "$id": "3071", + "json": { + "$id": "3072", + "name": "minShingleSize" + } + } + }, + { + "$id": "3073", + "kind": "property", + "name": "outputUnigrams", + "serializedName": "outputUnigrams", + "doc": "A value indicating whether the output stream will contain the input tokens\n(unigrams) as well as shingles. Default is true.", + "type": { + "$id": "3074", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ShingleTokenFilter.outputUnigrams", + "serializationOptions": { + "$id": "3075", + "json": { + "$id": "3076", + "name": "outputUnigrams" + } + } + }, + { + "$id": "3077", + "kind": "property", + "name": "outputUnigramsIfNoShingles", + "serializedName": "outputUnigramsIfNoShingles", + "doc": "A value indicating whether to output unigrams for those times when no shingles\nare available. This property takes precedence when outputUnigrams is set to\nfalse. Default is false.", + "type": { + "$id": "3078", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ShingleTokenFilter.outputUnigramsIfNoShingles", + "serializationOptions": { + "$id": "3079", + "json": { + "$id": "3080", + "name": "outputUnigramsIfNoShingles" + } + } + }, + { + "$id": "3081", + "kind": "property", + "name": "tokenSeparator", + "serializedName": "tokenSeparator", + "doc": "The string to use when joining adjacent tokens to form a shingle. Default is a\nsingle space (\" \").", + "type": { + "$id": "3082", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ShingleTokenFilter.tokenSeparator", + "serializationOptions": { + "$id": "3083", + "json": { + "$id": "3084", + "name": "tokenSeparator" + } + } + }, + { + "$id": "3085", + "kind": "property", + "name": "filterToken", + "serializedName": "filterToken", + "doc": "The string to insert for each position at which there is no token. Default is\nan underscore (\"_\").", + "type": { + "$id": "3086", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ShingleTokenFilter.filterToken", + "serializationOptions": { + "$id": "3087", + "json": { + "$id": "3088", + "name": "filterToken" + } + } + }, + { + "$id": "3089", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "3090", + "kind": "constant", + "valueType": { + "$id": "3091", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.ShingleTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ShingleTokenFilter.@odata.type", + "serializationOptions": { + "$id": "3092", + "json": { + "$id": "3093", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.SnowballTokenFilter": { + "$id": "3094", + "kind": "model", + "name": "SnowballTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SnowballTokenFilter", + "usage": "Input,Output,Json", + "doc": "A filter that stems words using a Snowball-generated stemmer. This token filter\nis implemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.SnowballTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "3095", + "kind": "property", + "name": "language", + "serializedName": "language", + "doc": "The language to use.", + "type": { + "$ref": "679" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SnowballTokenFilter.language", + "serializationOptions": { + "$id": "3096", + "json": { + "$id": "3097", + "name": "language" + } + } + }, + { + "$id": "3098", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "3099", + "kind": "constant", + "valueType": { + "$id": "3100", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.SnowballTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SnowballTokenFilter.@odata.type", + "serializationOptions": { + "$id": "3101", + "json": { + "$id": "3102", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.StemmerTokenFilter": { + "$id": "3103", + "kind": "model", + "name": "StemmerTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.StemmerTokenFilter", + "usage": "Input,Output,Json", + "doc": "Language specific stemming filter. This token filter is implemented using\nApache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.StemmerTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "3104", + "kind": "property", + "name": "language", + "serializedName": "language", + "doc": "The language to use.", + "type": { + "$ref": "725" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.StemmerTokenFilter.language", + "serializationOptions": { + "$id": "3105", + "json": { + "$id": "3106", + "name": "language" + } + } + }, + { + "$id": "3107", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "3108", + "kind": "constant", + "valueType": { + "$id": "3109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.StemmerTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.StemmerTokenFilter.@odata.type", + "serializationOptions": { + "$id": "3110", + "json": { + "$id": "3111", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.StemmerOverrideTokenFilter": { + "$id": "3112", + "kind": "model", + "name": "StemmerOverrideTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.StemmerOverrideTokenFilter", + "usage": "Input,Output,Json", + "doc": "Provides the ability to override other stemming filters with custom\ndictionary-based stemming. Any dictionary-stemmed terms will be marked as\nkeywords so that they will not be stemmed with stemmers down the chain. Must be\nplaced before any stemming filters. This token filter is implemented using\nApache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.StemmerOverrideTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "3113", + "kind": "property", + "name": "rules", + "serializedName": "rules", + "doc": "A list of stemming rules in the following format: \"word => stem\", for example:\n\"ran => run\".", + "type": { + "$id": "3114", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "3115", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.StemmerOverrideTokenFilter.rules", + "serializationOptions": { + "$id": "3116", + "json": { + "$id": "3117", + "name": "rules" + } + } + }, + { + "$id": "3118", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "3119", + "kind": "constant", + "valueType": { + "$id": "3120", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.StemmerOverrideTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.StemmerOverrideTokenFilter.@odata.type", + "serializationOptions": { + "$id": "3121", + "json": { + "$id": "3122", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.StopwordsTokenFilter": { + "$id": "3123", + "kind": "model", + "name": "StopwordsTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.StopwordsTokenFilter", + "usage": "Input,Output,Json", + "doc": "Removes stop words from a token stream. This token filter is implemented using\nApache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.StopwordsTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "3124", + "kind": "property", + "name": "stopwords", + "serializedName": "stopwords", + "doc": "The list of stopwords. This property and the stopwords list property cannot\nboth be set.", + "type": { + "$id": "3125", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "3126", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.StopwordsTokenFilter.stopwords", + "serializationOptions": { + "$id": "3127", + "json": { + "$id": "3128", + "name": "stopwords" + } + } + }, + { + "$id": "3129", + "kind": "property", + "name": "stopwordsList", + "serializedName": "stopwordsList", + "doc": "A predefined list of stopwords to use. This property and the stopwords property\ncannot both be set. Default is English.", + "type": { + "$ref": "835" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.StopwordsTokenFilter.stopwordsList", + "serializationOptions": { + "$id": "3130", + "json": { + "$id": "3131", + "name": "stopwordsList" + } + } + }, + { + "$id": "3132", + "kind": "property", + "name": "ignoreCase", + "serializedName": "ignoreCase", + "doc": "A value indicating whether to ignore case. If true, all words are converted to\nlower case first. Default is false.", + "type": { + "$id": "3133", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.StopwordsTokenFilter.ignoreCase", + "serializationOptions": { + "$id": "3134", + "json": { + "$id": "3135", + "name": "ignoreCase" + } + } + }, + { + "$id": "3136", + "kind": "property", + "name": "removeTrailingStopWords", + "serializedName": "removeTrailing", + "doc": "A value indicating whether to ignore the last search term if it's a stop word.\nDefault is true.", + "type": { + "$id": "3137", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.StopwordsTokenFilter.removeTrailing", + "serializationOptions": { + "$id": "3138", + "json": { + "$id": "3139", + "name": "removeTrailing" + } + } + }, + { + "$id": "3140", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "3141", + "kind": "constant", + "valueType": { + "$id": "3142", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.StopwordsTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.StopwordsTokenFilter.@odata.type", + "serializationOptions": { + "$id": "3143", + "json": { + "$id": "3144", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.SynonymTokenFilter": { + "$id": "3145", + "kind": "model", + "name": "SynonymTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SynonymTokenFilter", + "usage": "Input,Output,Json", + "doc": "Matches single or multi-word synonyms in a token stream. This token filter is\nimplemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.SynonymTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "3146", + "kind": "property", + "name": "synonyms", + "serializedName": "synonyms", + "doc": "A list of synonyms in following one of two formats: 1. incredible,\nunbelievable, fabulous => amazing - all terms on the left side of => symbol\nwill be replaced with all terms on its right side; 2. incredible, unbelievable,\nfabulous, amazing - comma separated list of equivalent words. Set the expand\noption to change how this list is interpreted.", + "type": { + "$id": "3147", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "3148", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SynonymTokenFilter.synonyms", + "serializationOptions": { + "$id": "3149", + "json": { + "$id": "3150", + "name": "synonyms" + } + } + }, + { + "$id": "3151", + "kind": "property", + "name": "ignoreCase", + "serializedName": "ignoreCase", + "doc": "A value indicating whether to case-fold input for matching. Default is false.", + "type": { + "$id": "3152", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SynonymTokenFilter.ignoreCase", + "serializationOptions": { + "$id": "3153", + "json": { + "$id": "3154", + "name": "ignoreCase" + } + } + }, + { + "$id": "3155", + "kind": "property", + "name": "expand", + "serializedName": "expand", + "doc": "A value indicating whether all words in the list of synonyms (if => notation is\nnot used) will map to one another. If true, all words in the list of synonyms\n(if => notation is not used) will map to one another. The following list:\nincredible, unbelievable, fabulous, amazing is equivalent to: incredible,\nunbelievable, fabulous, amazing => incredible, unbelievable, fabulous, amazing.\nIf false, the following list: incredible, unbelievable, fabulous, amazing will\nbe equivalent to: incredible, unbelievable, fabulous, amazing => incredible.\nDefault is true.", + "type": { + "$id": "3156", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SynonymTokenFilter.expand", + "serializationOptions": { + "$id": "3157", + "json": { + "$id": "3158", + "name": "expand" + } + } + }, + { + "$id": "3159", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "3160", + "kind": "constant", + "valueType": { + "$id": "3161", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.SynonymTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SynonymTokenFilter.@odata.type", + "serializationOptions": { + "$id": "3162", + "json": { + "$id": "3163", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.TruncateTokenFilter": { + "$id": "3164", + "kind": "model", + "name": "TruncateTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.TruncateTokenFilter", + "usage": "Input,Output,Json", + "doc": "Truncates the terms to a specific length. This token filter is implemented\nusing Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.TruncateTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "3165", + "kind": "property", + "name": "length", + "serializedName": "length", + "doc": "The length at which terms will be truncated. Default and maximum is 300.", + "type": { + "$id": "3166", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.TruncateTokenFilter.length", + "serializationOptions": { + "$id": "3167", + "json": { + "$id": "3168", + "name": "length" + } + } + }, + { + "$id": "3169", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "3170", + "kind": "constant", + "valueType": { + "$id": "3171", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.TruncateTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.TruncateTokenFilter.@odata.type", + "serializationOptions": { + "$id": "3172", + "json": { + "$id": "3173", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.UniqueTokenFilter": { + "$id": "3174", + "kind": "model", + "name": "UniqueTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.UniqueTokenFilter", + "usage": "Input,Output,Json", + "doc": "Filters out tokens with same text as the previous token. This token filter is\nimplemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.UniqueTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "3175", + "kind": "property", + "name": "onlyOnSamePosition", + "serializedName": "onlyOnSamePosition", + "doc": "A value indicating whether to remove duplicates only at the same position.\nDefault is false.", + "type": { + "$id": "3176", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.UniqueTokenFilter.onlyOnSamePosition", + "serializationOptions": { + "$id": "3177", + "json": { + "$id": "3178", + "name": "onlyOnSamePosition" + } + } + }, + { + "$id": "3179", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "3180", + "kind": "constant", + "valueType": { + "$id": "3181", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.UniqueTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.UniqueTokenFilter.@odata.type", + "serializationOptions": { + "$id": "3182", + "json": { + "$id": "3183", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.WordDelimiterTokenFilter": { + "$id": "3184", + "kind": "model", + "name": "WordDelimiterTokenFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.WordDelimiterTokenFilter", + "usage": "Input,Output,Json", + "doc": "Splits words into subwords and performs optional transformations on subword\ngroups. This token filter is implemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.WordDelimiterTokenFilter", + "decorators": [], + "baseModel": { + "$ref": "2842" + }, + "properties": [ + { + "$id": "3185", + "kind": "property", + "name": "generateWordParts", + "serializedName": "generateWordParts", + "doc": "A value indicating whether to generate part words. If set, causes parts of\nwords to be generated; for example \"AzureSearch\" becomes \"Azure\" \"Search\".\nDefault is true.", + "type": { + "$id": "3186", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WordDelimiterTokenFilter.generateWordParts", + "serializationOptions": { + "$id": "3187", + "json": { + "$id": "3188", + "name": "generateWordParts" + } + } + }, + { + "$id": "3189", + "kind": "property", + "name": "generateNumberParts", + "serializedName": "generateNumberParts", + "doc": "A value indicating whether to generate number subwords. Default is true.", + "type": { + "$id": "3190", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WordDelimiterTokenFilter.generateNumberParts", + "serializationOptions": { + "$id": "3191", + "json": { + "$id": "3192", + "name": "generateNumberParts" + } + } + }, + { + "$id": "3193", + "kind": "property", + "name": "catenateWords", + "serializedName": "catenateWords", + "doc": "A value indicating whether maximum runs of word parts will be catenated. For\nexample, if this is set to true, \"Azure-Search\" becomes \"AzureSearch\". Default\nis false.", + "type": { + "$id": "3194", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WordDelimiterTokenFilter.catenateWords", + "serializationOptions": { + "$id": "3195", + "json": { + "$id": "3196", + "name": "catenateWords" + } + } + }, + { + "$id": "3197", + "kind": "property", + "name": "catenateNumbers", + "serializedName": "catenateNumbers", + "doc": "A value indicating whether maximum runs of number parts will be catenated. For\nexample, if this is set to true, \"1-2\" becomes \"12\". Default is false.", + "type": { + "$id": "3198", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WordDelimiterTokenFilter.catenateNumbers", + "serializationOptions": { + "$id": "3199", + "json": { + "$id": "3200", + "name": "catenateNumbers" + } + } + }, + { + "$id": "3201", + "kind": "property", + "name": "catenateAll", + "serializedName": "catenateAll", + "doc": "A value indicating whether all subword parts will be catenated. For example, if\nthis is set to true, \"Azure-Search-1\" becomes \"AzureSearch1\". Default is false.", + "type": { + "$id": "3202", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WordDelimiterTokenFilter.catenateAll", + "serializationOptions": { + "$id": "3203", + "json": { + "$id": "3204", + "name": "catenateAll" + } + } + }, + { + "$id": "3205", + "kind": "property", + "name": "splitOnCaseChange", + "serializedName": "splitOnCaseChange", + "doc": "A value indicating whether to split words on caseChange. For example, if this\nis set to true, \"AzureSearch\" becomes \"Azure\" \"Search\". Default is true.", + "type": { + "$id": "3206", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WordDelimiterTokenFilter.splitOnCaseChange", + "serializationOptions": { + "$id": "3207", + "json": { + "$id": "3208", + "name": "splitOnCaseChange" + } + } + }, + { + "$id": "3209", + "kind": "property", + "name": "preserveOriginal", + "serializedName": "preserveOriginal", + "doc": "A value indicating whether original words will be preserved and added to the\nsubword list. Default is false.", + "type": { + "$id": "3210", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WordDelimiterTokenFilter.preserveOriginal", + "serializationOptions": { + "$id": "3211", + "json": { + "$id": "3212", + "name": "preserveOriginal" + } + } + }, + { + "$id": "3213", + "kind": "property", + "name": "splitOnNumerics", + "serializedName": "splitOnNumerics", + "doc": "A value indicating whether to split on numbers. For example, if this is set to\ntrue, \"Azure1Search\" becomes \"Azure\" \"1\" \"Search\". Default is true.", + "type": { + "$id": "3214", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WordDelimiterTokenFilter.splitOnNumerics", + "serializationOptions": { + "$id": "3215", + "json": { + "$id": "3216", + "name": "splitOnNumerics" + } + } + }, + { + "$id": "3217", + "kind": "property", + "name": "stemEnglishPossessive", + "serializedName": "stemEnglishPossessive", + "doc": "A value indicating whether to remove trailing \"'s\" for each subword. Default is\ntrue.", + "type": { + "$id": "3218", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WordDelimiterTokenFilter.stemEnglishPossessive", + "serializationOptions": { + "$id": "3219", + "json": { + "$id": "3220", + "name": "stemEnglishPossessive" + } + } + }, + { + "$id": "3221", + "kind": "property", + "name": "protectedWords", + "serializedName": "protectedWords", + "doc": "A list of tokens to protect from being delimited.", + "type": { + "$id": "3222", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "3223", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WordDelimiterTokenFilter.protectedWords", + "serializationOptions": { + "$id": "3224", + "json": { + "$id": "3225", + "name": "protectedWords" + } + } + }, + { + "$id": "3226", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of token filter.", + "type": { + "$id": "3227", + "kind": "constant", + "valueType": { + "$id": "3228", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.WordDelimiterTokenFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WordDelimiterTokenFilter.@odata.type", + "serializationOptions": { + "$id": "3229", + "json": { + "$id": "3230", + "name": "@odata.type" + } + } + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndex.tokenFilters", + "serializationOptions": { + "$id": "3231", + "json": { + "$id": "3232", + "name": "tokenFilters" + } + } + }, + { + "$id": "3233", + "kind": "property", + "name": "charFilters", + "serializedName": "charFilters", + "doc": "The character filters for the index.", + "type": { + "$id": "3234", + "kind": "array", + "name": "ArrayCharFilter", + "valueType": { + "$id": "3235", + "kind": "model", + "name": "CharFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.CharFilter", + "usage": "Input,Output,Json", + "doc": "Base type for character filters.", + "decorators": [], + "discriminatorProperty": { + "$id": "3236", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "The discriminator for derived types.", + "type": { + "$id": "3237", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CharFilter.@odata.type", + "serializationOptions": { + "$id": "3238", + "json": { + "$id": "3239", + "name": "@odata.type" + } + } + }, + "properties": [ + { + "$ref": "3236" + }, + { + "$id": "3240", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the char filter. It must only contain letters, digits, spaces,\ndashes or underscores, can only start and end with alphanumeric characters, and\nis limited to 128 characters.", + "type": { + "$id": "3241", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CharFilter.name", + "serializationOptions": { + "$id": "3242", + "json": { + "$id": "3243", + "name": "name" + } + } + } + ], + "discriminatedSubtypes": { + "$id": "3244", + "#Microsoft.Azure.Search.MappingCharFilter": { + "$id": "3245", + "kind": "model", + "name": "MappingCharFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.MappingCharFilter", + "usage": "Input,Output,Json", + "doc": "A character filter that applies mappings defined with the mappings option.\nMatching is greedy (longest pattern matching at a given point wins).\nReplacement is allowed to be the empty string. This character filter is\nimplemented using Apache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.MappingCharFilter", + "decorators": [], + "baseModel": { + "$ref": "3235" + }, + "properties": [ + { + "$id": "3246", + "kind": "property", + "name": "mappings", + "serializedName": "mappings", + "doc": "A list of mappings of the following format: \"a=>b\" (all occurrences of the\ncharacter \"a\" will be replaced with character \"b\").", + "type": { + "$id": "3247", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "3248", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MappingCharFilter.mappings", + "serializationOptions": { + "$id": "3249", + "json": { + "$id": "3250", + "name": "mappings" + } + } + }, + { + "$id": "3251", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of char filter.", + "type": { + "$id": "3252", + "kind": "constant", + "valueType": { + "$id": "3253", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.MappingCharFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MappingCharFilter.@odata.type", + "serializationOptions": { + "$id": "3254", + "json": { + "$id": "3255", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.PatternReplaceCharFilter": { + "$id": "3256", + "kind": "model", + "name": "PatternReplaceCharFilter", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.PatternReplaceCharFilter", + "usage": "Input,Output,Json", + "doc": "A character filter that replaces characters in the input string. It uses a\nregular expression to identify character sequences to preserve and a\nreplacement pattern to identify characters to replace. For example, given the\ninput text \"aa bb aa bb\", pattern \"(aa)\\s+(bb)\", and replacement \"$1#$2\", the\nresult would be \"aa#bb aa#bb\". This character filter is implemented using\nApache Lucene.", + "discriminatorValue": "#Microsoft.Azure.Search.PatternReplaceCharFilter", + "decorators": [], + "baseModel": { + "$ref": "3235" + }, + "properties": [ + { + "$id": "3257", + "kind": "property", + "name": "pattern", + "serializedName": "pattern", + "doc": "A regular expression pattern.", + "type": { + "$id": "3258", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternReplaceCharFilter.pattern", + "serializationOptions": { + "$id": "3259", + "json": { + "$id": "3260", + "name": "pattern" + } + } + }, + { + "$id": "3261", + "kind": "property", + "name": "replacement", + "serializedName": "replacement", + "doc": "The replacement text.", + "type": { + "$id": "3262", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternReplaceCharFilter.replacement", + "serializationOptions": { + "$id": "3263", + "json": { + "$id": "3264", + "name": "replacement" + } + } + }, + { + "$id": "3265", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of char filter.", + "type": { + "$id": "3266", + "kind": "constant", + "valueType": { + "$id": "3267", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.PatternReplaceCharFilter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PatternReplaceCharFilter.@odata.type", + "serializationOptions": { + "$id": "3268", + "json": { + "$id": "3269", + "name": "@odata.type" + } + } + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndex.charFilters", + "serializationOptions": { + "$id": "3270", + "json": { + "$id": "3271", + "name": "charFilters" + } + } + }, + { + "$id": "3272", + "kind": "property", + "name": "encryptionKey", + "serializedName": "encryptionKey", + "doc": "A description of an encryption key that you create in Azure Key Vault. This key\nis used to provide an additional level of encryption-at-rest for your data when\nyou want full assurance that no one, not even Microsoft, can decrypt your data.\nOnce you have encrypted your data, it will always remain encrypted. The search\nservice will ignore attempts to set this property to null. You can change this\nproperty as needed if you want to rotate your encryption key; Your data will be\nunaffected. Encryption with customer-managed keys is not available for free\nsearch services, and is only available for paid services created on or after\nJanuary 1, 2019.", + "type": { + "$id": "3273", + "kind": "model", + "name": "SearchResourceEncryptionKey", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchResourceEncryptionKey", + "usage": "Input,Output,Json", + "doc": "A customer-managed encryption key in Azure Key Vault. Keys that you create and\nmanage can be used to encrypt or decrypt data-at-rest, such as indexes and\nsynonym maps.", + "decorators": [], + "properties": [ + { + "$id": "3274", + "kind": "property", + "name": "keyName", + "serializedName": "keyVaultKeyName", + "doc": "The name of your Azure Key Vault key to be used to encrypt your data at rest.", + "type": { + "$id": "3275", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchResourceEncryptionKey.keyVaultKeyName", + "serializationOptions": { + "$id": "3276", + "json": { + "$id": "3277", + "name": "keyVaultKeyName" + } + } + }, + { + "$id": "3278", + "kind": "property", + "name": "keyVersion", + "serializedName": "keyVaultKeyVersion", + "doc": "The version of your Azure Key Vault key to be used to encrypt your data at rest.", + "type": { + "$id": "3279", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchResourceEncryptionKey.keyVaultKeyVersion", + "serializationOptions": { + "$id": "3280", + "json": { + "$id": "3281", + "name": "keyVaultKeyVersion" + } + } + }, + { + "$id": "3282", + "kind": "property", + "name": "vaultUri", + "serializedName": "keyVaultUri", + "doc": "The URI of your Azure Key Vault, also referred to as DNS name, that contains\nthe key to be used to encrypt your data at rest. An example URI might be\n`https://my-keyvault-name.vault.azure.net`.", + "type": { + "$id": "3283", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchResourceEncryptionKey.keyVaultUri", + "serializationOptions": { + "$id": "3284", + "json": { + "$id": "3285", + "name": "keyVaultUri" + } + } + }, + { + "$id": "3286", + "kind": "property", + "name": "accessCredentials", + "serializedName": "accessCredentials", + "doc": "Optional Azure Active Directory credentials used for accessing your Azure Key\nVault. Not required if using managed identity instead.", + "type": { + "$id": "3287", + "kind": "model", + "name": "AzureActiveDirectoryApplicationCredentials", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.AzureActiveDirectoryApplicationCredentials", + "usage": "Input,Output,Json", + "doc": "Credentials of a registered application created for your search service, used\nfor authenticated access to the encryption keys stored in Azure Key Vault.", + "decorators": [], + "properties": [ + { + "$id": "3288", + "kind": "property", + "name": "applicationId", + "serializedName": "applicationId", + "doc": "An AAD Application ID that was granted the required access permissions to the\nAzure Key Vault that is to be used when encrypting your data at rest. The\nApplication ID should not be confused with the Object ID for your AAD\nApplication.", + "type": { + "$id": "3289", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AzureActiveDirectoryApplicationCredentials.applicationId", + "serializationOptions": { + "$id": "3290", + "json": { + "$id": "3291", + "name": "applicationId" + } + } + }, + { + "$id": "3292", + "kind": "property", + "name": "applicationSecret", + "serializedName": "applicationSecret", + "doc": "The authentication key of the specified AAD application.", + "type": { + "$id": "3293", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AzureActiveDirectoryApplicationCredentials.applicationSecret", + "serializationOptions": { + "$id": "3294", + "json": { + "$id": "3295", + "name": "applicationSecret" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchResourceEncryptionKey.accessCredentials", + "serializationOptions": { + "$id": "3296", + "json": { + "$id": "3297", + "name": "accessCredentials" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndex.encryptionKey", + "serializationOptions": { + "$id": "3298", + "json": { + "$id": "3299", + "name": "encryptionKey" + } + } + }, + { + "$id": "3300", + "kind": "property", + "name": "similarity", + "serializedName": "similarity", + "doc": "The type of similarity algorithm to be used when scoring and ranking the\ndocuments matching a search query. The similarity algorithm can only be defined\nat index creation time and cannot be modified on existing indexes. If null, the\nClassicSimilarity algorithm is used.", + "type": { + "$id": "3301", + "kind": "model", + "name": "SimilarityAlgorithm", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SimilarityAlgorithm", + "usage": "Input,Output,Json", + "doc": "Base type for similarity algorithms. Similarity algorithms are used to\ncalculate scores that tie queries to documents. The higher the score, the more\nrelevant the document is to that specific query. Those scores are used to rank\nthe search results.", + "decorators": [], + "discriminatorProperty": { + "$id": "3302", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "The discriminator for derived types.", + "type": { + "$id": "3303", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SimilarityAlgorithm.@odata.type", + "serializationOptions": { + "$id": "3304", + "json": { + "$id": "3305", + "name": "@odata.type" + } + } + }, + "properties": [ + { + "$ref": "3302" + } + ], + "discriminatedSubtypes": { + "$id": "3306", + "#Microsoft.Azure.Search.ClassicSimilarity": { + "$id": "3307", + "kind": "model", + "name": "ClassicSimilarityAlgorithm", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ClassicSimilarityAlgorithm", + "usage": "Input,Output,Json", + "doc": "Legacy similarity algorithm which uses the Lucene TFIDFSimilarity\nimplementation of TF-IDF. This variation of TF-IDF introduces static document\nlength normalization as well as coordinating factors that penalize documents\nthat only partially match the searched queries.", + "discriminatorValue": "#Microsoft.Azure.Search.ClassicSimilarity", + "decorators": [], + "baseModel": { + "$ref": "3301" + }, + "properties": [ + { + "$id": "3308", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "The discriminator for derived types.", + "type": { + "$id": "3309", + "kind": "constant", + "valueType": { + "$id": "3310", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.ClassicSimilarity", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ClassicSimilarityAlgorithm.@odata.type", + "serializationOptions": { + "$id": "3311", + "json": { + "$id": "3312", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.BM25Similarity": { + "$id": "3313", + "kind": "model", + "name": "BM25SimilarityAlgorithm", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.BM25SimilarityAlgorithm", + "usage": "Input,Output,Json", + "doc": "Ranking function based on the Okapi BM25 similarity algorithm. BM25 is a\nTF-IDF-like algorithm that includes length normalization (controlled by the 'b'\nparameter) as well as term frequency saturation (controlled by the 'k1'\nparameter).", + "discriminatorValue": "#Microsoft.Azure.Search.BM25Similarity", + "decorators": [], + "baseModel": { + "$ref": "3301" + }, + "properties": [ + { + "$id": "3314", + "kind": "property", + "name": "k1", + "serializedName": "k1", + "doc": "This property controls the scaling function between the term frequency of each\nmatching terms and the final relevance score of a document-query pair. By\ndefault, a value of 1.2 is used. A value of 0.0 means the score does not scale\nwith an increase in term frequency.", + "type": { + "$id": "3315", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.BM25SimilarityAlgorithm.k1", + "serializationOptions": { + "$id": "3316", + "json": { + "$id": "3317", + "name": "k1" + } + } + }, + { + "$id": "3318", + "kind": "property", + "name": "b", + "serializedName": "b", + "doc": "This property controls how the length of a document affects the relevance\nscore. By default, a value of 0.75 is used. A value of 0.0 means no length\nnormalization is applied, while a value of 1.0 means the score is fully\nnormalized by the length of the document.", + "type": { + "$id": "3319", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.BM25SimilarityAlgorithm.b", + "serializationOptions": { + "$id": "3320", + "json": { + "$id": "3321", + "name": "b" + } + } + }, + { + "$id": "3322", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "The discriminator for derived types.", + "type": { + "$id": "3323", + "kind": "constant", + "valueType": { + "$id": "3324", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.BM25Similarity", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.BM25SimilarityAlgorithm.@odata.type", + "serializationOptions": { + "$id": "3325", + "json": { + "$id": "3326", + "name": "@odata.type" + } + } + } + ] + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndex.similarity", + "serializationOptions": { + "$id": "3327", + "json": { + "$id": "3328", + "name": "similarity" + } + } + }, + { + "$id": "3329", + "kind": "property", + "name": "semanticSearch", + "serializedName": "semantic", + "doc": "Defines parameters for a search index that influence semantic capabilities.", + "type": { + "$id": "3330", + "kind": "model", + "name": "SemanticSearch", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SemanticSearch", + "usage": "Input,Output,Json", + "doc": "Defines parameters for a search index that influence semantic capabilities.", + "decorators": [], + "properties": [ + { + "$id": "3331", + "kind": "property", + "name": "defaultConfigurationName", + "serializedName": "defaultConfiguration", + "doc": "Allows you to set the name of a default semantic configuration in your index,\nmaking it optional to pass it on as a query parameter every time.", + "type": { + "$id": "3332", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SemanticSearch.defaultConfiguration", + "serializationOptions": { + "$id": "3333", + "json": { + "$id": "3334", + "name": "defaultConfiguration" + } + } + }, + { + "$id": "3335", + "kind": "property", + "name": "configurations", + "serializedName": "configurations", + "doc": "The semantic configurations for the index.", + "type": { + "$id": "3336", + "kind": "array", + "name": "ArraySemanticConfiguration", + "valueType": { + "$id": "3337", + "kind": "model", + "name": "SemanticConfiguration", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SemanticConfiguration", + "usage": "Input,Output,Json", + "doc": "Defines a specific configuration to be used in the context of semantic\ncapabilities.", + "decorators": [], + "properties": [ + { + "$id": "3338", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the semantic configuration.", + "type": { + "$id": "3339", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SemanticConfiguration.name", + "serializationOptions": { + "$id": "3340", + "json": { + "$id": "3341", + "name": "name" + } + } + }, + { + "$id": "3342", + "kind": "property", + "name": "prioritizedFields", + "serializedName": "prioritizedFields", + "doc": "Describes the title, content, and keyword fields to be used for semantic\nranking, captions, highlights, and answers. At least one of the three sub\nproperties (titleField, prioritizedKeywordsFields and prioritizedContentFields)\nneed to be set.", + "type": { + "$id": "3343", + "kind": "model", + "name": "SemanticPrioritizedFields", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SemanticPrioritizedFields", + "usage": "Input,Output,Json", + "doc": "Describes the title, content, and keywords fields to be used for semantic\nranking, captions, highlights, and answers.", + "decorators": [], + "properties": [ + { + "$id": "3344", + "kind": "property", + "name": "titleField", + "serializedName": "titleField", + "doc": "Defines the title field to be used for semantic ranking, captions, highlights,\nand answers. If you don't have a title field in your index, leave this blank.", + "type": { + "$id": "3345", + "kind": "model", + "name": "SemanticField", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SemanticField", + "usage": "Input,Output,Json", + "doc": "A field that is used as part of the semantic configuration.", + "decorators": [], + "properties": [ + { + "$id": "3346", + "kind": "property", + "name": "fieldName", + "serializedName": "fieldName", + "doc": "File name", + "type": { + "$id": "3347", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SemanticField.fieldName", + "serializationOptions": { + "$id": "3348", + "json": { + "$id": "3349", + "name": "fieldName" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SemanticPrioritizedFields.titleField", + "serializationOptions": { + "$id": "3350", + "json": { + "$id": "3351", + "name": "titleField" + } + } + }, + { + "$id": "3352", + "kind": "property", + "name": "contentFields", + "serializedName": "prioritizedContentFields", + "doc": "Defines the content fields to be used for semantic ranking, captions,\nhighlights, and answers. For the best result, the selected fields should\ncontain text in natural language form. The order of the fields in the array\nrepresents their priority. Fields with lower priority may get truncated if the\ncontent is long.", + "type": { + "$id": "3353", + "kind": "array", + "name": "ArraySemanticField", + "valueType": { + "$ref": "3345" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SemanticPrioritizedFields.prioritizedContentFields", + "serializationOptions": { + "$id": "3354", + "json": { + "$id": "3355", + "name": "prioritizedContentFields" + } + } + }, + { + "$id": "3356", + "kind": "property", + "name": "keywordsFields", + "serializedName": "prioritizedKeywordsFields", + "doc": "Defines the keyword fields to be used for semantic ranking, captions,\nhighlights, and answers. For the best result, the selected fields should\ncontain a list of keywords. The order of the fields in the array represents\ntheir priority. Fields with lower priority may get truncated if the content is\nlong.", + "type": { + "$id": "3357", + "kind": "array", + "name": "ArraySemanticField", + "valueType": { + "$ref": "3345" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SemanticPrioritizedFields.prioritizedKeywordsFields", + "serializationOptions": { + "$id": "3358", + "json": { + "$id": "3359", + "name": "prioritizedKeywordsFields" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SemanticConfiguration.prioritizedFields", + "serializationOptions": { + "$id": "3360", + "json": { + "$id": "3361", + "name": "prioritizedFields" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SemanticSearch.configurations", + "serializationOptions": { + "$id": "3362", + "json": { + "$id": "3363", + "name": "configurations" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndex.semantic", + "serializationOptions": { + "$id": "3364", + "json": { + "$id": "3365", + "name": "semantic" + } + } + }, + { + "$id": "3366", + "kind": "property", + "name": "vectorSearch", + "serializedName": "vectorSearch", + "doc": "Contains configuration options related to vector search.", + "type": { + "$id": "3367", + "kind": "model", + "name": "VectorSearch", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.VectorSearch", + "usage": "Input,Output,Json", + "doc": "Contains configuration options related to vector search.", + "decorators": [], + "properties": [ + { + "$id": "3368", + "kind": "property", + "name": "profiles", + "serializedName": "profiles", + "doc": "Defines combinations of configurations to use with vector search.", + "type": { + "$id": "3369", + "kind": "array", + "name": "ArrayVectorSearchProfile", + "valueType": { + "$id": "3370", + "kind": "model", + "name": "VectorSearchProfile", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.VectorSearchProfile", + "usage": "Input,Output,Json", + "doc": "Defines a combination of configurations to use with vector search.", + "decorators": [], + "properties": [ + { + "$id": "3371", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name to associate with this particular vector search profile.", + "type": { + "$id": "3372", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorSearchProfile.name", + "serializationOptions": { + "$id": "3373", + "json": { + "$id": "3374", + "name": "name" + } + } + }, + { + "$id": "3375", + "kind": "property", + "name": "algorithmConfigurationName", + "serializedName": "algorithm", + "doc": "The name of the vector search algorithm configuration that specifies the\nalgorithm and optional parameters.", + "type": { + "$id": "3376", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorSearchProfile.algorithm", + "serializationOptions": { + "$id": "3377", + "json": { + "$id": "3378", + "name": "algorithm" + } + } + }, + { + "$id": "3379", + "kind": "property", + "name": "vectorizerName", + "serializedName": "vectorizer", + "doc": "The name of the vectorization being configured for use with vector search.", + "type": { + "$id": "3380", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorSearchProfile.vectorizer", + "serializationOptions": { + "$id": "3381", + "json": { + "$id": "3382", + "name": "vectorizer" + } + } + }, + { + "$id": "3383", + "kind": "property", + "name": "compressionName", + "serializedName": "compression", + "doc": "The name of the compression method configuration that specifies the compression\nmethod and optional parameters.", + "type": { + "$id": "3384", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorSearchProfile.compression", + "serializationOptions": { + "$id": "3385", + "json": { + "$id": "3386", + "name": "compression" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorSearch.profiles", + "serializationOptions": { + "$id": "3387", + "json": { + "$id": "3388", + "name": "profiles" + } + } + }, + { + "$id": "3389", + "kind": "property", + "name": "algorithms", + "serializedName": "algorithms", + "doc": "Contains configuration options specific to the algorithm used during indexing\nor querying.", + "type": { + "$id": "3390", + "kind": "array", + "name": "ArrayVectorSearchAlgorithmConfiguration", + "valueType": { + "$id": "3391", + "kind": "model", + "name": "VectorSearchAlgorithmConfiguration", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.VectorSearchAlgorithmConfiguration", + "usage": "Input,Output,Json", + "doc": "Contains configuration options specific to the algorithm used during indexing\nor querying.", + "decorators": [], + "discriminatorProperty": { + "$id": "3392", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Type of VectorSearchAlgorithmConfiguration.", + "type": { + "$ref": "899" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorSearchAlgorithmConfiguration.kind", + "serializationOptions": { + "$id": "3393", + "json": { + "$id": "3394", + "name": "kind" + } + } + }, + "properties": [ + { + "$id": "3395", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name to associate with this particular configuration.", + "type": { + "$id": "3396", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorSearchAlgorithmConfiguration.name", + "serializationOptions": { + "$id": "3397", + "json": { + "$id": "3398", + "name": "name" + } + } + }, + { + "$ref": "3392" + } + ], + "discriminatedSubtypes": { + "$id": "3399", + "hnsw": { + "$id": "3400", + "kind": "model", + "name": "HnswAlgorithmConfiguration", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.HnswAlgorithmConfiguration", + "usage": "Input,Output,Json", + "doc": "Contains configuration options specific to the HNSW approximate nearest\nneighbors algorithm used during indexing and querying. The HNSW algorithm\noffers a tunable trade-off between search speed and accuracy.", + "discriminatorValue": "hnsw", + "decorators": [], + "baseModel": { + "$ref": "3391" + }, + "properties": [ + { + "$id": "3401", + "kind": "property", + "name": "parameters", + "serializedName": "hnswParameters", + "doc": "Contains the parameters specific to HNSW algorithm.", + "type": { + "$id": "3402", + "kind": "model", + "name": "HnswParameters", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.HnswParameters", + "usage": "Input,Output,Json", + "doc": "Contains the parameters specific to the HNSW algorithm.", + "decorators": [], + "properties": [ + { + "$id": "3403", + "kind": "property", + "name": "m", + "serializedName": "m", + "doc": "The number of bi-directional links created for every new element during\nconstruction. Increasing this parameter value may improve recall and reduce\nretrieval times for datasets with high intrinsic dimensionality at the expense\nof increased memory consumption and longer indexing time.", + "type": { + "$id": "3404", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.HnswParameters.m", + "serializationOptions": { + "$id": "3405", + "json": { + "$id": "3406", + "name": "m" + } + } + }, + { + "$id": "3407", + "kind": "property", + "name": "efConstruction", + "serializedName": "efConstruction", + "doc": "The size of the dynamic list containing the nearest neighbors, which is used\nduring index time. Increasing this parameter may improve index quality, at the\nexpense of increased indexing time. At a certain point, increasing this\nparameter leads to diminishing returns.", + "type": { + "$id": "3408", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.HnswParameters.efConstruction", + "serializationOptions": { + "$id": "3409", + "json": { + "$id": "3410", + "name": "efConstruction" + } + } + }, + { + "$id": "3411", + "kind": "property", + "name": "efSearch", + "serializedName": "efSearch", + "doc": "The size of the dynamic list containing the nearest neighbors, which is used\nduring search time. Increasing this parameter may improve search results, at\nthe expense of slower search. At a certain point, increasing this parameter\nleads to diminishing returns.", + "type": { + "$id": "3412", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.HnswParameters.efSearch", + "serializationOptions": { + "$id": "3413", + "json": { + "$id": "3414", + "name": "efSearch" + } + } + }, + { + "$id": "3415", + "kind": "property", + "name": "metric", + "serializedName": "metric", + "doc": "The similarity metric to use for vector comparisons.", + "type": { + "$ref": "905" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.HnswParameters.metric", + "serializationOptions": { + "$id": "3416", + "json": { + "$id": "3417", + "name": "metric" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.HnswAlgorithmConfiguration.hnswParameters", + "serializationOptions": { + "$id": "3418", + "json": { + "$id": "3419", + "name": "hnswParameters" + } + } + }, + { + "$id": "3420", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "The name of the kind of algorithm being configured for use with vector search.", + "type": { + "$id": "3421", + "kind": "constant", + "valueType": { + "$id": "3422", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "hnsw", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.HnswAlgorithmConfiguration.kind", + "serializationOptions": { + "$id": "3423", + "json": { + "$id": "3424", + "name": "kind" + } + } + } + ] + }, + "exhaustiveKnn": { + "$id": "3425", + "kind": "model", + "name": "ExhaustiveKnnAlgorithmConfiguration", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ExhaustiveKnnAlgorithmConfiguration", + "usage": "Input,Output,Json", + "doc": "Contains configuration options specific to the exhaustive KNN algorithm used\nduring querying, which will perform brute-force search across the entire vector\nindex.", + "discriminatorValue": "exhaustiveKnn", + "decorators": [], + "baseModel": { + "$ref": "3391" + }, + "properties": [ + { + "$id": "3426", + "kind": "property", + "name": "parameters", + "serializedName": "exhaustiveKnnParameters", + "doc": "Contains the parameters specific to exhaustive KNN algorithm.", + "type": { + "$id": "3427", + "kind": "model", + "name": "ExhaustiveKnnParameters", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ExhaustiveKnnParameters", + "usage": "Input,Output,Json", + "doc": "Contains the parameters specific to exhaustive KNN algorithm.", + "decorators": [], + "properties": [ + { + "$id": "3428", + "kind": "property", + "name": "metric", + "serializedName": "metric", + "doc": "The similarity metric to use for vector comparisons.", + "type": { + "$ref": "905" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ExhaustiveKnnParameters.metric", + "serializationOptions": { + "$id": "3429", + "json": { + "$id": "3430", + "name": "metric" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ExhaustiveKnnAlgorithmConfiguration.exhaustiveKnnParameters", + "serializationOptions": { + "$id": "3431", + "json": { + "$id": "3432", + "name": "exhaustiveKnnParameters" + } + } + }, + { + "$id": "3433", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "The name of the kind of algorithm being configured for use with vector search.", + "type": { + "$id": "3434", + "kind": "constant", + "valueType": { + "$id": "3435", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "exhaustiveKnn", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ExhaustiveKnnAlgorithmConfiguration.kind", + "serializationOptions": { + "$id": "3436", + "json": { + "$id": "3437", + "name": "kind" + } + } + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorSearch.algorithms", + "serializationOptions": { + "$id": "3438", + "json": { + "$id": "3439", + "name": "algorithms" + } + } + }, + { + "$id": "3440", + "kind": "property", + "name": "vectorizers", + "serializedName": "vectorizers", + "doc": "Contains configuration options on how to vectorize text vector queries.", + "type": { + "$id": "3441", + "kind": "array", + "name": "ArrayVectorSearchVectorizer", + "valueType": { + "$id": "3442", + "kind": "model", + "name": "VectorSearchVectorizer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.VectorSearchVectorizer", + "usage": "Input,Output,Json", + "doc": "Specifies the vectorization method to be used during query time.", + "decorators": [], + "discriminatorProperty": { + "$id": "3443", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Type of VectorSearchVectorizer.", + "type": { + "$ref": "915" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorSearchVectorizer.kind", + "serializationOptions": { + "$id": "3444", + "json": { + "$id": "3445", + "name": "kind" + } + } + }, + "properties": [ + { + "$id": "3446", + "kind": "property", + "name": "vectorizerName", + "serializedName": "name", + "doc": "The name to associate with this particular vectorization method.", + "type": { + "$id": "3447", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorSearchVectorizer.name", + "serializationOptions": { + "$id": "3448", + "json": { + "$id": "3449", + "name": "name" + } + } + }, + { + "$ref": "3443" + } + ], + "discriminatedSubtypes": { + "$id": "3450", + "azureOpenAI": { + "$id": "3451", + "kind": "model", + "name": "AzureOpenAIVectorizer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.AzureOpenAIVectorizer", + "usage": "Input,Output,Json", + "doc": "Specifies the Azure OpenAI resource used to vectorize a query string.", + "discriminatorValue": "azureOpenAI", + "decorators": [], + "baseModel": { + "$ref": "3442" + }, + "properties": [ + { + "$id": "3452", + "kind": "property", + "name": "parameters", + "serializedName": "azureOpenAIParameters", + "doc": "Contains the parameters specific to Azure OpenAI embedding vectorization.", + "type": { + "$id": "3453", + "kind": "model", + "name": "AzureOpenAIVectorizerParameters", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.AzureOpenAIVectorizerParameters", + "usage": "Input,Output,Json", + "doc": "Specifies the parameters for connecting to the Azure OpenAI resource.", + "decorators": [], + "properties": [ + { + "$id": "3454", + "kind": "property", + "name": "resourceUrl", + "serializedName": "resourceUri", + "doc": "The resource URI of the Azure OpenAI resource.", + "type": { + "$id": "3455", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AzureOpenAIVectorizerParameters.resourceUri", + "serializationOptions": { + "$id": "3456", + "json": { + "$id": "3457", + "name": "resourceUri" + } + } + }, + { + "$id": "3458", + "kind": "property", + "name": "deploymentName", + "serializedName": "deploymentId", + "doc": "ID of the Azure OpenAI model deployment on the designated resource.", + "type": { + "$id": "3459", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AzureOpenAIVectorizerParameters.deploymentId", + "serializationOptions": { + "$id": "3460", + "json": { + "$id": "3461", + "name": "deploymentId" + } + } + }, + { + "$id": "3462", + "kind": "property", + "name": "apiKey", + "serializedName": "apiKey", + "doc": "API key of the designated Azure OpenAI resource.", + "type": { + "$id": "3463", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AzureOpenAIVectorizerParameters.apiKey", + "serializationOptions": { + "$id": "3464", + "json": { + "$id": "3465", + "name": "apiKey" + } + } + }, + { + "$id": "3466", + "kind": "property", + "name": "authIdentity", + "serializedName": "authIdentity", + "doc": "The user-assigned managed identity used for outbound connections.", + "type": { + "$id": "3467", + "kind": "model", + "name": "SearchIndexerDataIdentity", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerDataIdentity", + "usage": "Input,Output,Json", + "doc": "Abstract base type for data identities.", + "decorators": [], + "discriminatorProperty": { + "$id": "3468", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of identity.", + "type": { + "$id": "3469", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerDataIdentity.@odata.type", + "serializationOptions": { + "$id": "3470", + "json": { + "$id": "3471", + "name": "@odata.type" + } + } + }, + "properties": [ + { + "$ref": "3468" + } + ], + "discriminatedSubtypes": { + "$id": "3472", + "#Microsoft.Azure.Search.DataNoneIdentity": { + "$id": "3473", + "kind": "model", + "name": "SearchIndexerDataNoneIdentity", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerDataNoneIdentity", + "usage": "Input,Output,Json", + "doc": "Clears the identity property of a datasource.", + "discriminatorValue": "#Microsoft.Azure.Search.DataNoneIdentity", + "decorators": [], + "baseModel": { + "$ref": "3467" + }, + "properties": [ + { + "$id": "3474", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of identity.", + "type": { + "$id": "3475", + "kind": "constant", + "valueType": { + "$id": "3476", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.DataNoneIdentity", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerDataNoneIdentity.@odata.type", + "serializationOptions": { + "$id": "3477", + "json": { + "$id": "3478", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.DataUserAssignedIdentity": { + "$id": "3479", + "kind": "model", + "name": "SearchIndexerDataUserAssignedIdentity", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerDataUserAssignedIdentity", + "usage": "Input,Output,Json", + "doc": "Specifies the identity for a datasource to use.", + "discriminatorValue": "#Microsoft.Azure.Search.DataUserAssignedIdentity", + "decorators": [], + "baseModel": { + "$ref": "3467" + }, + "properties": [ + { + "$id": "3480", + "kind": "property", + "name": "resourceId", + "serializedName": "userAssignedIdentity", + "doc": "The fully qualified Azure resource Id of a user assigned managed identity\ntypically in the form\n\"/subscriptions/12345678-1234-1234-1234-1234567890ab/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId\"\nthat should have been assigned to the search service.", + "type": { + "$id": "3481", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerDataUserAssignedIdentity.userAssignedIdentity", + "serializationOptions": { + "$id": "3482", + "json": { + "$id": "3483", + "name": "userAssignedIdentity" + } + } + }, + { + "$id": "3484", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of identity.", + "type": { + "$id": "3485", + "kind": "constant", + "valueType": { + "$id": "3486", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.DataUserAssignedIdentity", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerDataUserAssignedIdentity.@odata.type", + "serializationOptions": { + "$id": "3487", + "json": { + "$id": "3488", + "name": "@odata.type" + } + } + } + ] + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AzureOpenAIVectorizerParameters.authIdentity", + "serializationOptions": { + "$id": "3489", + "json": { + "$id": "3490", + "name": "authIdentity" + } + } + }, + { + "$id": "3491", + "kind": "property", + "name": "modelName", + "serializedName": "modelName", + "doc": "The name of the embedding model that is deployed at the provided deploymentId\npath.", + "type": { + "$ref": "921" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AzureOpenAIVectorizerParameters.modelName", + "serializationOptions": { + "$id": "3492", + "json": { + "$id": "3493", + "name": "modelName" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AzureOpenAIVectorizer.azureOpenAIParameters", + "serializationOptions": { + "$id": "3494", + "json": { + "$id": "3495", + "name": "azureOpenAIParameters" + } + } + }, + { + "$id": "3496", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "The name of the kind of vectorization method being configured for use with\nvector search.", + "type": { + "$id": "3497", + "kind": "constant", + "valueType": { + "$id": "3498", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "azureOpenAI", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AzureOpenAIVectorizer.kind", + "serializationOptions": { + "$id": "3499", + "json": { + "$id": "3500", + "name": "kind" + } + } + } + ] + }, + "customWebApi": { + "$id": "3501", + "kind": "model", + "name": "WebApiVectorizer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.WebApiVectorizer", + "usage": "Input,Output,Json", + "doc": "Specifies a user-defined vectorizer for generating the vector embedding of a\nquery string. Integration of an external vectorizer is achieved using the\ncustom Web API interface of a skillset.", + "discriminatorValue": "customWebApi", + "decorators": [], + "baseModel": { + "$ref": "3442" + }, + "properties": [ + { + "$id": "3502", + "kind": "property", + "name": "webApiParameters", + "serializedName": "customWebApiParameters", + "doc": "Specifies the properties of the user-defined vectorizer.", + "type": { + "$id": "3503", + "kind": "model", + "name": "WebApiVectorizerParameters", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.WebApiVectorizerParameters", + "usage": "Input,Output,Json", + "doc": "Specifies the properties for connecting to a user-defined vectorizer.", + "decorators": [], + "properties": [ + { + "$id": "3504", + "kind": "property", + "name": "url", + "serializedName": "uri", + "doc": "The URI of the Web API providing the vectorizer.", + "type": { + "$id": "3505", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiVectorizerParameters.uri", + "serializationOptions": { + "$id": "3506", + "json": { + "$id": "3507", + "name": "uri" + } + } + }, + { + "$id": "3508", + "kind": "property", + "name": "httpHeaders", + "serializedName": "httpHeaders", + "doc": "The headers required to make the HTTP request.", + "type": { + "$id": "3509", + "kind": "dict", + "keyType": { + "$id": "3510", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "3511", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiVectorizerParameters.httpHeaders", + "serializationOptions": { + "$id": "3512", + "json": { + "$id": "3513", + "name": "httpHeaders" + } + } + }, + { + "$id": "3514", + "kind": "property", + "name": "httpMethod", + "serializedName": "httpMethod", + "doc": "The method for the HTTP request.", + "type": { + "$id": "3515", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiVectorizerParameters.httpMethod", + "serializationOptions": { + "$id": "3516", + "json": { + "$id": "3517", + "name": "httpMethod" + } + } + }, + { + "$id": "3518", + "kind": "property", + "name": "timeout", + "serializedName": "timeout", + "doc": "The desired timeout for the request. Default is 30 seconds.", + "type": { + "$id": "3519", + "kind": "duration", + "name": "duration", + "encode": "ISO8601", + "wireType": { + "$id": "3520", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.duration", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiVectorizerParameters.timeout", + "serializationOptions": { + "$id": "3521", + "json": { + "$id": "3522", + "name": "timeout" + } + } + }, + { + "$id": "3523", + "kind": "property", + "name": "authResourceId", + "serializedName": "authResourceId", + "doc": "Applies to custom endpoints that connect to external code in an Azure function\nor some other application that provides the transformations. This value should\nbe the application ID created for the function or app when it was registered\nwith Azure Active Directory. When specified, the vectorization connects to the\nfunction or app using a managed ID (either system or user-assigned) of the\nsearch service and the access token of the function or app, using this value as\nthe resource id for creating the scope of the access token.", + "type": { + "$id": "3524", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiVectorizerParameters.authResourceId", + "serializationOptions": { + "$id": "3525", + "json": { + "$id": "3526", + "name": "authResourceId" + } + } + }, + { + "$id": "3527", + "kind": "property", + "name": "authIdentity", + "serializedName": "authIdentity", + "doc": "The user-assigned managed identity used for outbound connections. If an\nauthResourceId is provided and it's not specified, the system-assigned managed\nidentity is used. On updates to the indexer, if the identity is unspecified,\nthe value remains unchanged. If set to \"none\", the value of this property is\ncleared.", + "type": { + "$ref": "3467" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiVectorizerParameters.authIdentity", + "serializationOptions": { + "$id": "3528", + "json": { + "$id": "3529", + "name": "authIdentity" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiVectorizer.customWebApiParameters", + "serializationOptions": { + "$id": "3530", + "json": { + "$id": "3531", + "name": "customWebApiParameters" + } + } + }, + { + "$id": "3532", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "The name of the kind of vectorization method being configured for use with\nvector search.", + "type": { + "$id": "3533", + "kind": "constant", + "valueType": { + "$id": "3534", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "customWebApi", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiVectorizer.kind", + "serializationOptions": { + "$id": "3535", + "json": { + "$id": "3536", + "name": "kind" + } + } + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorSearch.vectorizers", + "serializationOptions": { + "$id": "3537", + "json": { + "$id": "3538", + "name": "vectorizers" + } + } + }, + { + "$id": "3539", + "kind": "property", + "name": "compressions", + "serializedName": "compressions", + "doc": "Contains configuration options specific to the compression method used during\nindexing or querying.", + "type": { + "$id": "3540", + "kind": "array", + "name": "ArrayVectorSearchCompression", + "valueType": { + "$id": "3541", + "kind": "model", + "name": "VectorSearchCompression", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.VectorSearchCompression", + "usage": "Input,Output,Json", + "doc": "Contains configuration options specific to the compression method used during\nindexing or querying.", + "decorators": [], + "discriminatorProperty": { + "$id": "3542", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Type of VectorSearchCompression.", + "type": { + "$ref": "929" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorSearchCompression.kind", + "serializationOptions": { + "$id": "3543", + "json": { + "$id": "3544", + "name": "kind" + } + } + }, + "properties": [ + { + "$id": "3545", + "kind": "property", + "name": "compressionName", + "serializedName": "name", + "doc": "The name to associate with this particular configuration.", + "type": { + "$id": "3546", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorSearchCompression.name", + "serializationOptions": { + "$id": "3547", + "json": { + "$id": "3548", + "name": "name" + } + } + }, + { + "$id": "3549", + "kind": "property", + "name": "rerankWithOriginalVectors", + "serializedName": "rerankWithOriginalVectors", + "doc": "If set to true, once the ordered set of results calculated using compressed\nvectors are obtained, they will be reranked again by recalculating the\nfull-precision similarity scores. This will improve recall at the expense of\nlatency.", + "type": { + "$id": "3550", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorSearchCompression.rerankWithOriginalVectors", + "serializationOptions": { + "$id": "3551", + "json": { + "$id": "3552", + "name": "rerankWithOriginalVectors" + } + } + }, + { + "$id": "3553", + "kind": "property", + "name": "defaultOversampling", + "serializedName": "defaultOversampling", + "doc": "Default oversampling factor. Oversampling will internally request more\ndocuments (specified by this multiplier) in the initial search. This increases\nthe set of results that will be reranked using recomputed similarity scores\nfrom full-precision vectors. Minimum value is 1, meaning no oversampling (1x).\nThis parameter can only be set when rerankWithOriginalVectors is true. Higher\nvalues improve recall at the expense of latency.", + "type": { + "$id": "3554", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorSearchCompression.defaultOversampling", + "serializationOptions": { + "$id": "3555", + "json": { + "$id": "3556", + "name": "defaultOversampling" + } + } + }, + { + "$ref": "3542" + } + ], + "discriminatedSubtypes": { + "$id": "3557", + "scalarQuantization": { + "$id": "3558", + "kind": "model", + "name": "ScalarQuantizationCompression", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ScalarQuantizationCompression", + "usage": "Input,Output,Json", + "doc": "Contains configuration options specific to the scalar quantization compression\nmethod used during indexing and querying.", + "discriminatorValue": "scalarQuantization", + "decorators": [], + "baseModel": { + "$ref": "3541" + }, + "properties": [ + { + "$id": "3559", + "kind": "property", + "name": "parameters", + "serializedName": "scalarQuantizationParameters", + "doc": "Contains the parameters specific to Scalar Quantization.", + "type": { + "$id": "3560", + "kind": "model", + "name": "ScalarQuantizationParameters", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ScalarQuantizationParameters", + "usage": "Input,Output,Json", + "doc": "Contains the parameters specific to Scalar Quantization.", + "decorators": [], + "properties": [ + { + "$id": "3561", + "kind": "property", + "name": "quantizedDataType", + "serializedName": "quantizedDataType", + "doc": "The quantized data type of compressed vector values.", + "type": { + "$ref": "935" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ScalarQuantizationParameters.quantizedDataType", + "serializationOptions": { + "$id": "3562", + "json": { + "$id": "3563", + "name": "quantizedDataType" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ScalarQuantizationCompression.scalarQuantizationParameters", + "serializationOptions": { + "$id": "3564", + "json": { + "$id": "3565", + "name": "scalarQuantizationParameters" + } + } + }, + { + "$id": "3566", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "The name of the kind of compression method being configured for use with vector\nsearch.", + "type": { + "$id": "3567", + "kind": "constant", + "valueType": { + "$id": "3568", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "scalarQuantization", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ScalarQuantizationCompression.kind", + "serializationOptions": { + "$id": "3569", + "json": { + "$id": "3570", + "name": "kind" + } + } + } + ] + }, + "binaryQuantization": { + "$id": "3571", + "kind": "model", + "name": "BinaryQuantizationCompression", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.BinaryQuantizationCompression", + "usage": "Input,Output,Json", + "doc": "Contains configuration options specific to the binary quantization compression\nmethod used during indexing and querying.", + "discriminatorValue": "binaryQuantization", + "decorators": [], + "baseModel": { + "$ref": "3541" + }, + "properties": [ + { + "$id": "3572", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "The name of the kind of compression method being configured for use with vector\nsearch.", + "type": { + "$id": "3573", + "kind": "constant", + "valueType": { + "$id": "3574", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "binaryQuantization", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.BinaryQuantizationCompression.kind", + "serializationOptions": { + "$id": "3575", + "json": { + "$id": "3576", + "name": "kind" + } + } + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.VectorSearch.compressions", + "serializationOptions": { + "$id": "3577", + "json": { + "$id": "3578", + "name": "compressions" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndex.vectorSearch", + "serializationOptions": { + "$id": "3579", + "json": { + "$id": "3580", + "name": "vectorSearch" + } + } + }, + { + "$id": "3581", + "kind": "property", + "name": "eTag", + "serializedName": "@odata.etag", + "doc": "The ETag of the index.", + "type": { + "$id": "3582", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndex.eTag", + "serializationOptions": { + "$id": "3583", + "json": { + "$id": "3584", + "name": "@odata.etag" + } + } + } + ] + }, + { + "$ref": "2380" + }, + { + "$ref": "2449" + }, + { + "$ref": "2455" + }, + { + "$ref": "2466" + }, + { + "$ref": "2483" + }, + { + "$ref": "2485" + }, + { + "$ref": "2501" + }, + { + "$ref": "2503" + }, + { + "$ref": "2516" + }, + { + "$ref": "2518" + }, + { + "$ref": "2538" + }, + { + "$ref": "2540" + }, + { + "$ref": "2564" + }, + { + "$ref": "2578" + }, + { + "$ref": "2596" + }, + { + "$ref": "2606" + }, + { + "$ref": "2623" + }, + { + "$ref": "2645" + }, + { + "$ref": "2660" + }, + { + "$ref": "2675" + }, + { + "$ref": "2685" + }, + { + "$ref": "2695" + }, + { + "$ref": "2713" + }, + { + "$ref": "2723" + }, + { + "$ref": "2740" + }, + { + "$ref": "2757" + }, + { + "$ref": "2775" + }, + { + "$ref": "2801" + }, + { + "$ref": "2818" + }, + { + "$ref": "2828" + }, + { + "$ref": "2842" + }, + { + "$ref": "2852" + }, + { + "$ref": "2862" + }, + { + "$ref": "2876" + }, + { + "$ref": "2895" + }, + { + "$ref": "2922" + }, + { + "$ref": "2939" + }, + { + "$ref": "2950" + }, + { + "$ref": "2965" + }, + { + "$ref": "2980" + }, + { + "$ref": "2994" + }, + { + "$ref": "3008" + }, + { + "$ref": "3022" + }, + { + "$ref": "3037" + }, + { + "$ref": "3051" + }, + { + "$ref": "3064" + }, + { + "$ref": "3094" + }, + { + "$ref": "3103" + }, + { + "$ref": "3112" + }, + { + "$ref": "3123" + }, + { + "$ref": "3145" + }, + { + "$ref": "3164" + }, + { + "$ref": "3174" + }, + { + "$ref": "3184" + }, + { + "$ref": "3235" + }, + { + "$ref": "3245" + }, + { + "$ref": "3256" + }, + { + "$ref": "3273" + }, + { + "$ref": "3287" + }, + { + "$ref": "3301" + }, + { + "$ref": "3307" + }, + { + "$ref": "3313" + }, + { + "$ref": "3330" + }, + { + "$ref": "3337" + }, + { + "$ref": "3343" + }, + { + "$ref": "3345" + }, + { + "$ref": "3367" + }, + { + "$ref": "3370" + }, + { + "$ref": "3391" + }, + { + "$ref": "3400" + }, + { + "$ref": "3402" + }, + { + "$ref": "3425" + }, + { + "$ref": "3427" + }, + { + "$ref": "3442" + }, + { + "$ref": "3451" + }, + { + "$ref": "3453" + }, + { + "$ref": "3467" + }, + { + "$ref": "3473" + }, + { + "$ref": "3479" + }, + { + "$ref": "3501" + }, + { + "$ref": "3503" + }, + { + "$ref": "3541" + }, + { + "$ref": "3558" + }, + { + "$ref": "3560" + }, + { + "$ref": "3571" + }, + { + "$id": "3585", + "kind": "model", + "name": "ListIndexesResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ListIndexesResult", + "usage": "Output,Json", + "doc": "Response from a List Indexes request. If successful, it includes the full\ndefinitions of all indexes.", + "decorators": [], + "properties": [ + { + "$id": "3586", + "kind": "property", + "name": "indexes", + "serializedName": "value", + "doc": "The indexes in the Search service.", + "type": { + "$id": "3587", + "kind": "array", + "name": "ArraySearchIndex", + "valueType": { + "$ref": "2373" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ListIndexesResult.value", + "serializationOptions": { + "$id": "3588", + "json": { + "$id": "3589", + "name": "value" + } + } + } + ] + }, + { + "$id": "3590", + "kind": "model", + "name": "GetIndexStatisticsResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.GetIndexStatisticsResult", + "usage": "Output,Json", + "doc": "Statistics for a given index. Statistics are collected periodically and are not\nguaranteed to always be up-to-date.", + "decorators": [], + "properties": [ + { + "$id": "3591", + "kind": "property", + "name": "documentCount", + "serializedName": "documentCount", + "doc": "The number of documents in the index.", + "type": { + "$id": "3592", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.GetIndexStatisticsResult.documentCount", + "serializationOptions": { + "$id": "3593", + "json": { + "$id": "3594", + "name": "documentCount" + } + } + }, + { + "$id": "3595", + "kind": "property", + "name": "storageSize", + "serializedName": "storageSize", + "doc": "The amount of storage in bytes consumed by the index.", + "type": { + "$id": "3596", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.GetIndexStatisticsResult.storageSize", + "serializationOptions": { + "$id": "3597", + "json": { + "$id": "3598", + "name": "storageSize" + } + } + }, + { + "$id": "3599", + "kind": "property", + "name": "vectorIndexSize", + "serializedName": "vectorIndexSize", + "doc": "The amount of memory in bytes consumed by vectors in the index.", + "type": { + "$id": "3600", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.GetIndexStatisticsResult.vectorIndexSize", + "serializationOptions": { + "$id": "3601", + "json": { + "$id": "3602", + "name": "vectorIndexSize" + } + } + } + ] + }, + { + "$id": "3603", + "kind": "model", + "name": "AnalyzeRequest", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.AnalyzeRequest", + "usage": "Input,Json", + "doc": "Specifies some text and analysis components used to break that text into tokens.", + "decorators": [], + "properties": [ + { + "$id": "3604", + "kind": "property", + "name": "text", + "serializedName": "text", + "doc": "The text to break into tokens.", + "type": { + "$id": "3605", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AnalyzeRequest.text", + "serializationOptions": { + "$id": "3606", + "json": { + "$id": "3607", + "name": "text" + } + } + }, + { + "$id": "3608", + "kind": "property", + "name": "analyzer", + "serializedName": "analyzer", + "doc": "The name of the analyzer to use to break the given text. If this parameter is\nnot specified, you must specify a tokenizer instead. The tokenizer and analyzer\nparameters are mutually exclusive.", + "type": { + "$ref": "112" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AnalyzeRequest.analyzer", + "serializationOptions": { + "$id": "3609", + "json": { + "$id": "3610", + "name": "analyzer" + } + } + }, + { + "$id": "3611", + "kind": "property", + "name": "tokenizer", + "serializedName": "tokenizer", + "doc": "The name of the tokenizer to use to break the given text. If this parameter is\nnot specified, you must specify an analyzer instead. The tokenizer and analyzer\nparameters are mutually exclusive.", + "type": { + "$ref": "329" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AnalyzeRequest.tokenizer", + "serializationOptions": { + "$id": "3612", + "json": { + "$id": "3613", + "name": "tokenizer" + } + } + }, + { + "$id": "3614", + "kind": "property", + "name": "tokenFilters", + "serializedName": "tokenFilters", + "doc": "An optional list of token filters to use when breaking the given text. This\nparameter can only be set when using the tokenizer parameter.", + "type": { + "$id": "3615", + "kind": "array", + "name": "ArrayTokenFilterName", + "valueType": { + "$ref": "357" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AnalyzeRequest.tokenFilters", + "serializationOptions": { + "$id": "3616", + "json": { + "$id": "3617", + "name": "tokenFilters" + } + } + }, + { + "$id": "3618", + "kind": "property", + "name": "charFilters", + "serializedName": "charFilters", + "doc": "An optional list of character filters to use when breaking the given text. This\nparameter can only be set when using the tokenizer parameter.", + "type": { + "$id": "3619", + "kind": "array", + "name": "ArrayCharFilterName", + "valueType": { + "$ref": "427" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AnalyzeRequest.charFilters", + "serializationOptions": { + "$id": "3620", + "json": { + "$id": "3621", + "name": "charFilters" + } + } + } + ] + }, + { + "$id": "3622", + "kind": "model", + "name": "AnalyzeResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.AnalyzeResult", + "usage": "Output,Json", + "doc": "The result of testing an analyzer on text.", + "decorators": [], + "properties": [ + { + "$id": "3623", + "kind": "property", + "name": "tokens", + "serializedName": "tokens", + "doc": "The list of tokens returned by the analyzer specified in the request.", + "type": { + "$id": "3624", + "kind": "array", + "name": "ArrayAnalyzedTokenInfo", + "valueType": { + "$id": "3625", + "kind": "model", + "name": "AnalyzedTokenInfo", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.AnalyzedTokenInfo", + "usage": "Output,Json", + "doc": "Information about a token returned by an analyzer.", + "decorators": [], + "properties": [ + { + "$id": "3626", + "kind": "property", + "name": "token", + "serializedName": "token", + "doc": "The token returned by the analyzer.", + "type": { + "$id": "3627", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AnalyzedTokenInfo.token", + "serializationOptions": { + "$id": "3628", + "json": { + "$id": "3629", + "name": "token" + } + } + }, + { + "$id": "3630", + "kind": "property", + "name": "startOffset", + "serializedName": "startOffset", + "doc": "The index of the first character of the token in the input text.", + "type": { + "$id": "3631", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AnalyzedTokenInfo.startOffset", + "serializationOptions": { + "$id": "3632", + "json": { + "$id": "3633", + "name": "startOffset" + } + } + }, + { + "$id": "3634", + "kind": "property", + "name": "endOffset", + "serializedName": "endOffset", + "doc": "The index of the last character of the token in the input text.", + "type": { + "$id": "3635", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AnalyzedTokenInfo.endOffset", + "serializationOptions": { + "$id": "3636", + "json": { + "$id": "3637", + "name": "endOffset" + } + } + }, + { + "$id": "3638", + "kind": "property", + "name": "position", + "serializedName": "position", + "doc": "The position of the token in the input text relative to other tokens. The first\ntoken in the input text has position 0, the next has position 1, and so on.\nDepending on the analyzer used, some tokens might have the same position, for\nexample if they are synonyms of each other.", + "type": { + "$id": "3639", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AnalyzedTokenInfo.position", + "serializationOptions": { + "$id": "3640", + "json": { + "$id": "3641", + "name": "position" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AnalyzeResult.tokens", + "serializationOptions": { + "$id": "3642", + "json": { + "$id": "3643", + "name": "tokens" + } + } + } + ] + }, + { + "$ref": "3625" + }, + { + "$id": "3644", + "kind": "model", + "name": "SynonymMap", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SynonymMap", + "usage": "Input,Output,Json", + "doc": "Represents a synonym map definition.", + "decorators": [], + "properties": [ + { + "$id": "3645", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the synonym map.", + "type": { + "$id": "3646", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SynonymMap.name", + "serializationOptions": { + "$id": "3647", + "json": { + "$id": "3648", + "name": "name" + } + } + }, + { + "$id": "3649", + "kind": "property", + "name": "format", + "serializedName": "format", + "doc": "The format of the synonym map. Only the 'solr' format is currently supported.", + "type": { + "$id": "3650", + "kind": "constant", + "valueType": { + "$ref": "939" + }, + "value": "solr", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SynonymMap.format", + "serializationOptions": { + "$id": "3651", + "json": { + "$id": "3652", + "name": "format" + } + } + }, + { + "$id": "3653", + "kind": "property", + "name": "synonyms", + "serializedName": "synonyms", + "doc": "A series of synonym rules in the specified synonym map format. The rules must\nbe separated by newlines.", + "type": { + "$id": "3654", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SynonymMap.synonyms", + "serializationOptions": { + "$id": "3655", + "json": { + "$id": "3656", + "name": "synonyms" + } + } + }, + { + "$id": "3657", + "kind": "property", + "name": "encryptionKey", + "serializedName": "encryptionKey", + "doc": "A description of an encryption key that you create in Azure Key Vault. This key\nis used to provide an additional level of encryption-at-rest for your data when\nyou want full assurance that no one, not even Microsoft, can decrypt your data.\nOnce you have encrypted your data, it will always remain encrypted. The search\nservice will ignore attempts to set this property to null. You can change this\nproperty as needed if you want to rotate your encryption key; Your data will be\nunaffected. Encryption with customer-managed keys is not available for free\nsearch services, and is only available for paid services created on or after\nJanuary 1, 2019.", + "type": { + "$ref": "3273" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SynonymMap.encryptionKey", + "serializationOptions": { + "$id": "3658", + "json": { + "$id": "3659", + "name": "encryptionKey" + } + } + }, + { + "$id": "3660", + "kind": "property", + "name": "eTag", + "serializedName": "@odata.etag", + "doc": "The ETag of the synonym map.", + "type": { + "$id": "3661", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SynonymMap.eTag", + "serializationOptions": { + "$id": "3662", + "json": { + "$id": "3663", + "name": "@odata.etag" + } + } + } + ] + }, + { + "$id": "3664", + "kind": "model", + "name": "ListSynonymMapsResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ListSynonymMapsResult", + "usage": "Output,Json", + "doc": "Response from a List SynonymMaps request. If successful, it includes the full\ndefinitions of all synonym maps.", + "decorators": [], + "properties": [ + { + "$id": "3665", + "kind": "property", + "name": "synonymMaps", + "serializedName": "value", + "doc": "The synonym maps in the Search service.", + "type": { + "$id": "3666", + "kind": "array", + "name": "ArraySynonymMap", + "valueType": { + "$ref": "3644" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ListSynonymMapsResult.value", + "serializationOptions": { + "$id": "3667", + "json": { + "$id": "3668", + "name": "value" + } + } + } + ] + }, + { + "$id": "3669", + "kind": "model", + "name": "SearchIndexerSkillset", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerSkillset", + "usage": "Input,Output,Json", + "doc": "A list of skills.", + "decorators": [], + "properties": [ + { + "$id": "3670", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the skillset.", + "type": { + "$id": "3671", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerSkillset.name", + "serializationOptions": { + "$id": "3672", + "json": { + "$id": "3673", + "name": "name" + } + } + }, + { + "$id": "3674", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The description of the skillset.", + "type": { + "$id": "3675", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerSkillset.description", + "serializationOptions": { + "$id": "3676", + "json": { + "$id": "3677", + "name": "description" + } + } + }, + { + "$id": "3678", + "kind": "property", + "name": "skills", + "serializedName": "skills", + "doc": "A list of skills in the skillset.", + "type": { + "$id": "3679", + "kind": "array", + "name": "ArraySearchIndexerSkill", + "valueType": { + "$id": "3680", + "kind": "model", + "name": "SearchIndexerSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerSkill", + "usage": "Input,Output,Json", + "doc": "Base type for skills.", + "decorators": [], + "discriminatorProperty": { + "$id": "3681", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "The discriminator for derived types.", + "type": { + "$id": "3682", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerSkill.@odata.type", + "serializationOptions": { + "$id": "3683", + "json": { + "$id": "3684", + "name": "@odata.type" + } + } + }, + "properties": [ + { + "$ref": "3681" + }, + { + "$id": "3685", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the skill which uniquely identifies it within the skillset. A skill\nwith no name defined will be given a default name of its 1-based index in the\nskills array, prefixed with the character '#'.", + "type": { + "$id": "3686", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerSkill.name", + "serializationOptions": { + "$id": "3687", + "json": { + "$id": "3688", + "name": "name" + } + } + }, + { + "$id": "3689", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The description of the skill which describes the inputs, outputs, and usage of\nthe skill.", + "type": { + "$id": "3690", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerSkill.description", + "serializationOptions": { + "$id": "3691", + "json": { + "$id": "3692", + "name": "description" + } + } + }, + { + "$id": "3693", + "kind": "property", + "name": "context", + "serializedName": "context", + "doc": "Represents the level at which operations take place, such as the document root\nor document content (for example, /document or /document/content). The default\nis /document.", + "type": { + "$id": "3694", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerSkill.context", + "serializationOptions": { + "$id": "3695", + "json": { + "$id": "3696", + "name": "context" + } + } + }, + { + "$id": "3697", + "kind": "property", + "name": "inputs", + "serializedName": "inputs", + "doc": "Inputs of the skills could be a column in the source data set, or the output of\nan upstream skill.", + "type": { + "$id": "3698", + "kind": "array", + "name": "ArrayInputFieldMappingEntry", + "valueType": { + "$id": "3699", + "kind": "model", + "name": "InputFieldMappingEntry", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.InputFieldMappingEntry", + "usage": "Input,Output,Json", + "doc": "Input field mapping for a skill.", + "decorators": [], + "properties": [ + { + "$id": "3700", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the input.", + "type": { + "$id": "3701", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.InputFieldMappingEntry.name", + "serializationOptions": { + "$id": "3702", + "json": { + "$id": "3703", + "name": "name" + } + } + }, + { + "$id": "3704", + "kind": "property", + "name": "source", + "serializedName": "source", + "doc": "The source of the input.", + "type": { + "$id": "3705", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.InputFieldMappingEntry.source", + "serializationOptions": { + "$id": "3706", + "json": { + "$id": "3707", + "name": "source" + } + } + }, + { + "$id": "3708", + "kind": "property", + "name": "sourceContext", + "serializedName": "sourceContext", + "doc": "The source context used for selecting recursive inputs.", + "type": { + "$id": "3709", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.InputFieldMappingEntry.sourceContext", + "serializationOptions": { + "$id": "3710", + "json": { + "$id": "3711", + "name": "sourceContext" + } + } + }, + { + "$id": "3712", + "kind": "property", + "name": "inputs", + "serializedName": "inputs", + "doc": "The recursive inputs used when creating a complex type.", + "type": { + "$id": "3713", + "kind": "array", + "name": "ArrayInputFieldMappingEntry", + "valueType": { + "$ref": "3699" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.InputFieldMappingEntry.inputs", + "serializationOptions": { + "$id": "3714", + "json": { + "$id": "3715", + "name": "inputs" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerSkill.inputs", + "serializationOptions": { + "$id": "3716", + "json": { + "$id": "3717", + "name": "inputs" + } + } + }, + { + "$id": "3718", + "kind": "property", + "name": "outputs", + "serializedName": "outputs", + "doc": "The output of a skill is either a field in a search index, or a value that can\nbe consumed as an input by another skill.", + "type": { + "$id": "3719", + "kind": "array", + "name": "ArrayOutputFieldMappingEntry", + "valueType": { + "$id": "3720", + "kind": "model", + "name": "OutputFieldMappingEntry", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.OutputFieldMappingEntry", + "usage": "Input,Output,Json", + "doc": "Output field mapping for a skill.", + "decorators": [], + "properties": [ + { + "$id": "3721", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the output defined by the skill.", + "type": { + "$id": "3722", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.OutputFieldMappingEntry.name", + "serializationOptions": { + "$id": "3723", + "json": { + "$id": "3724", + "name": "name" + } + } + }, + { + "$id": "3725", + "kind": "property", + "name": "targetName", + "serializedName": "targetName", + "doc": "The target name of the output. It is optional and default to name.", + "type": { + "$id": "3726", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.OutputFieldMappingEntry.targetName", + "serializationOptions": { + "$id": "3727", + "json": { + "$id": "3728", + "name": "targetName" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerSkill.outputs", + "serializationOptions": { + "$id": "3729", + "json": { + "$id": "3730", + "name": "outputs" + } + } + } + ], + "discriminatedSubtypes": { + "$id": "3731", + "#Microsoft.Skills.Util.ConditionalSkill": { + "$id": "3732", + "kind": "model", + "name": "ConditionalSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ConditionalSkill", + "usage": "Input,Output,Json", + "doc": "A skill that enables scenarios that require a Boolean operation to determine\nthe data to assign to an output.", + "discriminatorValue": "#Microsoft.Skills.Util.ConditionalSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "3733", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "3734", + "kind": "constant", + "valueType": { + "$id": "3735", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Util.ConditionalSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ConditionalSkill.@odata.type", + "serializationOptions": { + "$id": "3736", + "json": { + "$id": "3737", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Text.KeyPhraseExtractionSkill": { + "$id": "3738", + "kind": "model", + "name": "KeyPhraseExtractionSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.KeyPhraseExtractionSkill", + "usage": "Input,Output,Json", + "doc": "A skill that uses text analytics for key phrase extraction.", + "discriminatorValue": "#Microsoft.Skills.Text.KeyPhraseExtractionSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "3739", + "kind": "property", + "name": "defaultLanguageCode", + "serializedName": "defaultLanguageCode", + "doc": "A value indicating which language code to use. Default is `en`.", + "type": { + "$ref": "942" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.KeyPhraseExtractionSkill.defaultLanguageCode", + "serializationOptions": { + "$id": "3740", + "json": { + "$id": "3741", + "name": "defaultLanguageCode" + } + } + }, + { + "$id": "3742", + "kind": "property", + "name": "maxKeyPhraseCount", + "serializedName": "maxKeyPhraseCount", + "doc": "A number indicating how many key phrases to return. If absent, all identified\nkey phrases will be returned.", + "type": { + "$id": "3743", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.KeyPhraseExtractionSkill.maxKeyPhraseCount", + "serializationOptions": { + "$id": "3744", + "json": { + "$id": "3745", + "name": "maxKeyPhraseCount" + } + } + }, + { + "$id": "3746", + "kind": "property", + "name": "modelVersion", + "serializedName": "modelVersion", + "doc": "The version of the model to use when calling the Text Analytics service. It\nwill default to the latest available when not specified. We recommend you do\nnot specify this value unless absolutely necessary.", + "type": { + "$id": "3747", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.KeyPhraseExtractionSkill.modelVersion", + "serializationOptions": { + "$id": "3748", + "json": { + "$id": "3749", + "name": "modelVersion" + } + } + }, + { + "$id": "3750", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "3751", + "kind": "constant", + "valueType": { + "$id": "3752", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Text.KeyPhraseExtractionSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.KeyPhraseExtractionSkill.@odata.type", + "serializationOptions": { + "$id": "3753", + "json": { + "$id": "3754", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Vision.OcrSkill": { + "$id": "3755", + "kind": "model", + "name": "OcrSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.OcrSkill", + "usage": "Input,Output,Json", + "doc": "A skill that extracts text from image files.", + "discriminatorValue": "#Microsoft.Skills.Vision.OcrSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "3756", + "kind": "property", + "name": "defaultLanguageCode", + "serializedName": "defaultLanguageCode", + "doc": "A value indicating which language code to use. Default is `en`.", + "type": { + "$ref": "976" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.OcrSkill.defaultLanguageCode", + "serializationOptions": { + "$id": "3757", + "json": { + "$id": "3758", + "name": "defaultLanguageCode" + } + } + }, + { + "$id": "3759", + "kind": "property", + "name": "shouldDetectOrientation", + "serializedName": "detectOrientation", + "doc": "A value indicating to turn orientation detection on or not. Default is false.", + "type": { + "$id": "3760", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.OcrSkill.detectOrientation", + "serializationOptions": { + "$id": "3761", + "json": { + "$id": "3762", + "name": "detectOrientation" + } + } + }, + { + "$id": "3763", + "kind": "property", + "name": "lineEnding", + "serializedName": "lineEnding", + "doc": "Defines the sequence of characters to use between the lines of text recognized\nby the OCR skill. The default value is \"space\".", + "type": { + "$ref": "1318" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.OcrSkill.lineEnding", + "serializationOptions": { + "$id": "3764", + "json": { + "$id": "3765", + "name": "lineEnding" + } + } + }, + { + "$id": "3766", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "3767", + "kind": "constant", + "valueType": { + "$id": "3768", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Vision.OcrSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.OcrSkill.@odata.type", + "serializationOptions": { + "$id": "3769", + "json": { + "$id": "3770", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Vision.ImageAnalysisSkill": { + "$id": "3771", + "kind": "model", + "name": "ImageAnalysisSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ImageAnalysisSkill", + "usage": "Input,Output,Json", + "doc": "A skill that analyzes image files. It extracts a rich set of visual features\nbased on the image content.", + "discriminatorValue": "#Microsoft.Skills.Vision.ImageAnalysisSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "3772", + "kind": "property", + "name": "defaultLanguageCode", + "serializedName": "defaultLanguageCode", + "doc": "A value indicating which language code to use. Default is `en`.", + "type": { + "$ref": "1328" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ImageAnalysisSkill.defaultLanguageCode", + "serializationOptions": { + "$id": "3773", + "json": { + "$id": "3774", + "name": "defaultLanguageCode" + } + } + }, + { + "$id": "3775", + "kind": "property", + "name": "visualFeatures", + "serializedName": "visualFeatures", + "doc": "A list of visual features.", + "type": { + "$id": "3776", + "kind": "array", + "name": "ArrayVisualFeature", + "valueType": { + "$ref": "1434" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ImageAnalysisSkill.visualFeatures", + "serializationOptions": { + "$id": "3777", + "json": { + "$id": "3778", + "name": "visualFeatures" + } + } + }, + { + "$id": "3779", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "A string indicating which domain-specific details to return.", + "type": { + "$id": "3780", + "kind": "array", + "name": "ArrayImageDetail", + "valueType": { + "$ref": "1450" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ImageAnalysisSkill.details", + "serializationOptions": { + "$id": "3781", + "json": { + "$id": "3782", + "name": "details" + } + } + }, + { + "$id": "3783", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "3784", + "kind": "constant", + "valueType": { + "$id": "3785", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Vision.ImageAnalysisSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ImageAnalysisSkill.@odata.type", + "serializationOptions": { + "$id": "3786", + "json": { + "$id": "3787", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Text.LanguageDetectionSkill": { + "$id": "3788", + "kind": "model", + "name": "LanguageDetectionSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.LanguageDetectionSkill", + "usage": "Input,Output,Json", + "doc": "A skill that detects the language of input text and reports a single language\ncode for every document submitted on the request. The language code is paired\nwith a score indicating the confidence of the analysis.", + "discriminatorValue": "#Microsoft.Skills.Text.LanguageDetectionSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "3789", + "kind": "property", + "name": "defaultCountryHint", + "serializedName": "defaultCountryHint", + "doc": "A country code to use as a hint to the language detection model if it cannot\ndisambiguate the language.", + "type": { + "$id": "3790", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LanguageDetectionSkill.defaultCountryHint", + "serializationOptions": { + "$id": "3791", + "json": { + "$id": "3792", + "name": "defaultCountryHint" + } + } + }, + { + "$id": "3793", + "kind": "property", + "name": "modelVersion", + "serializedName": "modelVersion", + "doc": "The version of the model to use when calling the Text Analytics service. It\nwill default to the latest available when not specified. We recommend you do\nnot specify this value unless absolutely necessary.", + "type": { + "$id": "3794", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LanguageDetectionSkill.modelVersion", + "serializationOptions": { + "$id": "3795", + "json": { + "$id": "3796", + "name": "modelVersion" + } + } + }, + { + "$id": "3797", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "3798", + "kind": "constant", + "valueType": { + "$id": "3799", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Text.LanguageDetectionSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.LanguageDetectionSkill.@odata.type", + "serializationOptions": { + "$id": "3800", + "json": { + "$id": "3801", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Util.ShaperSkill": { + "$id": "3802", + "kind": "model", + "name": "ShaperSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ShaperSkill", + "usage": "Input,Output,Json", + "doc": "A skill for reshaping the outputs. It creates a complex type to support\ncomposite fields (also known as multipart fields).", + "discriminatorValue": "#Microsoft.Skills.Util.ShaperSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "3803", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "3804", + "kind": "constant", + "valueType": { + "$id": "3805", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Util.ShaperSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ShaperSkill.@odata.type", + "serializationOptions": { + "$id": "3806", + "json": { + "$id": "3807", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Text.MergeSkill": { + "$id": "3808", + "kind": "model", + "name": "MergeSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.MergeSkill", + "usage": "Input,Output,Json", + "doc": "A skill for merging two or more strings into a single unified string, with an\noptional user-defined delimiter separating each component part.", + "discriminatorValue": "#Microsoft.Skills.Text.MergeSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "3809", + "kind": "property", + "name": "insertPreTag", + "serializedName": "insertPreTag", + "doc": "The tag indicates the start of the merged text. By default, the tag is an empty\nspace.", + "type": { + "$id": "3810", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MergeSkill.insertPreTag", + "serializationOptions": { + "$id": "3811", + "json": { + "$id": "3812", + "name": "insertPreTag" + } + } + }, + { + "$id": "3813", + "kind": "property", + "name": "insertPostTag", + "serializedName": "insertPostTag", + "doc": "The tag indicates the end of the merged text. By default, the tag is an empty\nspace.", + "type": { + "$id": "3814", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MergeSkill.insertPostTag", + "serializationOptions": { + "$id": "3815", + "json": { + "$id": "3816", + "name": "insertPostTag" + } + } + }, + { + "$id": "3817", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "3818", + "kind": "constant", + "valueType": { + "$id": "3819", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Text.MergeSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.MergeSkill.@odata.type", + "serializationOptions": { + "$id": "3820", + "json": { + "$id": "3821", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Text.EntityRecognitionSkill": { + "$id": "3822", + "kind": "model", + "name": "EntityRecognitionSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.EntityRecognitionSkill", + "usage": "Input,Output,Json", + "doc": "This skill is deprecated. Use the V3.EntityRecognitionSkill instead.", + "discriminatorValue": "#Microsoft.Skills.Text.EntityRecognitionSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "3823", + "kind": "property", + "name": "categories", + "serializedName": "categories", + "doc": "A list of entity categories that should be extracted.", + "type": { + "$id": "3824", + "kind": "array", + "name": "ArrayEntityCategory", + "valueType": { + "$ref": "1456" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EntityRecognitionSkill.categories", + "serializationOptions": { + "$id": "3825", + "json": { + "$id": "3826", + "name": "categories" + } + } + }, + { + "$id": "3827", + "kind": "property", + "name": "defaultLanguageCode", + "serializedName": "defaultLanguageCode", + "doc": "A value indicating which language code to use. Default is `en`.", + "type": { + "$ref": "1472" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EntityRecognitionSkill.defaultLanguageCode", + "serializationOptions": { + "$id": "3828", + "json": { + "$id": "3829", + "name": "defaultLanguageCode" + } + } + }, + { + "$id": "3830", + "kind": "property", + "name": "includeTypelessEntities", + "serializedName": "includeTypelessEntities", + "doc": "Determines whether or not to include entities which are well known but don't\nconform to a pre-defined type. If this configuration is not set (default), set\nto null or set to false, entities which don't conform to one of the pre-defined\ntypes will not be surfaced.", + "type": { + "$id": "3831", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EntityRecognitionSkill.includeTypelessEntities", + "serializationOptions": { + "$id": "3832", + "json": { + "$id": "3833", + "name": "includeTypelessEntities" + } + } + }, + { + "$id": "3834", + "kind": "property", + "name": "minimumPrecision", + "serializedName": "minimumPrecision", + "doc": "A value between 0 and 1 that be used to only include entities whose confidence\nscore is greater than the value specified. If not set (default), or if\nexplicitly set to null, all entities will be included.", + "type": { + "$id": "3835", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EntityRecognitionSkill.minimumPrecision", + "serializationOptions": { + "$id": "3836", + "json": { + "$id": "3837", + "name": "minimumPrecision" + } + } + }, + { + "$id": "3838", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "3839", + "kind": "constant", + "valueType": { + "$id": "3840", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Text.EntityRecognitionSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EntityRecognitionSkill.@odata.type", + "serializationOptions": { + "$id": "3841", + "json": { + "$id": "3842", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Text.SentimentSkill": { + "$id": "3843", + "kind": "model", + "name": "SentimentSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SentimentSkill", + "usage": "Input,Output,Json", + "doc": "This skill is deprecated. Use the V3.SentimentSkill instead.", + "discriminatorValue": "#Microsoft.Skills.Text.SentimentSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "3844", + "kind": "property", + "name": "defaultLanguageCode", + "serializedName": "defaultLanguageCode", + "doc": "A value indicating which language code to use. Default is `en`.", + "type": { + "$ref": "1520" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SentimentSkill.defaultLanguageCode", + "serializationOptions": { + "$id": "3845", + "json": { + "$id": "3846", + "name": "defaultLanguageCode" + } + } + }, + { + "$id": "3847", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "3848", + "kind": "constant", + "valueType": { + "$id": "3849", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Text.SentimentSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SentimentSkill.@odata.type", + "serializationOptions": { + "$id": "3850", + "json": { + "$id": "3851", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Text.V3.SentimentSkill": { + "$id": "3852", + "kind": "model", + "name": "SentimentSkillV3", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SentimentSkillV3", + "usage": "Input,Output,Json", + "doc": "Using the Text Analytics API, evaluates unstructured text and for each record,\nprovides sentiment labels (such as \"negative\", \"neutral\" and \"positive\") based\non the highest confidence score found by the service at a sentence and\ndocument-level.", + "discriminatorValue": "#Microsoft.Skills.Text.V3.SentimentSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "3853", + "kind": "property", + "name": "defaultLanguageCode", + "serializedName": "defaultLanguageCode", + "doc": "A value indicating which language code to use. Default is `en`.", + "type": { + "$id": "3854", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SentimentSkillV3.defaultLanguageCode", + "serializationOptions": { + "$id": "3855", + "json": { + "$id": "3856", + "name": "defaultLanguageCode" + } + } + }, + { + "$id": "3857", + "kind": "property", + "name": "includeOpinionMining", + "serializedName": "includeOpinionMining", + "doc": "If set to true, the skill output will include information from Text Analytics\nfor opinion mining, namely targets (nouns or verbs) and their associated\nassessment (adjective) in the text. Default is false.", + "type": { + "$id": "3858", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SentimentSkillV3.includeOpinionMining", + "serializationOptions": { + "$id": "3859", + "json": { + "$id": "3860", + "name": "includeOpinionMining" + } + } + }, + { + "$id": "3861", + "kind": "property", + "name": "modelVersion", + "serializedName": "modelVersion", + "doc": "The version of the model to use when calling the Text Analytics service. It\nwill default to the latest available when not specified. We recommend you do\nnot specify this value unless absolutely necessary.", + "type": { + "$id": "3862", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SentimentSkillV3.modelVersion", + "serializationOptions": { + "$id": "3863", + "json": { + "$id": "3864", + "name": "modelVersion" + } + } + }, + { + "$id": "3865", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "3866", + "kind": "constant", + "valueType": { + "$id": "3867", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Text.V3.SentimentSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SentimentSkillV3.@odata.type", + "serializationOptions": { + "$id": "3868", + "json": { + "$id": "3869", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Text.V3.EntityLinkingSkill": { + "$id": "3870", + "kind": "model", + "name": "EntityLinkingSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.EntityLinkingSkill", + "usage": "Input,Output,Json", + "doc": "Using the Text Analytics API, extracts linked entities from text.", + "discriminatorValue": "#Microsoft.Skills.Text.V3.EntityLinkingSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "3871", + "kind": "property", + "name": "defaultLanguageCode", + "serializedName": "defaultLanguageCode", + "doc": "A value indicating which language code to use. Default is `en`.", + "type": { + "$id": "3872", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EntityLinkingSkill.defaultLanguageCode", + "serializationOptions": { + "$id": "3873", + "json": { + "$id": "3874", + "name": "defaultLanguageCode" + } + } + }, + { + "$id": "3875", + "kind": "property", + "name": "minimumPrecision", + "serializedName": "minimumPrecision", + "doc": "A value between 0 and 1 that be used to only include entities whose confidence\nscore is greater than the value specified. If not set (default), or if\nexplicitly set to null, all entities will be included.", + "type": { + "$id": "3876", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EntityLinkingSkill.minimumPrecision", + "serializationOptions": { + "$id": "3877", + "json": { + "$id": "3878", + "name": "minimumPrecision" + } + } + }, + { + "$id": "3879", + "kind": "property", + "name": "modelVersion", + "serializedName": "modelVersion", + "doc": "The version of the model to use when calling the Text Analytics service. It\nwill default to the latest available when not specified. We recommend you do\nnot specify this value unless absolutely necessary.", + "type": { + "$id": "3880", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EntityLinkingSkill.modelVersion", + "serializationOptions": { + "$id": "3881", + "json": { + "$id": "3882", + "name": "modelVersion" + } + } + }, + { + "$id": "3883", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "3884", + "kind": "constant", + "valueType": { + "$id": "3885", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Text.V3.EntityLinkingSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EntityLinkingSkill.@odata.type", + "serializationOptions": { + "$id": "3886", + "json": { + "$id": "3887", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Text.V3.EntityRecognitionSkill": { + "$id": "3888", + "kind": "model", + "name": "EntityRecognitionSkillV3", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.EntityRecognitionSkillV3", + "usage": "Input,Output,Json", + "doc": "Using the Text Analytics API, extracts entities of different types from text.", + "discriminatorValue": "#Microsoft.Skills.Text.V3.EntityRecognitionSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "3889", + "kind": "property", + "name": "categories", + "serializedName": "categories", + "doc": "A list of entity categories that should be extracted.", + "type": { + "$id": "3890", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "3891", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EntityRecognitionSkillV3.categories", + "serializationOptions": { + "$id": "3892", + "json": { + "$id": "3893", + "name": "categories" + } + } + }, + { + "$id": "3894", + "kind": "property", + "name": "defaultLanguageCode", + "serializedName": "defaultLanguageCode", + "doc": "A value indicating which language code to use. Default is `en`.", + "type": { + "$id": "3895", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EntityRecognitionSkillV3.defaultLanguageCode", + "serializationOptions": { + "$id": "3896", + "json": { + "$id": "3897", + "name": "defaultLanguageCode" + } + } + }, + { + "$id": "3898", + "kind": "property", + "name": "minimumPrecision", + "serializedName": "minimumPrecision", + "doc": "A value between 0 and 1 that be used to only include entities whose confidence\nscore is greater than the value specified. If not set (default), or if\nexplicitly set to null, all entities will be included.", + "type": { + "$id": "3899", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EntityRecognitionSkillV3.minimumPrecision", + "serializationOptions": { + "$id": "3900", + "json": { + "$id": "3901", + "name": "minimumPrecision" + } + } + }, + { + "$id": "3902", + "kind": "property", + "name": "modelVersion", + "serializedName": "modelVersion", + "doc": "The version of the model to use when calling the Text Analytics API. It will\ndefault to the latest available when not specified. We recommend you do not\nspecify this value unless absolutely necessary.", + "type": { + "$id": "3903", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EntityRecognitionSkillV3.modelVersion", + "serializationOptions": { + "$id": "3904", + "json": { + "$id": "3905", + "name": "modelVersion" + } + } + }, + { + "$id": "3906", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "3907", + "kind": "constant", + "valueType": { + "$id": "3908", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Text.V3.EntityRecognitionSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.EntityRecognitionSkillV3.@odata.type", + "serializationOptions": { + "$id": "3909", + "json": { + "$id": "3910", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Text.PIIDetectionSkill": { + "$id": "3911", + "kind": "model", + "name": "PIIDetectionSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.PIIDetectionSkill", + "usage": "Input,Output,Json", + "doc": "Using the Text Analytics API, extracts personal information from an input text\nand gives you the option of masking it.", + "discriminatorValue": "#Microsoft.Skills.Text.PIIDetectionSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "3912", + "kind": "property", + "name": "defaultLanguageCode", + "serializedName": "defaultLanguageCode", + "doc": "A value indicating which language code to use. Default is `en`.", + "type": { + "$id": "3913", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PIIDetectionSkill.defaultLanguageCode", + "serializationOptions": { + "$id": "3914", + "json": { + "$id": "3915", + "name": "defaultLanguageCode" + } + } + }, + { + "$id": "3916", + "kind": "property", + "name": "minimumPrecision", + "serializedName": "minimumPrecision", + "doc": "A value between 0 and 1 that be used to only include entities whose confidence\nscore is greater than the value specified. If not set (default), or if\nexplicitly set to null, all entities will be included.", + "type": { + "$id": "3917", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PIIDetectionSkill.minimumPrecision", + "serializationOptions": { + "$id": "3918", + "json": { + "$id": "3919", + "name": "minimumPrecision" + } + } + }, + { + "$id": "3920", + "kind": "property", + "name": "maskingMode", + "serializedName": "maskingMode", + "doc": "A parameter that provides various ways to mask the personal information\ndetected in the input text. Default is 'none'.", + "type": { + "$ref": "1552" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PIIDetectionSkill.maskingMode", + "serializationOptions": { + "$id": "3921", + "json": { + "$id": "3922", + "name": "maskingMode" + } + } + }, + { + "$id": "3923", + "kind": "property", + "name": "mask", + "serializedName": "maskingCharacter", + "doc": "The character used to mask the text if the maskingMode parameter is set to\nreplace. Default is '*'.", + "type": { + "$id": "3924", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PIIDetectionSkill.maskingCharacter", + "serializationOptions": { + "$id": "3925", + "json": { + "$id": "3926", + "name": "maskingCharacter" + } + } + }, + { + "$id": "3927", + "kind": "property", + "name": "modelVersion", + "serializedName": "modelVersion", + "doc": "The version of the model to use when calling the Text Analytics service. It\nwill default to the latest available when not specified. We recommend you do\nnot specify this value unless absolutely necessary.", + "type": { + "$id": "3928", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PIIDetectionSkill.modelVersion", + "serializationOptions": { + "$id": "3929", + "json": { + "$id": "3930", + "name": "modelVersion" + } + } + }, + { + "$id": "3931", + "kind": "property", + "name": "piiCategories", + "serializedName": "piiCategories", + "doc": "A list of PII entity categories that should be extracted and masked.", + "type": { + "$id": "3932", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "3933", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PIIDetectionSkill.piiCategories", + "serializationOptions": { + "$id": "3934", + "json": { + "$id": "3935", + "name": "piiCategories" + } + } + }, + { + "$id": "3936", + "kind": "property", + "name": "domain", + "serializedName": "domain", + "doc": "If specified, will set the PII domain to include only a subset of the entity\ncategories. Possible values include: 'phi', 'none'. Default is 'none'.", + "type": { + "$id": "3937", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PIIDetectionSkill.domain", + "serializationOptions": { + "$id": "3938", + "json": { + "$id": "3939", + "name": "domain" + } + } + }, + { + "$id": "3940", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "3941", + "kind": "constant", + "valueType": { + "$id": "3942", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Text.PIIDetectionSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.PIIDetectionSkill.@odata.type", + "serializationOptions": { + "$id": "3943", + "json": { + "$id": "3944", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Text.SplitSkill": { + "$id": "3945", + "kind": "model", + "name": "SplitSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SplitSkill", + "usage": "Input,Output,Json", + "doc": "A skill to split a string into chunks of text.", + "discriminatorValue": "#Microsoft.Skills.Text.SplitSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "3946", + "kind": "property", + "name": "defaultLanguageCode", + "serializedName": "defaultLanguageCode", + "doc": "A value indicating which language code to use. Default is `en`.", + "type": { + "$ref": "1558" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SplitSkill.defaultLanguageCode", + "serializationOptions": { + "$id": "3947", + "json": { + "$id": "3948", + "name": "defaultLanguageCode" + } + } + }, + { + "$id": "3949", + "kind": "property", + "name": "textSplitMode", + "serializedName": "textSplitMode", + "doc": "A value indicating which split mode to perform.", + "type": { + "$ref": "1626" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SplitSkill.textSplitMode", + "serializationOptions": { + "$id": "3950", + "json": { + "$id": "3951", + "name": "textSplitMode" + } + } + }, + { + "$id": "3952", + "kind": "property", + "name": "maximumPageLength", + "serializedName": "maximumPageLength", + "doc": "The desired maximum page length. Default is 10000.", + "type": { + "$id": "3953", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SplitSkill.maximumPageLength", + "serializationOptions": { + "$id": "3954", + "json": { + "$id": "3955", + "name": "maximumPageLength" + } + } + }, + { + "$id": "3956", + "kind": "property", + "name": "pageOverlapLength", + "serializedName": "pageOverlapLength", + "doc": "Only applicable when textSplitMode is set to 'pages'. If specified, n+1th chunk\nwill start with this number of characters/tokens from the end of the nth chunk.", + "type": { + "$id": "3957", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SplitSkill.pageOverlapLength", + "serializationOptions": { + "$id": "3958", + "json": { + "$id": "3959", + "name": "pageOverlapLength" + } + } + }, + { + "$id": "3960", + "kind": "property", + "name": "maximumPagesToTake", + "serializedName": "maximumPagesToTake", + "doc": "Only applicable when textSplitMode is set to 'pages'. If specified, the\nSplitSkill will discontinue splitting after processing the first\n'maximumPagesToTake' pages, in order to improve performance when only a few\ninitial pages are needed from each document.", + "type": { + "$id": "3961", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SplitSkill.maximumPagesToTake", + "serializationOptions": { + "$id": "3962", + "json": { + "$id": "3963", + "name": "maximumPagesToTake" + } + } + }, + { + "$id": "3964", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "3965", + "kind": "constant", + "valueType": { + "$id": "3966", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Text.SplitSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SplitSkill.@odata.type", + "serializationOptions": { + "$id": "3967", + "json": { + "$id": "3968", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Text.CustomEntityLookupSkill": { + "$id": "3969", + "kind": "model", + "name": "CustomEntityLookupSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.CustomEntityLookupSkill", + "usage": "Input,Output,Json", + "doc": "A skill looks for text from a custom, user-defined list of words and phrases.", + "discriminatorValue": "#Microsoft.Skills.Text.CustomEntityLookupSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "3970", + "kind": "property", + "name": "defaultLanguageCode", + "serializedName": "defaultLanguageCode", + "doc": "A value indicating which language code to use. Default is `en`.", + "type": { + "$ref": "1632" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntityLookupSkill.defaultLanguageCode", + "serializationOptions": { + "$id": "3971", + "json": { + "$id": "3972", + "name": "defaultLanguageCode" + } + } + }, + { + "$id": "3973", + "kind": "property", + "name": "entitiesDefinitionUri", + "serializedName": "entitiesDefinitionUri", + "doc": "Path to a JSON or CSV file containing all the target text to match against.\nThis entity definition is read at the beginning of an indexer run. Any updates\nto this file during an indexer run will not take effect until subsequent runs.\nThis config must be accessible over HTTPS.", + "type": { + "$id": "3974", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntityLookupSkill.entitiesDefinitionUri", + "serializationOptions": { + "$id": "3975", + "json": { + "$id": "3976", + "name": "entitiesDefinitionUri" + } + } + }, + { + "$id": "3977", + "kind": "property", + "name": "inlineEntitiesDefinition", + "serializedName": "inlineEntitiesDefinition", + "doc": "The inline CustomEntity definition.", + "type": { + "$id": "3978", + "kind": "array", + "name": "ArrayCustomEntity", + "valueType": { + "$id": "3979", + "kind": "model", + "name": "CustomEntity", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.CustomEntity", + "usage": "Input,Output,Json", + "doc": "An object that contains information about the matches that were found, and\nrelated metadata.", + "decorators": [], + "properties": [ + { + "$id": "3980", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The top-level entity descriptor. Matches in the skill output will be grouped by\nthis name, and it should represent the \"normalized\" form of the text being\nfound.", + "type": { + "$id": "3981", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntity.name", + "serializationOptions": { + "$id": "3982", + "json": { + "$id": "3983", + "name": "name" + } + } + }, + { + "$id": "3984", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "This field can be used as a passthrough for custom metadata about the matched\ntext(s). The value of this field will appear with every match of its entity in\nthe skill output.", + "type": { + "$id": "3985", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntity.description", + "serializationOptions": { + "$id": "3986", + "json": { + "$id": "3987", + "name": "description" + } + } + }, + { + "$id": "3988", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "This field can be used as a passthrough for custom metadata about the matched\ntext(s). The value of this field will appear with every match of its entity in\nthe skill output.", + "type": { + "$id": "3989", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntity.type", + "serializationOptions": { + "$id": "3990", + "json": { + "$id": "3991", + "name": "type" + } + } + }, + { + "$id": "3992", + "kind": "property", + "name": "subtype", + "serializedName": "subtype", + "doc": "This field can be used as a passthrough for custom metadata about the matched\ntext(s). The value of this field will appear with every match of its entity in\nthe skill output.", + "type": { + "$id": "3993", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntity.subtype", + "serializationOptions": { + "$id": "3994", + "json": { + "$id": "3995", + "name": "subtype" + } + } + }, + { + "$id": "3996", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "This field can be used as a passthrough for custom metadata about the matched\ntext(s). The value of this field will appear with every match of its entity in\nthe skill output.", + "type": { + "$id": "3997", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntity.id", + "serializationOptions": { + "$id": "3998", + "json": { + "$id": "3999", + "name": "id" + } + } + }, + { + "$id": "4000", + "kind": "property", + "name": "caseSensitive", + "serializedName": "caseSensitive", + "doc": "Defaults to false. Boolean value denoting whether comparisons with the entity\nname should be sensitive to character casing. Sample case insensitive matches\nof \"Microsoft\" could be: microsoft, microSoft, MICROSOFT.", + "type": { + "$id": "4001", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntity.caseSensitive", + "serializationOptions": { + "$id": "4002", + "json": { + "$id": "4003", + "name": "caseSensitive" + } + } + }, + { + "$id": "4004", + "kind": "property", + "name": "accentSensitive", + "serializedName": "accentSensitive", + "doc": "Defaults to false. Boolean value denoting whether comparisons with the entity\nname should be sensitive to accent.", + "type": { + "$id": "4005", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntity.accentSensitive", + "serializationOptions": { + "$id": "4006", + "json": { + "$id": "4007", + "name": "accentSensitive" + } + } + }, + { + "$id": "4008", + "kind": "property", + "name": "fuzzyEditDistance", + "serializedName": "fuzzyEditDistance", + "doc": "Defaults to 0. Maximum value of 5. Denotes the acceptable number of divergent\ncharacters that would still constitute a match with the entity name. The\nsmallest possible fuzziness for any given match is returned. For instance, if\nthe edit distance is set to 3, \"Windows10\" would still match \"Windows\",\n\"Windows10\" and \"Windows 7\". When case sensitivity is set to false, case\ndifferences do NOT count towards fuzziness tolerance, but otherwise do.", + "type": { + "$id": "4009", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntity.fuzzyEditDistance", + "serializationOptions": { + "$id": "4010", + "json": { + "$id": "4011", + "name": "fuzzyEditDistance" + } + } + }, + { + "$id": "4012", + "kind": "property", + "name": "defaultCaseSensitive", + "serializedName": "defaultCaseSensitive", + "doc": "Changes the default case sensitivity value for this entity. It be used to\nchange the default value of all aliases caseSensitive values.", + "type": { + "$id": "4013", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntity.defaultCaseSensitive", + "serializationOptions": { + "$id": "4014", + "json": { + "$id": "4015", + "name": "defaultCaseSensitive" + } + } + }, + { + "$id": "4016", + "kind": "property", + "name": "defaultAccentSensitive", + "serializedName": "defaultAccentSensitive", + "doc": "Changes the default accent sensitivity value for this entity. It be used to\nchange the default value of all aliases accentSensitive values.", + "type": { + "$id": "4017", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntity.defaultAccentSensitive", + "serializationOptions": { + "$id": "4018", + "json": { + "$id": "4019", + "name": "defaultAccentSensitive" + } + } + }, + { + "$id": "4020", + "kind": "property", + "name": "defaultFuzzyEditDistance", + "serializedName": "defaultFuzzyEditDistance", + "doc": "Changes the default fuzzy edit distance value for this entity. It can be used\nto change the default value of all aliases fuzzyEditDistance values.", + "type": { + "$id": "4021", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntity.defaultFuzzyEditDistance", + "serializationOptions": { + "$id": "4022", + "json": { + "$id": "4023", + "name": "defaultFuzzyEditDistance" + } + } + }, + { + "$id": "4024", + "kind": "property", + "name": "aliases", + "serializedName": "aliases", + "doc": "An array of complex objects that can be used to specify alternative spellings\nor synonyms to the root entity name.", + "type": { + "$id": "4025", + "kind": "array", + "name": "ArrayCustomEntityAlias", + "valueType": { + "$id": "4026", + "kind": "model", + "name": "CustomEntityAlias", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.CustomEntityAlias", + "usage": "Input,Output,Json", + "doc": "A complex object that can be used to specify alternative spellings or synonyms\nto the root entity name.", + "decorators": [], + "properties": [ + { + "$id": "4027", + "kind": "property", + "name": "text", + "serializedName": "text", + "doc": "The text of the alias.", + "type": { + "$id": "4028", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntityAlias.text", + "serializationOptions": { + "$id": "4029", + "json": { + "$id": "4030", + "name": "text" + } + } + }, + { + "$id": "4031", + "kind": "property", + "name": "caseSensitive", + "serializedName": "caseSensitive", + "doc": "Determine if the alias is case sensitive.", + "type": { + "$id": "4032", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntityAlias.caseSensitive", + "serializationOptions": { + "$id": "4033", + "json": { + "$id": "4034", + "name": "caseSensitive" + } + } + }, + { + "$id": "4035", + "kind": "property", + "name": "accentSensitive", + "serializedName": "accentSensitive", + "doc": "Determine if the alias is accent sensitive.", + "type": { + "$id": "4036", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntityAlias.accentSensitive", + "serializationOptions": { + "$id": "4037", + "json": { + "$id": "4038", + "name": "accentSensitive" + } + } + }, + { + "$id": "4039", + "kind": "property", + "name": "fuzzyEditDistance", + "serializedName": "fuzzyEditDistance", + "doc": "Determine the fuzzy edit distance of the alias.", + "type": { + "$id": "4040", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntityAlias.fuzzyEditDistance", + "serializationOptions": { + "$id": "4041", + "json": { + "$id": "4042", + "name": "fuzzyEditDistance" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntity.aliases", + "serializationOptions": { + "$id": "4043", + "json": { + "$id": "4044", + "name": "aliases" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntityLookupSkill.inlineEntitiesDefinition", + "serializationOptions": { + "$id": "4045", + "json": { + "$id": "4046", + "name": "inlineEntitiesDefinition" + } + } + }, + { + "$id": "4047", + "kind": "property", + "name": "globalDefaultCaseSensitive", + "serializedName": "globalDefaultCaseSensitive", + "doc": "A global flag for CaseSensitive. If CaseSensitive is not set in CustomEntity,\nthis value will be the default value.", + "type": { + "$id": "4048", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntityLookupSkill.globalDefaultCaseSensitive", + "serializationOptions": { + "$id": "4049", + "json": { + "$id": "4050", + "name": "globalDefaultCaseSensitive" + } + } + }, + { + "$id": "4051", + "kind": "property", + "name": "globalDefaultAccentSensitive", + "serializedName": "globalDefaultAccentSensitive", + "doc": "A global flag for AccentSensitive. If AccentSensitive is not set in\nCustomEntity, this value will be the default value.", + "type": { + "$id": "4052", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntityLookupSkill.globalDefaultAccentSensitive", + "serializationOptions": { + "$id": "4053", + "json": { + "$id": "4054", + "name": "globalDefaultAccentSensitive" + } + } + }, + { + "$id": "4055", + "kind": "property", + "name": "globalDefaultFuzzyEditDistance", + "serializedName": "globalDefaultFuzzyEditDistance", + "doc": "A global flag for FuzzyEditDistance. If FuzzyEditDistance is not set in\nCustomEntity, this value will be the default value.", + "type": { + "$id": "4056", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntityLookupSkill.globalDefaultFuzzyEditDistance", + "serializationOptions": { + "$id": "4057", + "json": { + "$id": "4058", + "name": "globalDefaultFuzzyEditDistance" + } + } + }, + { + "$id": "4059", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "4060", + "kind": "constant", + "valueType": { + "$id": "4061", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Text.CustomEntityLookupSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CustomEntityLookupSkill.@odata.type", + "serializationOptions": { + "$id": "4062", + "json": { + "$id": "4063", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Text.TranslationSkill": { + "$id": "4064", + "kind": "model", + "name": "TextTranslationSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.TextTranslationSkill", + "usage": "Input,Output,Json", + "doc": "A skill to translate text from one language to another.", + "discriminatorValue": "#Microsoft.Skills.Text.TranslationSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "4065", + "kind": "property", + "name": "defaultToLanguageCode", + "serializedName": "defaultToLanguageCode", + "doc": "The language code to translate documents into for documents that don't specify\nthe to language explicitly.", + "type": { + "$ref": "1652" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.TextTranslationSkill.defaultToLanguageCode", + "serializationOptions": { + "$id": "4066", + "json": { + "$id": "4067", + "name": "defaultToLanguageCode" + } + } + }, + { + "$id": "4068", + "kind": "property", + "name": "defaultFromLanguageCode", + "serializedName": "defaultFromLanguageCode", + "doc": "The language code to translate documents from for documents that don't specify\nthe from language explicitly.", + "type": { + "$ref": "1652" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.TextTranslationSkill.defaultFromLanguageCode", + "serializationOptions": { + "$id": "4069", + "json": { + "$id": "4070", + "name": "defaultFromLanguageCode" + } + } + }, + { + "$id": "4071", + "kind": "property", + "name": "suggestedFrom", + "serializedName": "suggestedFrom", + "doc": "The language code to translate documents from when neither the fromLanguageCode\ninput nor the defaultFromLanguageCode parameter are provided, and the automatic\nlanguage detection is unsuccessful. Default is `en`.", + "type": { + "$ref": "1652" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.TextTranslationSkill.suggestedFrom", + "serializationOptions": { + "$id": "4072", + "json": { + "$id": "4073", + "name": "suggestedFrom" + } + } + }, + { + "$id": "4074", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "4075", + "kind": "constant", + "valueType": { + "$id": "4076", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Text.TranslationSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.TextTranslationSkill.@odata.type", + "serializationOptions": { + "$id": "4077", + "json": { + "$id": "4078", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Util.DocumentExtractionSkill": { + "$id": "4079", + "kind": "model", + "name": "DocumentExtractionSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.DocumentExtractionSkill", + "usage": "Input,Output,Json", + "doc": "A skill that extracts content from a file within the enrichment pipeline.", + "discriminatorValue": "#Microsoft.Skills.Util.DocumentExtractionSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "4080", + "kind": "property", + "name": "parsingMode", + "serializedName": "parsingMode", + "doc": "The parsingMode for the skill. Will be set to 'default' if not defined.", + "type": { + "$id": "4081", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DocumentExtractionSkill.parsingMode", + "serializationOptions": { + "$id": "4082", + "json": { + "$id": "4083", + "name": "parsingMode" + } + } + }, + { + "$id": "4084", + "kind": "property", + "name": "dataToExtract", + "serializedName": "dataToExtract", + "doc": "The type of data to be extracted for the skill. Will be set to\n'contentAndMetadata' if not defined.", + "type": { + "$id": "4085", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DocumentExtractionSkill.dataToExtract", + "serializationOptions": { + "$id": "4086", + "json": { + "$id": "4087", + "name": "dataToExtract" + } + } + }, + { + "$id": "4088", + "kind": "property", + "name": "configuration", + "serializedName": "configuration", + "doc": "A dictionary of configurations for the skill.", + "type": { + "$id": "4089", + "kind": "dict", + "keyType": { + "$id": "4090", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "4091", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DocumentExtractionSkill.configuration", + "serializationOptions": { + "$id": "4092", + "json": { + "$id": "4093", + "name": "configuration" + } + } + }, + { + "$id": "4094", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "4095", + "kind": "constant", + "valueType": { + "$id": "4096", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Util.DocumentExtractionSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DocumentExtractionSkill.@odata.type", + "serializationOptions": { + "$id": "4097", + "json": { + "$id": "4098", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Custom.WebApiSkill": { + "$id": "4099", + "kind": "model", + "name": "WebApiSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.WebApiSkill", + "usage": "Input,Output,Json", + "doc": "A skill that can call a Web API endpoint, allowing you to extend a skillset by\nhaving it call your custom code.", + "discriminatorValue": "#Microsoft.Skills.Custom.WebApiSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "4100", + "kind": "property", + "name": "uri", + "serializedName": "uri", + "doc": "The url for the Web API.", + "type": { + "$id": "4101", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiSkill.uri", + "serializationOptions": { + "$id": "4102", + "json": { + "$id": "4103", + "name": "uri" + } + } + }, + { + "$id": "4104", + "kind": "property", + "name": "httpHeaders", + "serializedName": "httpHeaders", + "doc": "The headers required to make the http request.", + "type": { + "$id": "4105", + "kind": "dict", + "keyType": { + "$id": "4106", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "4107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiSkill.httpHeaders", + "serializationOptions": { + "$id": "4108", + "json": { + "$id": "4109", + "name": "httpHeaders" + } + } + }, + { + "$id": "4110", + "kind": "property", + "name": "httpMethod", + "serializedName": "httpMethod", + "doc": "The method for the http request.", + "type": { + "$id": "4111", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiSkill.httpMethod", + "serializationOptions": { + "$id": "4112", + "json": { + "$id": "4113", + "name": "httpMethod" + } + } + }, + { + "$id": "4114", + "kind": "property", + "name": "timeout", + "serializedName": "timeout", + "doc": "The desired timeout for the request. Default is 30 seconds.", + "type": { + "$id": "4115", + "kind": "duration", + "name": "duration", + "encode": "ISO8601", + "wireType": { + "$id": "4116", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.duration", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiSkill.timeout", + "serializationOptions": { + "$id": "4117", + "json": { + "$id": "4118", + "name": "timeout" + } + } + }, + { + "$id": "4119", + "kind": "property", + "name": "batchSize", + "serializedName": "batchSize", + "doc": "The desired batch size which indicates number of documents.", + "type": { + "$id": "4120", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiSkill.batchSize", + "serializationOptions": { + "$id": "4121", + "json": { + "$id": "4122", + "name": "batchSize" + } + } + }, + { + "$id": "4123", + "kind": "property", + "name": "degreeOfParallelism", + "serializedName": "degreeOfParallelism", + "doc": "If set, the number of parallel calls that can be made to the Web API.", + "type": { + "$id": "4124", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiSkill.degreeOfParallelism", + "serializationOptions": { + "$id": "4125", + "json": { + "$id": "4126", + "name": "degreeOfParallelism" + } + } + }, + { + "$id": "4127", + "kind": "property", + "name": "authResourceId", + "serializedName": "authResourceId", + "doc": "Applies to custom skills that connect to external code in an Azure function or\nsome other application that provides the transformations. This value should be\nthe application ID created for the function or app when it was registered with\nAzure Active Directory. When specified, the custom skill connects to the\nfunction or app using a managed ID (either system or user-assigned) of the\nsearch service and the access token of the function or app, using this value as\nthe resource id for creating the scope of the access token.", + "type": { + "$id": "4128", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiSkill.authResourceId", + "serializationOptions": { + "$id": "4129", + "json": { + "$id": "4130", + "name": "authResourceId" + } + } + }, + { + "$id": "4131", + "kind": "property", + "name": "authIdentity", + "serializedName": "authIdentity", + "doc": "The user-assigned managed identity used for outbound connections. If an\nauthResourceId is provided and it's not specified, the system-assigned managed\nidentity is used. On updates to the indexer, if the identity is unspecified,\nthe value remains unchanged. If set to \"none\", the value of this property is\ncleared.", + "type": { + "$ref": "3467" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiSkill.authIdentity", + "serializationOptions": { + "$id": "4132", + "json": { + "$id": "4133", + "name": "authIdentity" + } + } + }, + { + "$id": "4134", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "4135", + "kind": "constant", + "valueType": { + "$id": "4136", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Custom.WebApiSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.WebApiSkill.@odata.type", + "serializationOptions": { + "$id": "4137", + "json": { + "$id": "4138", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill": { + "$id": "4139", + "kind": "model", + "name": "AzureOpenAIEmbeddingSkill", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.AzureOpenAIEmbeddingSkill", + "usage": "Input,Output,Json", + "doc": "Allows you to generate a vector embedding for a given text input using the\nAzure OpenAI resource.", + "discriminatorValue": "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill", + "decorators": [], + "baseModel": { + "$ref": "3680" + }, + "properties": [ + { + "$id": "4140", + "kind": "property", + "name": "resourceUrl", + "serializedName": "resourceUri", + "doc": "The resource URI of the Azure OpenAI resource.", + "type": { + "$id": "4141", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AzureOpenAIEmbeddingSkill.resourceUri", + "serializationOptions": { + "$id": "4142", + "json": { + "$id": "4143", + "name": "resourceUri" + } + } + }, + { + "$id": "4144", + "kind": "property", + "name": "deploymentName", + "serializedName": "deploymentId", + "doc": "ID of the Azure OpenAI model deployment on the designated resource.", + "type": { + "$id": "4145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AzureOpenAIEmbeddingSkill.deploymentId", + "serializationOptions": { + "$id": "4146", + "json": { + "$id": "4147", + "name": "deploymentId" + } + } + }, + { + "$id": "4148", + "kind": "property", + "name": "apiKey", + "serializedName": "apiKey", + "doc": "API key of the designated Azure OpenAI resource.", + "type": { + "$id": "4149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AzureOpenAIEmbeddingSkill.apiKey", + "serializationOptions": { + "$id": "4150", + "json": { + "$id": "4151", + "name": "apiKey" + } + } + }, + { + "$id": "4152", + "kind": "property", + "name": "authIdentity", + "serializedName": "authIdentity", + "doc": "The user-assigned managed identity used for outbound connections.", + "type": { + "$ref": "3467" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AzureOpenAIEmbeddingSkill.authIdentity", + "serializationOptions": { + "$id": "4153", + "json": { + "$id": "4154", + "name": "authIdentity" + } + } + }, + { + "$id": "4155", + "kind": "property", + "name": "modelName", + "serializedName": "modelName", + "doc": "The name of the embedding model that is deployed at the provided deploymentId\npath.", + "type": { + "$ref": "921" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AzureOpenAIEmbeddingSkill.modelName", + "serializationOptions": { + "$id": "4156", + "json": { + "$id": "4157", + "name": "modelName" + } + } + }, + { + "$id": "4158", + "kind": "property", + "name": "dimensions", + "serializedName": "dimensions", + "doc": "The number of dimensions the resulting output embeddings should have. Only\nsupported in text-embedding-3 and later models.", + "type": { + "$id": "4159", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AzureOpenAIEmbeddingSkill.dimensions", + "serializationOptions": { + "$id": "4160", + "json": { + "$id": "4161", + "name": "dimensions" + } + } + }, + { + "$id": "4162", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of skill.", + "type": { + "$id": "4163", + "kind": "constant", + "valueType": { + "$id": "4164", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.AzureOpenAIEmbeddingSkill.@odata.type", + "serializationOptions": { + "$id": "4165", + "json": { + "$id": "4166", + "name": "@odata.type" + } + } + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerSkillset.skills", + "serializationOptions": { + "$id": "4167", + "json": { + "$id": "4168", + "name": "skills" + } + } + }, + { + "$id": "4169", + "kind": "property", + "name": "cognitiveServicesAccount", + "serializedName": "cognitiveServices", + "doc": "Details about the Azure AI service to be used when running skills.", + "type": { + "$id": "4170", + "kind": "model", + "name": "CognitiveServicesAccount", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.CognitiveServicesAccount", + "usage": "Input,Output,Json", + "doc": "Base type for describing any Azure AI service resource attached to a skillset.", + "decorators": [], + "discriminatorProperty": { + "$id": "4171", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "The discriminator for derived types.", + "type": { + "$id": "4172", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CognitiveServicesAccount.@odata.type", + "serializationOptions": { + "$id": "4173", + "json": { + "$id": "4174", + "name": "@odata.type" + } + } + }, + "properties": [ + { + "$ref": "4171" + }, + { + "$id": "4175", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "Description of the Azure AI service resource attached to a skillset.", + "type": { + "$id": "4176", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CognitiveServicesAccount.description", + "serializationOptions": { + "$id": "4177", + "json": { + "$id": "4178", + "name": "description" + } + } + } + ], + "discriminatedSubtypes": { + "$id": "4179", + "#Microsoft.Azure.Search.DefaultCognitiveServices": { + "$id": "4180", + "kind": "model", + "name": "DefaultCognitiveServicesAccount", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.DefaultCognitiveServicesAccount", + "usage": "Input,Output,Json", + "doc": "An empty object that represents the default Azure AI service resource for a\nskillset.", + "discriminatorValue": "#Microsoft.Azure.Search.DefaultCognitiveServices", + "decorators": [], + "baseModel": { + "$ref": "4170" + }, + "properties": [ + { + "$id": "4181", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of Azure AI service resource attached to a\nskillset.", + "type": { + "$id": "4182", + "kind": "constant", + "valueType": { + "$id": "4183", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.DefaultCognitiveServices", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DefaultCognitiveServicesAccount.@odata.type", + "serializationOptions": { + "$id": "4184", + "json": { + "$id": "4185", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.CognitiveServicesByKey": { + "$id": "4186", + "kind": "model", + "name": "CognitiveServicesAccountKey", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.CognitiveServicesAccountKey", + "usage": "Input,Output,Json", + "doc": "The multi-region account key of an Azure AI service resource that's attached to\na skillset.", + "discriminatorValue": "#Microsoft.Azure.Search.CognitiveServicesByKey", + "decorators": [], + "baseModel": { + "$ref": "4170" + }, + "properties": [ + { + "$id": "4187", + "kind": "property", + "name": "key", + "serializedName": "key", + "doc": "The key used to provision the Azure AI service resource attached to a skillset.", + "type": { + "$id": "4188", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CognitiveServicesAccountKey.key", + "serializationOptions": { + "$id": "4189", + "json": { + "$id": "4190", + "name": "key" + } + } + }, + { + "$id": "4191", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of Azure AI service resource attached to a\nskillset.", + "type": { + "$id": "4192", + "kind": "constant", + "valueType": { + "$id": "4193", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.CognitiveServicesByKey", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.CognitiveServicesAccountKey.@odata.type", + "serializationOptions": { + "$id": "4194", + "json": { + "$id": "4195", + "name": "@odata.type" + } + } + } + ] + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerSkillset.cognitiveServices", + "serializationOptions": { + "$id": "4196", + "json": { + "$id": "4197", + "name": "cognitiveServices" + } + } + }, + { + "$id": "4198", + "kind": "property", + "name": "knowledgeStore", + "serializedName": "knowledgeStore", + "doc": "Definition of additional projections to Azure blob, table, or files, of\nenriched data.", + "type": { + "$id": "4199", + "kind": "model", + "name": "SearchIndexerKnowledgeStore", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStore", + "usage": "Input,Output,Json", + "doc": "Definition of additional projections to azure blob, table, or files, of\nenriched data.", + "decorators": [], + "properties": [ + { + "$id": "4200", + "kind": "property", + "name": "storageConnectionString", + "serializedName": "storageConnectionString", + "doc": "The connection string to the storage account projections will be stored in.", + "type": { + "$id": "4201", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStore.storageConnectionString", + "serializationOptions": { + "$id": "4202", + "json": { + "$id": "4203", + "name": "storageConnectionString" + } + } + }, + { + "$id": "4204", + "kind": "property", + "name": "projections", + "serializedName": "projections", + "doc": "A list of additional projections to perform during indexing.", + "type": { + "$id": "4205", + "kind": "array", + "name": "ArraySearchIndexerKnowledgeStoreProjection", + "valueType": { + "$id": "4206", + "kind": "model", + "name": "SearchIndexerKnowledgeStoreProjection", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStoreProjection", + "usage": "Input,Output,Json", + "doc": "Container object for various projection selectors.", + "decorators": [], + "properties": [ + { + "$id": "4207", + "kind": "property", + "name": "tables", + "serializedName": "tables", + "doc": "Projections to Azure Table storage.", + "type": { + "$id": "4208", + "kind": "array", + "name": "ArraySearchIndexerKnowledgeStoreTableProjectionSelector", + "valueType": { + "$id": "4209", + "kind": "model", + "name": "SearchIndexerKnowledgeStoreTableProjectionSelector", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStoreTableProjectionSelector", + "usage": "Input,Output,Json", + "doc": "Description for what data to store in Azure Tables.", + "decorators": [], + "baseModel": { + "$id": "4210", + "kind": "model", + "name": "SearchIndexerKnowledgeStoreProjectionSelector", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStoreProjectionSelector", + "usage": "Input,Output,Json", + "doc": "Abstract class to share properties between concrete selectors.", + "decorators": [], + "properties": [ + { + "$id": "4211", + "kind": "property", + "name": "referenceKeyName", + "serializedName": "referenceKeyName", + "doc": "Name of reference key to different projection.", + "type": { + "$id": "4212", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStoreProjectionSelector.referenceKeyName", + "serializationOptions": { + "$id": "4213", + "json": { + "$id": "4214", + "name": "referenceKeyName" + } + } + }, + { + "$id": "4215", + "kind": "property", + "name": "generatedKeyName", + "serializedName": "generatedKeyName", + "doc": "Name of generated key to store projection under.", + "type": { + "$id": "4216", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStoreProjectionSelector.generatedKeyName", + "serializationOptions": { + "$id": "4217", + "json": { + "$id": "4218", + "name": "generatedKeyName" + } + } + }, + { + "$id": "4219", + "kind": "property", + "name": "source", + "serializedName": "source", + "doc": "Source data to project.", + "type": { + "$id": "4220", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStoreProjectionSelector.source", + "serializationOptions": { + "$id": "4221", + "json": { + "$id": "4222", + "name": "source" + } + } + }, + { + "$id": "4223", + "kind": "property", + "name": "sourceContext", + "serializedName": "sourceContext", + "doc": "Source context for complex projections.", + "type": { + "$id": "4224", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStoreProjectionSelector.sourceContext", + "serializationOptions": { + "$id": "4225", + "json": { + "$id": "4226", + "name": "sourceContext" + } + } + }, + { + "$id": "4227", + "kind": "property", + "name": "inputs", + "serializedName": "inputs", + "doc": "Nested inputs for complex projections.", + "type": { + "$id": "4228", + "kind": "array", + "name": "ArrayInputFieldMappingEntry", + "valueType": { + "$ref": "3699" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStoreProjectionSelector.inputs", + "serializationOptions": { + "$id": "4229", + "json": { + "$id": "4230", + "name": "inputs" + } + } + } + ] + }, + "properties": [ + { + "$id": "4231", + "kind": "property", + "name": "tableName", + "serializedName": "tableName", + "doc": "Name of the Azure table to store projected data in.", + "type": { + "$id": "4232", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStoreTableProjectionSelector.tableName", + "serializationOptions": { + "$id": "4233", + "json": { + "$id": "4234", + "name": "tableName" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStoreProjection.tables", + "serializationOptions": { + "$id": "4235", + "json": { + "$id": "4236", + "name": "tables" + } + } + }, + { + "$id": "4237", + "kind": "property", + "name": "objects", + "serializedName": "objects", + "doc": "Projections to Azure Blob storage.", + "type": { + "$id": "4238", + "kind": "array", + "name": "ArraySearchIndexerKnowledgeStoreObjectProjectionSelector", + "valueType": { + "$id": "4239", + "kind": "model", + "name": "SearchIndexerKnowledgeStoreObjectProjectionSelector", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStoreObjectProjectionSelector", + "usage": "Input,Output,Json", + "doc": "Projection definition for what data to store in Azure Blob.", + "decorators": [], + "baseModel": { + "$id": "4240", + "kind": "model", + "name": "SearchIndexerKnowledgeStoreBlobProjectionSelector", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStoreBlobProjectionSelector", + "usage": "Input,Output,Json", + "doc": "Abstract class to share properties between concrete selectors.", + "decorators": [], + "baseModel": { + "$ref": "4210" + }, + "properties": [ + { + "$id": "4241", + "kind": "property", + "name": "storageContainer", + "serializedName": "storageContainer", + "doc": "Blob container to store projections in.", + "type": { + "$id": "4242", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStoreBlobProjectionSelector.storageContainer", + "serializationOptions": { + "$id": "4243", + "json": { + "$id": "4244", + "name": "storageContainer" + } + } + } + ] + }, + "properties": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStoreProjection.objects", + "serializationOptions": { + "$id": "4245", + "json": { + "$id": "4246", + "name": "objects" + } + } + }, + { + "$id": "4247", + "kind": "property", + "name": "files", + "serializedName": "files", + "doc": "Projections to Azure File storage.", + "type": { + "$id": "4248", + "kind": "array", + "name": "ArraySearchIndexerKnowledgeStoreFileProjectionSelector", + "valueType": { + "$id": "4249", + "kind": "model", + "name": "SearchIndexerKnowledgeStoreFileProjectionSelector", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStoreFileProjectionSelector", + "usage": "Input,Output,Json", + "doc": "Projection definition for what data to store in Azure Files.", + "decorators": [], + "baseModel": { + "$ref": "4240" + }, + "properties": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStoreProjection.files", + "serializationOptions": { + "$id": "4250", + "json": { + "$id": "4251", + "name": "files" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerKnowledgeStore.projections", + "serializationOptions": { + "$id": "4252", + "json": { + "$id": "4253", + "name": "projections" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerSkillset.knowledgeStore", + "serializationOptions": { + "$id": "4254", + "json": { + "$id": "4255", + "name": "knowledgeStore" + } + } + }, + { + "$id": "4256", + "kind": "property", + "name": "indexProjection", + "serializedName": "indexProjections", + "doc": "Definition of additional projections to secondary search index(es).", + "type": { + "$id": "4257", + "kind": "model", + "name": "SearchIndexerIndexProjection", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerIndexProjection", + "usage": "Input,Output,Json", + "doc": "Definition of additional projections to secondary search indexes.", + "decorators": [], + "properties": [ + { + "$id": "4258", + "kind": "property", + "name": "selectors", + "serializedName": "selectors", + "doc": "A list of projections to be performed to secondary search indexes.", + "type": { + "$id": "4259", + "kind": "array", + "name": "ArraySearchIndexerIndexProjectionSelector", + "valueType": { + "$id": "4260", + "kind": "model", + "name": "SearchIndexerIndexProjectionSelector", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerIndexProjectionSelector", + "usage": "Input,Output,Json", + "doc": "Description for what data to store in the designated search index.", + "decorators": [], + "properties": [ + { + "$id": "4261", + "kind": "property", + "name": "targetIndexName", + "serializedName": "targetIndexName", + "doc": "Name of the search index to project to. Must have a key field with the 'keyword' analyzer set.", + "type": { + "$id": "4262", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerIndexProjectionSelector.targetIndexName", + "serializationOptions": { + "$id": "4263", + "json": { + "$id": "4264", + "name": "targetIndexName" + } + } + }, + { + "$id": "4265", + "kind": "property", + "name": "parentKeyFieldName", + "serializedName": "parentKeyFieldName", + "doc": "Name of the field in the search index to map the parent document's key value\nto. Must be a string field that is filterable and not the key field.", + "type": { + "$id": "4266", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerIndexProjectionSelector.parentKeyFieldName", + "serializationOptions": { + "$id": "4267", + "json": { + "$id": "4268", + "name": "parentKeyFieldName" + } + } + }, + { + "$id": "4269", + "kind": "property", + "name": "sourceContext", + "serializedName": "sourceContext", + "doc": "Source context for the projections. Represents the cardinality at which the\ndocument will be split into multiple sub documents.", + "type": { + "$id": "4270", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerIndexProjectionSelector.sourceContext", + "serializationOptions": { + "$id": "4271", + "json": { + "$id": "4272", + "name": "sourceContext" + } + } + }, + { + "$id": "4273", + "kind": "property", + "name": "mappings", + "serializedName": "mappings", + "doc": "Mappings for the projection, or which source should be mapped to which field in\nthe target index.", + "type": { + "$id": "4274", + "kind": "array", + "name": "ArrayInputFieldMappingEntry", + "valueType": { + "$ref": "3699" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerIndexProjectionSelector.mappings", + "serializationOptions": { + "$id": "4275", + "json": { + "$id": "4276", + "name": "mappings" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerIndexProjection.selectors", + "serializationOptions": { + "$id": "4277", + "json": { + "$id": "4278", + "name": "selectors" + } + } + }, + { + "$id": "4279", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "doc": "A dictionary of index projection-specific configuration properties. Each name\nis the name of a specific property. Each value must be of a primitive type.", + "type": { + "$id": "4280", + "kind": "model", + "name": "SearchIndexerIndexProjectionsParameters", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerIndexProjectionsParameters", + "usage": "Input,Output,Json", + "doc": "A dictionary of index projection-specific configuration properties. Each name\nis the name of a specific property. Each value must be of a primitive type.", + "decorators": [], + "additionalProperties": { + "$id": "4281", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "properties": [ + { + "$id": "4282", + "kind": "property", + "name": "projectionMode", + "serializedName": "projectionMode", + "doc": "Defines behavior of the index projections in relation to the rest of the\nindexer.", + "type": { + "$ref": "1798" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerIndexProjectionsParameters.projectionMode", + "serializationOptions": { + "$id": "4283", + "json": { + "$id": "4284", + "name": "projectionMode" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerIndexProjection.parameters", + "serializationOptions": { + "$id": "4285", + "json": { + "$id": "4286", + "name": "parameters" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerSkillset.indexProjections", + "serializationOptions": { + "$id": "4287", + "json": { + "$id": "4288", + "name": "indexProjections" + } + } + }, + { + "$id": "4289", + "kind": "property", + "name": "eTag", + "serializedName": "@odata.etag", + "doc": "The ETag of the skillset.", + "type": { + "$id": "4290", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerSkillset.eTag", + "serializationOptions": { + "$id": "4291", + "json": { + "$id": "4292", + "name": "@odata.etag" + } + } + }, + { + "$id": "4293", + "kind": "property", + "name": "encryptionKey", + "serializedName": "encryptionKey", + "doc": "A description of an encryption key that you create in Azure Key Vault. This key\nis used to provide an additional level of encryption-at-rest for your skillset\ndefinition when you want full assurance that no one, not even Microsoft, can\ndecrypt your skillset definition. Once you have encrypted your skillset\ndefinition, it will always remain encrypted. The search service will ignore\nattempts to set this property to null. You can change this property as needed\nif you want to rotate your encryption key; Your skillset definition will be\nunaffected. Encryption with customer-managed keys is not available for free\nsearch services, and is only available for paid services created on or after\nJanuary 1, 2019.", + "type": { + "$ref": "3273" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerSkillset.encryptionKey", + "serializationOptions": { + "$id": "4294", + "json": { + "$id": "4295", + "name": "encryptionKey" + } + } + } + ] + }, + { + "$ref": "3680" + }, + { + "$ref": "3699" + }, + { + "$ref": "3720" + }, + { + "$ref": "3732" + }, + { + "$ref": "3738" + }, + { + "$ref": "3755" + }, + { + "$ref": "3771" + }, + { + "$ref": "3788" + }, + { + "$ref": "3802" + }, + { + "$ref": "3808" + }, + { + "$ref": "3822" + }, + { + "$ref": "3843" + }, + { + "$ref": "3852" + }, + { + "$ref": "3870" + }, + { + "$ref": "3888" + }, + { + "$ref": "3911" + }, + { + "$ref": "3945" + }, + { + "$ref": "3969" + }, + { + "$ref": "3979" + }, + { + "$ref": "4026" + }, + { + "$ref": "4064" + }, + { + "$ref": "4079" + }, + { + "$ref": "4099" + }, + { + "$ref": "4139" + }, + { + "$ref": "4170" + }, + { + "$ref": "4180" + }, + { + "$ref": "4186" + }, + { + "$ref": "4199" + }, + { + "$ref": "4206" + }, + { + "$ref": "4209" + }, + { + "$ref": "4210" + }, + { + "$ref": "4239" + }, + { + "$ref": "4240" + }, + { + "$ref": "4249" + }, + { + "$ref": "4257" + }, + { + "$ref": "4260" + }, + { + "$ref": "4280" + }, + { + "$id": "4296", + "kind": "model", + "name": "ListSkillsetsResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ListSkillsetsResult", + "usage": "Output,Json", + "doc": "Response from a list skillset request. If successful, it includes the full\ndefinitions of all skillsets.", + "decorators": [], + "properties": [ + { + "$id": "4297", + "kind": "property", + "name": "skillsets", + "serializedName": "value", + "doc": "The skillsets defined in the Search service.", + "type": { + "$id": "4298", + "kind": "array", + "name": "ArraySearchIndexerSkillset", + "valueType": { + "$ref": "3669" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ListSkillsetsResult.value", + "serializationOptions": { + "$id": "4299", + "json": { + "$id": "4300", + "name": "value" + } + } + } + ] + }, + { + "$id": "4301", + "kind": "model", + "name": "SearchIndexer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexer", + "usage": "Input,Output,Json", + "doc": "Represents an indexer.", + "decorators": [], + "properties": [ + { + "$id": "4302", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the indexer.", + "type": { + "$id": "4303", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexer.name", + "serializationOptions": { + "$id": "4304", + "json": { + "$id": "4305", + "name": "name" + } + } + }, + { + "$id": "4306", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The description of the indexer.", + "type": { + "$id": "4307", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexer.description", + "serializationOptions": { + "$id": "4308", + "json": { + "$id": "4309", + "name": "description" + } + } + }, + { + "$id": "4310", + "kind": "property", + "name": "dataSourceName", + "serializedName": "dataSourceName", + "doc": "The name of the datasource from which this indexer reads data.", + "type": { + "$id": "4311", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexer.dataSourceName", + "serializationOptions": { + "$id": "4312", + "json": { + "$id": "4313", + "name": "dataSourceName" + } + } + }, + { + "$id": "4314", + "kind": "property", + "name": "skillsetName", + "serializedName": "skillsetName", + "doc": "The name of the skillset executing with this indexer.", + "type": { + "$id": "4315", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexer.skillsetName", + "serializationOptions": { + "$id": "4316", + "json": { + "$id": "4317", + "name": "skillsetName" + } + } + }, + { + "$id": "4318", + "kind": "property", + "name": "targetIndexName", + "serializedName": "targetIndexName", + "doc": "The name of the index to which this indexer writes data.", + "type": { + "$id": "4319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexer.targetIndexName", + "serializationOptions": { + "$id": "4320", + "json": { + "$id": "4321", + "name": "targetIndexName" + } + } + }, + { + "$id": "4322", + "kind": "property", + "name": "schedule", + "serializedName": "schedule", + "doc": "The schedule for this indexer.", + "type": { + "$id": "4323", + "kind": "model", + "name": "IndexingSchedule", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.IndexingSchedule", + "usage": "Input,Output,Json", + "doc": "Represents a schedule for indexer execution.", + "decorators": [], + "properties": [ + { + "$id": "4324", + "kind": "property", + "name": "interval", + "serializedName": "interval", + "doc": "The interval of time between indexer executions.", + "type": { + "$id": "4325", + "kind": "duration", + "name": "duration", + "encode": "ISO8601", + "wireType": { + "$id": "4326", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.duration", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingSchedule.interval", + "serializationOptions": { + "$id": "4327", + "json": { + "$id": "4328", + "name": "interval" + } + } + }, + { + "$id": "4329", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "The time when an indexer should start running.", + "type": { + "$id": "4330", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "4331", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingSchedule.startTime", + "serializationOptions": { + "$id": "4332", + "json": { + "$id": "4333", + "name": "startTime" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexer.schedule", + "serializationOptions": { + "$id": "4334", + "json": { + "$id": "4335", + "name": "schedule" + } + } + }, + { + "$id": "4336", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "doc": "Parameters for indexer execution.", + "type": { + "$id": "4337", + "kind": "model", + "name": "IndexingParameters", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.IndexingParameters", + "usage": "Input,Output,Json", + "doc": "Represents parameters for indexer execution.", + "decorators": [], + "properties": [ + { + "$id": "4338", + "kind": "property", + "name": "batchSize", + "serializedName": "batchSize", + "doc": "The number of items that are read from the data source and indexed as a single\nbatch in order to improve performance. The default depends on the data source\ntype.", + "type": { + "$id": "4339", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParameters.batchSize", + "serializationOptions": { + "$id": "4340", + "json": { + "$id": "4341", + "name": "batchSize" + } + } + }, + { + "$id": "4342", + "kind": "property", + "name": "maxFailedItems", + "serializedName": "maxFailedItems", + "doc": "The maximum number of items that can fail indexing for indexer execution to\nstill be considered successful. -1 means no limit. Default is 0.", + "type": { + "$id": "4343", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParameters.maxFailedItems", + "serializationOptions": { + "$id": "4344", + "json": { + "$id": "4345", + "name": "maxFailedItems" + } + } + }, + { + "$id": "4346", + "kind": "property", + "name": "maxFailedItemsPerBatch", + "serializedName": "maxFailedItemsPerBatch", + "doc": "The maximum number of items in a single batch that can fail indexing for the\nbatch to still be considered successful. -1 means no limit. Default is 0.", + "type": { + "$id": "4347", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParameters.maxFailedItemsPerBatch", + "serializationOptions": { + "$id": "4348", + "json": { + "$id": "4349", + "name": "maxFailedItemsPerBatch" + } + } + }, + { + "$id": "4350", + "kind": "property", + "name": "configuration", + "serializedName": "configuration", + "doc": "A dictionary of indexer-specific configuration properties. Each name is the\nname of a specific property. Each value must be of a primitive type.", + "type": { + "$id": "4351", + "kind": "model", + "name": "IndexingParametersConfiguration", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration", + "usage": "Input,Output,Json", + "doc": "A dictionary of indexer-specific configuration properties. Each name is the\nname of a specific property. Each value must be of a primitive type.", + "decorators": [], + "additionalProperties": { + "$id": "4352", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "properties": [ + { + "$id": "4353", + "kind": "property", + "name": "parsingMode", + "serializedName": "parsingMode", + "doc": "Represents the parsing mode for indexing from an Azure blob data source.", + "type": { + "$ref": "1804" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration.parsingMode", + "serializationOptions": { + "$id": "4354", + "json": { + "$id": "4355", + "name": "parsingMode" + } + } + }, + { + "$id": "4356", + "kind": "property", + "name": "excludedFileNameExtensions", + "serializedName": "excludedFileNameExtensions", + "doc": "Comma-delimited list of filename extensions to ignore when processing from\nAzure blob storage. For example, you could exclude \".png, .mp4\" to skip over\nthose files during indexing.", + "type": { + "$id": "4357", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration.excludedFileNameExtensions", + "serializationOptions": { + "$id": "4358", + "json": { + "$id": "4359", + "name": "excludedFileNameExtensions" + } + } + }, + { + "$id": "4360", + "kind": "property", + "name": "indexedFileNameExtensions", + "serializedName": "indexedFileNameExtensions", + "doc": "Comma-delimited list of filename extensions to select when processing from\nAzure blob storage. For example, you could focus indexing on specific\napplication files \".docx, .pptx, .msg\" to specifically include those file\ntypes.", + "type": { + "$id": "4361", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration.indexedFileNameExtensions", + "serializationOptions": { + "$id": "4362", + "json": { + "$id": "4363", + "name": "indexedFileNameExtensions" + } + } + }, + { + "$id": "4364", + "kind": "property", + "name": "failOnUnsupportedContentType", + "serializedName": "failOnUnsupportedContentType", + "doc": "For Azure blobs, set to false if you want to continue indexing when an\nunsupported content type is encountered, and you don't know all the content\ntypes (file extensions) in advance.", + "type": { + "$id": "4365", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration.failOnUnsupportedContentType", + "serializationOptions": { + "$id": "4366", + "json": { + "$id": "4367", + "name": "failOnUnsupportedContentType" + } + } + }, + { + "$id": "4368", + "kind": "property", + "name": "failOnUnprocessableDocument", + "serializedName": "failOnUnprocessableDocument", + "doc": "For Azure blobs, set to false if you want to continue indexing if a document\nfails indexing.", + "type": { + "$id": "4369", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration.failOnUnprocessableDocument", + "serializationOptions": { + "$id": "4370", + "json": { + "$id": "4371", + "name": "failOnUnprocessableDocument" + } + } + }, + { + "$id": "4372", + "kind": "property", + "name": "indexStorageMetadataOnlyForOversizedDocuments", + "serializedName": "indexStorageMetadataOnlyForOversizedDocuments", + "doc": "For Azure blobs, set this property to true to still index storage metadata for\nblob content that is too large to process. Oversized blobs are treated as\nerrors by default. For limits on blob size, see\nhttps://learn.microsoft.com/azure/search/search-limits-quotas-capacity.", + "type": { + "$id": "4373", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration.indexStorageMetadataOnlyForOversizedDocuments", + "serializationOptions": { + "$id": "4374", + "json": { + "$id": "4375", + "name": "indexStorageMetadataOnlyForOversizedDocuments" + } + } + }, + { + "$id": "4376", + "kind": "property", + "name": "delimitedTextHeaders", + "serializedName": "delimitedTextHeaders", + "doc": "For CSV blobs, specifies a comma-delimited list of column headers, useful for\nmapping source fields to destination fields in an index.", + "type": { + "$id": "4377", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration.delimitedTextHeaders", + "serializationOptions": { + "$id": "4378", + "json": { + "$id": "4379", + "name": "delimitedTextHeaders" + } + } + }, + { + "$id": "4380", + "kind": "property", + "name": "delimitedTextDelimiter", + "serializedName": "delimitedTextDelimiter", + "doc": "For CSV blobs, specifies the end-of-line single-character delimiter for CSV\nfiles where each line starts a new document (for example, \"|\").", + "type": { + "$id": "4381", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration.delimitedTextDelimiter", + "serializationOptions": { + "$id": "4382", + "json": { + "$id": "4383", + "name": "delimitedTextDelimiter" + } + } + }, + { + "$id": "4384", + "kind": "property", + "name": "firstLineContainsHeaders", + "serializedName": "firstLineContainsHeaders", + "doc": "For CSV blobs, indicates that the first (non-blank) line of each blob contains\nheaders.", + "type": { + "$id": "4385", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration.firstLineContainsHeaders", + "serializationOptions": { + "$id": "4386", + "json": { + "$id": "4387", + "name": "firstLineContainsHeaders" + } + } + }, + { + "$id": "4388", + "kind": "property", + "name": "documentRoot", + "serializedName": "documentRoot", + "doc": "For JSON arrays, given a structured or semi-structured document, you can\nspecify a path to the array using this property.", + "type": { + "$id": "4389", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration.documentRoot", + "serializationOptions": { + "$id": "4390", + "json": { + "$id": "4391", + "name": "documentRoot" + } + } + }, + { + "$id": "4392", + "kind": "property", + "name": "dataToExtract", + "serializedName": "dataToExtract", + "doc": "Specifies the data to extract from Azure blob storage and tells the indexer\nwhich data to extract from image content when \"imageAction\" is set to a value\nother than \"none\". This applies to embedded image content in a .PDF or other\napplication, or image files such as .jpg and .png, in Azure blobs.", + "type": { + "$ref": "1818" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration.dataToExtract", + "serializationOptions": { + "$id": "4393", + "json": { + "$id": "4394", + "name": "dataToExtract" + } + } + }, + { + "$id": "4395", + "kind": "property", + "name": "imageAction", + "serializedName": "imageAction", + "doc": "Determines how to process embedded images and image files in Azure blob\nstorage. Setting the \"imageAction\" configuration to any value other than\n\"none\" requires that a skillset also be attached to that indexer.", + "type": { + "$ref": "1826" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration.imageAction", + "serializationOptions": { + "$id": "4396", + "json": { + "$id": "4397", + "name": "imageAction" + } + } + }, + { + "$id": "4398", + "kind": "property", + "name": "allowSkillsetToReadFileData", + "serializedName": "allowSkillsetToReadFileData", + "doc": "If true, will create a path //document//file_data that is an object\nrepresenting the original file data downloaded from your blob data source.\nThis allows you to pass the original file data to a custom skill for processing\nwithin the enrichment pipeline, or to the Document Extraction skill.", + "type": { + "$id": "4399", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration.allowSkillsetToReadFileData", + "serializationOptions": { + "$id": "4400", + "json": { + "$id": "4401", + "name": "allowSkillsetToReadFileData" + } + } + }, + { + "$id": "4402", + "kind": "property", + "name": "pdfTextRotationAlgorithm", + "serializedName": "pdfTextRotationAlgorithm", + "doc": "Determines algorithm for text extraction from PDF files in Azure blob storage.", + "type": { + "$ref": "1834" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration.pdfTextRotationAlgorithm", + "serializationOptions": { + "$id": "4403", + "json": { + "$id": "4404", + "name": "pdfTextRotationAlgorithm" + } + } + }, + { + "$id": "4405", + "kind": "property", + "name": "executionEnvironment", + "serializedName": "executionEnvironment", + "doc": "Specifies the environment in which the indexer should execute.", + "type": { + "$ref": "1840" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration.executionEnvironment", + "serializationOptions": { + "$id": "4406", + "json": { + "$id": "4407", + "name": "executionEnvironment" + } + } + }, + { + "$id": "4408", + "kind": "property", + "name": "queryTimeout", + "serializedName": "queryTimeout", + "doc": "Increases the timeout beyond the 5-minute default for Azure SQL database data\nsources, specified in the format \"hh:mm:ss\".", + "type": { + "$id": "4409", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParametersConfiguration.queryTimeout", + "serializationOptions": { + "$id": "4410", + "json": { + "$id": "4411", + "name": "queryTimeout" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexingParameters.configuration", + "serializationOptions": { + "$id": "4412", + "json": { + "$id": "4413", + "name": "configuration" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexer.parameters", + "serializationOptions": { + "$id": "4414", + "json": { + "$id": "4415", + "name": "parameters" + } + } + }, + { + "$id": "4416", + "kind": "property", + "name": "fieldMappings", + "serializedName": "fieldMappings", + "doc": "Defines mappings between fields in the data source and corresponding target\nfields in the index.", + "type": { + "$id": "4417", + "kind": "array", + "name": "ArrayFieldMapping", + "valueType": { + "$id": "4418", + "kind": "model", + "name": "FieldMapping", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.FieldMapping", + "usage": "Input,Output,Json", + "doc": "Defines a mapping between a field in a data source and a target field in an\nindex.", + "decorators": [], + "properties": [ + { + "$id": "4419", + "kind": "property", + "name": "sourceFieldName", + "serializedName": "sourceFieldName", + "doc": "The name of the field in the data source.", + "type": { + "$id": "4420", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.FieldMapping.sourceFieldName", + "serializationOptions": { + "$id": "4421", + "json": { + "$id": "4422", + "name": "sourceFieldName" + } + } + }, + { + "$id": "4423", + "kind": "property", + "name": "targetFieldName", + "serializedName": "targetFieldName", + "doc": "The name of the target field in the index. Same as the source field name by\ndefault.", + "type": { + "$id": "4424", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.FieldMapping.targetFieldName", + "serializationOptions": { + "$id": "4425", + "json": { + "$id": "4426", + "name": "targetFieldName" + } + } + }, + { + "$id": "4427", + "kind": "property", + "name": "mappingFunction", + "serializedName": "mappingFunction", + "doc": "A function to apply to each source field value before indexing.", + "type": { + "$id": "4428", + "kind": "model", + "name": "FieldMappingFunction", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.FieldMappingFunction", + "usage": "Input,Output,Json", + "doc": "Represents a function that transforms a value from a data source before\nindexing.", + "decorators": [], + "properties": [ + { + "$id": "4429", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the field mapping function.", + "type": { + "$id": "4430", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.FieldMappingFunction.name", + "serializationOptions": { + "$id": "4431", + "json": { + "$id": "4432", + "name": "name" + } + } + }, + { + "$id": "4433", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "doc": "A dictionary of parameter name/value pairs to pass to the function. Each value\nmust be of a primitive type.", + "type": { + "$id": "4434", + "kind": "dict", + "keyType": { + "$id": "4435", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "4436", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.FieldMappingFunction.parameters", + "serializationOptions": { + "$id": "4437", + "json": { + "$id": "4438", + "name": "parameters" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.FieldMapping.mappingFunction", + "serializationOptions": { + "$id": "4439", + "json": { + "$id": "4440", + "name": "mappingFunction" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexer.fieldMappings", + "serializationOptions": { + "$id": "4441", + "json": { + "$id": "4442", + "name": "fieldMappings" + } + } + }, + { + "$id": "4443", + "kind": "property", + "name": "outputFieldMappings", + "serializedName": "outputFieldMappings", + "doc": "Output field mappings are applied after enrichment and immediately before\nindexing.", + "type": { + "$id": "4444", + "kind": "array", + "name": "ArrayFieldMapping", + "valueType": { + "$ref": "4418" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexer.outputFieldMappings", + "serializationOptions": { + "$id": "4445", + "json": { + "$id": "4446", + "name": "outputFieldMappings" + } + } + }, + { + "$id": "4447", + "kind": "property", + "name": "isDisabled", + "serializedName": "disabled", + "doc": "A value indicating whether the indexer is disabled. Default is false.", + "type": { + "$id": "4448", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexer.disabled", + "serializationOptions": { + "$id": "4449", + "json": { + "$id": "4450", + "name": "disabled" + } + } + }, + { + "$id": "4451", + "kind": "property", + "name": "eTag", + "serializedName": "@odata.etag", + "doc": "The ETag of the indexer.", + "type": { + "$id": "4452", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexer.eTag", + "serializationOptions": { + "$id": "4453", + "json": { + "$id": "4454", + "name": "@odata.etag" + } + } + }, + { + "$id": "4455", + "kind": "property", + "name": "encryptionKey", + "serializedName": "encryptionKey", + "doc": "A description of an encryption key that you create in Azure Key Vault. This key\nis used to provide an additional level of encryption-at-rest for your indexer\ndefinition (as well as indexer execution status) when you want full assurance\nthat no one, not even Microsoft, can decrypt them. Once you have encrypted your\nindexer definition, it will always remain encrypted. The search service will\nignore attempts to set this property to null. You can change this property as\nneeded if you want to rotate your encryption key; Your indexer definition (and\nindexer execution status) will be unaffected. Encryption with customer-managed\nkeys is not available for free search services, and is only available for paid\nservices created on or after January 1, 2019.", + "type": { + "$ref": "3273" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexer.encryptionKey", + "serializationOptions": { + "$id": "4456", + "json": { + "$id": "4457", + "name": "encryptionKey" + } + } + } + ] + }, + { + "$ref": "4323" + }, + { + "$ref": "4337" + }, + { + "$ref": "4351" + }, + { + "$ref": "4418" + }, + { + "$ref": "4428" + }, + { + "$id": "4458", + "kind": "model", + "name": "ListIndexersResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ListIndexersResult", + "usage": "Output,Json", + "doc": "Response from a List Indexers request. If successful, it includes the full\ndefinitions of all indexers.", + "decorators": [], + "properties": [ + { + "$id": "4459", + "kind": "property", + "name": "indexers", + "serializedName": "value", + "doc": "The indexers in the Search service.", + "type": { + "$id": "4460", + "kind": "array", + "name": "ArraySearchIndexer", + "valueType": { + "$ref": "4301" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ListIndexersResult.value", + "serializationOptions": { + "$id": "4461", + "json": { + "$id": "4462", + "name": "value" + } + } + } + ] + }, + { + "$id": "4463", + "kind": "model", + "name": "SearchIndexerStatus", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerStatus", + "usage": "Output,Json", + "doc": "Represents the current status and execution history of an indexer.", + "decorators": [], + "properties": [ + { + "$id": "4464", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "Overall indexer status.", + "type": { + "$ref": "1846" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerStatus.status", + "serializationOptions": { + "$id": "4465", + "json": { + "$id": "4466", + "name": "status" + } + } + }, + { + "$id": "4467", + "kind": "property", + "name": "lastResult", + "serializedName": "lastResult", + "doc": "The result of the most recent or an in-progress indexer execution.", + "type": { + "$id": "4468", + "kind": "model", + "name": "IndexerExecutionResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.IndexerExecutionResult", + "usage": "Output,Json", + "doc": "Represents the result of an individual indexer execution.", + "decorators": [], + "properties": [ + { + "$id": "4469", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The outcome of this indexer execution.", + "type": { + "$ref": "1854" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexerExecutionResult.status", + "serializationOptions": { + "$id": "4470", + "json": { + "$id": "4471", + "name": "status" + } + } + }, + { + "$id": "4472", + "kind": "property", + "name": "errorMessage", + "serializedName": "errorMessage", + "doc": "The error message indicating the top-level error, if any.", + "type": { + "$id": "4473", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexerExecutionResult.errorMessage", + "serializationOptions": { + "$id": "4474", + "json": { + "$id": "4475", + "name": "errorMessage" + } + } + }, + { + "$id": "4476", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "The start time of this indexer execution.", + "type": { + "$id": "4477", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "4478", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexerExecutionResult.startTime", + "serializationOptions": { + "$id": "4479", + "json": { + "$id": "4480", + "name": "startTime" + } + } + }, + { + "$id": "4481", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "The end time of this indexer execution, if the execution has already completed.", + "type": { + "$id": "4482", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "4483", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexerExecutionResult.endTime", + "serializationOptions": { + "$id": "4484", + "json": { + "$id": "4485", + "name": "endTime" + } + } + }, + { + "$id": "4486", + "kind": "property", + "name": "errors", + "serializedName": "errors", + "doc": "The item-level indexing errors.", + "type": { + "$id": "4487", + "kind": "array", + "name": "ArraySearchIndexerError", + "valueType": { + "$id": "4488", + "kind": "model", + "name": "SearchIndexerError", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerError", + "usage": "Output,Error,Json", + "doc": "Represents an item- or document-level indexing error.", + "decorators": [], + "properties": [ + { + "$id": "4489", + "kind": "property", + "name": "key", + "serializedName": "key", + "doc": "The key of the item for which indexing failed.", + "type": { + "$id": "4490", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerError.key", + "serializationOptions": { + "$id": "4491", + "json": { + "$id": "4492", + "name": "key" + } + } + }, + { + "$id": "4493", + "kind": "property", + "name": "errorMessage", + "serializedName": "errorMessage", + "doc": "The message describing the error that occurred while processing the item.", + "type": { + "$id": "4494", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerError.errorMessage", + "serializationOptions": { + "$id": "4495", + "json": { + "$id": "4496", + "name": "errorMessage" + } + } + }, + { + "$id": "4497", + "kind": "property", + "name": "statusCode", + "serializedName": "statusCode", + "doc": "The status code indicating why the indexing operation failed. Possible values\ninclude: 400 for a malformed input document, 404 for document not found, 409\nfor a version conflict, 422 when the index is temporarily unavailable, or 503\nfor when the service is too busy.", + "type": { + "$id": "4498", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerError.statusCode", + "serializationOptions": { + "$id": "4499", + "json": { + "$id": "4500", + "name": "statusCode" + } + } + }, + { + "$id": "4501", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the source at which the error originated. For example, this could\nrefer to a particular skill in the attached skillset. This may not be always\navailable.", + "type": { + "$id": "4502", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerError.name", + "serializationOptions": { + "$id": "4503", + "json": { + "$id": "4504", + "name": "name" + } + } + }, + { + "$id": "4505", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "Additional, verbose details about the error to assist in debugging the indexer.\nThis may not be always available.", + "type": { + "$id": "4506", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerError.details", + "serializationOptions": { + "$id": "4507", + "json": { + "$id": "4508", + "name": "details" + } + } + }, + { + "$id": "4509", + "kind": "property", + "name": "documentationLink", + "serializedName": "documentationLink", + "doc": "A link to a troubleshooting guide for these classes of errors. This may not be\nalways available.", + "type": { + "$id": "4510", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerError.documentationLink", + "serializationOptions": { + "$id": "4511", + "json": { + "$id": "4512", + "name": "documentationLink" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexerExecutionResult.errors", + "serializationOptions": { + "$id": "4513", + "json": { + "$id": "4514", + "name": "errors" + } + } + }, + { + "$id": "4515", + "kind": "property", + "name": "warnings", + "serializedName": "warnings", + "doc": "The item-level indexing warnings.", + "type": { + "$id": "4516", + "kind": "array", + "name": "ArraySearchIndexerWarning", + "valueType": { + "$id": "4517", + "kind": "model", + "name": "SearchIndexerWarning", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerWarning", + "usage": "Output,Json", + "doc": "Represents an item-level warning.", + "decorators": [], + "properties": [ + { + "$id": "4518", + "kind": "property", + "name": "key", + "serializedName": "key", + "doc": "The key of the item which generated a warning.", + "type": { + "$id": "4519", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerWarning.key", + "serializationOptions": { + "$id": "4520", + "json": { + "$id": "4521", + "name": "key" + } + } + }, + { + "$id": "4522", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The message describing the warning that occurred while processing the item.", + "type": { + "$id": "4523", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerWarning.message", + "serializationOptions": { + "$id": "4524", + "json": { + "$id": "4525", + "name": "message" + } + } + }, + { + "$id": "4526", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the source at which the warning originated. For example, this could\nrefer to a particular skill in the attached skillset. This may not be always\navailable.", + "type": { + "$id": "4527", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerWarning.name", + "serializationOptions": { + "$id": "4528", + "json": { + "$id": "4529", + "name": "name" + } + } + }, + { + "$id": "4530", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "Additional, verbose details about the warning to assist in debugging the\nindexer. This may not be always available.", + "type": { + "$id": "4531", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerWarning.details", + "serializationOptions": { + "$id": "4532", + "json": { + "$id": "4533", + "name": "details" + } + } + }, + { + "$id": "4534", + "kind": "property", + "name": "documentationLink", + "serializedName": "documentationLink", + "doc": "A link to a troubleshooting guide for these classes of warnings. This may not\nbe always available.", + "type": { + "$id": "4535", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerWarning.documentationLink", + "serializationOptions": { + "$id": "4536", + "json": { + "$id": "4537", + "name": "documentationLink" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexerExecutionResult.warnings", + "serializationOptions": { + "$id": "4538", + "json": { + "$id": "4539", + "name": "warnings" + } + } + }, + { + "$id": "4540", + "kind": "property", + "name": "itemCount", + "serializedName": "itemsProcessed", + "doc": "The number of items that were processed during this indexer execution. This\nincludes both successfully processed items and items where indexing was\nattempted but failed.", + "type": { + "$id": "4541", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexerExecutionResult.itemsProcessed", + "serializationOptions": { + "$id": "4542", + "json": { + "$id": "4543", + "name": "itemsProcessed" + } + } + }, + { + "$id": "4544", + "kind": "property", + "name": "failedItemCount", + "serializedName": "itemsFailed", + "doc": "The number of items that failed to be indexed during this indexer execution.", + "type": { + "$id": "4545", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexerExecutionResult.itemsFailed", + "serializationOptions": { + "$id": "4546", + "json": { + "$id": "4547", + "name": "itemsFailed" + } + } + }, + { + "$id": "4548", + "kind": "property", + "name": "initialTrackingState", + "serializedName": "initialTrackingState", + "doc": "Change tracking state with which an indexer execution started.", + "type": { + "$id": "4549", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexerExecutionResult.initialTrackingState", + "serializationOptions": { + "$id": "4550", + "json": { + "$id": "4551", + "name": "initialTrackingState" + } + } + }, + { + "$id": "4552", + "kind": "property", + "name": "finalTrackingState", + "serializedName": "finalTrackingState", + "doc": "Change tracking state with which an indexer execution finished.", + "type": { + "$id": "4553", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.IndexerExecutionResult.finalTrackingState", + "serializationOptions": { + "$id": "4554", + "json": { + "$id": "4555", + "name": "finalTrackingState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerStatus.lastResult", + "serializationOptions": { + "$id": "4556", + "json": { + "$id": "4557", + "name": "lastResult" + } + } + }, + { + "$id": "4558", + "kind": "property", + "name": "executionHistory", + "serializedName": "executionHistory", + "doc": "History of the recent indexer executions, sorted in reverse chronological order.", + "type": { + "$id": "4559", + "kind": "array", + "name": "ArrayIndexerExecutionResult", + "valueType": { + "$ref": "4468" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerStatus.executionHistory", + "serializationOptions": { + "$id": "4560", + "json": { + "$id": "4561", + "name": "executionHistory" + } + } + }, + { + "$id": "4562", + "kind": "property", + "name": "limits", + "serializedName": "limits", + "doc": "The execution limits for the indexer.", + "type": { + "$id": "4563", + "kind": "model", + "name": "SearchIndexerLimits", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerLimits", + "usage": "Output,Json", + "doc": "Represents the limits that can be applied to an indexer.", + "decorators": [], + "properties": [ + { + "$id": "4564", + "kind": "property", + "name": "maxRunTime", + "serializedName": "maxRunTime", + "doc": "The maximum duration that the indexer is permitted to run for one execution.", + "type": { + "$id": "4565", + "kind": "duration", + "name": "duration", + "encode": "ISO8601", + "wireType": { + "$id": "4566", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.duration", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerLimits.maxRunTime", + "serializationOptions": { + "$id": "4567", + "json": { + "$id": "4568", + "name": "maxRunTime" + } + } + }, + { + "$id": "4569", + "kind": "property", + "name": "maxDocumentExtractionSize", + "serializedName": "maxDocumentExtractionSize", + "doc": "The maximum size of a document, in bytes, which will be considered valid for\nindexing.", + "type": { + "$id": "4570", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerLimits.maxDocumentExtractionSize", + "serializationOptions": { + "$id": "4571", + "json": { + "$id": "4572", + "name": "maxDocumentExtractionSize" + } + } + }, + { + "$id": "4573", + "kind": "property", + "name": "maxDocumentContentCharactersToExtract", + "serializedName": "maxDocumentContentCharactersToExtract", + "doc": "The maximum number of characters that will be extracted from a document picked\nup for indexing.", + "type": { + "$id": "4574", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerLimits.maxDocumentContentCharactersToExtract", + "serializationOptions": { + "$id": "4575", + "json": { + "$id": "4576", + "name": "maxDocumentContentCharactersToExtract" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerStatus.limits", + "serializationOptions": { + "$id": "4577", + "json": { + "$id": "4578", + "name": "limits" + } + } + } + ] + }, + { + "$ref": "4468" + }, + { + "$ref": "4488" + }, + { + "$ref": "4517" + }, + { + "$ref": "4563" + }, + { + "$id": "4579", + "kind": "model", + "name": "SearchIndexerDataSource", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerDataSource", + "usage": "Input,Output,Json", + "doc": "Represents a datasource definition, which can be used to configure an indexer.", + "decorators": [], + "properties": [ + { + "$id": "4580", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the datasource.", + "type": { + "$id": "4581", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerDataSource.name", + "serializationOptions": { + "$id": "4582", + "json": { + "$id": "4583", + "name": "name" + } + } + }, + { + "$id": "4584", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The description of the datasource.", + "type": { + "$id": "4585", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerDataSource.description", + "serializationOptions": { + "$id": "4586", + "json": { + "$id": "4587", + "name": "description" + } + } + }, + { + "$id": "4588", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of the datasource.", + "type": { + "$ref": "1864" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerDataSource.type", + "serializationOptions": { + "$id": "4589", + "json": { + "$id": "4590", + "name": "type" + } + } + }, + { + "$id": "4591", + "kind": "property", + "name": "credentials", + "serializedName": "credentials", + "doc": "Credentials for the datasource.", + "type": { + "$id": "4592", + "kind": "model", + "name": "DataSourceCredentials", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.DataSourceCredentials", + "usage": "Input,Output,Json", + "doc": "Represents credentials that can be used to connect to a datasource.", + "decorators": [], + "properties": [ + { + "$id": "4593", + "kind": "property", + "name": "connectionString", + "serializedName": "connectionString", + "doc": "The connection string for the datasource. Set to `` (with brackets)\nif you don't want the connection string updated. Set to `` if you\nwant to remove the connection string value from the datasource.", + "type": { + "$id": "4594", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DataSourceCredentials.connectionString", + "serializationOptions": { + "$id": "4595", + "json": { + "$id": "4596", + "name": "connectionString" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerDataSource.credentials", + "serializationOptions": { + "$id": "4597", + "json": { + "$id": "4598", + "name": "credentials" + } + } + }, + { + "$id": "4599", + "kind": "property", + "name": "container", + "serializedName": "container", + "doc": "The data container for the datasource.", + "type": { + "$id": "4600", + "kind": "model", + "name": "SearchIndexerDataContainer", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SearchIndexerDataContainer", + "usage": "Input,Output,Json", + "doc": "Represents information about the entity (such as Azure SQL table or CosmosDB\ncollection) that will be indexed.", + "decorators": [], + "properties": [ + { + "$id": "4601", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the table or view (for Azure SQL data source) or collection (for\nCosmosDB data source) that will be indexed.", + "type": { + "$id": "4602", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerDataContainer.name", + "serializationOptions": { + "$id": "4603", + "json": { + "$id": "4604", + "name": "name" + } + } + }, + { + "$id": "4605", + "kind": "property", + "name": "query", + "serializedName": "query", + "doc": "A query that is applied to this data container. The syntax and meaning of this\nparameter is datasource-specific. Not supported by Azure SQL datasources.", + "type": { + "$id": "4606", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerDataContainer.query", + "serializationOptions": { + "$id": "4607", + "json": { + "$id": "4608", + "name": "query" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerDataSource.container", + "serializationOptions": { + "$id": "4609", + "json": { + "$id": "4610", + "name": "container" + } + } + }, + { + "$id": "4611", + "kind": "property", + "name": "dataChangeDetectionPolicy", + "serializedName": "dataChangeDetectionPolicy", + "doc": "The data change detection policy for the datasource.", + "type": { + "$id": "4612", + "kind": "model", + "name": "DataChangeDetectionPolicy", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.DataChangeDetectionPolicy", + "usage": "Input,Output,Json", + "doc": "Base type for data change detection policies.", + "decorators": [], + "discriminatorProperty": { + "$id": "4613", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "The discriminator for derived types.", + "type": { + "$id": "4614", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DataChangeDetectionPolicy.@odata.type", + "serializationOptions": { + "$id": "4615", + "json": { + "$id": "4616", + "name": "@odata.type" + } + } + }, + "properties": [ + { + "$ref": "4613" + } + ], + "discriminatedSubtypes": { + "$id": "4617", + "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy": { + "$id": "4618", + "kind": "model", + "name": "HighWaterMarkChangeDetectionPolicy", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.HighWaterMarkChangeDetectionPolicy", + "usage": "Input,Output,Json", + "doc": "Defines a data change detection policy that captures changes based on the value\nof a high water mark column.", + "discriminatorValue": "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy", + "decorators": [], + "baseModel": { + "$ref": "4612" + }, + "properties": [ + { + "$id": "4619", + "kind": "property", + "name": "highWaterMarkColumnName", + "serializedName": "highWaterMarkColumnName", + "doc": "The name of the high water mark column.", + "type": { + "$id": "4620", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.HighWaterMarkChangeDetectionPolicy.highWaterMarkColumnName", + "serializationOptions": { + "$id": "4621", + "json": { + "$id": "4622", + "name": "highWaterMarkColumnName" + } + } + }, + { + "$id": "4623", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of data change detection policy.", + "type": { + "$id": "4624", + "kind": "constant", + "valueType": { + "$id": "4625", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.HighWaterMarkChangeDetectionPolicy.@odata.type", + "serializationOptions": { + "$id": "4626", + "json": { + "$id": "4627", + "name": "@odata.type" + } + } + } + ] + }, + "#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy": { + "$id": "4628", + "kind": "model", + "name": "SqlIntegratedChangeTrackingPolicy", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SqlIntegratedChangeTrackingPolicy", + "usage": "Input,Output,Json", + "doc": "Defines a data change detection policy that captures changes using the\nIntegrated Change Tracking feature of Azure SQL Database.", + "discriminatorValue": "#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy", + "decorators": [], + "baseModel": { + "$ref": "4612" + }, + "properties": [ + { + "$id": "4629", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of data change detection policy.", + "type": { + "$id": "4630", + "kind": "constant", + "valueType": { + "$id": "4631", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SqlIntegratedChangeTrackingPolicy.@odata.type", + "serializationOptions": { + "$id": "4632", + "json": { + "$id": "4633", + "name": "@odata.type" + } + } + } + ] + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerDataSource.dataChangeDetectionPolicy", + "serializationOptions": { + "$id": "4634", + "json": { + "$id": "4635", + "name": "dataChangeDetectionPolicy" + } + } + }, + { + "$id": "4636", + "kind": "property", + "name": "dataDeletionDetectionPolicy", + "serializedName": "dataDeletionDetectionPolicy", + "doc": "The data deletion detection policy for the datasource.", + "type": { + "$id": "4637", + "kind": "model", + "name": "DataDeletionDetectionPolicy", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.DataDeletionDetectionPolicy", + "usage": "Input,Output,Json", + "doc": "Base type for data deletion detection policies.", + "decorators": [], + "discriminatorProperty": { + "$id": "4638", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "The discriminator for derived types.", + "type": { + "$id": "4639", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.DataDeletionDetectionPolicy.@odata.type", + "serializationOptions": { + "$id": "4640", + "json": { + "$id": "4641", + "name": "@odata.type" + } + } + }, + "properties": [ + { + "$ref": "4638" + } + ], + "discriminatedSubtypes": { + "$id": "4642", + "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy": { + "$id": "4643", + "kind": "model", + "name": "SoftDeleteColumnDeletionDetectionPolicy", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.SoftDeleteColumnDeletionDetectionPolicy", + "usage": "Input,Output,Json", + "doc": "Defines a data deletion detection policy that implements a soft-deletion\nstrategy. It determines whether an item should be deleted based on the value of\na designated 'soft delete' column.", + "discriminatorValue": "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy", + "decorators": [], + "baseModel": { + "$ref": "4637" + }, + "properties": [ + { + "$id": "4644", + "kind": "property", + "name": "softDeleteColumnName", + "serializedName": "softDeleteColumnName", + "doc": "The name of the column to use for soft-deletion detection.", + "type": { + "$id": "4645", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SoftDeleteColumnDeletionDetectionPolicy.softDeleteColumnName", + "serializationOptions": { + "$id": "4646", + "json": { + "$id": "4647", + "name": "softDeleteColumnName" + } + } + }, + { + "$id": "4648", + "kind": "property", + "name": "softDeleteMarkerValue", + "serializedName": "softDeleteMarkerValue", + "doc": "The marker value that identifies an item as deleted.", + "type": { + "$id": "4649", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SoftDeleteColumnDeletionDetectionPolicy.softDeleteMarkerValue", + "serializationOptions": { + "$id": "4650", + "json": { + "$id": "4651", + "name": "softDeleteMarkerValue" + } + } + }, + { + "$id": "4652", + "kind": "property", + "name": "odataType", + "serializedName": "@odata.type", + "doc": "A URI fragment specifying the type of data deletion detection policy.", + "type": { + "$id": "4653", + "kind": "constant", + "valueType": { + "$id": "4654", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SoftDeleteColumnDeletionDetectionPolicy.@odata.type", + "serializationOptions": { + "$id": "4655", + "json": { + "$id": "4656", + "name": "@odata.type" + } + } + } + ] + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerDataSource.dataDeletionDetectionPolicy", + "serializationOptions": { + "$id": "4657", + "json": { + "$id": "4658", + "name": "dataDeletionDetectionPolicy" + } + } + }, + { + "$id": "4659", + "kind": "property", + "name": "eTag", + "serializedName": "@odata.etag", + "doc": "The ETag of the data source.", + "type": { + "$id": "4660", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerDataSource.eTag", + "serializationOptions": { + "$id": "4661", + "json": { + "$id": "4662", + "name": "@odata.etag" + } + } + }, + { + "$id": "4663", + "kind": "property", + "name": "encryptionKey", + "serializedName": "encryptionKey", + "doc": "A description of an encryption key that you create in Azure Key Vault. This key\nis used to provide an additional level of encryption-at-rest for your\ndatasource definition when you want full assurance that no one, not even\nMicrosoft, can decrypt your data source definition. Once you have encrypted\nyour data source definition, it will always remain encrypted. The search\nservice will ignore attempts to set this property to null. You can change this\nproperty as needed if you want to rotate your encryption key; Your datasource\ndefinition will be unaffected. Encryption with customer-managed keys is not\navailable for free search services, and is only available for paid services\ncreated on or after January 1, 2019.", + "type": { + "$ref": "3273" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.SearchIndexerDataSource.encryptionKey", + "serializationOptions": { + "$id": "4664", + "json": { + "$id": "4665", + "name": "encryptionKey" + } + } + } + ] + }, + { + "$ref": "4592" + }, + { + "$ref": "4600" + }, + { + "$ref": "4612" + }, + { + "$ref": "4618" + }, + { + "$ref": "4628" + }, + { + "$ref": "4637" + }, + { + "$ref": "4643" + }, + { + "$id": "4666", + "kind": "model", + "name": "ListDataSourcesResult", + "namespace": "Azure.Search.Documents", + "crossLanguageDefinitionId": "Search.ListDataSourcesResult", + "usage": "Output,Json", + "doc": "Response from a List Datasources request. If successful, it includes the full\ndefinitions of all datasources.", + "decorators": [], + "properties": [ + { + "$id": "4667", + "kind": "property", + "name": "dataSources", + "serializedName": "value", + "doc": "The datasources in the Search service.", + "type": { + "$id": "4668", + "kind": "array", + "name": "ArraySearchIndexerDataSource", + "valueType": { + "$ref": "4579" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Search.ListDataSourcesResult.value", + "serializationOptions": { + "$id": "4669", + "json": { + "$id": "4670", + "name": "value" + } + } + } + ] + } + ], + "clients": [ + { + "$id": "4671", + "kind": "client", + "name": "SearchClient", + "namespace": "Azure.Search.Documents", + "doc": "Client that can be used to manage and query indexes and documents, as well as\nmanage other resources, on a search service.", + "operations": [ + { + "$id": "4672", + "name": "getServiceStatistics", + "resourceName": "Search", + "doc": "Gets service level statistics for a search service.", + "accessibility": "public", + "parameters": [ + { + "$id": "4673", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "4674", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "4675", + "type": { + "$id": "4676", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4677", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "4678", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "4679", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4680", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "4681", + "kind": "constant", + "valueType": { + "$id": "4682", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "4683", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "1882" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/servicestats", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.getServiceStatistics", + "decorators": [], + "examples": [ + { + "$id": "4684", + "kind": "http", + "name": "SearchServiceGetServiceStatistics", + "description": "SearchServiceGetServiceStatistics", + "filePath": "2024-07-01/SearchServiceGetServiceStatistics.json", + "parameters": [ + { + "$id": "4685", + "parameter": { + "$ref": "4673" + }, + "value": { + "$id": "4686", + "kind": "string", + "type": { + "$ref": "4674" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "4687", + "response": { + "$ref": "4683" + }, + "statusCode": 200, + "bodyValue": { + "$id": "4688", + "kind": "model", + "type": { + "$ref": "1882" + }, + "value": { + "$id": "4689", + "counters": { + "$id": "4690", + "kind": "model", + "type": { + "$ref": "1884" + }, + "value": { + "$id": "4691", + "documentCount": { + "$id": "4692", + "kind": "model", + "type": { + "$ref": "1886" + }, + "value": { + "$id": "4693", + "usage": { + "$id": "4694", + "kind": "number", + "type": { + "$ref": "1888" + }, + "value": 7093 + }, + "quota": { + "$id": "4695", + "kind": "number", + "type": { + "$ref": "1892" + }, + "value": 10000 + } + } + }, + "indexesCount": { + "$id": "4696", + "kind": "model", + "type": { + "$ref": "1886" + }, + "value": { + "$id": "4697", + "usage": { + "$id": "4698", + "kind": "number", + "type": { + "$ref": "1888" + }, + "value": 3 + }, + "quota": { + "$id": "4699", + "kind": "number", + "type": { + "$ref": "1892" + }, + "value": 3 + } + } + }, + "indexersCount": { + "$id": "4700", + "kind": "model", + "type": { + "$ref": "1886" + }, + "value": { + "$id": "4701", + "usage": { + "$id": "4702", + "kind": "number", + "type": { + "$ref": "1888" + }, + "value": 3 + }, + "quota": { + "$id": "4703", + "kind": "number", + "type": { + "$ref": "1892" + }, + "value": 3 + } + } + }, + "dataSourcesCount": { + "$id": "4704", + "kind": "model", + "type": { + "$ref": "1886" + }, + "value": { + "$id": "4705", + "usage": { + "$id": "4706", + "kind": "number", + "type": { + "$ref": "1888" + }, + "value": 1 + }, + "quota": { + "$id": "4707", + "kind": "number", + "type": { + "$ref": "1892" + }, + "value": 3 + } + } + }, + "storageSize": { + "$id": "4708", + "kind": "model", + "type": { + "$ref": "1886" + }, + "value": { + "$id": "4709", + "usage": { + "$id": "4710", + "kind": "number", + "type": { + "$ref": "1888" + }, + "value": 914529 + }, + "quota": { + "$id": "4711", + "kind": "number", + "type": { + "$ref": "1892" + }, + "value": 52428800 + } + } + }, + "synonymMaps": { + "$id": "4712", + "kind": "model", + "type": { + "$ref": "1886" + }, + "value": { + "$id": "4713", + "usage": { + "$id": "4714", + "kind": "number", + "type": { + "$ref": "1888" + }, + "value": 2 + }, + "quota": { + "$id": "4715", + "kind": "number", + "type": { + "$ref": "1892" + }, + "value": 3 + } + } + }, + "skillsetCount": { + "$id": "4716", + "kind": "model", + "type": { + "$ref": "1886" + }, + "value": { + "$id": "4717", + "usage": { + "$id": "4718", + "kind": "number", + "type": { + "$ref": "1888" + }, + "value": 1 + }, + "quota": { + "$id": "4719", + "kind": "number", + "type": { + "$ref": "1892" + }, + "value": 3 + } + } + }, + "vectorIndexSize": { + "$id": "4720", + "kind": "model", + "type": { + "$ref": "1886" + }, + "value": { + "$id": "4721", + "usage": { + "$id": "4722", + "kind": "number", + "type": { + "$ref": "1888" + }, + "value": 123456 + }, + "quota": { + "$id": "4723", + "kind": "number", + "type": { + "$ref": "1892" + }, + "value": 26214400 + } + } + } + } + }, + "limits": { + "$id": "4724", + "kind": "model", + "type": { + "$ref": "1921" + }, + "value": { + "$id": "4725", + "maxFieldsPerIndex": { + "$id": "4726", + "kind": "number", + "type": { + "$ref": "1923" + }, + "value": 1000 + }, + "maxFieldNestingDepthPerIndex": { + "$id": "4727", + "kind": "number", + "type": { + "$ref": "1927" + }, + "value": 10 + }, + "maxComplexCollectionFieldsPerIndex": { + "$id": "4728", + "kind": "number", + "type": { + "$ref": "1931" + }, + "value": 100 + }, + "maxComplexObjectsInCollectionsPerDocument": { + "$id": "4729", + "kind": "number", + "type": { + "$ref": "1935" + }, + "value": 3000 + } + } + } + } + } + } + ] + } + ] + } + ], + "parameters": [ + { + "$id": "4730", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "4731", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client" + } + ], + "decorators": [ + { + "$id": "4732", + "name": "TypeSpec.@service", + "arguments": { + "$id": "4733", + "options": { + "$id": "4734", + "title": "Azure AI Search" + } + } + } + ], + "crossLanguageDefinitionId": "Search", + "apiVersions": [ + "2024-07-01" + ], + "children": [ + { + "$id": "4735", + "kind": "client", + "name": "DataSources", + "namespace": "Azure.Search.Documents", + "operations": [ + { + "$id": "4736", + "name": "createOrUpdate", + "resourceName": "DataSources", + "doc": "Creates a new datasource or updates a datasource if it already exists.", + "accessibility": "public", + "parameters": [ + { + "$id": "4737", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "4738", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "4739", + "type": { + "$id": "4740", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4741", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.", + "type": { + "$id": "4742", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4743", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.", + "type": { + "$id": "4744", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4745", + "name": "prefer", + "nameInRequest": "Prefer", + "doc": "For HTTP PUT requests, instructs the service to return the created/updated resource on success.", + "type": { + "$id": "4746", + "kind": "constant", + "valueType": { + "$id": "4747", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "return=representation", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4748", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "4749", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "4750", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4751", + "name": "dataSourceName", + "nameInRequest": "dataSourceName", + "doc": "The name of the datasource.", + "type": { + "$id": "4752", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4753", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "4754", + "kind": "constant", + "valueType": { + "$id": "4755", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4756", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "4757", + "kind": "constant", + "valueType": { + "$id": "4758", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4759", + "name": "dataSource", + "nameInRequest": "dataSource", + "doc": "The definition of the datasource to create or update.", + "type": { + "$ref": "4579" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "4760", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "4579" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "4761", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "4579" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/datasources('{dataSourceName}')", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.DataSources.createOrUpdate", + "decorators": [], + "examples": [ + { + "$id": "4762", + "kind": "http", + "name": "SearchServiceCreateOrUpdateDataSource", + "description": "SearchServiceCreateOrUpdateDataSource", + "filePath": "2024-07-01/SearchServiceCreateOrUpdateDataSource.json", + "parameters": [ + { + "$id": "4763", + "parameter": { + "$ref": "4751" + }, + "value": { + "$id": "4764", + "kind": "string", + "type": { + "$ref": "4752" + }, + "value": "mydatasource" + } + }, + { + "$id": "4765", + "parameter": { + "$ref": "4737" + }, + "value": { + "$id": "4766", + "kind": "string", + "type": { + "$ref": "4738" + }, + "value": "2024-07-01" + } + }, + { + "$id": "4767", + "parameter": { + "$ref": "4745" + }, + "value": { + "$id": "4768", + "kind": "string", + "type": { + "$ref": "4746" + }, + "value": "return=representation" + } + }, + { + "$id": "4769", + "parameter": { + "$ref": "4759" + }, + "value": { + "$id": "4770", + "kind": "model", + "type": { + "$ref": "4579" + }, + "value": { + "$id": "4771", + "name": { + "$id": "4772", + "kind": "string", + "type": { + "$ref": "4581" + }, + "value": "mydocdbdatasource" + }, + "description": { + "$id": "4773", + "kind": "string", + "type": { + "$ref": "4585" + }, + "value": "My Cosmos DB data source." + }, + "type": { + "$id": "4774", + "kind": "string", + "type": { + "$ref": "1864" + }, + "value": "cosmosdb" + }, + "credentials": { + "$id": "4775", + "kind": "model", + "type": { + "$ref": "4592" + }, + "value": { + "$id": "4776", + "connectionString": { + "$id": "4777", + "kind": "string", + "type": { + "$ref": "4594" + }, + "value": "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId" + } + } + }, + "container": { + "$id": "4778", + "kind": "model", + "type": { + "$ref": "4600" + }, + "value": { + "$id": "4779", + "name": { + "$id": "4780", + "kind": "string", + "type": { + "$ref": "4602" + }, + "value": "myDocDbCollectionId" + }, + "query": { + "$id": "4781", + "kind": "string", + "type": { + "$ref": "4606" + }, + "value": "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts" + } + } + }, + "encryptionKey": { + "$id": "4782", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "4783", + "keyVaultKeyName": { + "$id": "4784", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "4785", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "4786", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "4787", + "response": { + "$ref": "4760" + }, + "statusCode": 200, + "bodyValue": { + "$id": "4788", + "kind": "model", + "type": { + "$ref": "4579" + }, + "value": { + "$id": "4789", + "name": { + "$id": "4790", + "kind": "string", + "type": { + "$ref": "4581" + }, + "value": "mydocdbdatasource" + }, + "description": { + "$id": "4791", + "kind": "string", + "type": { + "$ref": "4585" + }, + "value": "My Cosmos DB data source." + }, + "type": { + "$id": "4792", + "kind": "string", + "type": { + "$ref": "1864" + }, + "value": "cosmosdb" + }, + "credentials": { + "$id": "4793", + "kind": "model", + "type": { + "$ref": "4592" + }, + "value": { + "$id": "4794" + } + }, + "container": { + "$id": "4795", + "kind": "model", + "type": { + "$ref": "4600" + }, + "value": { + "$id": "4796", + "name": { + "$id": "4797", + "kind": "string", + "type": { + "$ref": "4602" + }, + "value": "myDocDbCollectionId" + }, + "query": { + "$id": "4798", + "kind": "string", + "type": { + "$ref": "4606" + }, + "value": "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts" + } + } + }, + "encryptionKey": { + "$id": "4799", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "4800", + "keyVaultKeyName": { + "$id": "4801", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "4802", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "4803", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + } + } + } + }, + { + "$id": "4804", + "response": { + "$ref": "4761" + }, + "statusCode": 201, + "bodyValue": { + "$id": "4805", + "kind": "model", + "type": { + "$ref": "4579" + }, + "value": { + "$id": "4806", + "name": { + "$id": "4807", + "kind": "string", + "type": { + "$ref": "4581" + }, + "value": "mydocdbdatasource" + }, + "description": { + "$id": "4808", + "kind": "string", + "type": { + "$ref": "4585" + }, + "value": "My Cosmos DB data source." + }, + "type": { + "$id": "4809", + "kind": "string", + "type": { + "$ref": "1864" + }, + "value": "cosmosdb" + }, + "credentials": { + "$id": "4810", + "kind": "model", + "type": { + "$ref": "4592" + }, + "value": { + "$id": "4811" + } + }, + "container": { + "$id": "4812", + "kind": "model", + "type": { + "$ref": "4600" + }, + "value": { + "$id": "4813", + "name": { + "$id": "4814", + "kind": "string", + "type": { + "$ref": "4602" + }, + "value": "myDocDbCollectionId" + }, + "query": { + "$id": "4815", + "kind": "string", + "type": { + "$ref": "4606" + }, + "value": "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts" + } + } + }, + "encryptionKey": { + "$id": "4816", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "4817", + "keyVaultKeyName": { + "$id": "4818", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "4819", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "4820", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "4821", + "name": "delete", + "resourceName": "DataSources", + "doc": "Deletes a datasource.", + "accessibility": "public", + "parameters": [ + { + "$id": "4822", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "4823", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "4824", + "type": { + "$id": "4825", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4826", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.", + "type": { + "$id": "4827", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4828", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.", + "type": { + "$id": "4829", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4830", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "4831", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "4832", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4833", + "name": "dataSourceName", + "nameInRequest": "dataSourceName", + "doc": "The name of the datasource.", + "type": { + "$id": "4834", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4835", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "4836", + "kind": "constant", + "valueType": { + "$id": "4837", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "4838", + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + }, + { + "$id": "4839", + "statusCodes": [ + 404 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/datasources('{dataSourceName}')", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.DataSources.delete", + "decorators": [], + "examples": [ + { + "$id": "4840", + "kind": "http", + "name": "SearchServiceDeleteDataSource", + "description": "SearchServiceDeleteDataSource", + "filePath": "2024-07-01/SearchServiceDeleteDataSource.json", + "parameters": [ + { + "$id": "4841", + "parameter": { + "$ref": "4833" + }, + "value": { + "$id": "4842", + "kind": "string", + "type": { + "$ref": "4834" + }, + "value": "mydatasource" + } + }, + { + "$id": "4843", + "parameter": { + "$ref": "4822" + }, + "value": { + "$id": "4844", + "kind": "string", + "type": { + "$ref": "4823" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "4845", + "response": { + "$ref": "4838" + }, + "statusCode": 204 + }, + { + "$id": "4846", + "response": { + "$ref": "4839" + }, + "statusCode": 404 + } + ] + } + ] + }, + { + "$id": "4847", + "name": "get", + "resourceName": "DataSources", + "doc": "Retrieves a datasource definition.", + "accessibility": "public", + "parameters": [ + { + "$id": "4848", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "4849", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "4850", + "type": { + "$id": "4851", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4852", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "4853", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "4854", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4855", + "name": "dataSourceName", + "nameInRequest": "dataSourceName", + "doc": "The name of the datasource.", + "type": { + "$id": "4856", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4857", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "4858", + "kind": "constant", + "valueType": { + "$id": "4859", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "4860", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "4579" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/datasources('{dataSourceName}')", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.DataSources.get", + "decorators": [], + "examples": [ + { + "$id": "4861", + "kind": "http", + "name": "SearchServiceGetDataSource", + "description": "SearchServiceGetDataSource", + "filePath": "2024-07-01/SearchServiceGetDataSource.json", + "parameters": [ + { + "$id": "4862", + "parameter": { + "$ref": "4855" + }, + "value": { + "$id": "4863", + "kind": "string", + "type": { + "$ref": "4856" + }, + "value": "mydatasource" + } + }, + { + "$id": "4864", + "parameter": { + "$ref": "4848" + }, + "value": { + "$id": "4865", + "kind": "string", + "type": { + "$ref": "4849" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "4866", + "response": { + "$ref": "4860" + }, + "statusCode": 200, + "bodyValue": { + "$id": "4867", + "kind": "model", + "type": { + "$ref": "4579" + }, + "value": { + "$id": "4868", + "name": { + "$id": "4869", + "kind": "string", + "type": { + "$ref": "4581" + }, + "value": "mydocdbdatasource" + }, + "description": { + "$id": "4870", + "kind": "string", + "type": { + "$ref": "4585" + }, + "value": "My Cosmos DB data source." + }, + "type": { + "$id": "4871", + "kind": "string", + "type": { + "$ref": "1864" + }, + "value": "cosmosdb" + }, + "credentials": { + "$id": "4872", + "kind": "model", + "type": { + "$ref": "4592" + }, + "value": { + "$id": "4873" + } + }, + "container": { + "$id": "4874", + "kind": "model", + "type": { + "$ref": "4600" + }, + "value": { + "$id": "4875", + "name": { + "$id": "4876", + "kind": "string", + "type": { + "$ref": "4602" + }, + "value": "myDocDbCollectionId" + }, + "query": { + "$id": "4877", + "kind": "string", + "type": { + "$ref": "4606" + }, + "value": "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts" + } + } + }, + "encryptionKey": { + "$id": "4878", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "4879", + "keyVaultKeyName": { + "$id": "4880", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myKeyName" + }, + "keyVaultKeyVersion": { + "$id": "4881", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion" + }, + "keyVaultUri": { + "$id": "4882", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "4883", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "4884", + "applicationId": { + "$id": "4885", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "4886", + "name": "list", + "resourceName": "DataSources", + "doc": "Lists all datasources available for a search service.", + "accessibility": "public", + "parameters": [ + { + "$id": "4887", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "4888", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "4889", + "type": { + "$id": "4890", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4891", + "name": "$select", + "nameInRequest": "$select", + "doc": "Selects which top-level properties to retrieve.\nSpecified as a comma-separated list of JSON property names,\nor '*' for all properties. The default is all properties.", + "type": { + "$id": "4892", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4893", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "4894", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "4895", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4896", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "4897", + "kind": "constant", + "valueType": { + "$id": "4898", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "4899", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "4666" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/datasources", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.DataSources.list", + "decorators": [], + "examples": [ + { + "$id": "4900", + "kind": "http", + "name": "SearchServiceListDataSources", + "description": "SearchServiceListDataSources", + "filePath": "2024-07-01/SearchServiceListDataSources.json", + "parameters": [ + { + "$id": "4901", + "parameter": { + "$ref": "4891" + }, + "value": { + "$id": "4902", + "kind": "string", + "type": { + "$ref": "4892" + }, + "value": "*" + } + }, + { + "$id": "4903", + "parameter": { + "$ref": "4887" + }, + "value": { + "$id": "4904", + "kind": "string", + "type": { + "$ref": "4888" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "4905", + "response": { + "$ref": "4899" + }, + "statusCode": 200, + "bodyValue": { + "$id": "4906", + "kind": "model", + "type": { + "$ref": "4666" + }, + "value": { + "$id": "4907", + "value": { + "$id": "4908", + "kind": "array", + "type": { + "$ref": "4668" + }, + "value": [ + { + "$id": "4909", + "kind": "model", + "type": { + "$ref": "4579" + }, + "value": { + "$id": "4910", + "name": { + "$id": "4911", + "kind": "string", + "type": { + "$ref": "4581" + }, + "value": "mydocdbdatasource" + }, + "description": { + "$id": "4912", + "kind": "string", + "type": { + "$ref": "4585" + }, + "value": "My Cosmos DB data source." + }, + "type": { + "$id": "4913", + "kind": "string", + "type": { + "$ref": "1864" + }, + "value": "cosmosdb" + }, + "credentials": { + "$id": "4914", + "kind": "model", + "type": { + "$ref": "4592" + }, + "value": { + "$id": "4915" + } + }, + "container": { + "$id": "4916", + "kind": "model", + "type": { + "$ref": "4600" + }, + "value": { + "$id": "4917", + "name": { + "$id": "4918", + "kind": "string", + "type": { + "$ref": "4602" + }, + "value": "myDocDbCollectionId" + }, + "query": { + "$id": "4919", + "kind": "string", + "type": { + "$ref": "4606" + }, + "value": "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts" + } + } + }, + "encryptionKey": { + "$id": "4920", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "4921", + "keyVaultKeyName": { + "$id": "4922", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myKeyName" + }, + "keyVaultKeyVersion": { + "$id": "4923", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion" + }, + "keyVaultUri": { + "$id": "4924", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "4925", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "4926", + "applicationId": { + "$id": "4927", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "4928", + "name": "create", + "resourceName": "DataSources", + "doc": "Creates a new datasource.", + "accessibility": "public", + "parameters": [ + { + "$id": "4929", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "4930", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "4931", + "type": { + "$id": "4932", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4933", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "4934", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "4935", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4936", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "4937", + "kind": "constant", + "valueType": { + "$id": "4938", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4939", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "4940", + "kind": "constant", + "valueType": { + "$id": "4941", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4942", + "name": "dataSource", + "nameInRequest": "dataSource", + "doc": "The definition of the datasource to create.", + "type": { + "$ref": "4579" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "4943", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "4579" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/datasources", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.DataSources.create", + "decorators": [], + "examples": [ + { + "$id": "4944", + "kind": "http", + "name": "SearchServiceCreateDataSource", + "description": "SearchServiceCreateDataSource", + "filePath": "2024-07-01/SearchServiceCreateDataSource.json", + "parameters": [ + { + "$id": "4945", + "parameter": { + "$ref": "4929" + }, + "value": { + "$id": "4946", + "kind": "string", + "type": { + "$ref": "4930" + }, + "value": "2024-07-01" + } + }, + { + "$id": "4947", + "parameter": { + "$ref": "4942" + }, + "value": { + "$id": "4948", + "kind": "model", + "type": { + "$ref": "4579" + }, + "value": { + "$id": "4949", + "name": { + "$id": "4950", + "kind": "string", + "type": { + "$ref": "4581" + }, + "value": "mydocdbdatasource" + }, + "description": { + "$id": "4951", + "kind": "string", + "type": { + "$ref": "4585" + }, + "value": "My Cosmos DB data source." + }, + "type": { + "$id": "4952", + "kind": "string", + "type": { + "$ref": "1864" + }, + "value": "cosmosdb" + }, + "credentials": { + "$id": "4953", + "kind": "model", + "type": { + "$ref": "4592" + }, + "value": { + "$id": "4954", + "connectionString": { + "$id": "4955", + "kind": "string", + "type": { + "$ref": "4594" + }, + "value": "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId" + } + } + }, + "container": { + "$id": "4956", + "kind": "model", + "type": { + "$ref": "4600" + }, + "value": { + "$id": "4957", + "name": { + "$id": "4958", + "kind": "string", + "type": { + "$ref": "4602" + }, + "value": "myDocDbCollectionId" + }, + "query": { + "$id": "4959", + "kind": "string", + "type": { + "$ref": "4606" + }, + "value": "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts" + } + } + }, + "encryptionKey": { + "$id": "4960", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "4961", + "keyVaultKeyName": { + "$id": "4962", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "4963", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "4964", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "4965", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "4966", + "applicationId": { + "$id": "4967", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + }, + "applicationSecret": { + "$id": "4968", + "kind": "string", + "type": { + "$ref": "3293" + }, + "value": "" + } + } + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "4969", + "response": { + "$ref": "4943" + }, + "statusCode": 201, + "bodyValue": { + "$id": "4970", + "kind": "model", + "type": { + "$ref": "4579" + }, + "value": { + "$id": "4971", + "name": { + "$id": "4972", + "kind": "string", + "type": { + "$ref": "4581" + }, + "value": "mydocdbdatasource" + }, + "description": { + "$id": "4973", + "kind": "string", + "type": { + "$ref": "4585" + }, + "value": "My Cosmos DB data source." + }, + "type": { + "$id": "4974", + "kind": "string", + "type": { + "$ref": "1864" + }, + "value": "cosmosdb" + }, + "credentials": { + "$id": "4975", + "kind": "model", + "type": { + "$ref": "4592" + }, + "value": { + "$id": "4976" + } + }, + "container": { + "$id": "4977", + "kind": "model", + "type": { + "$ref": "4600" + }, + "value": { + "$id": "4978", + "name": { + "$id": "4979", + "kind": "string", + "type": { + "$ref": "4602" + }, + "value": "myDocDbCollectionId" + }, + "query": { + "$id": "4980", + "kind": "string", + "type": { + "$ref": "4606" + }, + "value": "SELECT c.id, c.userId, tag, c._ts FROM c JOIN tag IN c.tags WHERE c._ts >= @HighWaterMark ORDER BY c._ts" + } + } + }, + "encryptionKey": { + "$id": "4981", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "4982", + "keyVaultKeyName": { + "$id": "4983", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "4984", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "4985", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "4986", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "4987", + "applicationId": { + "$id": "4988", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + } + } + ] + } + ] + } + ], + "parameters": [ + { + "$id": "4989", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "4990", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client" + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Search.DataSources", + "apiVersions": [ + "2024-07-01" + ], + "parent": { + "$ref": "4671" + } + }, + { + "$id": "4991", + "kind": "client", + "name": "Indexers", + "namespace": "Azure.Search.Documents", + "operations": [ + { + "$id": "4992", + "name": "reset", + "resourceName": "Indexers", + "doc": "Resets the change tracking state associated with an indexer.", + "accessibility": "public", + "parameters": [ + { + "$id": "4993", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "4994", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "4995", + "type": { + "$id": "4996", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "4997", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "4998", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "4999", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5000", + "name": "indexerName", + "nameInRequest": "indexerName", + "doc": "The name of the indexer.", + "type": { + "$id": "5001", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5002", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5003", + "kind": "constant", + "valueType": { + "$id": "5004", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5005", + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/indexers('{indexerName}')/search.reset", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Indexers.reset", + "decorators": [], + "examples": [ + { + "$id": "5006", + "kind": "http", + "name": "SearchServiceResetIndexer", + "description": "SearchServiceResetIndexer", + "filePath": "2024-07-01/SearchServiceResetIndexer.json", + "parameters": [ + { + "$id": "5007", + "parameter": { + "$ref": "5000" + }, + "value": { + "$id": "5008", + "kind": "string", + "type": { + "$ref": "5001" + }, + "value": "myindexer" + } + }, + { + "$id": "5009", + "parameter": { + "$ref": "4993" + }, + "value": { + "$id": "5010", + "kind": "string", + "type": { + "$ref": "4994" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "5011", + "response": { + "$ref": "5005" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "5012", + "name": "run", + "resourceName": "Indexers", + "doc": "Runs an indexer on-demand.", + "accessibility": "public", + "parameters": [ + { + "$id": "5013", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5014", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5015", + "type": { + "$id": "5016", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5017", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5018", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5019", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5020", + "name": "indexerName", + "nameInRequest": "indexerName", + "doc": "The name of the indexer.", + "type": { + "$id": "5021", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5022", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5023", + "kind": "constant", + "valueType": { + "$id": "5024", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5025", + "statusCodes": [ + 202 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/indexers('{indexerName}')/search.run", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Indexers.run", + "decorators": [], + "examples": [ + { + "$id": "5026", + "kind": "http", + "name": "SearchServiceRunIndexer", + "description": "SearchServiceRunIndexer", + "filePath": "2024-07-01/SearchServiceRunIndexer.json", + "parameters": [ + { + "$id": "5027", + "parameter": { + "$ref": "5020" + }, + "value": { + "$id": "5028", + "kind": "string", + "type": { + "$ref": "5021" + }, + "value": "myindexer" + } + }, + { + "$id": "5029", + "parameter": { + "$ref": "5013" + }, + "value": { + "$id": "5030", + "kind": "string", + "type": { + "$ref": "5014" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "5031", + "response": { + "$ref": "5025" + }, + "statusCode": 202 + } + ] + } + ] + }, + { + "$id": "5032", + "name": "createOrUpdate", + "resourceName": "Indexers", + "doc": "Creates a new indexer or updates an indexer if it already exists.", + "accessibility": "public", + "parameters": [ + { + "$id": "5033", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5034", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5035", + "type": { + "$id": "5036", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5037", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.", + "type": { + "$id": "5038", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5039", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.", + "type": { + "$id": "5040", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5041", + "name": "prefer", + "nameInRequest": "Prefer", + "doc": "For HTTP PUT requests, instructs the service to return the created/updated resource on success.", + "type": { + "$id": "5042", + "kind": "constant", + "valueType": { + "$id": "5043", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "return=representation", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5044", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5045", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5046", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5047", + "name": "indexerName", + "nameInRequest": "indexerName", + "doc": "The name of the indexer.", + "type": { + "$id": "5048", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5049", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "5050", + "kind": "constant", + "valueType": { + "$id": "5051", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5052", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5053", + "kind": "constant", + "valueType": { + "$id": "5054", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5055", + "name": "indexer", + "nameInRequest": "indexer", + "doc": "The definition of the indexer to create or update.", + "type": { + "$ref": "4301" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5056", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "4301" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "5057", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "4301" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/indexers('{indexerName}')", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Indexers.createOrUpdate", + "decorators": [], + "examples": [ + { + "$id": "5058", + "kind": "http", + "name": "SearchServiceCreateOrUpdateIndexer", + "description": "SearchServiceCreateOrUpdateIndexer", + "filePath": "2024-07-01/SearchServiceCreateOrUpdateIndexer.json", + "parameters": [ + { + "$id": "5059", + "parameter": { + "$ref": "5047" + }, + "value": { + "$id": "5060", + "kind": "string", + "type": { + "$ref": "5048" + }, + "value": "myindexer" + } + }, + { + "$id": "5061", + "parameter": { + "$ref": "5033" + }, + "value": { + "$id": "5062", + "kind": "string", + "type": { + "$ref": "5034" + }, + "value": "2024-07-01" + } + }, + { + "$id": "5063", + "parameter": { + "$ref": "5041" + }, + "value": { + "$id": "5064", + "kind": "string", + "type": { + "$ref": "5042" + }, + "value": "return=representation" + } + }, + { + "$id": "5065", + "parameter": { + "$ref": "5055" + }, + "value": { + "$id": "5066", + "kind": "model", + "type": { + "$ref": "4301" + }, + "value": { + "$id": "5067", + "name": { + "$id": "5068", + "kind": "string", + "type": { + "$ref": "4303" + }, + "value": "myindexer" + }, + "description": { + "$id": "5069", + "kind": "string", + "type": { + "$ref": "4307" + }, + "value": "a cool indexer" + }, + "dataSourceName": { + "$id": "5070", + "kind": "string", + "type": { + "$ref": "4311" + }, + "value": "mydatasource" + }, + "targetIndexName": { + "$id": "5071", + "kind": "string", + "type": { + "$ref": "4319" + }, + "value": "orders" + }, + "schedule": { + "$id": "5072", + "kind": "model", + "type": { + "$ref": "4323" + }, + "value": { + "$id": "5073", + "interval": { + "$id": "5074", + "kind": "string", + "type": { + "$ref": "4325" + }, + "value": "PT1H" + }, + "startTime": { + "$id": "5075", + "kind": "string", + "type": { + "$ref": "4330" + }, + "value": "2015-01-01T00:00:00Z" + } + } + }, + "parameters": { + "$id": "5076", + "kind": "model", + "type": { + "$ref": "4337" + }, + "value": { + "$id": "5077", + "maxFailedItems": { + "$id": "5078", + "kind": "number", + "type": { + "$ref": "4343" + }, + "value": 10 + }, + "maxFailedItemsPerBatch": { + "$id": "5079", + "kind": "number", + "type": { + "$ref": "4347" + }, + "value": 5 + } + } + }, + "encryptionKey": { + "$id": "5080", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5081", + "keyVaultKeyName": { + "$id": "5082", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "5083", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "5084", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "5085", + "response": { + "$ref": "5056" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5086", + "kind": "model", + "type": { + "$ref": "4301" + }, + "value": { + "$id": "5087", + "name": { + "$id": "5088", + "kind": "string", + "type": { + "$ref": "4303" + }, + "value": "myindexer" + }, + "description": { + "$id": "5089", + "kind": "string", + "type": { + "$ref": "4307" + }, + "value": "a cool indexer" + }, + "dataSourceName": { + "$id": "5090", + "kind": "string", + "type": { + "$ref": "4311" + }, + "value": "mydatasource" + }, + "targetIndexName": { + "$id": "5091", + "kind": "string", + "type": { + "$ref": "4319" + }, + "value": "orders" + }, + "schedule": { + "$id": "5092", + "kind": "model", + "type": { + "$ref": "4323" + }, + "value": { + "$id": "5093", + "interval": { + "$id": "5094", + "kind": "string", + "type": { + "$ref": "4325" + }, + "value": "PT1H" + }, + "startTime": { + "$id": "5095", + "kind": "string", + "type": { + "$ref": "4330" + }, + "value": "2015-01-01T00:00:00Z" + } + } + }, + "parameters": { + "$id": "5096", + "kind": "model", + "type": { + "$ref": "4337" + }, + "value": { + "$id": "5097", + "maxFailedItems": { + "$id": "5098", + "kind": "number", + "type": { + "$ref": "4343" + }, + "value": 10 + }, + "maxFailedItemsPerBatch": { + "$id": "5099", + "kind": "number", + "type": { + "$ref": "4347" + }, + "value": 5 + } + } + }, + "fieldMappings": { + "$id": "5100", + "kind": "array", + "type": { + "$ref": "4417" + }, + "value": [] + }, + "disabled": { + "$id": "5101", + "kind": "boolean", + "type": { + "$ref": "4448" + }, + "value": false + }, + "encryptionKey": { + "$id": "5102", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5103", + "keyVaultKeyName": { + "$id": "5104", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "5105", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "5106", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + } + } + } + }, + { + "$id": "5107", + "response": { + "$ref": "5057" + }, + "statusCode": 201, + "bodyValue": { + "$id": "5108", + "kind": "model", + "type": { + "$ref": "4301" + }, + "value": { + "$id": "5109", + "name": { + "$id": "5110", + "kind": "string", + "type": { + "$ref": "4303" + }, + "value": "myindexer" + }, + "description": { + "$id": "5111", + "kind": "string", + "type": { + "$ref": "4307" + }, + "value": "a cool indexer" + }, + "dataSourceName": { + "$id": "5112", + "kind": "string", + "type": { + "$ref": "4311" + }, + "value": "mydatasource" + }, + "targetIndexName": { + "$id": "5113", + "kind": "string", + "type": { + "$ref": "4319" + }, + "value": "orders" + }, + "schedule": { + "$id": "5114", + "kind": "model", + "type": { + "$ref": "4323" + }, + "value": { + "$id": "5115", + "interval": { + "$id": "5116", + "kind": "string", + "type": { + "$ref": "4325" + }, + "value": "PT1H" + }, + "startTime": { + "$id": "5117", + "kind": "string", + "type": { + "$ref": "4330" + }, + "value": "2015-01-01T00:00:00Z" + } + } + }, + "parameters": { + "$id": "5118", + "kind": "model", + "type": { + "$ref": "4337" + }, + "value": { + "$id": "5119", + "maxFailedItems": { + "$id": "5120", + "kind": "number", + "type": { + "$ref": "4343" + }, + "value": 10 + }, + "maxFailedItemsPerBatch": { + "$id": "5121", + "kind": "number", + "type": { + "$ref": "4347" + }, + "value": 5 + } + } + }, + "fieldMappings": { + "$id": "5122", + "kind": "array", + "type": { + "$ref": "4417" + }, + "value": [] + }, + "disabled": { + "$id": "5123", + "kind": "boolean", + "type": { + "$ref": "4448" + }, + "value": false + }, + "encryptionKey": { + "$id": "5124", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5125", + "keyVaultKeyName": { + "$id": "5126", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "5127", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "5128", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "5129", + "name": "delete", + "resourceName": "Indexers", + "doc": "Deletes an indexer.", + "accessibility": "public", + "parameters": [ + { + "$id": "5130", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5131", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5132", + "type": { + "$id": "5133", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5134", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.", + "type": { + "$id": "5135", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5136", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.", + "type": { + "$id": "5137", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5138", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5139", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5140", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5141", + "name": "indexerName", + "nameInRequest": "indexerName", + "doc": "The name of the indexer.", + "type": { + "$id": "5142", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5143", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5144", + "kind": "constant", + "valueType": { + "$id": "5145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5146", + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + }, + { + "$id": "5147", + "statusCodes": [ + 404 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/indexers('{indexerName}')", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Indexers.delete", + "decorators": [], + "examples": [ + { + "$id": "5148", + "kind": "http", + "name": "SearchServiceDeleteIndexer", + "description": "SearchServiceDeleteIndexer", + "filePath": "2024-07-01/SearchServiceDeleteIndexer.json", + "parameters": [ + { + "$id": "5149", + "parameter": { + "$ref": "5141" + }, + "value": { + "$id": "5150", + "kind": "string", + "type": { + "$ref": "5142" + }, + "value": "myindexer" + } + }, + { + "$id": "5151", + "parameter": { + "$ref": "5130" + }, + "value": { + "$id": "5152", + "kind": "string", + "type": { + "$ref": "5131" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "5153", + "response": { + "$ref": "5146" + }, + "statusCode": 204 + }, + { + "$id": "5154", + "response": { + "$ref": "5147" + }, + "statusCode": 404 + } + ] + } + ] + }, + { + "$id": "5155", + "name": "get", + "resourceName": "Indexers", + "doc": "Retrieves an indexer definition.", + "accessibility": "public", + "parameters": [ + { + "$id": "5156", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5157", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5158", + "type": { + "$id": "5159", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5160", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5161", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5162", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5163", + "name": "indexerName", + "nameInRequest": "indexerName", + "doc": "The name of the indexer.", + "type": { + "$id": "5164", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5165", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5166", + "kind": "constant", + "valueType": { + "$id": "5167", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5168", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "4301" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/indexers('{indexerName}')", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Indexers.get", + "decorators": [], + "examples": [ + { + "$id": "5169", + "kind": "http", + "name": "SearchServiceGetIndexer", + "description": "SearchServiceGetIndexer", + "filePath": "2024-07-01/SearchServiceGetIndexer.json", + "parameters": [ + { + "$id": "5170", + "parameter": { + "$ref": "5163" + }, + "value": { + "$id": "5171", + "kind": "string", + "type": { + "$ref": "5164" + }, + "value": "myindexer" + } + }, + { + "$id": "5172", + "parameter": { + "$ref": "5156" + }, + "value": { + "$id": "5173", + "kind": "string", + "type": { + "$ref": "5157" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "5174", + "response": { + "$ref": "5168" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5175", + "kind": "model", + "type": { + "$ref": "4301" + }, + "value": { + "$id": "5176", + "name": { + "$id": "5177", + "kind": "string", + "type": { + "$ref": "4303" + }, + "value": "myindexer" + }, + "description": { + "$id": "5178", + "kind": "string", + "type": { + "$ref": "4307" + }, + "value": "a cool indexer" + }, + "dataSourceName": { + "$id": "5179", + "kind": "string", + "type": { + "$ref": "4311" + }, + "value": "mydatasource" + }, + "targetIndexName": { + "$id": "5180", + "kind": "string", + "type": { + "$ref": "4319" + }, + "value": "orders" + }, + "schedule": { + "$id": "5181", + "kind": "model", + "type": { + "$ref": "4323" + }, + "value": { + "$id": "5182", + "interval": { + "$id": "5183", + "kind": "string", + "type": { + "$ref": "4325" + }, + "value": "PT1H" + }, + "startTime": { + "$id": "5184", + "kind": "string", + "type": { + "$ref": "4330" + }, + "value": "2015-01-01T00:00:00Z" + } + } + }, + "parameters": { + "$id": "5185", + "kind": "model", + "type": { + "$ref": "4337" + }, + "value": { + "$id": "5186", + "maxFailedItems": { + "$id": "5187", + "kind": "number", + "type": { + "$ref": "4343" + }, + "value": 10 + }, + "maxFailedItemsPerBatch": { + "$id": "5188", + "kind": "number", + "type": { + "$ref": "4347" + }, + "value": 5 + } + } + }, + "fieldMappings": { + "$id": "5189", + "kind": "array", + "type": { + "$ref": "4417" + }, + "value": [] + }, + "disabled": { + "$id": "5190", + "kind": "boolean", + "type": { + "$ref": "4448" + }, + "value": false + }, + "encryptionKey": { + "$id": "5191", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5192", + "keyVaultKeyName": { + "$id": "5193", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myKeyName" + }, + "keyVaultKeyVersion": { + "$id": "5194", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion" + }, + "keyVaultUri": { + "$id": "5195", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "5196", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "5197", + "applicationId": { + "$id": "5198", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "5199", + "name": "list", + "resourceName": "Indexers", + "doc": "Lists all indexers available for a search service.", + "accessibility": "public", + "parameters": [ + { + "$id": "5200", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5201", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5202", + "type": { + "$id": "5203", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5204", + "name": "$select", + "nameInRequest": "$select", + "doc": "Selects which top-level properties to retrieve.\nSpecified as a comma-separated list of JSON property names,\nor '*' for all properties. The default is all properties.", + "type": { + "$id": "5205", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5206", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5207", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5208", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5209", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5210", + "kind": "constant", + "valueType": { + "$id": "5211", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5212", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "4458" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/indexers", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Indexers.list", + "decorators": [], + "examples": [ + { + "$id": "5213", + "kind": "http", + "name": "SearchServiceListIndexers", + "description": "SearchServiceListIndexers", + "filePath": "2024-07-01/SearchServiceListIndexers.json", + "parameters": [ + { + "$id": "5214", + "parameter": { + "$ref": "5204" + }, + "value": { + "$id": "5215", + "kind": "string", + "type": { + "$ref": "5205" + }, + "value": "*" + } + }, + { + "$id": "5216", + "parameter": { + "$ref": "5200" + }, + "value": { + "$id": "5217", + "kind": "string", + "type": { + "$ref": "5201" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "5218", + "response": { + "$ref": "5212" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5219", + "kind": "model", + "type": { + "$ref": "4458" + }, + "value": { + "$id": "5220", + "value": { + "$id": "5221", + "kind": "array", + "type": { + "$ref": "4460" + }, + "value": [ + { + "$id": "5222", + "kind": "model", + "type": { + "$ref": "4301" + }, + "value": { + "$id": "5223", + "name": { + "$id": "5224", + "kind": "string", + "type": { + "$ref": "4303" + }, + "value": "myindexer" + }, + "description": { + "$id": "5225", + "kind": "string", + "type": { + "$ref": "4307" + }, + "value": "a cool indexer" + }, + "dataSourceName": { + "$id": "5226", + "kind": "string", + "type": { + "$ref": "4311" + }, + "value": "mydocdbdatasource" + }, + "targetIndexName": { + "$id": "5227", + "kind": "string", + "type": { + "$ref": "4319" + }, + "value": "orders" + }, + "schedule": { + "$id": "5228", + "kind": "model", + "type": { + "$ref": "4323" + }, + "value": { + "$id": "5229", + "interval": { + "$id": "5230", + "kind": "string", + "type": { + "$ref": "4325" + }, + "value": "PT1H" + }, + "startTime": { + "$id": "5231", + "kind": "string", + "type": { + "$ref": "4330" + }, + "value": "2015-01-01T00:00:00Z" + } + } + }, + "parameters": { + "$id": "5232", + "kind": "model", + "type": { + "$ref": "4337" + }, + "value": { + "$id": "5233", + "maxFailedItems": { + "$id": "5234", + "kind": "number", + "type": { + "$ref": "4343" + }, + "value": 10 + }, + "maxFailedItemsPerBatch": { + "$id": "5235", + "kind": "number", + "type": { + "$ref": "4347" + }, + "value": 5 + } + } + }, + "fieldMappings": { + "$id": "5236", + "kind": "array", + "type": { + "$ref": "4417" + }, + "value": [] + }, + "disabled": { + "$id": "5237", + "kind": "boolean", + "type": { + "$ref": "4448" + }, + "value": false + } + } + }, + { + "$id": "5238", + "kind": "model", + "type": { + "$ref": "4301" + }, + "value": { + "$id": "5239", + "name": { + "$id": "5240", + "kind": "string", + "type": { + "$ref": "4303" + }, + "value": "myotherindexer" + }, + "description": { + "$id": "5241", + "kind": "string", + "type": { + "$ref": "4307" + }, + "value": "another cool indexer" + }, + "dataSourceName": { + "$id": "5242", + "kind": "string", + "type": { + "$ref": "4311" + }, + "value": "myblobdatasource" + }, + "targetIndexName": { + "$id": "5243", + "kind": "string", + "type": { + "$ref": "4319" + }, + "value": "orders" + }, + "parameters": { + "$id": "5244", + "kind": "model", + "type": { + "$ref": "4337" + }, + "value": { + "$id": "5245", + "maxFailedItems": { + "$id": "5246", + "kind": "number", + "type": { + "$ref": "4343" + }, + "value": 10 + }, + "maxFailedItemsPerBatch": { + "$id": "5247", + "kind": "number", + "type": { + "$ref": "4347" + }, + "value": 5 + }, + "batchSize": { + "$id": "5248", + "kind": "number", + "type": { + "$ref": "4339" + }, + "value": 15 + } + } + }, + "fieldMappings": { + "$id": "5249", + "kind": "array", + "type": { + "$ref": "4417" + }, + "value": [ + { + "$id": "5250", + "kind": "model", + "type": { + "$ref": "4418" + }, + "value": { + "$id": "5251", + "sourceFieldName": { + "$id": "5252", + "kind": "string", + "type": { + "$ref": "4420" + }, + "value": "PersonName" + }, + "targetFieldName": { + "$id": "5253", + "kind": "string", + "type": { + "$ref": "4424" + }, + "value": "FirstName" + }, + "mappingFunction": { + "$id": "5254", + "kind": "model", + "type": { + "$ref": "4428" + }, + "value": { + "$id": "5255", + "name": { + "$id": "5256", + "kind": "string", + "type": { + "$ref": "4430" + }, + "value": "extractTokenAtPosition" + }, + "parameters": { + "$id": "5257", + "kind": "dict", + "type": { + "$ref": "4434" + }, + "value": { + "$id": "5258", + "delimiter": { + "$id": "5259", + "kind": "unknown", + "type": { + "$ref": "4436" + }, + "value": " " + }, + "position": { + "$id": "5260", + "kind": "unknown", + "type": { + "$ref": "4436" + }, + "value": 0 + } + } + } + } + } + } + }, + { + "$id": "5261", + "kind": "model", + "type": { + "$ref": "4418" + }, + "value": { + "$id": "5262", + "sourceFieldName": { + "$id": "5263", + "kind": "string", + "type": { + "$ref": "4420" + }, + "value": "PersonName" + }, + "targetFieldName": { + "$id": "5264", + "kind": "string", + "type": { + "$ref": "4424" + }, + "value": "LastName" + }, + "mappingFunction": { + "$id": "5265", + "kind": "model", + "type": { + "$ref": "4428" + }, + "value": { + "$id": "5266", + "name": { + "$id": "5267", + "kind": "string", + "type": { + "$ref": "4430" + }, + "value": "extractTokenAtPosition" + }, + "parameters": { + "$id": "5268", + "kind": "dict", + "type": { + "$ref": "4434" + }, + "value": { + "$id": "5269", + "delimiter": { + "$id": "5270", + "kind": "unknown", + "type": { + "$ref": "4436" + }, + "value": " " + }, + "position": { + "$id": "5271", + "kind": "unknown", + "type": { + "$ref": "4436" + }, + "value": 1 + } + } + } + } + } + } + } + ] + }, + "disabled": { + "$id": "5272", + "kind": "boolean", + "type": { + "$ref": "4448" + }, + "value": false + }, + "encryptionKey": { + "$id": "5273", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5274", + "keyVaultKeyName": { + "$id": "5275", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myKeyName" + }, + "keyVaultKeyVersion": { + "$id": "5276", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion" + }, + "keyVaultUri": { + "$id": "5277", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "5278", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "5279", + "applicationId": { + "$id": "5280", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "5281", + "name": "create", + "resourceName": "Indexers", + "doc": "Creates a new indexer.", + "accessibility": "public", + "parameters": [ + { + "$id": "5282", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5283", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5284", + "type": { + "$id": "5285", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5286", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5287", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5288", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5289", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "5290", + "kind": "constant", + "valueType": { + "$id": "5291", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5292", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5293", + "kind": "constant", + "valueType": { + "$id": "5294", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5295", + "name": "indexer", + "nameInRequest": "indexer", + "doc": "The definition of the indexer to create.", + "type": { + "$ref": "4301" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5296", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "4301" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/indexers", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Indexers.create", + "decorators": [], + "examples": [ + { + "$id": "5297", + "kind": "http", + "name": "SearchServiceCreateIndexer", + "description": "SearchServiceCreateIndexer", + "filePath": "2024-07-01/SearchServiceCreateIndexer.json", + "parameters": [ + { + "$id": "5298", + "parameter": { + "$ref": "5282" + }, + "value": { + "$id": "5299", + "kind": "string", + "type": { + "$ref": "5283" + }, + "value": "2024-07-01" + } + }, + { + "$id": "5300", + "parameter": { + "$ref": "5295" + }, + "value": { + "$id": "5301", + "kind": "model", + "type": { + "$ref": "4301" + }, + "value": { + "$id": "5302", + "name": { + "$id": "5303", + "kind": "string", + "type": { + "$ref": "4303" + }, + "value": "myindexer" + }, + "description": { + "$id": "5304", + "kind": "string", + "type": { + "$ref": "4307" + }, + "value": "an indexer" + }, + "dataSourceName": { + "$id": "5305", + "kind": "string", + "type": { + "$ref": "4311" + }, + "value": "mydatasource" + }, + "targetIndexName": { + "$id": "5306", + "kind": "string", + "type": { + "$ref": "4319" + }, + "value": "orders" + }, + "schedule": { + "$id": "5307", + "kind": "model", + "type": { + "$ref": "4323" + }, + "value": { + "$id": "5308", + "interval": { + "$id": "5309", + "kind": "string", + "type": { + "$ref": "4325" + }, + "value": "PT1H" + }, + "startTime": { + "$id": "5310", + "kind": "string", + "type": { + "$ref": "4330" + }, + "value": "2015-01-01T00:00:00Z" + } + } + }, + "parameters": { + "$id": "5311", + "kind": "model", + "type": { + "$ref": "4337" + }, + "value": { + "$id": "5312", + "maxFailedItems": { + "$id": "5313", + "kind": "number", + "type": { + "$ref": "4343" + }, + "value": 10 + }, + "maxFailedItemsPerBatch": { + "$id": "5314", + "kind": "number", + "type": { + "$ref": "4347" + }, + "value": 5 + } + } + }, + "encryptionKey": { + "$id": "5315", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5316", + "keyVaultKeyName": { + "$id": "5317", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "5318", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "5319", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "5320", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "5321", + "applicationId": { + "$id": "5322", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + }, + "applicationSecret": { + "$id": "5323", + "kind": "string", + "type": { + "$ref": "3293" + }, + "value": "" + } + } + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "5324", + "response": { + "$ref": "5296" + }, + "statusCode": 201, + "bodyValue": { + "$id": "5325", + "kind": "model", + "type": { + "$ref": "4301" + }, + "value": { + "$id": "5326", + "name": { + "$id": "5327", + "kind": "string", + "type": { + "$ref": "4303" + }, + "value": "myindexer" + }, + "description": { + "$id": "5328", + "kind": "string", + "type": { + "$ref": "4307" + }, + "value": "an indexer" + }, + "dataSourceName": { + "$id": "5329", + "kind": "string", + "type": { + "$ref": "4311" + }, + "value": "mydatasource" + }, + "targetIndexName": { + "$id": "5330", + "kind": "string", + "type": { + "$ref": "4319" + }, + "value": "orders" + }, + "schedule": { + "$id": "5331", + "kind": "model", + "type": { + "$ref": "4323" + }, + "value": { + "$id": "5332", + "interval": { + "$id": "5333", + "kind": "string", + "type": { + "$ref": "4325" + }, + "value": "PT1H" + }, + "startTime": { + "$id": "5334", + "kind": "string", + "type": { + "$ref": "4330" + }, + "value": "2015-01-01T00:00:00Z" + } + } + }, + "parameters": { + "$id": "5335", + "kind": "model", + "type": { + "$ref": "4337" + }, + "value": { + "$id": "5336", + "maxFailedItems": { + "$id": "5337", + "kind": "number", + "type": { + "$ref": "4343" + }, + "value": 10 + }, + "maxFailedItemsPerBatch": { + "$id": "5338", + "kind": "number", + "type": { + "$ref": "4347" + }, + "value": 5 + } + } + }, + "fieldMappings": { + "$id": "5339", + "kind": "array", + "type": { + "$ref": "4417" + }, + "value": [] + }, + "disabled": { + "$id": "5340", + "kind": "boolean", + "type": { + "$ref": "4448" + }, + "value": false + }, + "encryptionKey": { + "$id": "5341", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5342", + "keyVaultKeyName": { + "$id": "5343", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "5344", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "5345", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "5346", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "5347", + "applicationId": { + "$id": "5348", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "5349", + "name": "getStatus", + "resourceName": "Indexers", + "doc": "Returns the current status and execution history of an indexer.", + "accessibility": "public", + "parameters": [ + { + "$id": "5350", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5351", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5352", + "type": { + "$id": "5353", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5354", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5355", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5356", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5357", + "name": "indexerName", + "nameInRequest": "indexerName", + "doc": "The name of the indexer.", + "type": { + "$id": "5358", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5359", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5360", + "kind": "constant", + "valueType": { + "$id": "5361", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5362", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "4463" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/indexers('{indexerName}')/search.status", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Indexers.getStatus", + "decorators": [], + "examples": [ + { + "$id": "5363", + "kind": "http", + "name": "SearchServiceGetIndexerStatus", + "description": "SearchServiceGetIndexerStatus", + "filePath": "2024-07-01/SearchServiceGetIndexerStatus.json", + "parameters": [ + { + "$id": "5364", + "parameter": { + "$ref": "5357" + }, + "value": { + "$id": "5365", + "kind": "string", + "type": { + "$ref": "5358" + }, + "value": "myindexer" + } + }, + { + "$id": "5366", + "parameter": { + "$ref": "5350" + }, + "value": { + "$id": "5367", + "kind": "string", + "type": { + "$ref": "5351" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "5368", + "response": { + "$ref": "5362" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5369", + "kind": "model", + "type": { + "$ref": "4463" + }, + "value": { + "$id": "5370", + "status": { + "$id": "5371", + "kind": "string", + "type": { + "$ref": "1846" + }, + "value": "running" + }, + "lastResult": { + "$id": "5372", + "kind": "model", + "type": { + "$ref": "4468" + }, + "value": { + "$id": "5373", + "status": { + "$id": "5374", + "kind": "string", + "type": { + "$ref": "1854" + }, + "value": "success" + }, + "startTime": { + "$id": "5375", + "kind": "string", + "type": { + "$ref": "4477" + }, + "value": "2014-11-26T03:37:18.853Z" + }, + "endTime": { + "$id": "5376", + "kind": "string", + "type": { + "$ref": "4482" + }, + "value": "2014-11-26T03:37:19.012Z" + }, + "errors": { + "$id": "5377", + "kind": "array", + "type": { + "$ref": "4487" + }, + "value": [] + }, + "warnings": { + "$id": "5378", + "kind": "array", + "type": { + "$ref": "4516" + }, + "value": [] + }, + "itemsProcessed": { + "$id": "5379", + "kind": "number", + "type": { + "$ref": "4541" + }, + "value": 11 + }, + "itemsFailed": { + "$id": "5380", + "kind": "number", + "type": { + "$ref": "4545" + }, + "value": 0 + } + } + }, + "executionHistory": { + "$id": "5381", + "kind": "array", + "type": { + "$ref": "4559" + }, + "value": [ + { + "$id": "5382", + "kind": "model", + "type": { + "$ref": "4468" + }, + "value": { + "$id": "5383", + "status": { + "$id": "5384", + "kind": "string", + "type": { + "$ref": "1854" + }, + "value": "success" + }, + "startTime": { + "$id": "5385", + "kind": "string", + "type": { + "$ref": "4477" + }, + "value": "2014-11-26T03:37:18.853Z" + }, + "endTime": { + "$id": "5386", + "kind": "string", + "type": { + "$ref": "4482" + }, + "value": "2014-11-26T03:37:19.012Z" + }, + "errors": { + "$id": "5387", + "kind": "array", + "type": { + "$ref": "4487" + }, + "value": [] + }, + "warnings": { + "$id": "5388", + "kind": "array", + "type": { + "$ref": "4516" + }, + "value": [] + }, + "itemsProcessed": { + "$id": "5389", + "kind": "number", + "type": { + "$ref": "4541" + }, + "value": 11 + }, + "itemsFailed": { + "$id": "5390", + "kind": "number", + "type": { + "$ref": "4545" + }, + "value": 0 + } + } + }, + { + "$id": "5391", + "kind": "model", + "type": { + "$ref": "4468" + }, + "value": { + "$id": "5392", + "status": { + "$id": "5393", + "kind": "string", + "type": { + "$ref": "1854" + }, + "value": "transientFailure" + }, + "startTime": { + "$id": "5394", + "kind": "string", + "type": { + "$ref": "4477" + }, + "value": "2014-11-26T03:28:10.125Z" + }, + "endTime": { + "$id": "5395", + "kind": "string", + "type": { + "$ref": "4482" + }, + "value": "2014-11-26T03:28:12.007Z" + }, + "errors": { + "$id": "5396", + "kind": "array", + "type": { + "$ref": "4487" + }, + "value": [ + { + "$id": "5397", + "kind": "model", + "type": { + "$ref": "4488" + }, + "value": { + "$id": "5398", + "key": { + "$id": "5399", + "kind": "string", + "type": { + "$ref": "4490" + }, + "value": "" + }, + "errorMessage": { + "$id": "5400", + "kind": "string", + "type": { + "$ref": "4494" + }, + "value": "Document key cannot be missing or empty." + }, + "statusCode": { + "$id": "5401", + "kind": "number", + "type": { + "$ref": "4498" + }, + "value": 400 + } + } + }, + { + "$id": "5402", + "kind": "model", + "type": { + "$ref": "4488" + }, + "value": { + "$id": "5403", + "key": { + "$id": "5404", + "kind": "string", + "type": { + "$ref": "4490" + }, + "value": "document id 1" + }, + "errorMessage": { + "$id": "5405", + "kind": "string", + "type": { + "$ref": "4494" + }, + "value": "Could not read the value of column 'foo' at index '0'." + }, + "statusCode": { + "$id": "5406", + "kind": "number", + "type": { + "$ref": "4498" + }, + "value": 400 + }, + "name": { + "$id": "5407", + "kind": "string", + "type": { + "$ref": "4502" + }, + "value": "DocumentExtraction.AzureBlob.MyDataSource" + }, + "details": { + "$id": "5408", + "kind": "string", + "type": { + "$ref": "4506" + }, + "value": "The file could not be parsed." + }, + "documentationLink": { + "$id": "5409", + "kind": "string", + "type": { + "$ref": "4510" + }, + "value": "https://go.microsoft.com/fwlink/?linkid=2049388" + } + } + } + ] + }, + "warnings": { + "$id": "5410", + "kind": "array", + "type": { + "$ref": "4516" + }, + "value": [ + { + "$id": "5411", + "kind": "model", + "type": { + "$ref": "4517" + }, + "value": { + "$id": "5412", + "key": { + "$id": "5413", + "kind": "string", + "type": { + "$ref": "4519" + }, + "value": "document id" + }, + "message": { + "$id": "5414", + "kind": "string", + "type": { + "$ref": "4523" + }, + "value": "A warning doesn't stop indexing, and is intended to inform you of certain interesting situations, like when a blob indexer truncates the amount of text extracted from a blob." + } + } + }, + { + "$id": "5415", + "kind": "model", + "type": { + "$ref": "4517" + }, + "value": { + "$id": "5416", + "key": { + "$id": "5417", + "kind": "string", + "type": { + "$ref": "4519" + }, + "value": "document id 2" + }, + "message": { + "$id": "5418", + "kind": "string", + "type": { + "$ref": "4523" + }, + "value": "Document was truncated to 50000 characters." + }, + "name": { + "$id": "5419", + "kind": "string", + "type": { + "$ref": "4527" + }, + "value": "Enrichment.LanguageDetectionSkill.#4" + }, + "details": { + "$id": "5420", + "kind": "string", + "type": { + "$ref": "4531" + }, + "value": "The skill did something that didn't break anything, nonetheless something we didn't expect happened, so it might be worth double checking." + }, + "documentationLink": { + "$id": "5421", + "kind": "string", + "type": { + "$ref": "4535" + }, + "value": "https://go.microsoft.com/fwlink/?linkid=2099692" + } + } + } + ] + }, + "itemsProcessed": { + "$id": "5422", + "kind": "number", + "type": { + "$ref": "4541" + }, + "value": 1 + }, + "itemsFailed": { + "$id": "5423", + "kind": "number", + "type": { + "$ref": "4545" + }, + "value": 2 + } + } + } + ] + }, + "limits": { + "$id": "5424", + "kind": "model", + "type": { + "$ref": "4563" + }, + "value": { + "$id": "5425", + "maxRunTime": { + "$id": "5426", + "kind": "string", + "type": { + "$ref": "4565" + }, + "value": "PT22H" + }, + "maxDocumentExtractionSize": { + "$id": "5427", + "kind": "number", + "type": { + "$ref": "4570" + }, + "value": 256000000 + }, + "maxDocumentContentCharactersToExtract": { + "$id": "5428", + "kind": "number", + "type": { + "$ref": "4574" + }, + "value": 4000000 + } + } + } + } + } + } + ] + } + ] + } + ], + "parameters": [ + { + "$id": "5429", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "5430", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client" + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Search.Indexers", + "apiVersions": [ + "2024-07-01" + ], + "parent": { + "$ref": "4671" + } + }, + { + "$id": "5431", + "kind": "client", + "name": "Skillsets", + "namespace": "Azure.Search.Documents", + "operations": [ + { + "$id": "5432", + "name": "createOrUpdate", + "resourceName": "Skillsets", + "doc": "Creates a new skillset in a search service or updates the skillset if it\nalready exists.", + "accessibility": "public", + "parameters": [ + { + "$id": "5433", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5434", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5435", + "type": { + "$id": "5436", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5437", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.", + "type": { + "$id": "5438", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5439", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.", + "type": { + "$id": "5440", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5441", + "name": "prefer", + "nameInRequest": "Prefer", + "doc": "For HTTP PUT requests, instructs the service to return the created/updated resource on success.", + "type": { + "$id": "5442", + "kind": "constant", + "valueType": { + "$id": "5443", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "return=representation", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5444", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5445", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5446", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5447", + "name": "skillsetName", + "nameInRequest": "skillsetName", + "doc": "The name of the skillset.", + "type": { + "$id": "5448", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5449", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "5450", + "kind": "constant", + "valueType": { + "$id": "5451", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5452", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5453", + "kind": "constant", + "valueType": { + "$id": "5454", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5455", + "name": "skillset", + "nameInRequest": "skillset", + "doc": "The skillset containing one or more skills to create or update in a search\nservice.", + "type": { + "$ref": "3669" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5456", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "3669" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "5457", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "3669" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/skillsets('{skillsetName}')", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Skillsets.createOrUpdate", + "decorators": [], + "examples": [ + { + "$id": "5458", + "kind": "http", + "name": "SearchServiceCreateOrUpdateSkillset", + "description": "SearchServiceCreateOrUpdateSkillset", + "filePath": "2024-07-01/SearchServiceCreateOrUpdateSkillset.json", + "parameters": [ + { + "$id": "5459", + "parameter": { + "$ref": "5447" + }, + "value": { + "$id": "5460", + "kind": "string", + "type": { + "$ref": "5448" + }, + "value": "demoskillset" + } + }, + { + "$id": "5461", + "parameter": { + "$ref": "5433" + }, + "value": { + "$id": "5462", + "kind": "string", + "type": { + "$ref": "5434" + }, + "value": "2024-07-01" + } + }, + { + "$id": "5463", + "parameter": { + "$ref": "5441" + }, + "value": { + "$id": "5464", + "kind": "string", + "type": { + "$ref": "5442" + }, + "value": "return=representation" + } + }, + { + "$id": "5465", + "parameter": { + "$ref": "5455" + }, + "value": { + "$id": "5466", + "kind": "model", + "type": { + "$ref": "3669" + }, + "value": { + "$id": "5467", + "name": { + "$id": "5468", + "kind": "string", + "type": { + "$ref": "3671" + }, + "value": "demoskillset" + }, + "description": { + "$id": "5469", + "kind": "string", + "type": { + "$ref": "3675" + }, + "value": "Extract entities, detect language and extract key-phrases" + }, + "skills": { + "$id": "5470", + "kind": "array", + "type": { + "$ref": "3679" + }, + "value": [] + }, + "encryptionKey": { + "$id": "5471", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5472", + "keyVaultKeyName": { + "$id": "5473", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "5474", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "5475", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "5476", + "response": { + "$ref": "5456" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5477", + "kind": "model", + "type": { + "$ref": "3669" + }, + "value": { + "$id": "5478", + "name": { + "$id": "5479", + "kind": "string", + "type": { + "$ref": "3671" + }, + "value": "demoskillset" + }, + "description": { + "$id": "5480", + "kind": "string", + "type": { + "$ref": "3675" + }, + "value": "Extract entities, detect language and extract key-phrases" + }, + "skills": { + "$id": "5481", + "kind": "array", + "type": { + "$ref": "3679" + }, + "value": [] + }, + "encryptionKey": { + "$id": "5482", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5483", + "keyVaultKeyName": { + "$id": "5484", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "5485", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "5486", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + } + } + } + }, + { + "$id": "5487", + "response": { + "$ref": "5457" + }, + "statusCode": 201, + "bodyValue": { + "$id": "5488", + "kind": "model", + "type": { + "$ref": "3669" + }, + "value": { + "$id": "5489", + "name": { + "$id": "5490", + "kind": "string", + "type": { + "$ref": "3671" + }, + "value": "demoskillset" + }, + "description": { + "$id": "5491", + "kind": "string", + "type": { + "$ref": "3675" + }, + "value": "Extract entities, detect language and extract key-phrases" + }, + "skills": { + "$id": "5492", + "kind": "array", + "type": { + "$ref": "3679" + }, + "value": [] + }, + "encryptionKey": { + "$id": "5493", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5494", + "keyVaultKeyName": { + "$id": "5495", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "5496", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "5497", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "5498", + "name": "delete", + "resourceName": "Skillsets", + "doc": "Deletes a skillset in a search service.", + "accessibility": "public", + "parameters": [ + { + "$id": "5499", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5500", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5501", + "type": { + "$id": "5502", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5503", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.", + "type": { + "$id": "5504", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5505", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.", + "type": { + "$id": "5506", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5507", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5508", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5509", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5510", + "name": "skillsetName", + "nameInRequest": "skillsetName", + "doc": "The name of the skillset.", + "type": { + "$id": "5511", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5512", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5513", + "kind": "constant", + "valueType": { + "$id": "5514", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5515", + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + }, + { + "$id": "5516", + "statusCodes": [ + 404 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/skillsets('{skillsetName}')", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Skillsets.delete", + "decorators": [], + "examples": [ + { + "$id": "5517", + "kind": "http", + "name": "SearchServiceDeleteSkillset", + "description": "SearchServiceDeleteSkillset", + "filePath": "2024-07-01/SearchServiceDeleteSkillset.json", + "parameters": [ + { + "$id": "5518", + "parameter": { + "$ref": "5510" + }, + "value": { + "$id": "5519", + "kind": "string", + "type": { + "$ref": "5511" + }, + "value": "demoskillset" + } + }, + { + "$id": "5520", + "parameter": { + "$ref": "5499" + }, + "value": { + "$id": "5521", + "kind": "string", + "type": { + "$ref": "5500" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "5522", + "response": { + "$ref": "5515" + }, + "statusCode": 204 + }, + { + "$id": "5523", + "response": { + "$ref": "5516" + }, + "statusCode": 404 + } + ] + } + ] + }, + { + "$id": "5524", + "name": "get", + "resourceName": "Skillsets", + "doc": "Retrieves a skillset in a search service.", + "accessibility": "public", + "parameters": [ + { + "$id": "5525", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5526", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5527", + "type": { + "$id": "5528", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5529", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5530", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5531", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5532", + "name": "skillsetName", + "nameInRequest": "skillsetName", + "doc": "The name of the skillset.", + "type": { + "$id": "5533", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5534", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5535", + "kind": "constant", + "valueType": { + "$id": "5536", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5537", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "3669" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/skillsets('{skillsetName}')", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Skillsets.get", + "decorators": [], + "examples": [ + { + "$id": "5538", + "kind": "http", + "name": "SearchServiceGetSkillset", + "description": "SearchServiceGetSkillset", + "filePath": "2024-07-01/SearchServiceGetSkillset.json", + "parameters": [ + { + "$id": "5539", + "parameter": { + "$ref": "5532" + }, + "value": { + "$id": "5540", + "kind": "string", + "type": { + "$ref": "5533" + }, + "value": "demoskillset" + } + }, + { + "$id": "5541", + "parameter": { + "$ref": "5525" + }, + "value": { + "$id": "5542", + "kind": "string", + "type": { + "$ref": "5526" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "5543", + "response": { + "$ref": "5537" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5544", + "kind": "model", + "type": { + "$ref": "3669" + }, + "value": { + "$id": "5545", + "name": { + "$id": "5546", + "kind": "string", + "type": { + "$ref": "3671" + }, + "value": "demoskillset" + }, + "description": { + "$id": "5547", + "kind": "string", + "type": { + "$ref": "3675" + }, + "value": "Extract entities, detect language and extract key-phrases" + }, + "skills": { + "$id": "5548", + "kind": "array", + "type": { + "$ref": "3679" + }, + "value": [] + }, + "encryptionKey": { + "$id": "5549", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5550", + "keyVaultKeyName": { + "$id": "5551", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myKeyName" + }, + "keyVaultKeyVersion": { + "$id": "5552", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion" + }, + "keyVaultUri": { + "$id": "5553", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "5554", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "5555", + "applicationId": { + "$id": "5556", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "5557", + "name": "list", + "resourceName": "Skillsets", + "doc": "List all skillsets in a search service.", + "accessibility": "public", + "parameters": [ + { + "$id": "5558", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5559", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5560", + "type": { + "$id": "5561", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5562", + "name": "$select", + "nameInRequest": "$select", + "doc": "Selects which top-level properties to retrieve.\nSpecified as a comma-separated list of JSON property names,\nor '*' for all properties. The default is all properties.", + "type": { + "$id": "5563", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5564", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5565", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5566", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5567", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5568", + "kind": "constant", + "valueType": { + "$id": "5569", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5570", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "4296" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/skillsets", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Skillsets.list", + "decorators": [], + "examples": [ + { + "$id": "5571", + "kind": "http", + "name": "SearchServiceListSkillsets", + "description": "SearchServiceListSkillsets", + "filePath": "2024-07-01/SearchServiceListSkillsets.json", + "parameters": [ + { + "$id": "5572", + "parameter": { + "$ref": "5562" + }, + "value": { + "$id": "5573", + "kind": "string", + "type": { + "$ref": "5563" + }, + "value": "*" + } + }, + { + "$id": "5574", + "parameter": { + "$ref": "5558" + }, + "value": { + "$id": "5575", + "kind": "string", + "type": { + "$ref": "5559" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "5576", + "response": { + "$ref": "5570" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5577", + "kind": "model", + "type": { + "$ref": "4296" + }, + "value": { + "$id": "5578", + "value": { + "$id": "5579", + "kind": "array", + "type": { + "$ref": "4298" + }, + "value": [ + { + "$id": "5580", + "kind": "model", + "type": { + "$ref": "3669" + }, + "value": { + "$id": "5581", + "name": { + "$id": "5582", + "kind": "string", + "type": { + "$ref": "3671" + }, + "value": "demoskillset" + }, + "description": { + "$id": "5583", + "kind": "string", + "type": { + "$ref": "3675" + }, + "value": "Extract entities, detect language and extract key-phrases" + }, + "skills": { + "$id": "5584", + "kind": "array", + "type": { + "$ref": "3679" + }, + "value": [] + }, + "encryptionKey": { + "$id": "5585", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5586", + "keyVaultKeyName": { + "$id": "5587", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myKeyName" + }, + "keyVaultKeyVersion": { + "$id": "5588", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion" + }, + "keyVaultUri": { + "$id": "5589", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "5590", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "5591", + "applicationId": { + "$id": "5592", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "5593", + "name": "create", + "resourceName": "Skillsets", + "doc": "Creates a new skillset in a search service.", + "accessibility": "public", + "parameters": [ + { + "$id": "5594", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5595", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5596", + "type": { + "$id": "5597", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5598", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5599", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5600", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5601", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "5602", + "kind": "constant", + "valueType": { + "$id": "5603", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5604", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5605", + "kind": "constant", + "valueType": { + "$id": "5606", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5607", + "name": "skillset", + "nameInRequest": "skillset", + "doc": "The skillset containing one or more skills to create in a search service.", + "type": { + "$ref": "3669" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5608", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "3669" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/skillsets", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Skillsets.create", + "decorators": [], + "examples": [ + { + "$id": "5609", + "kind": "http", + "name": "SearchServiceCreateSkillset", + "description": "SearchServiceCreateSkillset", + "filePath": "2024-07-01/SearchServiceCreateSkillset.json", + "parameters": [ + { + "$id": "5610", + "parameter": { + "$ref": "5594" + }, + "value": { + "$id": "5611", + "kind": "string", + "type": { + "$ref": "5595" + }, + "value": "2024-07-01" + } + }, + { + "$id": "5612", + "parameter": { + "$ref": "5607" + }, + "value": { + "$id": "5613", + "kind": "model", + "type": { + "$ref": "3669" + }, + "value": { + "$id": "5614", + "name": { + "$id": "5615", + "kind": "string", + "type": { + "$ref": "3671" + }, + "value": "demoskillset" + }, + "description": { + "$id": "5616", + "kind": "string", + "type": { + "$ref": "3675" + }, + "value": "Extract entities, detect language and extract key-phrases" + }, + "skills": { + "$id": "5617", + "kind": "array", + "type": { + "$ref": "3679" + }, + "value": [] + }, + "knowledgeStore": { + "$id": "5618", + "kind": "model", + "type": { + "$ref": "4199" + }, + "value": { + "$id": "5619", + "storageConnectionString": { + "$id": "5620", + "kind": "string", + "type": { + "$ref": "4201" + }, + "value": "DefaultEndpointsProtocol=https;AccountName=myStorage;AccountKey=myStorageKey;EndpointSuffix=core.windows.net" + }, + "projections": { + "$id": "5621", + "kind": "array", + "type": { + "$ref": "4205" + }, + "value": [ + { + "$id": "5622", + "kind": "model", + "type": { + "$ref": "4206" + }, + "value": { + "$id": "5623", + "tables": { + "$id": "5624", + "kind": "array", + "type": { + "$ref": "4208" + }, + "value": [ + { + "$id": "5625", + "kind": "model", + "type": { + "$ref": "4209" + }, + "value": { + "$id": "5626", + "tableName": { + "$id": "5627", + "kind": "string", + "type": { + "$ref": "4232" + }, + "value": "Reviews" + }, + "generatedKeyName": { + "$id": "5628", + "kind": "string", + "type": { + "$ref": "4216" + }, + "value": "ReviewId" + }, + "source": { + "$id": "5629", + "kind": "string", + "type": { + "$ref": "4220" + }, + "value": "/document/Review" + }, + "inputs": { + "$id": "5630", + "kind": "array", + "type": { + "$ref": "4228" + }, + "value": [] + } + } + }, + { + "$id": "5631", + "kind": "model", + "type": { + "$ref": "4209" + }, + "value": { + "$id": "5632", + "tableName": { + "$id": "5633", + "kind": "string", + "type": { + "$ref": "4232" + }, + "value": "Sentences" + }, + "generatedKeyName": { + "$id": "5634", + "kind": "string", + "type": { + "$ref": "4216" + }, + "value": "SentenceId" + }, + "source": { + "$id": "5635", + "kind": "string", + "type": { + "$ref": "4220" + }, + "value": "/document/Review/Sentences/*" + }, + "inputs": { + "$id": "5636", + "kind": "array", + "type": { + "$ref": "4228" + }, + "value": [] + } + } + }, + { + "$id": "5637", + "kind": "model", + "type": { + "$ref": "4209" + }, + "value": { + "$id": "5638", + "tableName": { + "$id": "5639", + "kind": "string", + "type": { + "$ref": "4232" + }, + "value": "KeyPhrases" + }, + "generatedKeyName": { + "$id": "5640", + "kind": "string", + "type": { + "$ref": "4216" + }, + "value": "KeyPhraseId" + }, + "source": { + "$id": "5641", + "kind": "string", + "type": { + "$ref": "4220" + }, + "value": "/document/Review/Sentences/*/KeyPhrases" + }, + "inputs": { + "$id": "5642", + "kind": "array", + "type": { + "$ref": "4228" + }, + "value": [] + } + } + }, + { + "$id": "5643", + "kind": "model", + "type": { + "$ref": "4209" + }, + "value": { + "$id": "5644", + "tableName": { + "$id": "5645", + "kind": "string", + "type": { + "$ref": "4232" + }, + "value": "Entities" + }, + "generatedKeyName": { + "$id": "5646", + "kind": "string", + "type": { + "$ref": "4216" + }, + "value": "EntityId" + }, + "source": { + "$id": "5647", + "kind": "string", + "type": { + "$ref": "4220" + }, + "value": "/document/Review/Sentences/*/Entities/*" + }, + "inputs": { + "$id": "5648", + "kind": "array", + "type": { + "$ref": "4228" + }, + "value": [] + } + } + } + ] + } + } + }, + { + "$id": "5649", + "kind": "model", + "type": { + "$ref": "4206" + }, + "value": { + "$id": "5650", + "objects": { + "$id": "5651", + "kind": "array", + "type": { + "$ref": "4238" + }, + "value": [ + { + "$id": "5652", + "kind": "model", + "type": { + "$ref": "4239" + }, + "value": { + "$id": "5653", + "storageContainer": { + "$id": "5654", + "kind": "string", + "type": { + "$ref": "4242" + }, + "value": "Reviews" + }, + "source": { + "$id": "5655", + "kind": "string", + "type": { + "$ref": "4220" + }, + "value": "/document/Review" + }, + "generatedKeyName": { + "$id": "5656", + "kind": "string", + "type": { + "$ref": "4216" + }, + "value": "/document/Review/Id" + } + } + } + ] + } + } + } + ] + } + } + }, + "encryptionKey": { + "$id": "5657", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5658", + "keyVaultKeyName": { + "$id": "5659", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "5660", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "5661", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "5662", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "5663", + "applicationId": { + "$id": "5664", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + }, + "applicationSecret": { + "$id": "5665", + "kind": "string", + "type": { + "$ref": "3293" + }, + "value": "" + } + } + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "5666", + "response": { + "$ref": "5608" + }, + "statusCode": 201, + "bodyValue": { + "$id": "5667", + "kind": "model", + "type": { + "$ref": "3669" + }, + "value": { + "$id": "5668", + "name": { + "$id": "5669", + "kind": "string", + "type": { + "$ref": "3671" + }, + "value": "demoskillset" + }, + "description": { + "$id": "5670", + "kind": "string", + "type": { + "$ref": "3675" + }, + "value": "Extract entities, detect language and extract key-phrases" + }, + "skills": { + "$id": "5671", + "kind": "array", + "type": { + "$ref": "3679" + }, + "value": [] + }, + "encryptionKey": { + "$id": "5672", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5673", + "keyVaultKeyName": { + "$id": "5674", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "5675", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "5676", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "5677", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "5678", + "applicationId": { + "$id": "5679", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + } + } + ] + } + ] + } + ], + "parameters": [ + { + "$id": "5680", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "5681", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client" + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Search.Skillsets", + "apiVersions": [ + "2024-07-01" + ], + "parent": { + "$ref": "4671" + } + }, + { + "$id": "5682", + "kind": "client", + "name": "SynonymMaps", + "namespace": "Azure.Search.Documents", + "operations": [ + { + "$id": "5683", + "name": "createOrUpdate", + "resourceName": "SynonymMaps", + "doc": "Creates a new synonym map or updates a synonym map if it already exists.", + "accessibility": "public", + "parameters": [ + { + "$id": "5684", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5685", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5686", + "type": { + "$id": "5687", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5688", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.", + "type": { + "$id": "5689", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5690", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.", + "type": { + "$id": "5691", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5692", + "name": "prefer", + "nameInRequest": "Prefer", + "doc": "For HTTP PUT requests, instructs the service to return the created/updated resource on success.", + "type": { + "$id": "5693", + "kind": "constant", + "valueType": { + "$id": "5694", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "return=representation", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5695", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5696", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5697", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5698", + "name": "synonymMapName", + "nameInRequest": "synonymMapName", + "doc": "The name of the synonym map.", + "type": { + "$id": "5699", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5700", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "5701", + "kind": "constant", + "valueType": { + "$id": "5702", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5703", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5704", + "kind": "constant", + "valueType": { + "$id": "5705", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5706", + "name": "synonymMap", + "nameInRequest": "synonymMap", + "doc": "The definition of the synonym map to create or update.", + "type": { + "$ref": "3644" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5707", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "3644" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "5708", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "3644" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/synonymmaps('{synonymMapName}')", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.SynonymMaps.createOrUpdate", + "decorators": [], + "examples": [ + { + "$id": "5709", + "kind": "http", + "name": "SearchServiceCreateOrUpdateSynonymMap", + "description": "SearchServiceCreateOrUpdateSynonymMap", + "filePath": "2024-07-01/SearchServiceCreateOrUpdateSynonymMap.json", + "parameters": [ + { + "$id": "5710", + "parameter": { + "$ref": "5698" + }, + "value": { + "$id": "5711", + "kind": "string", + "type": { + "$ref": "5699" + }, + "value": "mysynonymmap" + } + }, + { + "$id": "5712", + "parameter": { + "$ref": "5684" + }, + "value": { + "$id": "5713", + "kind": "string", + "type": { + "$ref": "5685" + }, + "value": "2024-07-01" + } + }, + { + "$id": "5714", + "parameter": { + "$ref": "5692" + }, + "value": { + "$id": "5715", + "kind": "string", + "type": { + "$ref": "5693" + }, + "value": "return=representation" + } + }, + { + "$id": "5716", + "parameter": { + "$ref": "5706" + }, + "value": { + "$id": "5717", + "kind": "model", + "type": { + "$ref": "3644" + }, + "value": { + "$id": "5718", + "name": { + "$id": "5719", + "kind": "string", + "type": { + "$ref": "3646" + }, + "value": "mysynonymmap" + }, + "format": { + "$id": "5720", + "kind": "string", + "type": { + "$ref": "3650" + }, + "value": "solr" + }, + "synonyms": { + "$id": "5721", + "kind": "string", + "type": { + "$ref": "3654" + }, + "value": "United States, United States of America, USA\nWashington, Wash. => WA" + }, + "encryptionKey": { + "$id": "5722", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5723", + "keyVaultKeyName": { + "$id": "5724", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "5725", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "5726", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "5727", + "response": { + "$ref": "5707" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5728", + "kind": "model", + "type": { + "$ref": "3644" + }, + "value": { + "$id": "5729", + "name": { + "$id": "5730", + "kind": "string", + "type": { + "$ref": "3646" + }, + "value": "mysynonymmap" + }, + "format": { + "$id": "5731", + "kind": "string", + "type": { + "$ref": "3650" + }, + "value": "solr" + }, + "synonyms": { + "$id": "5732", + "kind": "string", + "type": { + "$ref": "3654" + }, + "value": "United States, United States of America, USA\nWashington, Wash. => WA" + }, + "encryptionKey": { + "$id": "5733", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5734", + "keyVaultKeyName": { + "$id": "5735", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "5736", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "5737", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + } + } + } + }, + { + "$id": "5738", + "response": { + "$ref": "5708" + }, + "statusCode": 201, + "bodyValue": { + "$id": "5739", + "kind": "model", + "type": { + "$ref": "3644" + }, + "value": { + "$id": "5740", + "name": { + "$id": "5741", + "kind": "string", + "type": { + "$ref": "3646" + }, + "value": "mysynonymmap" + }, + "format": { + "$id": "5742", + "kind": "string", + "type": { + "$ref": "3650" + }, + "value": "solr" + }, + "synonyms": { + "$id": "5743", + "kind": "string", + "type": { + "$ref": "3654" + }, + "value": "United States, United States of America, USA\nWashington, Wash. => WA" + }, + "encryptionKey": { + "$id": "5744", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5745", + "keyVaultKeyName": { + "$id": "5746", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "5747", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "5748", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "5749", + "name": "delete", + "resourceName": "SynonymMaps", + "doc": "Deletes a synonym map.", + "accessibility": "public", + "parameters": [ + { + "$id": "5750", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5751", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5752", + "type": { + "$id": "5753", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5754", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.", + "type": { + "$id": "5755", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5756", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.", + "type": { + "$id": "5757", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5758", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5759", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5760", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5761", + "name": "synonymMapName", + "nameInRequest": "synonymMapName", + "doc": "The name of the synonym map.", + "type": { + "$id": "5762", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5763", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5764", + "kind": "constant", + "valueType": { + "$id": "5765", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5766", + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + }, + { + "$id": "5767", + "statusCodes": [ + 404 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/synonymmaps('{synonymMapName}')", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.SynonymMaps.delete", + "decorators": [], + "examples": [ + { + "$id": "5768", + "kind": "http", + "name": "SearchServiceDeleteSynonymMap", + "description": "SearchServiceDeleteSynonymMap", + "filePath": "2024-07-01/SearchServiceDeleteSynonymMap.json", + "parameters": [ + { + "$id": "5769", + "parameter": { + "$ref": "5761" + }, + "value": { + "$id": "5770", + "kind": "string", + "type": { + "$ref": "5762" + }, + "value": "mysynonymmap" + } + }, + { + "$id": "5771", + "parameter": { + "$ref": "5750" + }, + "value": { + "$id": "5772", + "kind": "string", + "type": { + "$ref": "5751" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "5773", + "response": { + "$ref": "5766" + }, + "statusCode": 204 + }, + { + "$id": "5774", + "response": { + "$ref": "5767" + }, + "statusCode": 404 + } + ] + } + ] + }, + { + "$id": "5775", + "name": "get", + "resourceName": "SynonymMaps", + "doc": "Retrieves a synonym map definition.", + "accessibility": "public", + "parameters": [ + { + "$id": "5776", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5777", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5778", + "type": { + "$id": "5779", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5780", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5781", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5782", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5783", + "name": "synonymMapName", + "nameInRequest": "synonymMapName", + "doc": "The name of the synonym map.", + "type": { + "$id": "5784", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5785", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5786", + "kind": "constant", + "valueType": { + "$id": "5787", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5788", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "3644" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/synonymmaps('{synonymMapName}')", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.SynonymMaps.get", + "decorators": [], + "examples": [ + { + "$id": "5789", + "kind": "http", + "name": "SearchServiceGetSynonymMap", + "description": "SearchServiceGetSynonymMap", + "filePath": "2024-07-01/SearchServiceGetSynonymMap.json", + "parameters": [ + { + "$id": "5790", + "parameter": { + "$ref": "5783" + }, + "value": { + "$id": "5791", + "kind": "string", + "type": { + "$ref": "5784" + }, + "value": "mysynonymmap" + } + }, + { + "$id": "5792", + "parameter": { + "$ref": "5776" + }, + "value": { + "$id": "5793", + "kind": "string", + "type": { + "$ref": "5777" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "5794", + "response": { + "$ref": "5788" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5795", + "kind": "model", + "type": { + "$ref": "3644" + }, + "value": { + "$id": "5796", + "name": { + "$id": "5797", + "kind": "string", + "type": { + "$ref": "3646" + }, + "value": "mysynonymmap" + }, + "format": { + "$id": "5798", + "kind": "string", + "type": { + "$ref": "3650" + }, + "value": "solr" + }, + "synonyms": { + "$id": "5799", + "kind": "string", + "type": { + "$ref": "3654" + }, + "value": "United States, United States of America, USA\nWashington, Wash. => WA" + }, + "encryptionKey": { + "$id": "5800", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5801", + "keyVaultKeyName": { + "$id": "5802", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myKeyName" + }, + "keyVaultKeyVersion": { + "$id": "5803", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion" + }, + "keyVaultUri": { + "$id": "5804", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "5805", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "5806", + "applicationId": { + "$id": "5807", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "5808", + "name": "list", + "resourceName": "SynonymMaps", + "doc": "Lists all synonym maps available for a search service.", + "accessibility": "public", + "parameters": [ + { + "$id": "5809", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5810", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5811", + "type": { + "$id": "5812", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5813", + "name": "$select", + "nameInRequest": "$select", + "doc": "Selects which top-level properties to retrieve.\nSpecified as a comma-separated list of JSON property names,\nor '*' for all properties. The default is all properties.", + "type": { + "$id": "5814", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5815", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5816", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5817", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5818", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5819", + "kind": "constant", + "valueType": { + "$id": "5820", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5821", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "3664" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/synonymmaps", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.SynonymMaps.list", + "decorators": [], + "examples": [ + { + "$id": "5822", + "kind": "http", + "name": "SearchServiceListSynonymMaps", + "description": "SearchServiceListSynonymMaps", + "filePath": "2024-07-01/SearchServiceListSynonymMaps.json", + "parameters": [ + { + "$id": "5823", + "parameter": { + "$ref": "5809" + }, + "value": { + "$id": "5824", + "kind": "string", + "type": { + "$ref": "5810" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "5825", + "response": { + "$ref": "5821" + }, + "statusCode": 200, + "bodyValue": { + "$id": "5826", + "kind": "model", + "type": { + "$ref": "3664" + }, + "value": { + "$id": "5827", + "value": { + "$id": "5828", + "kind": "array", + "type": { + "$ref": "3666" + }, + "value": [ + { + "$id": "5829", + "kind": "model", + "type": { + "$ref": "3644" + }, + "value": { + "$id": "5830", + "name": { + "$id": "5831", + "kind": "string", + "type": { + "$ref": "3646" + }, + "value": "mysynonymmap" + }, + "format": { + "$id": "5832", + "kind": "string", + "type": { + "$ref": "3650" + }, + "value": "solr" + }, + "synonyms": { + "$id": "5833", + "kind": "string", + "type": { + "$ref": "3654" + }, + "value": "United States, United States of America, USA\nWashington, Wash. => WA" + }, + "encryptionKey": { + "$id": "5834", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5835", + "keyVaultKeyName": { + "$id": "5836", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myKeyName" + }, + "keyVaultKeyVersion": { + "$id": "5837", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion" + }, + "keyVaultUri": { + "$id": "5838", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + } + } + }, + { + "$id": "5839", + "kind": "model", + "type": { + "$ref": "3644" + }, + "value": { + "$id": "5840", + "name": { + "$id": "5841", + "kind": "string", + "type": { + "$ref": "3646" + }, + "value": "myothersynonymmap" + }, + "format": { + "$id": "5842", + "kind": "string", + "type": { + "$ref": "3650" + }, + "value": "solr" + }, + "synonyms": { + "$id": "5843", + "kind": "string", + "type": { + "$ref": "3654" + }, + "value": "couch, sofa, chesterfield\npop, soda\ntoque, hat" + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "5844", + "name": "create", + "resourceName": "SynonymMaps", + "doc": "Creates a new synonym map.", + "accessibility": "public", + "parameters": [ + { + "$id": "5845", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5846", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5847", + "type": { + "$id": "5848", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5849", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5850", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5851", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5852", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "5853", + "kind": "constant", + "valueType": { + "$id": "5854", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5855", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5856", + "kind": "constant", + "valueType": { + "$id": "5857", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5858", + "name": "synonymMap", + "nameInRequest": "synonymMap", + "doc": "The definition of the synonym map to create.", + "type": { + "$ref": "3644" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5859", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "3644" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/synonymmaps", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.SynonymMaps.create", + "decorators": [], + "examples": [ + { + "$id": "5860", + "kind": "http", + "name": "SearchServiceCreateSynonymMap", + "description": "SearchServiceCreateSynonymMap", + "filePath": "2024-07-01/SearchServiceCreateSynonymMap.json", + "parameters": [ + { + "$id": "5861", + "parameter": { + "$ref": "5845" + }, + "value": { + "$id": "5862", + "kind": "string", + "type": { + "$ref": "5846" + }, + "value": "2024-07-01" + } + }, + { + "$id": "5863", + "parameter": { + "$ref": "5858" + }, + "value": { + "$id": "5864", + "kind": "model", + "type": { + "$ref": "3644" + }, + "value": { + "$id": "5865", + "name": { + "$id": "5866", + "kind": "string", + "type": { + "$ref": "3646" + }, + "value": "mysynonymmap" + }, + "format": { + "$id": "5867", + "kind": "string", + "type": { + "$ref": "3650" + }, + "value": "solr" + }, + "synonyms": { + "$id": "5868", + "kind": "string", + "type": { + "$ref": "3654" + }, + "value": "United States, United States of America, USA\nWashington, Wash. => WA" + }, + "encryptionKey": { + "$id": "5869", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5870", + "keyVaultKeyName": { + "$id": "5871", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "5872", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "5873", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "5874", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "5875", + "applicationId": { + "$id": "5876", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + }, + "applicationSecret": { + "$id": "5877", + "kind": "string", + "type": { + "$ref": "3293" + }, + "value": "myApplicationSecret" + } + } + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "5878", + "response": { + "$ref": "5859" + }, + "statusCode": 201, + "bodyValue": { + "$id": "5879", + "kind": "model", + "type": { + "$ref": "3644" + }, + "value": { + "$id": "5880", + "name": { + "$id": "5881", + "kind": "string", + "type": { + "$ref": "3646" + }, + "value": "mysynonymmap" + }, + "format": { + "$id": "5882", + "kind": "string", + "type": { + "$ref": "3650" + }, + "value": "solr" + }, + "synonyms": { + "$id": "5883", + "kind": "string", + "type": { + "$ref": "3654" + }, + "value": "United States, United States of America, USA\nWashington, Wash. => WA" + }, + "encryptionKey": { + "$id": "5884", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "5885", + "keyVaultKeyName": { + "$id": "5886", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "5887", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "5888", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "5889", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "5890", + "applicationId": { + "$id": "5891", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + } + } + ] + } + ] + } + ], + "parameters": [ + { + "$id": "5892", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "5893", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client" + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Search.SynonymMaps", + "apiVersions": [ + "2024-07-01" + ], + "parent": { + "$ref": "4671" + } + }, + { + "$id": "5894", + "kind": "client", + "name": "Indexes", + "namespace": "Azure.Search.Documents", + "operations": [ + { + "$id": "5895", + "name": "create", + "resourceName": "Indexes", + "doc": "Creates a new search index.", + "accessibility": "public", + "parameters": [ + { + "$id": "5896", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "5897", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "5898", + "type": { + "$id": "5899", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5900", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "5901", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "5902", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5903", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "5904", + "kind": "constant", + "valueType": { + "$id": "5905", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5906", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "5907", + "kind": "constant", + "valueType": { + "$id": "5908", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "5909", + "name": "index", + "nameInRequest": "index", + "doc": "The definition of the index to create.", + "type": { + "$ref": "2373" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "5910", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "2373" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/indexes", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Indexes.create", + "decorators": [], + "examples": [ + { + "$id": "5911", + "kind": "http", + "name": "SearchServiceCreateIndex", + "description": "SearchServiceCreateIndex", + "filePath": "2024-07-01/SearchServiceCreateIndex.json", + "parameters": [ + { + "$id": "5912", + "parameter": { + "$ref": "5896" + }, + "value": { + "$id": "5913", + "kind": "string", + "type": { + "$ref": "5897" + }, + "value": "2024-07-01" + } + }, + { + "$id": "5914", + "parameter": { + "$ref": "5909" + }, + "value": { + "$id": "5915", + "kind": "model", + "type": { + "$ref": "2373" + }, + "value": { + "$id": "5916", + "name": { + "$id": "5917", + "kind": "string", + "type": { + "$ref": "2375" + }, + "value": "hotels" + }, + "fields": { + "$id": "5918", + "kind": "array", + "type": { + "$ref": "2379" + }, + "value": [ + { + "$id": "5919", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "5920", + "name": { + "$id": "5921", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "hotelId" + }, + "type": { + "$id": "5922", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "key": { + "$id": "5923", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": true + }, + "searchable": { + "$id": "5924", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + } + } + }, + { + "$id": "5925", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "5926", + "name": { + "$id": "5927", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "baseRate" + }, + "type": { + "$id": "5928", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Double" + } + } + }, + { + "$id": "5929", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "5930", + "name": { + "$id": "5931", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "description" + }, + "type": { + "$id": "5932", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "filterable": { + "$id": "5933", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "sortable": { + "$id": "5934", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "5935", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + } + } + }, + { + "$id": "5936", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "5937", + "name": { + "$id": "5938", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "descriptionEmbedding" + }, + "type": { + "$id": "5939", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.Single)" + }, + "searchable": { + "$id": "5940", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "5941", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "5942", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "5943", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "5944", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "5945", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "5946", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + }, + "dimensions": { + "$id": "5947", + "kind": "number", + "type": { + "$ref": "2426" + }, + "value": 1536 + }, + "vectorSearchProfile": { + "$id": "5948", + "kind": "string", + "type": { + "$ref": "2430" + }, + "value": "myHnswSQProfile" + } + } + }, + { + "$id": "5949", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "5950", + "name": { + "$id": "5951", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "descriptionEmbedding_notstored" + }, + "type": { + "$id": "5952", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.Single)" + }, + "searchable": { + "$id": "5953", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "5954", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "5955", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": false + }, + "stored": { + "$id": "5956", + "kind": "boolean", + "type": { + "$ref": "2397" + }, + "value": false + }, + "sortable": { + "$id": "5957", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "5958", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "5959", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "5960", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + }, + "dimensions": { + "$id": "5961", + "kind": "number", + "type": { + "$ref": "2426" + }, + "value": 1536 + }, + "vectorSearchProfile": { + "$id": "5962", + "kind": "string", + "type": { + "$ref": "2430" + }, + "value": "myHnswSQProfile" + } + } + }, + { + "$id": "5963", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "5964", + "name": { + "$id": "5965", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "descriptionEmbedding_forBQ" + }, + "type": { + "$id": "5966", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.Single)" + }, + "searchable": { + "$id": "5967", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "5968", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "5969", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "5970", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "5971", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "5972", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "5973", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + }, + "dimensions": { + "$id": "5974", + "kind": "number", + "type": { + "$ref": "2426" + }, + "value": 1536 + }, + "vectorSearchProfile": { + "$id": "5975", + "kind": "string", + "type": { + "$ref": "2430" + }, + "value": "myHnswBQProfile" + } + } + }, + { + "$id": "5976", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "5977", + "name": { + "$id": "5978", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "description_fr" + }, + "type": { + "$id": "5979", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "filterable": { + "$id": "5980", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "sortable": { + "$id": "5981", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "5982", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "analyzer": { + "$id": "5983", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "fr.lucene" + } + } + }, + { + "$id": "5984", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "5985", + "name": { + "$id": "5986", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "hotelName" + }, + "type": { + "$id": "5987", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + } + } + }, + { + "$id": "5988", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "5989", + "name": { + "$id": "5990", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "nameEmbedding" + }, + "type": { + "$id": "5991", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.Half)" + }, + "searchable": { + "$id": "5992", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "5993", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "5994", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "5995", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "5996", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "5997", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "5998", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + }, + "dimensions": { + "$id": "5999", + "kind": "number", + "type": { + "$ref": "2426" + }, + "value": 1536 + }, + "vectorSearchProfile": { + "$id": "6000", + "kind": "string", + "type": { + "$ref": "2430" + }, + "value": "myHnswProfile" + } + } + }, + { + "$id": "6001", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6002", + "name": { + "$id": "6003", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "category" + }, + "type": { + "$id": "6004", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + } + } + }, + { + "$id": "6005", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6006", + "name": { + "$id": "6007", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "tags" + }, + "type": { + "$id": "6008", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.String)" + }, + "analyzer": { + "$id": "6009", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "tagsAnalyzer" + } + } + }, + { + "$id": "6010", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6011", + "name": { + "$id": "6012", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "parkingIncluded" + }, + "type": { + "$id": "6013", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Boolean" + } + } + }, + { + "$id": "6014", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6015", + "name": { + "$id": "6016", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "smokingAllowed" + }, + "type": { + "$id": "6017", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Boolean" + } + } + }, + { + "$id": "6018", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6019", + "name": { + "$id": "6020", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "lastRenovationDate" + }, + "type": { + "$id": "6021", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.DateTimeOffset" + } + } + }, + { + "$id": "6022", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6023", + "name": { + "$id": "6024", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "rating" + }, + "type": { + "$id": "6025", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Int32" + } + } + }, + { + "$id": "6026", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6027", + "name": { + "$id": "6028", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "location" + }, + "type": { + "$id": "6029", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.GeographyPoint" + } + } + } + ] + }, + "scoringProfiles": { + "$id": "6030", + "kind": "array", + "type": { + "$ref": "2448" + }, + "value": [ + { + "$id": "6031", + "kind": "model", + "type": { + "$ref": "2449" + }, + "value": { + "$id": "6032", + "name": { + "$id": "6033", + "kind": "string", + "type": { + "$ref": "2451" + }, + "value": "geo" + }, + "text": { + "$id": "6034", + "kind": "model", + "type": { + "$ref": "2455" + }, + "value": { + "$id": "6035", + "weights": { + "$id": "6036", + "kind": "dict", + "type": { + "$ref": "2457" + }, + "value": { + "$id": "6037", + "hotelName": { + "$id": "6038", + "kind": "number", + "type": { + "$ref": "2459" + }, + "value": 5 + } + } + } + } + }, + "functions": { + "$id": "6039", + "kind": "array", + "type": { + "$ref": "2465" + }, + "value": [ + { + "$id": "6040", + "kind": "model", + "type": { + "$ref": "2483" + }, + "value": { + "$id": "6041", + "type": { + "$id": "6042", + "kind": "string", + "type": { + "$ref": "2497" + }, + "value": "distance" + }, + "boost": { + "$id": "6043", + "kind": "number", + "type": { + "$ref": "2476" + }, + "value": 5 + }, + "fieldName": { + "$id": "6044", + "kind": "string", + "type": { + "$ref": "2472" + }, + "value": "location" + }, + "interpolation": { + "$id": "6045", + "kind": "string", + "type": { + "$ref": "304" + }, + "value": "logarithmic" + }, + "distance": { + "$id": "6046", + "kind": "model", + "type": { + "$ref": "2485" + }, + "value": { + "$id": "6047", + "referencePointParameter": { + "$id": "6048", + "kind": "string", + "type": { + "$ref": "2487" + }, + "value": "currentLocation" + }, + "boostingDistance": { + "$id": "6049", + "kind": "number", + "type": { + "$ref": "2491" + }, + "value": 10 + } + } + } + } + } + ] + } + } + } + ] + }, + "defaultScoringProfile": { + "$id": "6050", + "kind": "string", + "type": { + "$ref": "2560" + }, + "value": "geo" + }, + "suggesters": { + "$id": "6051", + "kind": "array", + "type": { + "$ref": "2577" + }, + "value": [ + { + "$id": "6052", + "kind": "model", + "type": { + "$ref": "2578" + }, + "value": { + "$id": "6053", + "name": { + "$id": "6054", + "kind": "string", + "type": { + "$ref": "2580" + }, + "value": "sg" + }, + "searchMode": { + "$id": "6055", + "kind": "string", + "type": { + "$ref": "2584" + }, + "value": "analyzingInfixMatching" + }, + "sourceFields": { + "$id": "6056", + "kind": "array", + "type": { + "$ref": "2588" + }, + "value": [ + { + "$id": "6057", + "kind": "string", + "type": { + "$ref": "2589" + }, + "value": "hotelName" + } + ] + } + } + } + ] + }, + "analyzers": { + "$id": "6058", + "kind": "array", + "type": { + "$ref": "2595" + }, + "value": [] + }, + "corsOptions": { + "$id": "6059", + "kind": "model", + "type": { + "$ref": "2564" + }, + "value": { + "$id": "6060", + "allowedOrigins": { + "$id": "6061", + "kind": "array", + "type": { + "$ref": "2566" + }, + "value": [ + { + "$id": "6062", + "kind": "string", + "type": { + "$ref": "2567" + }, + "value": "tempuri.org" + } + ] + }, + "maxAgeInSeconds": { + "$id": "6063", + "kind": "number", + "type": { + "$ref": "2571" + }, + "value": 60 + } + } + }, + "encryptionKey": { + "$id": "6064", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "6065", + "keyVaultKeyName": { + "$id": "6066", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "6067", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "6068", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "6069", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "6070", + "applicationId": { + "$id": "6071", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + }, + "applicationSecret": { + "$id": "6072", + "kind": "string", + "type": { + "$ref": "3293" + }, + "value": "" + } + } + } + } + }, + "semantic": { + "$id": "6073", + "kind": "model", + "type": { + "$ref": "3330" + }, + "value": { + "$id": "6074", + "configurations": { + "$id": "6075", + "kind": "array", + "type": { + "$ref": "3336" + }, + "value": [ + { + "$id": "6076", + "kind": "model", + "type": { + "$ref": "3337" + }, + "value": { + "$id": "6077", + "name": { + "$id": "6078", + "kind": "string", + "type": { + "$ref": "3339" + }, + "value": "semanticHotels" + }, + "prioritizedFields": { + "$id": "6079", + "kind": "model", + "type": { + "$ref": "3343" + }, + "value": { + "$id": "6080", + "titleField": { + "$id": "6081", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6082", + "fieldName": { + "$id": "6083", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "hotelName" + } + } + }, + "prioritizedContentFields": { + "$id": "6084", + "kind": "array", + "type": { + "$ref": "3353" + }, + "value": [ + { + "$id": "6085", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6086", + "fieldName": { + "$id": "6087", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "description" + } + } + }, + { + "$id": "6088", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6089", + "fieldName": { + "$id": "6090", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "description_fr" + } + } + } + ] + }, + "prioritizedKeywordsFields": { + "$id": "6091", + "kind": "array", + "type": { + "$ref": "3357" + }, + "value": [ + { + "$id": "6092", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6093", + "fieldName": { + "$id": "6094", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "tags" + } + } + }, + { + "$id": "6095", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6096", + "fieldName": { + "$id": "6097", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "category" + } + } + } + ] + } + } + } + } + } + ] + } + } + }, + "vectorSearch": { + "$id": "6098", + "kind": "model", + "type": { + "$ref": "3367" + }, + "value": { + "$id": "6099", + "profiles": { + "$id": "6100", + "kind": "array", + "type": { + "$ref": "3369" + }, + "value": [ + { + "$id": "6101", + "kind": "model", + "type": { + "$ref": "3370" + }, + "value": { + "$id": "6102", + "name": { + "$id": "6103", + "kind": "string", + "type": { + "$ref": "3372" + }, + "value": "myHnswProfile" + }, + "algorithm": { + "$id": "6104", + "kind": "string", + "type": { + "$ref": "3376" + }, + "value": "myHnsw" + } + } + }, + { + "$id": "6105", + "kind": "model", + "type": { + "$ref": "3370" + }, + "value": { + "$id": "6106", + "name": { + "$id": "6107", + "kind": "string", + "type": { + "$ref": "3372" + }, + "value": "myHnswSQProfile" + }, + "algorithm": { + "$id": "6108", + "kind": "string", + "type": { + "$ref": "3376" + }, + "value": "myHnsw" + }, + "compression": { + "$id": "6109", + "kind": "string", + "type": { + "$ref": "3384" + }, + "value": "mySQ8" + } + } + }, + { + "$id": "6110", + "kind": "model", + "type": { + "$ref": "3370" + }, + "value": { + "$id": "6111", + "name": { + "$id": "6112", + "kind": "string", + "type": { + "$ref": "3372" + }, + "value": "myHnswBQProfile" + }, + "algorithm": { + "$id": "6113", + "kind": "string", + "type": { + "$ref": "3376" + }, + "value": "myHnsw" + }, + "compression": { + "$id": "6114", + "kind": "string", + "type": { + "$ref": "3384" + }, + "value": "myBQ" + } + } + }, + { + "$id": "6115", + "kind": "model", + "type": { + "$ref": "3370" + }, + "value": { + "$id": "6116", + "name": { + "$id": "6117", + "kind": "string", + "type": { + "$ref": "3372" + }, + "value": "myAlgorithm" + }, + "algorithm": { + "$id": "6118", + "kind": "string", + "type": { + "$ref": "3376" + }, + "value": "myExhaustive" + } + } + } + ] + }, + "algorithms": { + "$id": "6119", + "kind": "array", + "type": { + "$ref": "3390" + }, + "value": [ + { + "$id": "6120", + "kind": "model", + "type": { + "$ref": "3400" + }, + "value": { + "$id": "6121", + "name": { + "$id": "6122", + "kind": "string", + "type": { + "$ref": "3396" + }, + "value": "myHnsw" + }, + "kind": { + "$id": "6123", + "kind": "string", + "type": { + "$ref": "3421" + }, + "value": "hnsw" + }, + "hnswParameters": { + "$id": "6124", + "kind": "model", + "type": { + "$ref": "3402" + }, + "value": { + "$id": "6125", + "m": { + "$id": "6126", + "kind": "number", + "type": { + "$ref": "3404" + }, + "value": 4 + }, + "metric": { + "$id": "6127", + "kind": "string", + "type": { + "$ref": "905" + }, + "value": "cosine" + } + } + } + } + }, + { + "$id": "6128", + "kind": "model", + "type": { + "$ref": "3425" + }, + "value": { + "$id": "6129", + "name": { + "$id": "6130", + "kind": "string", + "type": { + "$ref": "3396" + }, + "value": "myExhaustive" + }, + "kind": { + "$id": "6131", + "kind": "string", + "type": { + "$ref": "3434" + }, + "value": "exhaustiveKnn" + }, + "exhaustiveKnnParameters": { + "$id": "6132", + "kind": "model", + "type": { + "$ref": "3427" + }, + "value": { + "$id": "6133", + "metric": { + "$id": "6134", + "kind": "string", + "type": { + "$ref": "905" + }, + "value": "cosine" + } + } + } + } + } + ] + }, + "compressions": { + "$id": "6135", + "kind": "array", + "type": { + "$ref": "3540" + }, + "value": [ + { + "$id": "6136", + "kind": "model", + "type": { + "$ref": "3558" + }, + "value": { + "$id": "6137", + "name": { + "$id": "6138", + "kind": "string", + "type": { + "$ref": "3546" + }, + "value": "mySQ8" + }, + "kind": { + "$id": "6139", + "kind": "string", + "type": { + "$ref": "3567" + }, + "value": "scalarQuantization" + }, + "scalarQuantizationParameters": { + "$id": "6140", + "kind": "model", + "type": { + "$ref": "3560" + }, + "value": { + "$id": "6141", + "quantizedDataType": { + "$id": "6142", + "kind": "string", + "type": { + "$ref": "935" + }, + "value": "int8" + } + } + }, + "rerankWithOriginalVectors": { + "$id": "6143", + "kind": "boolean", + "type": { + "$ref": "3550" + }, + "value": true + }, + "defaultOversampling": { + "$id": "6144", + "kind": "number", + "type": { + "$ref": "3554" + }, + "value": 10 + } + } + }, + { + "$id": "6145", + "kind": "model", + "type": { + "$ref": "3571" + }, + "value": { + "$id": "6146", + "name": { + "$id": "6147", + "kind": "string", + "type": { + "$ref": "3546" + }, + "value": "myBQ" + }, + "kind": { + "$id": "6148", + "kind": "string", + "type": { + "$ref": "3573" + }, + "value": "binaryQuantization" + }, + "rerankWithOriginalVectors": { + "$id": "6149", + "kind": "boolean", + "type": { + "$ref": "3550" + }, + "value": true + }, + "defaultOversampling": { + "$id": "6150", + "kind": "number", + "type": { + "$ref": "3554" + }, + "value": 10 + } + } + } + ] + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "6151", + "response": { + "$ref": "5910" + }, + "statusCode": 201, + "bodyValue": { + "$id": "6152", + "kind": "model", + "type": { + "$ref": "2373" + }, + "value": { + "$id": "6153", + "name": { + "$id": "6154", + "kind": "string", + "type": { + "$ref": "2375" + }, + "value": "hotels" + }, + "fields": { + "$id": "6155", + "kind": "array", + "type": { + "$ref": "2379" + }, + "value": [ + { + "$id": "6156", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6157", + "name": { + "$id": "6158", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "hotelId" + }, + "type": { + "$id": "6159", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "6160", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6161", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6162", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6163", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6164", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6165", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": true + }, + "synonymMaps": { + "$id": "6166", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6167", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6168", + "name": { + "$id": "6169", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "baseRate" + }, + "type": { + "$id": "6170", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Double" + }, + "searchable": { + "$id": "6171", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6172", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6173", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6174", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6175", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6176", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6177", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6178", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6179", + "name": { + "$id": "6180", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "description" + }, + "type": { + "$id": "6181", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "6182", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6183", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "6184", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6185", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "6186", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "6187", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6188", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6189", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6190", + "name": { + "$id": "6191", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "descriptionEmbedding" + }, + "type": { + "$id": "6192", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.Single)" + }, + "searchable": { + "$id": "6193", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6194", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "6195", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6196", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "6197", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "6198", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "dimensions": { + "$id": "6199", + "kind": "number", + "type": { + "$ref": "2426" + }, + "value": 1536 + }, + "vectorSearchProfile": { + "$id": "6200", + "kind": "string", + "type": { + "$ref": "2430" + }, + "value": "myHnswSQProfile" + }, + "synonymMaps": { + "$id": "6201", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6202", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6203", + "name": { + "$id": "6204", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "descriptionEmbedding_notstored" + }, + "type": { + "$id": "6205", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.Single)" + }, + "searchable": { + "$id": "6206", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6207", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "6208", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": false + }, + "stored": { + "$id": "6209", + "kind": "boolean", + "type": { + "$ref": "2397" + }, + "value": false + }, + "sortable": { + "$id": "6210", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "6211", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "6212", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6213", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + }, + "dimensions": { + "$id": "6214", + "kind": "number", + "type": { + "$ref": "2426" + }, + "value": 1536 + }, + "vectorSearchProfile": { + "$id": "6215", + "kind": "string", + "type": { + "$ref": "2430" + }, + "value": "myHnswSQProfile" + } + } + }, + { + "$id": "6216", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6217", + "name": { + "$id": "6218", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "descriptionEmbedding_forBQ" + }, + "type": { + "$id": "6219", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.Single)" + }, + "searchable": { + "$id": "6220", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6221", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "6222", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6223", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "6224", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "6225", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "dimensions": { + "$id": "6226", + "kind": "number", + "type": { + "$ref": "2426" + }, + "value": 1536 + }, + "vectorSearchProfile": { + "$id": "6227", + "kind": "string", + "type": { + "$ref": "2430" + }, + "value": "myHnswBQProfile" + }, + "synonymMaps": { + "$id": "6228", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6229", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6230", + "name": { + "$id": "6231", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "description_fr" + }, + "type": { + "$id": "6232", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "6233", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6234", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "6235", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6236", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "6237", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "6238", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "analyzer": { + "$id": "6239", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "fr.lucene" + }, + "synonymMaps": { + "$id": "6240", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6241", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6242", + "name": { + "$id": "6243", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "hotelName" + }, + "type": { + "$id": "6244", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "6245", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6246", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6247", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6248", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6249", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6250", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6251", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6252", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6253", + "name": { + "$id": "6254", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "nameEmbedding" + }, + "type": { + "$id": "6255", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.Half)" + }, + "searchable": { + "$id": "6256", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6257", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "6258", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6259", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "6260", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "6261", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "dimensions": { + "$id": "6262", + "kind": "number", + "type": { + "$ref": "2426" + }, + "value": 1536 + }, + "vectorSearchProfile": { + "$id": "6263", + "kind": "string", + "type": { + "$ref": "2430" + }, + "value": "myHnswProfile" + }, + "synonymMaps": { + "$id": "6264", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6265", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6266", + "name": { + "$id": "6267", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "category" + }, + "type": { + "$id": "6268", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "6269", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6270", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6271", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6272", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6273", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6274", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6275", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6276", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6277", + "name": { + "$id": "6278", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "tags" + }, + "type": { + "$id": "6279", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.String)" + }, + "searchable": { + "$id": "6280", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6281", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6282", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6283", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "6284", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6285", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "analyzer": { + "$id": "6286", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "tagsAnalyzer" + }, + "synonymMaps": { + "$id": "6287", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6288", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6289", + "name": { + "$id": "6290", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "parkingIncluded" + }, + "type": { + "$id": "6291", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Boolean" + }, + "searchable": { + "$id": "6292", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6293", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6294", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6295", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6296", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6297", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6298", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6299", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6300", + "name": { + "$id": "6301", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "smokingAllowed" + }, + "type": { + "$id": "6302", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Boolean" + }, + "searchable": { + "$id": "6303", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6304", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6305", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6306", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6307", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6308", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6309", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6310", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6311", + "name": { + "$id": "6312", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "lastRenovationDate" + }, + "type": { + "$id": "6313", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.DateTimeOffset" + }, + "searchable": { + "$id": "6314", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6315", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6316", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6317", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6318", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6319", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6320", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6321", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6322", + "name": { + "$id": "6323", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "rating" + }, + "type": { + "$id": "6324", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Int32" + }, + "searchable": { + "$id": "6325", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6326", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6327", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6328", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6329", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6330", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6331", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6332", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6333", + "name": { + "$id": "6334", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "location" + }, + "type": { + "$id": "6335", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.GeographyPoint" + }, + "searchable": { + "$id": "6336", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6337", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6338", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6339", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6340", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "6341", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6342", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + } + ] + }, + "scoringProfiles": { + "$id": "6343", + "kind": "array", + "type": { + "$ref": "2448" + }, + "value": [ + { + "$id": "6344", + "kind": "model", + "type": { + "$ref": "2449" + }, + "value": { + "$id": "6345", + "name": { + "$id": "6346", + "kind": "string", + "type": { + "$ref": "2451" + }, + "value": "geo" + }, + "functionAggregation": { + "$id": "6347", + "kind": "string", + "type": { + "$ref": "314" + }, + "value": "sum" + }, + "text": { + "$id": "6348", + "kind": "model", + "type": { + "$ref": "2455" + }, + "value": { + "$id": "6349", + "weights": { + "$id": "6350", + "kind": "dict", + "type": { + "$ref": "2457" + }, + "value": { + "$id": "6351", + "hotelName": { + "$id": "6352", + "kind": "number", + "type": { + "$ref": "2459" + }, + "value": 5 + } + } + } + } + }, + "functions": { + "$id": "6353", + "kind": "array", + "type": { + "$ref": "2465" + }, + "value": [ + { + "$id": "6354", + "kind": "model", + "type": { + "$ref": "2483" + }, + "value": { + "$id": "6355", + "fieldName": { + "$id": "6356", + "kind": "string", + "type": { + "$ref": "2472" + }, + "value": "location" + }, + "interpolation": { + "$id": "6357", + "kind": "string", + "type": { + "$ref": "304" + }, + "value": "logarithmic" + }, + "type": { + "$id": "6358", + "kind": "string", + "type": { + "$ref": "2497" + }, + "value": "distance" + }, + "boost": { + "$id": "6359", + "kind": "number", + "type": { + "$ref": "2476" + }, + "value": 5 + }, + "distance": { + "$id": "6360", + "kind": "model", + "type": { + "$ref": "2485" + }, + "value": { + "$id": "6361", + "referencePointParameter": { + "$id": "6362", + "kind": "string", + "type": { + "$ref": "2487" + }, + "value": "currentLocation" + }, + "boostingDistance": { + "$id": "6363", + "kind": "number", + "type": { + "$ref": "2491" + }, + "value": 10 + } + } + } + } + } + ] + } + } + } + ] + }, + "defaultScoringProfile": { + "$id": "6364", + "kind": "string", + "type": { + "$ref": "2560" + }, + "value": "geo" + }, + "suggesters": { + "$id": "6365", + "kind": "array", + "type": { + "$ref": "2577" + }, + "value": [ + { + "$id": "6366", + "kind": "model", + "type": { + "$ref": "2578" + }, + "value": { + "$id": "6367", + "name": { + "$id": "6368", + "kind": "string", + "type": { + "$ref": "2580" + }, + "value": "sg" + }, + "searchMode": { + "$id": "6369", + "kind": "string", + "type": { + "$ref": "2584" + }, + "value": "analyzingInfixMatching" + }, + "sourceFields": { + "$id": "6370", + "kind": "array", + "type": { + "$ref": "2588" + }, + "value": [ + { + "$id": "6371", + "kind": "string", + "type": { + "$ref": "2589" + }, + "value": "hotelName" + } + ] + } + } + } + ] + }, + "analyzers": { + "$id": "6372", + "kind": "array", + "type": { + "$ref": "2595" + }, + "value": [] + }, + "tokenizers": { + "$id": "6373", + "kind": "array", + "type": { + "$ref": "2674" + }, + "value": [] + }, + "tokenFilters": { + "$id": "6374", + "kind": "array", + "type": { + "$ref": "2841" + }, + "value": [] + }, + "charFilters": { + "$id": "6375", + "kind": "array", + "type": { + "$ref": "3234" + }, + "value": [] + }, + "corsOptions": { + "$id": "6376", + "kind": "model", + "type": { + "$ref": "2564" + }, + "value": { + "$id": "6377", + "allowedOrigins": { + "$id": "6378", + "kind": "array", + "type": { + "$ref": "2566" + }, + "value": [ + { + "$id": "6379", + "kind": "string", + "type": { + "$ref": "2567" + }, + "value": "tempuri.org" + } + ] + }, + "maxAgeInSeconds": { + "$id": "6380", + "kind": "number", + "type": { + "$ref": "2571" + }, + "value": 60 + } + } + }, + "encryptionKey": { + "$id": "6381", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "6382", + "keyVaultKeyName": { + "$id": "6383", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "6384", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "6385", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "6386", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "6387", + "applicationId": { + "$id": "6388", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + }, + "semantic": { + "$id": "6389", + "kind": "model", + "type": { + "$ref": "3330" + }, + "value": { + "$id": "6390", + "configurations": { + "$id": "6391", + "kind": "array", + "type": { + "$ref": "3336" + }, + "value": [ + { + "$id": "6392", + "kind": "model", + "type": { + "$ref": "3337" + }, + "value": { + "$id": "6393", + "name": { + "$id": "6394", + "kind": "string", + "type": { + "$ref": "3339" + }, + "value": "semanticHotels" + }, + "prioritizedFields": { + "$id": "6395", + "kind": "model", + "type": { + "$ref": "3343" + }, + "value": { + "$id": "6396", + "titleField": { + "$id": "6397", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6398", + "fieldName": { + "$id": "6399", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "hotelName" + } + } + }, + "prioritizedContentFields": { + "$id": "6400", + "kind": "array", + "type": { + "$ref": "3353" + }, + "value": [ + { + "$id": "6401", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6402", + "fieldName": { + "$id": "6403", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "description" + } + } + }, + { + "$id": "6404", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6405", + "fieldName": { + "$id": "6406", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "description_fr" + } + } + } + ] + }, + "prioritizedKeywordsFields": { + "$id": "6407", + "kind": "array", + "type": { + "$ref": "3357" + }, + "value": [ + { + "$id": "6408", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6409", + "fieldName": { + "$id": "6410", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "tags" + } + } + }, + { + "$id": "6411", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6412", + "fieldName": { + "$id": "6413", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "category" + } + } + } + ] + } + } + } + } + } + ] + } + } + }, + "vectorSearch": { + "$id": "6414", + "kind": "model", + "type": { + "$ref": "3367" + }, + "value": { + "$id": "6415", + "algorithms": { + "$id": "6416", + "kind": "array", + "type": { + "$ref": "3390" + }, + "value": [ + { + "$id": "6417", + "kind": "model", + "type": { + "$ref": "3400" + }, + "value": { + "$id": "6418", + "name": { + "$id": "6419", + "kind": "string", + "type": { + "$ref": "3396" + }, + "value": "myHnsw" + }, + "kind": { + "$id": "6420", + "kind": "string", + "type": { + "$ref": "3421" + }, + "value": "hnsw" + }, + "hnswParameters": { + "$id": "6421", + "kind": "model", + "type": { + "$ref": "3402" + }, + "value": { + "$id": "6422", + "metric": { + "$id": "6423", + "kind": "string", + "type": { + "$ref": "905" + }, + "value": "cosine" + }, + "m": { + "$id": "6424", + "kind": "number", + "type": { + "$ref": "3404" + }, + "value": 4 + }, + "efConstruction": { + "$id": "6425", + "kind": "number", + "type": { + "$ref": "3408" + }, + "value": 400 + }, + "efSearch": { + "$id": "6426", + "kind": "number", + "type": { + "$ref": "3412" + }, + "value": 500 + } + } + } + } + }, + { + "$id": "6427", + "kind": "model", + "type": { + "$ref": "3425" + }, + "value": { + "$id": "6428", + "name": { + "$id": "6429", + "kind": "string", + "type": { + "$ref": "3396" + }, + "value": "myExhaustive" + }, + "kind": { + "$id": "6430", + "kind": "string", + "type": { + "$ref": "3434" + }, + "value": "exhaustiveKnn" + }, + "exhaustiveKnnParameters": { + "$id": "6431", + "kind": "model", + "type": { + "$ref": "3427" + }, + "value": { + "$id": "6432", + "metric": { + "$id": "6433", + "kind": "string", + "type": { + "$ref": "905" + }, + "value": "cosine" + } + } + } + } + } + ] + }, + "profiles": { + "$id": "6434", + "kind": "array", + "type": { + "$ref": "3369" + }, + "value": [ + { + "$id": "6435", + "kind": "model", + "type": { + "$ref": "3370" + }, + "value": { + "$id": "6436", + "name": { + "$id": "6437", + "kind": "string", + "type": { + "$ref": "3372" + }, + "value": "myHnswProfile" + }, + "algorithm": { + "$id": "6438", + "kind": "string", + "type": { + "$ref": "3376" + }, + "value": "myHnsw" + } + } + }, + { + "$id": "6439", + "kind": "model", + "type": { + "$ref": "3370" + }, + "value": { + "$id": "6440", + "name": { + "$id": "6441", + "kind": "string", + "type": { + "$ref": "3372" + }, + "value": "myHnswSQProfile" + }, + "algorithm": { + "$id": "6442", + "kind": "string", + "type": { + "$ref": "3376" + }, + "value": "myHnsw" + }, + "compression": { + "$id": "6443", + "kind": "string", + "type": { + "$ref": "3384" + }, + "value": "mySQ8" + } + } + }, + { + "$id": "6444", + "kind": "model", + "type": { + "$ref": "3370" + }, + "value": { + "$id": "6445", + "name": { + "$id": "6446", + "kind": "string", + "type": { + "$ref": "3372" + }, + "value": "myHnswBQProfile" + }, + "algorithm": { + "$id": "6447", + "kind": "string", + "type": { + "$ref": "3376" + }, + "value": "myHnsw" + }, + "vectorizer": { + "$id": "6448", + "kind": "string", + "type": { + "$ref": "3380" + }, + "value": "myOpenAi" + }, + "compression": { + "$id": "6449", + "kind": "string", + "type": { + "$ref": "3384" + }, + "value": "myBQ" + } + } + }, + { + "$id": "6450", + "kind": "model", + "type": { + "$ref": "3370" + }, + "value": { + "$id": "6451", + "name": { + "$id": "6452", + "kind": "string", + "type": { + "$ref": "3372" + }, + "value": "myAlgorithm" + }, + "algorithm": { + "$id": "6453", + "kind": "string", + "type": { + "$ref": "3376" + }, + "value": "myExhaustive" + } + } + } + ] + }, + "compressions": { + "$id": "6454", + "kind": "array", + "type": { + "$ref": "3540" + }, + "value": [ + { + "$id": "6455", + "kind": "model", + "type": { + "$ref": "3558" + }, + "value": { + "$id": "6456", + "name": { + "$id": "6457", + "kind": "string", + "type": { + "$ref": "3546" + }, + "value": "mySQ8" + }, + "kind": { + "$id": "6458", + "kind": "string", + "type": { + "$ref": "3567" + }, + "value": "scalarQuantization" + }, + "scalarQuantizationParameters": { + "$id": "6459", + "kind": "model", + "type": { + "$ref": "3560" + }, + "value": { + "$id": "6460", + "quantizedDataType": { + "$id": "6461", + "kind": "string", + "type": { + "$ref": "935" + }, + "value": "int8" + } + } + }, + "rerankWithOriginalVectors": { + "$id": "6462", + "kind": "boolean", + "type": { + "$ref": "3550" + }, + "value": true + }, + "defaultOversampling": { + "$id": "6463", + "kind": "number", + "type": { + "$ref": "3554" + }, + "value": 10 + } + } + }, + { + "$id": "6464", + "kind": "model", + "type": { + "$ref": "3571" + }, + "value": { + "$id": "6465", + "name": { + "$id": "6466", + "kind": "string", + "type": { + "$ref": "3546" + }, + "value": "myBQ" + }, + "kind": { + "$id": "6467", + "kind": "string", + "type": { + "$ref": "3573" + }, + "value": "binaryQuantization" + }, + "rerankWithOriginalVectors": { + "$id": "6468", + "kind": "boolean", + "type": { + "$ref": "3550" + }, + "value": true + }, + "defaultOversampling": { + "$id": "6469", + "kind": "number", + "type": { + "$ref": "3554" + }, + "value": 10 + } + } + } + ] + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "6470", + "name": "list", + "resourceName": "Indexes", + "doc": "Lists all indexes available for a search service.", + "accessibility": "public", + "parameters": [ + { + "$id": "6471", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "6472", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "6473", + "type": { + "$id": "6474", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "6475", + "name": "$select", + "nameInRequest": "$select", + "doc": "Selects which top-level properties to retrieve.\nSpecified as a comma-separated list of JSON property names,\nor '*' for all properties. The default is all properties.", + "type": { + "$id": "6476", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "6477", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "6478", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "6479", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "6480", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "6481", + "kind": "constant", + "valueType": { + "$id": "6482", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "6483", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "3585" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/indexes", + "bufferResponse": true, + "paging": { + "$id": "6484", + "itemPropertySegments": [ + "indexes" + ] + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Indexes.list", + "decorators": [], + "examples": [ + { + "$id": "6485", + "kind": "http", + "name": "SearchServiceListIndexes", + "description": "SearchServiceListIndexes", + "filePath": "2024-07-01/SearchServiceListIndexes.json", + "parameters": [ + { + "$id": "6486", + "parameter": { + "$ref": "6475" + }, + "value": { + "$id": "6487", + "kind": "string", + "type": { + "$ref": "6476" + }, + "value": "*" + } + }, + { + "$id": "6488", + "parameter": { + "$ref": "6471" + }, + "value": { + "$id": "6489", + "kind": "string", + "type": { + "$ref": "6472" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "6490", + "response": { + "$ref": "6483" + }, + "statusCode": 200, + "bodyValue": { + "$id": "6491", + "kind": "model", + "type": { + "$ref": "3585" + }, + "value": { + "$id": "6492", + "value": { + "$id": "6493", + "kind": "array", + "type": { + "$ref": "3587" + }, + "value": [ + { + "$id": "6494", + "kind": "model", + "type": { + "$ref": "2373" + }, + "value": { + "$id": "6495", + "name": { + "$id": "6496", + "kind": "string", + "type": { + "$ref": "2375" + }, + "value": "hotels" + }, + "fields": { + "$id": "6497", + "kind": "array", + "type": { + "$ref": "2379" + }, + "value": [ + { + "$id": "6498", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6499", + "name": { + "$id": "6500", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "hotelId" + }, + "type": { + "$id": "6501", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "6502", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6503", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6504", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6505", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6506", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6507", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": true + }, + "synonymMaps": { + "$id": "6508", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6509", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6510", + "name": { + "$id": "6511", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "baseRate" + }, + "type": { + "$id": "6512", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Double" + }, + "searchable": { + "$id": "6513", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6514", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6515", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6516", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6517", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6518", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6519", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6520", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6521", + "name": { + "$id": "6522", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "description" + }, + "type": { + "$id": "6523", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "6524", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6525", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "6526", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6527", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "6528", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "6529", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6530", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6531", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6532", + "name": { + "$id": "6533", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "description_fr" + }, + "type": { + "$id": "6534", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "6535", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6536", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "6537", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6538", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "6539", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "6540", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "analyzer": { + "$id": "6541", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "fr.lucene" + }, + "synonymMaps": { + "$id": "6542", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6543", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6544", + "name": { + "$id": "6545", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "hotelName" + }, + "type": { + "$id": "6546", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "6547", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6548", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6549", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6550", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6551", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6552", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6553", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6554", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6555", + "name": { + "$id": "6556", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "category" + }, + "type": { + "$id": "6557", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "6558", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6559", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6560", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6561", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6562", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6563", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6564", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6565", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6566", + "name": { + "$id": "6567", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "tags" + }, + "type": { + "$id": "6568", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.String)" + }, + "searchable": { + "$id": "6569", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6570", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6571", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6572", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "6573", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6574", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "analyzer": { + "$id": "6575", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "tagsAnalyzer" + }, + "synonymMaps": { + "$id": "6576", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6577", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6578", + "name": { + "$id": "6579", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "parkingIncluded" + }, + "type": { + "$id": "6580", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Boolean" + }, + "searchable": { + "$id": "6581", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6582", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6583", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6584", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6585", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6586", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6587", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6588", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6589", + "name": { + "$id": "6590", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "smokingAllowed" + }, + "type": { + "$id": "6591", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Boolean" + }, + "searchable": { + "$id": "6592", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6593", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6594", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6595", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6596", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6597", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6598", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6599", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6600", + "name": { + "$id": "6601", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "lastRenovationDate" + }, + "type": { + "$id": "6602", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.DateTimeOffset" + }, + "searchable": { + "$id": "6603", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6604", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6605", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6606", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6607", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6608", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6609", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6610", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6611", + "name": { + "$id": "6612", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "rating" + }, + "type": { + "$id": "6613", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Int32" + }, + "searchable": { + "$id": "6614", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6615", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6616", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6617", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6618", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6619", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6620", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6621", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6622", + "name": { + "$id": "6623", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "location" + }, + "type": { + "$id": "6624", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.GeographyPoint" + }, + "searchable": { + "$id": "6625", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6626", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6627", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6628", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6629", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "6630", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6631", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + } + ] + }, + "scoringProfiles": { + "$id": "6632", + "kind": "array", + "type": { + "$ref": "2448" + }, + "value": [ + { + "$id": "6633", + "kind": "model", + "type": { + "$ref": "2449" + }, + "value": { + "$id": "6634", + "name": { + "$id": "6635", + "kind": "string", + "type": { + "$ref": "2451" + }, + "value": "geo" + }, + "text": { + "$id": "6636", + "kind": "model", + "type": { + "$ref": "2455" + }, + "value": { + "$id": "6637", + "weights": { + "$id": "6638", + "kind": "dict", + "type": { + "$ref": "2457" + }, + "value": { + "$id": "6639", + "hotelName": { + "$id": "6640", + "kind": "number", + "type": { + "$ref": "2459" + }, + "value": 5 + } + } + } + } + }, + "functions": { + "$id": "6641", + "kind": "array", + "type": { + "$ref": "2465" + }, + "value": [ + { + "$id": "6642", + "kind": "model", + "type": { + "$ref": "2483" + }, + "value": { + "$id": "6643", + "type": { + "$id": "6644", + "kind": "string", + "type": { + "$ref": "2497" + }, + "value": "distance" + }, + "boost": { + "$id": "6645", + "kind": "number", + "type": { + "$ref": "2476" + }, + "value": 5 + }, + "fieldName": { + "$id": "6646", + "kind": "string", + "type": { + "$ref": "2472" + }, + "value": "location" + }, + "interpolation": { + "$id": "6647", + "kind": "string", + "type": { + "$ref": "304" + }, + "value": "logarithmic" + }, + "distance": { + "$id": "6648", + "kind": "model", + "type": { + "$ref": "2485" + }, + "value": { + "$id": "6649", + "referencePointParameter": { + "$id": "6650", + "kind": "string", + "type": { + "$ref": "2487" + }, + "value": "currentLocation" + }, + "boostingDistance": { + "$id": "6651", + "kind": "number", + "type": { + "$ref": "2491" + }, + "value": 10 + } + } + } + } + } + ] + } + } + } + ] + }, + "defaultScoringProfile": { + "$id": "6652", + "kind": "string", + "type": { + "$ref": "2560" + }, + "value": "geo" + }, + "suggesters": { + "$id": "6653", + "kind": "array", + "type": { + "$ref": "2577" + }, + "value": [ + { + "$id": "6654", + "kind": "model", + "type": { + "$ref": "2578" + }, + "value": { + "$id": "6655", + "name": { + "$id": "6656", + "kind": "string", + "type": { + "$ref": "2580" + }, + "value": "sg" + }, + "searchMode": { + "$id": "6657", + "kind": "string", + "type": { + "$ref": "2584" + }, + "value": "analyzingInfixMatching" + }, + "sourceFields": { + "$id": "6658", + "kind": "array", + "type": { + "$ref": "2588" + }, + "value": [ + { + "$id": "6659", + "kind": "string", + "type": { + "$ref": "2589" + }, + "value": "hotelName" + } + ] + } + } + } + ] + }, + "analyzers": { + "$id": "6660", + "kind": "array", + "type": { + "$ref": "2595" + }, + "value": [] + }, + "tokenizers": { + "$id": "6661", + "kind": "array", + "type": { + "$ref": "2674" + }, + "value": [] + }, + "tokenFilters": { + "$id": "6662", + "kind": "array", + "type": { + "$ref": "2841" + }, + "value": [] + }, + "charFilters": { + "$id": "6663", + "kind": "array", + "type": { + "$ref": "3234" + }, + "value": [] + }, + "corsOptions": { + "$id": "6664", + "kind": "model", + "type": { + "$ref": "2564" + }, + "value": { + "$id": "6665", + "allowedOrigins": { + "$id": "6666", + "kind": "array", + "type": { + "$ref": "2566" + }, + "value": [ + { + "$id": "6667", + "kind": "string", + "type": { + "$ref": "2567" + }, + "value": "tempuri.org" + } + ] + }, + "maxAgeInSeconds": { + "$id": "6668", + "kind": "number", + "type": { + "$ref": "2571" + }, + "value": 60 + } + } + }, + "encryptionKey": { + "$id": "6669", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "6670", + "keyVaultKeyName": { + "$id": "6671", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myKeyName" + }, + "keyVaultKeyVersion": { + "$id": "6672", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion" + }, + "keyVaultUri": { + "$id": "6673", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + }, + "semantic": { + "$id": "6674", + "kind": "model", + "type": { + "$ref": "3330" + }, + "value": { + "$id": "6675", + "configurations": { + "$id": "6676", + "kind": "array", + "type": { + "$ref": "3336" + }, + "value": [ + { + "$id": "6677", + "kind": "model", + "type": { + "$ref": "3337" + }, + "value": { + "$id": "6678", + "name": { + "$id": "6679", + "kind": "string", + "type": { + "$ref": "3339" + }, + "value": "semanticHotels" + }, + "prioritizedFields": { + "$id": "6680", + "kind": "model", + "type": { + "$ref": "3343" + }, + "value": { + "$id": "6681", + "titleField": { + "$id": "6682", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6683", + "fieldName": { + "$id": "6684", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "hotelName" + } + } + }, + "prioritizedContentFields": { + "$id": "6685", + "kind": "array", + "type": { + "$ref": "3353" + }, + "value": [ + { + "$id": "6686", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6687", + "fieldName": { + "$id": "6688", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "description" + } + } + }, + { + "$id": "6689", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6690", + "fieldName": { + "$id": "6691", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "description_fr" + } + } + } + ] + }, + "prioritizedKeywordsFields": { + "$id": "6692", + "kind": "array", + "type": { + "$ref": "3357" + }, + "value": [ + { + "$id": "6693", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6694", + "fieldName": { + "$id": "6695", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "tags" + } + } + }, + { + "$id": "6696", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6697", + "fieldName": { + "$id": "6698", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "category" + } + } + } + ] + } + } + } + } + } + ] + } + } + } + } + }, + { + "$id": "6699", + "kind": "model", + "type": { + "$ref": "2373" + }, + "value": { + "$id": "6700", + "name": { + "$id": "6701", + "kind": "string", + "type": { + "$ref": "2375" + }, + "value": "testindex" + }, + "fields": { + "$id": "6702", + "kind": "array", + "type": { + "$ref": "2379" + }, + "value": [ + { + "$id": "6703", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6704", + "name": { + "$id": "6705", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "id" + }, + "type": { + "$id": "6706", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "6707", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6708", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "6709", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6710", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "6711", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "6712", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": true + }, + "synonymMaps": { + "$id": "6713", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6714", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6715", + "name": { + "$id": "6716", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "hidden" + }, + "type": { + "$id": "6717", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Double" + }, + "searchable": { + "$id": "6718", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6719", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6720", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": false + }, + "sortable": { + "$id": "6721", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6722", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "6723", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6724", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + } + ] + }, + "scoringProfiles": { + "$id": "6725", + "kind": "array", + "type": { + "$ref": "2448" + }, + "value": [] + }, + "suggesters": { + "$id": "6726", + "kind": "array", + "type": { + "$ref": "2577" + }, + "value": [] + }, + "analyzers": { + "$id": "6727", + "kind": "array", + "type": { + "$ref": "2595" + }, + "value": [] + }, + "tokenizers": { + "$id": "6728", + "kind": "array", + "type": { + "$ref": "2674" + }, + "value": [] + }, + "tokenFilters": { + "$id": "6729", + "kind": "array", + "type": { + "$ref": "2841" + }, + "value": [] + }, + "charFilters": { + "$id": "6730", + "kind": "array", + "type": { + "$ref": "3234" + }, + "value": [] + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "6731", + "name": "createOrUpdate", + "resourceName": "Indexes", + "doc": "Creates a new search index or updates an index if it already exists.", + "accessibility": "public", + "parameters": [ + { + "$id": "6732", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "6733", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "6734", + "type": { + "$id": "6735", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "6736", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.", + "type": { + "$id": "6737", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "6738", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.", + "type": { + "$id": "6739", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "6740", + "name": "allowIndexDowntime", + "nameInRequest": "allowIndexDowntime", + "doc": "Allows new analyzers, tokenizers, token filters, or char filters to be added to\nan index by taking the index offline for at least a few seconds. This\ntemporarily causes indexing and query requests to fail. Performance and write\navailability of the index can be impaired for several minutes after the index\nis updated, or longer for very large indexes.", + "type": { + "$id": "6741", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "6742", + "name": "prefer", + "nameInRequest": "Prefer", + "doc": "For HTTP PUT requests, instructs the service to return the created/updated resource on success.", + "type": { + "$id": "6743", + "kind": "constant", + "valueType": { + "$id": "6744", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "return=representation", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "6745", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "6746", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "6747", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "6748", + "name": "indexName", + "nameInRequest": "indexName", + "doc": "The name of the index.", + "type": { + "$id": "6749", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "6750", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "6751", + "kind": "constant", + "valueType": { + "$id": "6752", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "6753", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "6754", + "kind": "constant", + "valueType": { + "$id": "6755", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "6756", + "name": "index", + "nameInRequest": "index", + "doc": "The definition of the index to create or update.", + "type": { + "$ref": "2373" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "6757", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "2373" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "6758", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "2373" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/indexes('{indexName}')", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Indexes.createOrUpdate", + "decorators": [], + "examples": [ + { + "$id": "6759", + "kind": "http", + "name": "SearchServiceCreateOrUpdateIndex", + "description": "SearchServiceCreateOrUpdateIndex", + "filePath": "2024-07-01/SearchServiceCreateOrUpdateIndex.json", + "parameters": [ + { + "$id": "6760", + "parameter": { + "$ref": "6748" + }, + "value": { + "$id": "6761", + "kind": "string", + "type": { + "$ref": "6749" + }, + "value": "hotels" + } + }, + { + "$id": "6762", + "parameter": { + "$ref": "6740" + }, + "value": { + "$id": "6763", + "kind": "boolean", + "type": { + "$ref": "6741" + }, + "value": false + } + }, + { + "$id": "6764", + "parameter": { + "$ref": "6732" + }, + "value": { + "$id": "6765", + "kind": "string", + "type": { + "$ref": "6733" + }, + "value": "2024-07-01" + } + }, + { + "$id": "6766", + "parameter": { + "$ref": "6742" + }, + "value": { + "$id": "6767", + "kind": "string", + "type": { + "$ref": "6743" + }, + "value": "return=representation" + } + }, + { + "$id": "6768", + "parameter": { + "$ref": "6756" + }, + "value": { + "$id": "6769", + "kind": "model", + "type": { + "$ref": "2373" + }, + "value": { + "$id": "6770", + "name": { + "$id": "6771", + "kind": "string", + "type": { + "$ref": "2375" + }, + "value": "hotels" + }, + "fields": { + "$id": "6772", + "kind": "array", + "type": { + "$ref": "2379" + }, + "value": [ + { + "$id": "6773", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6774", + "name": { + "$id": "6775", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "hotelId" + }, + "type": { + "$id": "6776", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "key": { + "$id": "6777", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": true + }, + "searchable": { + "$id": "6778", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + } + } + }, + { + "$id": "6779", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6780", + "name": { + "$id": "6781", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "baseRate" + }, + "type": { + "$id": "6782", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Double" + } + } + }, + { + "$id": "6783", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6784", + "name": { + "$id": "6785", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "description" + }, + "type": { + "$id": "6786", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "filterable": { + "$id": "6787", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "sortable": { + "$id": "6788", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "6789", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + } + } + }, + { + "$id": "6790", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6791", + "name": { + "$id": "6792", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "descriptionEmbedding" + }, + "type": { + "$id": "6793", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.Single)" + }, + "dimensions": { + "$id": "6794", + "kind": "number", + "type": { + "$ref": "2426" + }, + "value": 1536 + }, + "vectorSearchProfile": { + "$id": "6795", + "kind": "string", + "type": { + "$ref": "2430" + }, + "value": "myHnswProfile" + }, + "searchable": { + "$id": "6796", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "retrievable": { + "$id": "6797", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + } + } + }, + { + "$id": "6798", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6799", + "name": { + "$id": "6800", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "description_fr" + }, + "type": { + "$id": "6801", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "filterable": { + "$id": "6802", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "sortable": { + "$id": "6803", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "6804", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "analyzer": { + "$id": "6805", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "fr.lucene" + } + } + }, + { + "$id": "6806", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6807", + "name": { + "$id": "6808", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "hotelName" + }, + "type": { + "$id": "6809", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + } + } + }, + { + "$id": "6810", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6811", + "name": { + "$id": "6812", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "category" + }, + "type": { + "$id": "6813", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + } + } + }, + { + "$id": "6814", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6815", + "name": { + "$id": "6816", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "tags" + }, + "type": { + "$id": "6817", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.String)" + }, + "analyzer": { + "$id": "6818", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "tagsAnalyzer" + } + } + }, + { + "$id": "6819", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6820", + "name": { + "$id": "6821", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "parkingIncluded" + }, + "type": { + "$id": "6822", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Boolean" + } + } + }, + { + "$id": "6823", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6824", + "name": { + "$id": "6825", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "smokingAllowed" + }, + "type": { + "$id": "6826", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Boolean" + } + } + }, + { + "$id": "6827", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6828", + "name": { + "$id": "6829", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "lastRenovationDate" + }, + "type": { + "$id": "6830", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.DateTimeOffset" + } + } + }, + { + "$id": "6831", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6832", + "name": { + "$id": "6833", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "rating" + }, + "type": { + "$id": "6834", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Int32" + } + } + }, + { + "$id": "6835", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6836", + "name": { + "$id": "6837", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "location" + }, + "type": { + "$id": "6838", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.GeographyPoint" + } + } + } + ] + }, + "scoringProfiles": { + "$id": "6839", + "kind": "array", + "type": { + "$ref": "2448" + }, + "value": [ + { + "$id": "6840", + "kind": "model", + "type": { + "$ref": "2449" + }, + "value": { + "$id": "6841", + "name": { + "$id": "6842", + "kind": "string", + "type": { + "$ref": "2451" + }, + "value": "geo" + }, + "text": { + "$id": "6843", + "kind": "model", + "type": { + "$ref": "2455" + }, + "value": { + "$id": "6844", + "weights": { + "$id": "6845", + "kind": "dict", + "type": { + "$ref": "2457" + }, + "value": { + "$id": "6846", + "hotelName": { + "$id": "6847", + "kind": "number", + "type": { + "$ref": "2459" + }, + "value": 5 + } + } + } + } + }, + "functions": { + "$id": "6848", + "kind": "array", + "type": { + "$ref": "2465" + }, + "value": [ + { + "$id": "6849", + "kind": "model", + "type": { + "$ref": "2483" + }, + "value": { + "$id": "6850", + "type": { + "$id": "6851", + "kind": "string", + "type": { + "$ref": "2497" + }, + "value": "distance" + }, + "boost": { + "$id": "6852", + "kind": "number", + "type": { + "$ref": "2476" + }, + "value": 5 + }, + "fieldName": { + "$id": "6853", + "kind": "string", + "type": { + "$ref": "2472" + }, + "value": "location" + }, + "interpolation": { + "$id": "6854", + "kind": "string", + "type": { + "$ref": "304" + }, + "value": "logarithmic" + }, + "distance": { + "$id": "6855", + "kind": "model", + "type": { + "$ref": "2485" + }, + "value": { + "$id": "6856", + "referencePointParameter": { + "$id": "6857", + "kind": "string", + "type": { + "$ref": "2487" + }, + "value": "currentLocation" + }, + "boostingDistance": { + "$id": "6858", + "kind": "number", + "type": { + "$ref": "2491" + }, + "value": 10 + } + } + } + } + } + ] + } + } + } + ] + }, + "defaultScoringProfile": { + "$id": "6859", + "kind": "string", + "type": { + "$ref": "2560" + }, + "value": "geo" + }, + "suggesters": { + "$id": "6860", + "kind": "array", + "type": { + "$ref": "2577" + }, + "value": [ + { + "$id": "6861", + "kind": "model", + "type": { + "$ref": "2578" + }, + "value": { + "$id": "6862", + "name": { + "$id": "6863", + "kind": "string", + "type": { + "$ref": "2580" + }, + "value": "sg" + }, + "searchMode": { + "$id": "6864", + "kind": "string", + "type": { + "$ref": "2584" + }, + "value": "analyzingInfixMatching" + }, + "sourceFields": { + "$id": "6865", + "kind": "array", + "type": { + "$ref": "2588" + }, + "value": [ + { + "$id": "6866", + "kind": "string", + "type": { + "$ref": "2589" + }, + "value": "hotelName" + } + ] + } + } + } + ] + }, + "analyzers": { + "$id": "6867", + "kind": "array", + "type": { + "$ref": "2595" + }, + "value": [] + }, + "corsOptions": { + "$id": "6868", + "kind": "model", + "type": { + "$ref": "2564" + }, + "value": { + "$id": "6869", + "allowedOrigins": { + "$id": "6870", + "kind": "array", + "type": { + "$ref": "2566" + }, + "value": [ + { + "$id": "6871", + "kind": "string", + "type": { + "$ref": "2567" + }, + "value": "tempuri.org" + } + ] + }, + "maxAgeInSeconds": { + "$id": "6872", + "kind": "number", + "type": { + "$ref": "2571" + }, + "value": 60 + } + } + }, + "encryptionKey": { + "$id": "6873", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "6874", + "keyVaultKeyName": { + "$id": "6875", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "6876", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "6877", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + }, + "semantic": { + "$id": "6878", + "kind": "model", + "type": { + "$ref": "3330" + }, + "value": { + "$id": "6879", + "configurations": { + "$id": "6880", + "kind": "array", + "type": { + "$ref": "3336" + }, + "value": [ + { + "$id": "6881", + "kind": "model", + "type": { + "$ref": "3337" + }, + "value": { + "$id": "6882", + "name": { + "$id": "6883", + "kind": "string", + "type": { + "$ref": "3339" + }, + "value": "semanticHotels" + }, + "prioritizedFields": { + "$id": "6884", + "kind": "model", + "type": { + "$ref": "3343" + }, + "value": { + "$id": "6885", + "titleField": { + "$id": "6886", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6887", + "fieldName": { + "$id": "6888", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "hotelName" + } + } + }, + "prioritizedContentFields": { + "$id": "6889", + "kind": "array", + "type": { + "$ref": "3353" + }, + "value": [ + { + "$id": "6890", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6891", + "fieldName": { + "$id": "6892", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "description" + } + } + }, + { + "$id": "6893", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6894", + "fieldName": { + "$id": "6895", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "description_fr" + } + } + } + ] + }, + "prioritizedKeywordsFields": { + "$id": "6896", + "kind": "array", + "type": { + "$ref": "3357" + }, + "value": [ + { + "$id": "6897", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6898", + "fieldName": { + "$id": "6899", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "tags" + } + } + }, + { + "$id": "6900", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "6901", + "fieldName": { + "$id": "6902", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "category" + } + } + } + ] + } + } + } + } + } + ] + } + } + }, + "vectorSearch": { + "$id": "6903", + "kind": "model", + "type": { + "$ref": "3367" + }, + "value": { + "$id": "6904", + "profiles": { + "$id": "6905", + "kind": "array", + "type": { + "$ref": "3369" + }, + "value": [ + { + "$id": "6906", + "kind": "model", + "type": { + "$ref": "3370" + }, + "value": { + "$id": "6907", + "name": { + "$id": "6908", + "kind": "string", + "type": { + "$ref": "3372" + }, + "value": "myHnswProfile" + }, + "algorithm": { + "$id": "6909", + "kind": "string", + "type": { + "$ref": "3376" + }, + "value": "myHnsw" + } + } + }, + { + "$id": "6910", + "kind": "model", + "type": { + "$ref": "3370" + }, + "value": { + "$id": "6911", + "name": { + "$id": "6912", + "kind": "string", + "type": { + "$ref": "3372" + }, + "value": "myAlgorithm" + }, + "algorithm": { + "$id": "6913", + "kind": "string", + "type": { + "$ref": "3376" + }, + "value": "myExhaustive" + } + } + } + ] + }, + "algorithms": { + "$id": "6914", + "kind": "array", + "type": { + "$ref": "3390" + }, + "value": [ + { + "$id": "6915", + "kind": "model", + "type": { + "$ref": "3400" + }, + "value": { + "$id": "6916", + "name": { + "$id": "6917", + "kind": "string", + "type": { + "$ref": "3396" + }, + "value": "myHnsw" + }, + "kind": { + "$id": "6918", + "kind": "string", + "type": { + "$ref": "3421" + }, + "value": "hnsw" + }, + "hnswParameters": { + "$id": "6919", + "kind": "model", + "type": { + "$ref": "3402" + }, + "value": { + "$id": "6920", + "m": { + "$id": "6921", + "kind": "number", + "type": { + "$ref": "3404" + }, + "value": 4 + }, + "metric": { + "$id": "6922", + "kind": "string", + "type": { + "$ref": "905" + }, + "value": "cosine" + } + } + } + } + }, + { + "$id": "6923", + "kind": "model", + "type": { + "$ref": "3425" + }, + "value": { + "$id": "6924", + "name": { + "$id": "6925", + "kind": "string", + "type": { + "$ref": "3396" + }, + "value": "myExhaustive" + }, + "kind": { + "$id": "6926", + "kind": "string", + "type": { + "$ref": "3434" + }, + "value": "exhaustiveKnn" + }, + "exhaustiveKnnParameters": { + "$id": "6927", + "kind": "model", + "type": { + "$ref": "3427" + }, + "value": { + "$id": "6928", + "metric": { + "$id": "6929", + "kind": "string", + "type": { + "$ref": "905" + }, + "value": "cosine" + } + } + } + } + } + ] + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "6930", + "response": { + "$ref": "6757" + }, + "statusCode": 200, + "bodyValue": { + "$id": "6931", + "kind": "model", + "type": { + "$ref": "2373" + }, + "value": { + "$id": "6932", + "name": { + "$id": "6933", + "kind": "string", + "type": { + "$ref": "2375" + }, + "value": "hotels" + }, + "fields": { + "$id": "6934", + "kind": "array", + "type": { + "$ref": "2379" + }, + "value": [ + { + "$id": "6935", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6936", + "name": { + "$id": "6937", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "hotelId" + }, + "type": { + "$id": "6938", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "6939", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6940", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6941", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6942", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6943", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6944", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": true + }, + "synonymMaps": { + "$id": "6945", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6946", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6947", + "name": { + "$id": "6948", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "baseRate" + }, + "type": { + "$id": "6949", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Double" + }, + "searchable": { + "$id": "6950", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "6951", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6952", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6953", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "6954", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "6955", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6956", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6957", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6958", + "name": { + "$id": "6959", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "description" + }, + "type": { + "$id": "6960", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "6961", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6962", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "6963", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6964", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "6965", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "6966", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "6967", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6968", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6969", + "name": { + "$id": "6970", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "descriptionEmbedding" + }, + "type": { + "$id": "6971", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.Single)" + }, + "searchable": { + "$id": "6972", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6973", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "6974", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6975", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "6976", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "6977", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "dimensions": { + "$id": "6978", + "kind": "number", + "type": { + "$ref": "2426" + }, + "value": 1536 + }, + "vectorSearchProfile": { + "$id": "6979", + "kind": "string", + "type": { + "$ref": "2430" + }, + "value": "myHnswProfile" + }, + "synonymMaps": { + "$id": "6980", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6981", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6982", + "name": { + "$id": "6983", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "description_fr" + }, + "type": { + "$id": "6984", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "6985", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6986", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "6987", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "6988", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "6989", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "6990", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "analyzer": { + "$id": "6991", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "fr.lucene" + }, + "synonymMaps": { + "$id": "6992", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "6993", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "6994", + "name": { + "$id": "6995", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "hotelName" + }, + "type": { + "$id": "6996", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "6997", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "6998", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "6999", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7000", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7001", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7002", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7003", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7004", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7005", + "name": { + "$id": "7006", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "category" + }, + "type": { + "$id": "7007", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "7008", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "7009", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7010", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7011", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7012", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7013", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7014", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7015", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7016", + "name": { + "$id": "7017", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "tags" + }, + "type": { + "$id": "7018", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.String)" + }, + "searchable": { + "$id": "7019", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "7020", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7021", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7022", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "7023", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7024", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "analyzer": { + "$id": "7025", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "tagsAnalyzer" + }, + "synonymMaps": { + "$id": "7026", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7027", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7028", + "name": { + "$id": "7029", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "parkingIncluded" + }, + "type": { + "$id": "7030", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Boolean" + }, + "searchable": { + "$id": "7031", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7032", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7033", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7034", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7035", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7036", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7037", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7038", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7039", + "name": { + "$id": "7040", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "smokingAllowed" + }, + "type": { + "$id": "7041", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Boolean" + }, + "searchable": { + "$id": "7042", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7043", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7044", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7045", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7046", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7047", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7048", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7049", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7050", + "name": { + "$id": "7051", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "lastRenovationDate" + }, + "type": { + "$id": "7052", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.DateTimeOffset" + }, + "searchable": { + "$id": "7053", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7054", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7055", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7056", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7057", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7058", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7059", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7060", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7061", + "name": { + "$id": "7062", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "rating" + }, + "type": { + "$id": "7063", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Int32" + }, + "searchable": { + "$id": "7064", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7065", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7066", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7067", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7068", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7069", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7070", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7071", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7072", + "name": { + "$id": "7073", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "location" + }, + "type": { + "$id": "7074", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.GeographyPoint" + }, + "searchable": { + "$id": "7075", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7076", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7077", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7078", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7079", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "7080", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7081", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + } + ] + }, + "scoringProfiles": { + "$id": "7082", + "kind": "array", + "type": { + "$ref": "2448" + }, + "value": [ + { + "$id": "7083", + "kind": "model", + "type": { + "$ref": "2449" + }, + "value": { + "$id": "7084", + "name": { + "$id": "7085", + "kind": "string", + "type": { + "$ref": "2451" + }, + "value": "geo" + }, + "functionAggregation": { + "$id": "7086", + "kind": "string", + "type": { + "$ref": "314" + }, + "value": "sum" + }, + "text": { + "$id": "7087", + "kind": "model", + "type": { + "$ref": "2455" + }, + "value": { + "$id": "7088", + "weights": { + "$id": "7089", + "kind": "dict", + "type": { + "$ref": "2457" + }, + "value": { + "$id": "7090", + "hotelName": { + "$id": "7091", + "kind": "number", + "type": { + "$ref": "2459" + }, + "value": 5 + } + } + } + } + }, + "functions": { + "$id": "7092", + "kind": "array", + "type": { + "$ref": "2465" + }, + "value": [ + { + "$id": "7093", + "kind": "model", + "type": { + "$ref": "2483" + }, + "value": { + "$id": "7094", + "type": { + "$id": "7095", + "kind": "string", + "type": { + "$ref": "2497" + }, + "value": "distance" + }, + "boost": { + "$id": "7096", + "kind": "number", + "type": { + "$ref": "2476" + }, + "value": 5 + }, + "fieldName": { + "$id": "7097", + "kind": "string", + "type": { + "$ref": "2472" + }, + "value": "location" + }, + "interpolation": { + "$id": "7098", + "kind": "string", + "type": { + "$ref": "304" + }, + "value": "logarithmic" + }, + "distance": { + "$id": "7099", + "kind": "model", + "type": { + "$ref": "2485" + }, + "value": { + "$id": "7100", + "referencePointParameter": { + "$id": "7101", + "kind": "string", + "type": { + "$ref": "2487" + }, + "value": "currentLocation" + }, + "boostingDistance": { + "$id": "7102", + "kind": "number", + "type": { + "$ref": "2491" + }, + "value": 10 + } + } + } + } + } + ] + } + } + } + ] + }, + "defaultScoringProfile": { + "$id": "7103", + "kind": "string", + "type": { + "$ref": "2560" + }, + "value": "geo" + }, + "suggesters": { + "$id": "7104", + "kind": "array", + "type": { + "$ref": "2577" + }, + "value": [ + { + "$id": "7105", + "kind": "model", + "type": { + "$ref": "2578" + }, + "value": { + "$id": "7106", + "name": { + "$id": "7107", + "kind": "string", + "type": { + "$ref": "2580" + }, + "value": "sg" + }, + "searchMode": { + "$id": "7108", + "kind": "string", + "type": { + "$ref": "2584" + }, + "value": "analyzingInfixMatching" + }, + "sourceFields": { + "$id": "7109", + "kind": "array", + "type": { + "$ref": "2588" + }, + "value": [ + { + "$id": "7110", + "kind": "string", + "type": { + "$ref": "2589" + }, + "value": "hotelName" + } + ] + } + } + } + ] + }, + "analyzers": { + "$id": "7111", + "kind": "array", + "type": { + "$ref": "2595" + }, + "value": [] + }, + "tokenizers": { + "$id": "7112", + "kind": "array", + "type": { + "$ref": "2674" + }, + "value": [] + }, + "tokenFilters": { + "$id": "7113", + "kind": "array", + "type": { + "$ref": "2841" + }, + "value": [] + }, + "charFilters": { + "$id": "7114", + "kind": "array", + "type": { + "$ref": "3234" + }, + "value": [] + }, + "corsOptions": { + "$id": "7115", + "kind": "model", + "type": { + "$ref": "2564" + }, + "value": { + "$id": "7116", + "allowedOrigins": { + "$id": "7117", + "kind": "array", + "type": { + "$ref": "2566" + }, + "value": [ + { + "$id": "7118", + "kind": "string", + "type": { + "$ref": "2567" + }, + "value": "tempuri.org" + } + ] + }, + "maxAgeInSeconds": { + "$id": "7119", + "kind": "number", + "type": { + "$ref": "2571" + }, + "value": 60 + } + } + }, + "encryptionKey": { + "$id": "7120", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "7121", + "keyVaultKeyName": { + "$id": "7122", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "7123", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "7124", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + }, + "semantic": { + "$id": "7125", + "kind": "model", + "type": { + "$ref": "3330" + }, + "value": { + "$id": "7126", + "configurations": { + "$id": "7127", + "kind": "array", + "type": { + "$ref": "3336" + }, + "value": [ + { + "$id": "7128", + "kind": "model", + "type": { + "$ref": "3337" + }, + "value": { + "$id": "7129", + "name": { + "$id": "7130", + "kind": "string", + "type": { + "$ref": "3339" + }, + "value": "semanticHotels" + }, + "prioritizedFields": { + "$id": "7131", + "kind": "model", + "type": { + "$ref": "3343" + }, + "value": { + "$id": "7132", + "titleField": { + "$id": "7133", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "7134", + "fieldName": { + "$id": "7135", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "hotelName" + } + } + }, + "prioritizedContentFields": { + "$id": "7136", + "kind": "array", + "type": { + "$ref": "3353" + }, + "value": [ + { + "$id": "7137", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "7138", + "fieldName": { + "$id": "7139", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "description" + } + } + }, + { + "$id": "7140", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "7141", + "fieldName": { + "$id": "7142", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "description_fr" + } + } + } + ] + }, + "prioritizedKeywordsFields": { + "$id": "7143", + "kind": "array", + "type": { + "$ref": "3357" + }, + "value": [ + { + "$id": "7144", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "7145", + "fieldName": { + "$id": "7146", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "tags" + } + } + }, + { + "$id": "7147", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "7148", + "fieldName": { + "$id": "7149", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "category" + } + } + } + ] + } + } + } + } + } + ] + } + } + }, + "vectorSearch": { + "$id": "7150", + "kind": "model", + "type": { + "$ref": "3367" + }, + "value": { + "$id": "7151", + "algorithms": { + "$id": "7152", + "kind": "array", + "type": { + "$ref": "3390" + }, + "value": [ + { + "$id": "7153", + "kind": "model", + "type": { + "$ref": "3400" + }, + "value": { + "$id": "7154", + "name": { + "$id": "7155", + "kind": "string", + "type": { + "$ref": "3396" + }, + "value": "myHnsw" + }, + "kind": { + "$id": "7156", + "kind": "string", + "type": { + "$ref": "3421" + }, + "value": "hnsw" + }, + "hnswParameters": { + "$id": "7157", + "kind": "model", + "type": { + "$ref": "3402" + }, + "value": { + "$id": "7158", + "metric": { + "$id": "7159", + "kind": "string", + "type": { + "$ref": "905" + }, + "value": "cosine" + }, + "m": { + "$id": "7160", + "kind": "number", + "type": { + "$ref": "3404" + }, + "value": 4 + }, + "efConstruction": { + "$id": "7161", + "kind": "number", + "type": { + "$ref": "3408" + }, + "value": 400 + }, + "efSearch": { + "$id": "7162", + "kind": "number", + "type": { + "$ref": "3412" + }, + "value": 500 + } + } + } + } + }, + { + "$id": "7163", + "kind": "model", + "type": { + "$ref": "3425" + }, + "value": { + "$id": "7164", + "name": { + "$id": "7165", + "kind": "string", + "type": { + "$ref": "3396" + }, + "value": "myExhaustive" + }, + "kind": { + "$id": "7166", + "kind": "string", + "type": { + "$ref": "3434" + }, + "value": "exhaustiveKnn" + }, + "exhaustiveKnnParameters": { + "$id": "7167", + "kind": "model", + "type": { + "$ref": "3427" + }, + "value": { + "$id": "7168", + "metric": { + "$id": "7169", + "kind": "string", + "type": { + "$ref": "905" + }, + "value": "cosine" + } + } + } + } + } + ] + }, + "profiles": { + "$id": "7170", + "kind": "array", + "type": { + "$ref": "3369" + }, + "value": [ + { + "$id": "7171", + "kind": "model", + "type": { + "$ref": "3370" + }, + "value": { + "$id": "7172", + "name": { + "$id": "7173", + "kind": "string", + "type": { + "$ref": "3372" + }, + "value": "myHnswProfile" + }, + "algorithm": { + "$id": "7174", + "kind": "string", + "type": { + "$ref": "3376" + }, + "value": "myHnsw" + } + } + }, + { + "$id": "7175", + "kind": "model", + "type": { + "$ref": "3370" + }, + "value": { + "$id": "7176", + "name": { + "$id": "7177", + "kind": "string", + "type": { + "$ref": "3372" + }, + "value": "myAlgorithm" + }, + "algorithm": { + "$id": "7178", + "kind": "string", + "type": { + "$ref": "3376" + }, + "value": "myExhaustive" + } + } + } + ] + } + } + } + } + } + }, + { + "$id": "7179", + "response": { + "$ref": "6758" + }, + "statusCode": 201, + "bodyValue": { + "$id": "7180", + "kind": "model", + "type": { + "$ref": "2373" + }, + "value": { + "$id": "7181", + "name": { + "$id": "7182", + "kind": "string", + "type": { + "$ref": "2375" + }, + "value": "hotels" + }, + "fields": { + "$id": "7183", + "kind": "array", + "type": { + "$ref": "2379" + }, + "value": [ + { + "$id": "7184", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7185", + "name": { + "$id": "7186", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "hotelId" + }, + "type": { + "$id": "7187", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "7188", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7189", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7190", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7191", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7192", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7193", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": true + }, + "synonymMaps": { + "$id": "7194", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7195", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7196", + "name": { + "$id": "7197", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "baseRate" + }, + "type": { + "$id": "7198", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Double" + }, + "searchable": { + "$id": "7199", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7200", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7201", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7202", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7203", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7204", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7205", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7206", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7207", + "name": { + "$id": "7208", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "description" + }, + "type": { + "$id": "7209", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "7210", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "7211", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "7212", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7213", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "7214", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "7215", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7216", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7217", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7218", + "name": { + "$id": "7219", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "descriptionEmbedding" + }, + "type": { + "$id": "7220", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.Single)" + }, + "searchable": { + "$id": "7221", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "7222", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "7223", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7224", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "7225", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "7226", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "dimensions": { + "$id": "7227", + "kind": "number", + "type": { + "$ref": "2426" + }, + "value": 1536 + }, + "vectorSearchProfile": { + "$id": "7228", + "kind": "string", + "type": { + "$ref": "2430" + }, + "value": "myHnswProfile" + }, + "synonymMaps": { + "$id": "7229", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7230", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7231", + "name": { + "$id": "7232", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "description_fr" + }, + "type": { + "$id": "7233", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "7234", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "7235", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "7236", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7237", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "7238", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "7239", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "analyzer": { + "$id": "7240", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "fr.lucene" + }, + "synonymMaps": { + "$id": "7241", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7242", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7243", + "name": { + "$id": "7244", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "hotelName" + }, + "type": { + "$id": "7245", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "7246", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "7247", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7248", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7249", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7250", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7251", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7252", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7253", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7254", + "name": { + "$id": "7255", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "category" + }, + "type": { + "$id": "7256", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "7257", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "7258", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7259", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7260", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7261", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7262", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7263", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7264", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7265", + "name": { + "$id": "7266", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "tags" + }, + "type": { + "$id": "7267", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.String)" + }, + "searchable": { + "$id": "7268", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "7269", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7270", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7271", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "7272", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7273", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "analyzer": { + "$id": "7274", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "tagsAnalyzer" + }, + "synonymMaps": { + "$id": "7275", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7276", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7277", + "name": { + "$id": "7278", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "parkingIncluded" + }, + "type": { + "$id": "7279", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Boolean" + }, + "searchable": { + "$id": "7280", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7281", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7282", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7283", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7284", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7285", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7286", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7287", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7288", + "name": { + "$id": "7289", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "smokingAllowed" + }, + "type": { + "$id": "7290", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Boolean" + }, + "searchable": { + "$id": "7291", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7292", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7293", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7294", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7295", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7296", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7297", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7298", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7299", + "name": { + "$id": "7300", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "lastRenovationDate" + }, + "type": { + "$id": "7301", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.DateTimeOffset" + }, + "searchable": { + "$id": "7302", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7303", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7304", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7305", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7306", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7307", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7308", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7309", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7310", + "name": { + "$id": "7311", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "rating" + }, + "type": { + "$id": "7312", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Int32" + }, + "searchable": { + "$id": "7313", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7314", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7315", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7316", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7317", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7318", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7319", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7320", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7321", + "name": { + "$id": "7322", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "location" + }, + "type": { + "$id": "7323", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.GeographyPoint" + }, + "searchable": { + "$id": "7324", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7325", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7326", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7327", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7328", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "7329", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7330", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + } + ] + }, + "scoringProfiles": { + "$id": "7331", + "kind": "array", + "type": { + "$ref": "2448" + }, + "value": [ + { + "$id": "7332", + "kind": "model", + "type": { + "$ref": "2449" + }, + "value": { + "$id": "7333", + "name": { + "$id": "7334", + "kind": "string", + "type": { + "$ref": "2451" + }, + "value": "geo" + }, + "functionAggregation": { + "$id": "7335", + "kind": "string", + "type": { + "$ref": "314" + }, + "value": "sum" + }, + "text": { + "$id": "7336", + "kind": "model", + "type": { + "$ref": "2455" + }, + "value": { + "$id": "7337", + "weights": { + "$id": "7338", + "kind": "dict", + "type": { + "$ref": "2457" + }, + "value": { + "$id": "7339", + "hotelName": { + "$id": "7340", + "kind": "number", + "type": { + "$ref": "2459" + }, + "value": 5 + } + } + } + } + }, + "functions": { + "$id": "7341", + "kind": "array", + "type": { + "$ref": "2465" + }, + "value": [ + { + "$id": "7342", + "kind": "model", + "type": { + "$ref": "2483" + }, + "value": { + "$id": "7343", + "type": { + "$id": "7344", + "kind": "string", + "type": { + "$ref": "2497" + }, + "value": "distance" + }, + "boost": { + "$id": "7345", + "kind": "number", + "type": { + "$ref": "2476" + }, + "value": 5 + }, + "fieldName": { + "$id": "7346", + "kind": "string", + "type": { + "$ref": "2472" + }, + "value": "location" + }, + "interpolation": { + "$id": "7347", + "kind": "string", + "type": { + "$ref": "304" + }, + "value": "logarithmic" + }, + "distance": { + "$id": "7348", + "kind": "model", + "type": { + "$ref": "2485" + }, + "value": { + "$id": "7349", + "referencePointParameter": { + "$id": "7350", + "kind": "string", + "type": { + "$ref": "2487" + }, + "value": "currentLocation" + }, + "boostingDistance": { + "$id": "7351", + "kind": "number", + "type": { + "$ref": "2491" + }, + "value": 10 + } + } + } + } + } + ] + } + } + } + ] + }, + "defaultScoringProfile": { + "$id": "7352", + "kind": "string", + "type": { + "$ref": "2560" + }, + "value": "geo" + }, + "suggesters": { + "$id": "7353", + "kind": "array", + "type": { + "$ref": "2577" + }, + "value": [ + { + "$id": "7354", + "kind": "model", + "type": { + "$ref": "2578" + }, + "value": { + "$id": "7355", + "name": { + "$id": "7356", + "kind": "string", + "type": { + "$ref": "2580" + }, + "value": "sg" + }, + "searchMode": { + "$id": "7357", + "kind": "string", + "type": { + "$ref": "2584" + }, + "value": "analyzingInfixMatching" + }, + "sourceFields": { + "$id": "7358", + "kind": "array", + "type": { + "$ref": "2588" + }, + "value": [ + { + "$id": "7359", + "kind": "string", + "type": { + "$ref": "2589" + }, + "value": "hotelName" + } + ] + } + } + } + ] + }, + "analyzers": { + "$id": "7360", + "kind": "array", + "type": { + "$ref": "2595" + }, + "value": [] + }, + "tokenizers": { + "$id": "7361", + "kind": "array", + "type": { + "$ref": "2674" + }, + "value": [] + }, + "tokenFilters": { + "$id": "7362", + "kind": "array", + "type": { + "$ref": "2841" + }, + "value": [] + }, + "charFilters": { + "$id": "7363", + "kind": "array", + "type": { + "$ref": "3234" + }, + "value": [] + }, + "corsOptions": { + "$id": "7364", + "kind": "model", + "type": { + "$ref": "2564" + }, + "value": { + "$id": "7365", + "allowedOrigins": { + "$id": "7366", + "kind": "array", + "type": { + "$ref": "2566" + }, + "value": [ + { + "$id": "7367", + "kind": "string", + "type": { + "$ref": "2567" + }, + "value": "tempuri.org" + } + ] + }, + "maxAgeInSeconds": { + "$id": "7368", + "kind": "number", + "type": { + "$ref": "2571" + }, + "value": 60 + } + } + }, + "encryptionKey": { + "$id": "7369", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "7370", + "keyVaultKeyName": { + "$id": "7371", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myUserManagedEncryptionKey-createdinAzureKeyVault" + }, + "keyVaultKeyVersion": { + "$id": "7372", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion-32charAlphaNumericString" + }, + "keyVaultUri": { + "$id": "7373", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + } + } + }, + "semantic": { + "$id": "7374", + "kind": "model", + "type": { + "$ref": "3330" + }, + "value": { + "$id": "7375", + "configurations": { + "$id": "7376", + "kind": "array", + "type": { + "$ref": "3336" + }, + "value": [ + { + "$id": "7377", + "kind": "model", + "type": { + "$ref": "3337" + }, + "value": { + "$id": "7378", + "name": { + "$id": "7379", + "kind": "string", + "type": { + "$ref": "3339" + }, + "value": "semanticHotels" + }, + "prioritizedFields": { + "$id": "7380", + "kind": "model", + "type": { + "$ref": "3343" + }, + "value": { + "$id": "7381", + "titleField": { + "$id": "7382", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "7383", + "fieldName": { + "$id": "7384", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "hotelName" + } + } + }, + "prioritizedContentFields": { + "$id": "7385", + "kind": "array", + "type": { + "$ref": "3353" + }, + "value": [ + { + "$id": "7386", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "7387", + "fieldName": { + "$id": "7388", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "description" + } + } + }, + { + "$id": "7389", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "7390", + "fieldName": { + "$id": "7391", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "description_fr" + } + } + } + ] + }, + "prioritizedKeywordsFields": { + "$id": "7392", + "kind": "array", + "type": { + "$ref": "3357" + }, + "value": [ + { + "$id": "7393", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "7394", + "fieldName": { + "$id": "7395", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "tags" + } + } + }, + { + "$id": "7396", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "7397", + "fieldName": { + "$id": "7398", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "category" + } + } + } + ] + } + } + } + } + } + ] + } + } + }, + "vectorSearch": { + "$id": "7399", + "kind": "model", + "type": { + "$ref": "3367" + }, + "value": { + "$id": "7400", + "algorithms": { + "$id": "7401", + "kind": "array", + "type": { + "$ref": "3390" + }, + "value": [ + { + "$id": "7402", + "kind": "model", + "type": { + "$ref": "3400" + }, + "value": { + "$id": "7403", + "name": { + "$id": "7404", + "kind": "string", + "type": { + "$ref": "3396" + }, + "value": "myHnsw" + }, + "kind": { + "$id": "7405", + "kind": "string", + "type": { + "$ref": "3421" + }, + "value": "hnsw" + }, + "hnswParameters": { + "$id": "7406", + "kind": "model", + "type": { + "$ref": "3402" + }, + "value": { + "$id": "7407", + "metric": { + "$id": "7408", + "kind": "string", + "type": { + "$ref": "905" + }, + "value": "cosine" + }, + "m": { + "$id": "7409", + "kind": "number", + "type": { + "$ref": "3404" + }, + "value": 4 + }, + "efConstruction": { + "$id": "7410", + "kind": "number", + "type": { + "$ref": "3408" + }, + "value": 400 + }, + "efSearch": { + "$id": "7411", + "kind": "number", + "type": { + "$ref": "3412" + }, + "value": 500 + } + } + } + } + }, + { + "$id": "7412", + "kind": "model", + "type": { + "$ref": "3425" + }, + "value": { + "$id": "7413", + "name": { + "$id": "7414", + "kind": "string", + "type": { + "$ref": "3396" + }, + "value": "myExhaustive" + }, + "kind": { + "$id": "7415", + "kind": "string", + "type": { + "$ref": "3434" + }, + "value": "exhaustiveKnn" + }, + "exhaustiveKnnParameters": { + "$id": "7416", + "kind": "model", + "type": { + "$ref": "3427" + }, + "value": { + "$id": "7417", + "metric": { + "$id": "7418", + "kind": "string", + "type": { + "$ref": "905" + }, + "value": "cosine" + } + } + } + } + } + ] + }, + "profiles": { + "$id": "7419", + "kind": "array", + "type": { + "$ref": "3369" + }, + "value": [ + { + "$id": "7420", + "kind": "model", + "type": { + "$ref": "3370" + }, + "value": { + "$id": "7421", + "name": { + "$id": "7422", + "kind": "string", + "type": { + "$ref": "3372" + }, + "value": "myHnswProfile" + }, + "algorithm": { + "$id": "7423", + "kind": "string", + "type": { + "$ref": "3376" + }, + "value": "myHnsw" + } + } + }, + { + "$id": "7424", + "kind": "model", + "type": { + "$ref": "3370" + }, + "value": { + "$id": "7425", + "name": { + "$id": "7426", + "kind": "string", + "type": { + "$ref": "3372" + }, + "value": "myAlgorithm" + }, + "algorithm": { + "$id": "7427", + "kind": "string", + "type": { + "$ref": "3376" + }, + "value": "myExhaustive" + } + } + } + ] + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "7428", + "name": "delete", + "resourceName": "Indexes", + "doc": "Deletes a search index and all the documents it contains. This operation is\npermanent, with no recovery option. Make sure you have a master copy of your\nindex definition, data ingestion code, and a backup of the primary data source\nin case you need to re-build the index.", + "accessibility": "public", + "parameters": [ + { + "$id": "7429", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "7430", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "7431", + "type": { + "$id": "7432", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7433", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.", + "type": { + "$id": "7434", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7435", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.", + "type": { + "$id": "7436", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7437", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "7438", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "7439", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7440", + "name": "indexName", + "nameInRequest": "indexName", + "doc": "The name of the index.", + "type": { + "$id": "7441", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7442", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "7443", + "kind": "constant", + "valueType": { + "$id": "7444", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "7445", + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + }, + { + "$id": "7446", + "statusCodes": [ + 404 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/indexes('{indexName}')", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Indexes.delete", + "decorators": [], + "examples": [ + { + "$id": "7447", + "kind": "http", + "name": "SearchServiceDeleteIndex", + "description": "SearchServiceDeleteIndex", + "filePath": "2024-07-01/SearchServiceDeleteIndex.json", + "parameters": [ + { + "$id": "7448", + "parameter": { + "$ref": "7440" + }, + "value": { + "$id": "7449", + "kind": "string", + "type": { + "$ref": "7441" + }, + "value": "myindex" + } + }, + { + "$id": "7450", + "parameter": { + "$ref": "7429" + }, + "value": { + "$id": "7451", + "kind": "string", + "type": { + "$ref": "7430" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "7452", + "response": { + "$ref": "7445" + }, + "statusCode": 204 + }, + { + "$id": "7453", + "response": { + "$ref": "7446" + }, + "statusCode": 404 + } + ] + } + ] + }, + { + "$id": "7454", + "name": "get", + "resourceName": "Indexes", + "doc": "Retrieves an index definition.", + "accessibility": "public", + "parameters": [ + { + "$id": "7455", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "7456", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "7457", + "type": { + "$id": "7458", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7459", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "7460", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "7461", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7462", + "name": "indexName", + "nameInRequest": "indexName", + "doc": "The name of the index.", + "type": { + "$id": "7463", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7464", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "7465", + "kind": "constant", + "valueType": { + "$id": "7466", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "7467", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "2373" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/indexes('{indexName}')", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Indexes.get", + "decorators": [], + "examples": [ + { + "$id": "7468", + "kind": "http", + "name": "SearchServiceGetIndex", + "description": "SearchServiceGetIndex", + "filePath": "2024-07-01/SearchServiceGetIndex.json", + "parameters": [ + { + "$id": "7469", + "parameter": { + "$ref": "7462" + }, + "value": { + "$id": "7470", + "kind": "string", + "type": { + "$ref": "7463" + }, + "value": "hotels" + } + }, + { + "$id": "7471", + "parameter": { + "$ref": "7455" + }, + "value": { + "$id": "7472", + "kind": "string", + "type": { + "$ref": "7456" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "7473", + "response": { + "$ref": "7467" + }, + "statusCode": 200, + "bodyValue": { + "$id": "7474", + "kind": "model", + "type": { + "$ref": "2373" + }, + "value": { + "$id": "7475", + "name": { + "$id": "7476", + "kind": "string", + "type": { + "$ref": "2375" + }, + "value": "hotels" + }, + "fields": { + "$id": "7477", + "kind": "array", + "type": { + "$ref": "2379" + }, + "value": [ + { + "$id": "7478", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7479", + "name": { + "$id": "7480", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "hotelId" + }, + "type": { + "$id": "7481", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "7482", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7483", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7484", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7485", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7486", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7487", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": true + }, + "synonymMaps": { + "$id": "7488", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7489", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7490", + "name": { + "$id": "7491", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "baseRate" + }, + "type": { + "$id": "7492", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Double" + }, + "searchable": { + "$id": "7493", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7494", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7495", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7496", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7497", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7498", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7499", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7500", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7501", + "name": { + "$id": "7502", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "description" + }, + "type": { + "$id": "7503", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "7504", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "7505", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "7506", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7507", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "7508", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "7509", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7510", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7511", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7512", + "name": { + "$id": "7513", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "descriptionEmbedding" + }, + "type": { + "$id": "7514", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.Single)" + }, + "searchable": { + "$id": "7515", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "7516", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "7517", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7518", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "7519", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "7520", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "dimensions": { + "$id": "7521", + "kind": "number", + "type": { + "$ref": "2426" + }, + "value": 1536 + }, + "vectorSearchProfile": { + "$id": "7522", + "kind": "string", + "type": { + "$ref": "2430" + }, + "value": "myHnswProfile" + }, + "synonymMaps": { + "$id": "7523", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7524", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7525", + "name": { + "$id": "7526", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "description_fr" + }, + "type": { + "$id": "7527", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "7528", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "7529", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": false + }, + "retrievable": { + "$id": "7530", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7531", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "7532", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "7533", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "analyzer": { + "$id": "7534", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "fr.lucene" + }, + "synonymMaps": { + "$id": "7535", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7536", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7537", + "name": { + "$id": "7538", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "hotelName" + }, + "type": { + "$id": "7539", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "7540", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "7541", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7542", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7543", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7544", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7545", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7546", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7547", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7548", + "name": { + "$id": "7549", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "category" + }, + "type": { + "$id": "7550", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.String" + }, + "searchable": { + "$id": "7551", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "7552", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7553", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7554", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7555", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7556", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7557", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7558", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7559", + "name": { + "$id": "7560", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "tags" + }, + "type": { + "$id": "7561", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Collection(Edm.String)" + }, + "searchable": { + "$id": "7562", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": true + }, + "filterable": { + "$id": "7563", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7564", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7565", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": false + }, + "facetable": { + "$id": "7566", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7567", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "analyzer": { + "$id": "7568", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "tagsAnalyzer" + }, + "synonymMaps": { + "$id": "7569", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7570", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7571", + "name": { + "$id": "7572", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "parkingIncluded" + }, + "type": { + "$id": "7573", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Boolean" + }, + "searchable": { + "$id": "7574", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7575", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7576", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7577", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7578", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7579", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7580", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7581", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7582", + "name": { + "$id": "7583", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "smokingAllowed" + }, + "type": { + "$id": "7584", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Boolean" + }, + "searchable": { + "$id": "7585", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7586", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7587", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7588", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7589", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7590", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7591", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7592", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7593", + "name": { + "$id": "7594", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "lastRenovationDate" + }, + "type": { + "$id": "7595", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.DateTimeOffset" + }, + "searchable": { + "$id": "7596", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7597", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7598", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7599", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7600", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7601", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7602", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7603", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7604", + "name": { + "$id": "7605", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "rating" + }, + "type": { + "$id": "7606", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.Int32" + }, + "searchable": { + "$id": "7607", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7608", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7609", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7610", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7611", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": true + }, + "key": { + "$id": "7612", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7613", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + }, + { + "$id": "7614", + "kind": "model", + "type": { + "$ref": "2380" + }, + "value": { + "$id": "7615", + "name": { + "$id": "7616", + "kind": "string", + "type": { + "$ref": "2382" + }, + "value": "location" + }, + "type": { + "$id": "7617", + "kind": "string", + "type": { + "$ref": "84" + }, + "value": "Edm.GeographyPoint" + }, + "searchable": { + "$id": "7618", + "kind": "boolean", + "type": { + "$ref": "2401" + }, + "value": false + }, + "filterable": { + "$id": "7619", + "kind": "boolean", + "type": { + "$ref": "2405" + }, + "value": true + }, + "retrievable": { + "$id": "7620", + "kind": "boolean", + "type": { + "$ref": "2393" + }, + "value": true + }, + "sortable": { + "$id": "7621", + "kind": "boolean", + "type": { + "$ref": "2409" + }, + "value": true + }, + "facetable": { + "$id": "7622", + "kind": "boolean", + "type": { + "$ref": "2413" + }, + "value": false + }, + "key": { + "$id": "7623", + "kind": "boolean", + "type": { + "$ref": "2389" + }, + "value": false + }, + "synonymMaps": { + "$id": "7624", + "kind": "array", + "type": { + "$ref": "2437" + }, + "value": [] + } + } + } + ] + }, + "scoringProfiles": { + "$id": "7625", + "kind": "array", + "type": { + "$ref": "2448" + }, + "value": [ + { + "$id": "7626", + "kind": "model", + "type": { + "$ref": "2449" + }, + "value": { + "$id": "7627", + "name": { + "$id": "7628", + "kind": "string", + "type": { + "$ref": "2451" + }, + "value": "geo" + }, + "functionAggregation": { + "$id": "7629", + "kind": "string", + "type": { + "$ref": "314" + }, + "value": "sum" + }, + "text": { + "$id": "7630", + "kind": "model", + "type": { + "$ref": "2455" + }, + "value": { + "$id": "7631", + "weights": { + "$id": "7632", + "kind": "dict", + "type": { + "$ref": "2457" + }, + "value": { + "$id": "7633", + "hotelName": { + "$id": "7634", + "kind": "number", + "type": { + "$ref": "2459" + }, + "value": 5 + } + } + } + } + }, + "functions": { + "$id": "7635", + "kind": "array", + "type": { + "$ref": "2465" + }, + "value": [ + { + "$id": "7636", + "kind": "model", + "type": { + "$ref": "2483" + }, + "value": { + "$id": "7637", + "type": { + "$id": "7638", + "kind": "string", + "type": { + "$ref": "2497" + }, + "value": "distance" + }, + "boost": { + "$id": "7639", + "kind": "number", + "type": { + "$ref": "2476" + }, + "value": 5 + }, + "fieldName": { + "$id": "7640", + "kind": "string", + "type": { + "$ref": "2472" + }, + "value": "location" + }, + "interpolation": { + "$id": "7641", + "kind": "string", + "type": { + "$ref": "304" + }, + "value": "logarithmic" + }, + "distance": { + "$id": "7642", + "kind": "model", + "type": { + "$ref": "2485" + }, + "value": { + "$id": "7643", + "referencePointParameter": { + "$id": "7644", + "kind": "string", + "type": { + "$ref": "2487" + }, + "value": "currentLocation" + }, + "boostingDistance": { + "$id": "7645", + "kind": "number", + "type": { + "$ref": "2491" + }, + "value": 10 + } + } + } + } + } + ] + } + } + } + ] + }, + "defaultScoringProfile": { + "$id": "7646", + "kind": "string", + "type": { + "$ref": "2560" + }, + "value": "geo" + }, + "suggesters": { + "$id": "7647", + "kind": "array", + "type": { + "$ref": "2577" + }, + "value": [ + { + "$id": "7648", + "kind": "model", + "type": { + "$ref": "2578" + }, + "value": { + "$id": "7649", + "name": { + "$id": "7650", + "kind": "string", + "type": { + "$ref": "2580" + }, + "value": "sg" + }, + "searchMode": { + "$id": "7651", + "kind": "string", + "type": { + "$ref": "2584" + }, + "value": "analyzingInfixMatching" + }, + "sourceFields": { + "$id": "7652", + "kind": "array", + "type": { + "$ref": "2588" + }, + "value": [ + { + "$id": "7653", + "kind": "string", + "type": { + "$ref": "2589" + }, + "value": "hotelName" + } + ] + } + } + } + ] + }, + "analyzers": { + "$id": "7654", + "kind": "array", + "type": { + "$ref": "2595" + }, + "value": [] + }, + "tokenizers": { + "$id": "7655", + "kind": "array", + "type": { + "$ref": "2674" + }, + "value": [] + }, + "tokenFilters": { + "$id": "7656", + "kind": "array", + "type": { + "$ref": "2841" + }, + "value": [] + }, + "charFilters": { + "$id": "7657", + "kind": "array", + "type": { + "$ref": "3234" + }, + "value": [] + }, + "corsOptions": { + "$id": "7658", + "kind": "model", + "type": { + "$ref": "2564" + }, + "value": { + "$id": "7659", + "allowedOrigins": { + "$id": "7660", + "kind": "array", + "type": { + "$ref": "2566" + }, + "value": [ + { + "$id": "7661", + "kind": "string", + "type": { + "$ref": "2567" + }, + "value": "tempuri.org" + } + ] + }, + "maxAgeInSeconds": { + "$id": "7662", + "kind": "number", + "type": { + "$ref": "2571" + }, + "value": 60 + } + } + }, + "encryptionKey": { + "$id": "7663", + "kind": "model", + "type": { + "$ref": "3273" + }, + "value": { + "$id": "7664", + "keyVaultKeyName": { + "$id": "7665", + "kind": "string", + "type": { + "$ref": "3275" + }, + "value": "myKeyName" + }, + "keyVaultKeyVersion": { + "$id": "7666", + "kind": "string", + "type": { + "$ref": "3279" + }, + "value": "myKeyVersion" + }, + "keyVaultUri": { + "$id": "7667", + "kind": "string", + "type": { + "$ref": "3283" + }, + "value": "https://myKeyVault.vault.azure.net" + }, + "accessCredentials": { + "$id": "7668", + "kind": "model", + "type": { + "$ref": "3287" + }, + "value": { + "$id": "7669", + "applicationId": { + "$id": "7670", + "kind": "string", + "type": { + "$ref": "3289" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + }, + "semantic": { + "$id": "7671", + "kind": "model", + "type": { + "$ref": "3330" + }, + "value": { + "$id": "7672", + "configurations": { + "$id": "7673", + "kind": "array", + "type": { + "$ref": "3336" + }, + "value": [ + { + "$id": "7674", + "kind": "model", + "type": { + "$ref": "3337" + }, + "value": { + "$id": "7675", + "name": { + "$id": "7676", + "kind": "string", + "type": { + "$ref": "3339" + }, + "value": "semanticHotels" + }, + "prioritizedFields": { + "$id": "7677", + "kind": "model", + "type": { + "$ref": "3343" + }, + "value": { + "$id": "7678", + "titleField": { + "$id": "7679", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "7680", + "fieldName": { + "$id": "7681", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "hotelName" + } + } + }, + "prioritizedContentFields": { + "$id": "7682", + "kind": "array", + "type": { + "$ref": "3353" + }, + "value": [ + { + "$id": "7683", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "7684", + "fieldName": { + "$id": "7685", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "description" + } + } + }, + { + "$id": "7686", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "7687", + "fieldName": { + "$id": "7688", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "description_fr" + } + } + } + ] + }, + "prioritizedKeywordsFields": { + "$id": "7689", + "kind": "array", + "type": { + "$ref": "3357" + }, + "value": [ + { + "$id": "7690", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "7691", + "fieldName": { + "$id": "7692", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "tags" + } + } + }, + { + "$id": "7693", + "kind": "model", + "type": { + "$ref": "3345" + }, + "value": { + "$id": "7694", + "fieldName": { + "$id": "7695", + "kind": "string", + "type": { + "$ref": "3347" + }, + "value": "category" + } + } + } + ] + } + } + } + } + } + ] + } + } + }, + "vectorSearch": { + "$id": "7696", + "kind": "model", + "type": { + "$ref": "3367" + }, + "value": { + "$id": "7697", + "algorithms": { + "$id": "7698", + "kind": "array", + "type": { + "$ref": "3390" + }, + "value": [ + { + "$id": "7699", + "kind": "model", + "type": { + "$ref": "3400" + }, + "value": { + "$id": "7700", + "name": { + "$id": "7701", + "kind": "string", + "type": { + "$ref": "3396" + }, + "value": "myHnsw" + }, + "kind": { + "$id": "7702", + "kind": "string", + "type": { + "$ref": "3421" + }, + "value": "hnsw" + }, + "hnswParameters": { + "$id": "7703", + "kind": "model", + "type": { + "$ref": "3402" + }, + "value": { + "$id": "7704", + "metric": { + "$id": "7705", + "kind": "string", + "type": { + "$ref": "905" + }, + "value": "cosine" + }, + "m": { + "$id": "7706", + "kind": "number", + "type": { + "$ref": "3404" + }, + "value": 4 + }, + "efConstruction": { + "$id": "7707", + "kind": "number", + "type": { + "$ref": "3408" + }, + "value": 400 + }, + "efSearch": { + "$id": "7708", + "kind": "number", + "type": { + "$ref": "3412" + }, + "value": 500 + } + } + } + } + }, + { + "$id": "7709", + "kind": "model", + "type": { + "$ref": "3425" + }, + "value": { + "$id": "7710", + "name": { + "$id": "7711", + "kind": "string", + "type": { + "$ref": "3396" + }, + "value": "myExhaustive" + }, + "kind": { + "$id": "7712", + "kind": "string", + "type": { + "$ref": "3434" + }, + "value": "exhaustiveKnn" + }, + "exhaustiveKnnParameters": { + "$id": "7713", + "kind": "model", + "type": { + "$ref": "3427" + }, + "value": { + "$id": "7714", + "metric": { + "$id": "7715", + "kind": "string", + "type": { + "$ref": "905" + }, + "value": "cosine" + } + } + } + } + } + ] + }, + "profiles": { + "$id": "7716", + "kind": "array", + "type": { + "$ref": "3369" + }, + "value": [ + { + "$id": "7717", + "kind": "model", + "type": { + "$ref": "3370" + }, + "value": { + "$id": "7718", + "name": { + "$id": "7719", + "kind": "string", + "type": { + "$ref": "3372" + }, + "value": "myHnswProfile" + }, + "algorithm": { + "$id": "7720", + "kind": "string", + "type": { + "$ref": "3376" + }, + "value": "myHnsw" + } + } + }, + { + "$id": "7721", + "kind": "model", + "type": { + "$ref": "3370" + }, + "value": { + "$id": "7722", + "name": { + "$id": "7723", + "kind": "string", + "type": { + "$ref": "3372" + }, + "value": "myAlgorithm" + }, + "algorithm": { + "$id": "7724", + "kind": "string", + "type": { + "$ref": "3376" + }, + "value": "myExhaustive" + } + } + } + ] + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "7725", + "name": "getStatistics", + "resourceName": "Indexes", + "doc": "Returns statistics for the given index, including a document count and storage\nusage.", + "accessibility": "public", + "parameters": [ + { + "$id": "7726", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "7727", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "7728", + "type": { + "$id": "7729", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7730", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "7731", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "7732", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7733", + "name": "indexName", + "nameInRequest": "indexName", + "doc": "The name of the index.", + "type": { + "$id": "7734", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7735", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "7736", + "kind": "constant", + "valueType": { + "$id": "7737", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "7738", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "3590" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/indexes('{indexName}')/search.stats", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Indexes.getStatistics", + "decorators": [], + "examples": [ + { + "$id": "7739", + "kind": "http", + "name": "SearchServiceGetIndexStatistics", + "description": "SearchServiceGetIndexStatistics", + "filePath": "2024-07-01/SearchServiceGetIndexStatistics.json", + "parameters": [ + { + "$id": "7740", + "parameter": { + "$ref": "7733" + }, + "value": { + "$id": "7741", + "kind": "string", + "type": { + "$ref": "7734" + }, + "value": "hotels" + } + }, + { + "$id": "7742", + "parameter": { + "$ref": "7726" + }, + "value": { + "$id": "7743", + "kind": "string", + "type": { + "$ref": "7727" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "7744", + "response": { + "$ref": "7738" + }, + "statusCode": 200, + "bodyValue": { + "$id": "7745", + "kind": "model", + "type": { + "$ref": "3590" + }, + "value": { + "$id": "7746", + "documentCount": { + "$id": "7747", + "kind": "number", + "type": { + "$ref": "3592" + }, + "value": 239572 + }, + "storageSize": { + "$id": "7748", + "kind": "number", + "type": { + "$ref": "3596" + }, + "value": 72375920 + }, + "vectorIndexSize": { + "$id": "7749", + "kind": "number", + "type": { + "$ref": "3600" + }, + "value": 123456 + } + } + } + } + ] + } + ] + }, + { + "$id": "7750", + "name": "analyze", + "resourceName": "Indexes", + "doc": "Shows how an analyzer breaks text into tokens.", + "accessibility": "public", + "parameters": [ + { + "$id": "7751", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "7752", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "7753", + "type": { + "$id": "7754", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7755", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "7756", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "7757", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7758", + "name": "indexName", + "nameInRequest": "indexName", + "doc": "The name of the index.", + "type": { + "$id": "7759", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7760", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "7761", + "kind": "constant", + "valueType": { + "$id": "7762", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7763", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "7764", + "kind": "constant", + "valueType": { + "$id": "7765", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7766", + "name": "request", + "nameInRequest": "request", + "doc": "The text and analyzer or analysis components to test.", + "type": { + "$ref": "3603" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "7767", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "3622" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/indexes('{indexName}')/search.analyze", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Indexes.analyze", + "decorators": [], + "examples": [ + { + "$id": "7768", + "kind": "http", + "name": "SearchServiceIndexAnalyze", + "description": "SearchServiceIndexAnalyze", + "filePath": "2024-07-01/SearchServiceIndexAnalyze.json", + "parameters": [ + { + "$id": "7769", + "parameter": { + "$ref": "7758" + }, + "value": { + "$id": "7770", + "kind": "string", + "type": { + "$ref": "7759" + }, + "value": "hotels" + } + }, + { + "$id": "7771", + "parameter": { + "$ref": "7751" + }, + "value": { + "$id": "7772", + "kind": "string", + "type": { + "$ref": "7752" + }, + "value": "2024-07-01" + } + }, + { + "$id": "7773", + "parameter": { + "$ref": "7766" + }, + "value": { + "$id": "7774", + "kind": "model", + "type": { + "$ref": "3603" + }, + "value": { + "$id": "7775", + "text": { + "$id": "7776", + "kind": "string", + "type": { + "$ref": "3605" + }, + "value": "Text to analyze" + }, + "analyzer": { + "$id": "7777", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "standard.lucene" + } + } + } + } + ], + "responses": [ + { + "$id": "7778", + "response": { + "$ref": "7767" + }, + "statusCode": 200, + "bodyValue": { + "$id": "7779", + "kind": "model", + "type": { + "$ref": "3622" + }, + "value": { + "$id": "7780", + "tokens": { + "$id": "7781", + "kind": "array", + "type": { + "$ref": "3624" + }, + "value": [ + { + "$id": "7782", + "kind": "model", + "type": { + "$ref": "3625" + }, + "value": { + "$id": "7783", + "token": { + "$id": "7784", + "kind": "string", + "type": { + "$ref": "3627" + }, + "value": "text" + }, + "startOffset": { + "$id": "7785", + "kind": "number", + "type": { + "$ref": "3631" + }, + "value": 0 + }, + "endOffset": { + "$id": "7786", + "kind": "number", + "type": { + "$ref": "3635" + }, + "value": 4 + }, + "position": { + "$id": "7787", + "kind": "number", + "type": { + "$ref": "3639" + }, + "value": 0 + } + } + }, + { + "$id": "7788", + "kind": "model", + "type": { + "$ref": "3625" + }, + "value": { + "$id": "7789", + "token": { + "$id": "7790", + "kind": "string", + "type": { + "$ref": "3627" + }, + "value": "to" + }, + "startOffset": { + "$id": "7791", + "kind": "number", + "type": { + "$ref": "3631" + }, + "value": 5 + }, + "endOffset": { + "$id": "7792", + "kind": "number", + "type": { + "$ref": "3635" + }, + "value": 7 + }, + "position": { + "$id": "7793", + "kind": "number", + "type": { + "$ref": "3639" + }, + "value": 1 + } + } + }, + { + "$id": "7794", + "kind": "model", + "type": { + "$ref": "3625" + }, + "value": { + "$id": "7795", + "token": { + "$id": "7796", + "kind": "string", + "type": { + "$ref": "3627" + }, + "value": "analyze" + }, + "startOffset": { + "$id": "7797", + "kind": "number", + "type": { + "$ref": "3631" + }, + "value": 8 + }, + "endOffset": { + "$id": "7798", + "kind": "number", + "type": { + "$ref": "3635" + }, + "value": 15 + }, + "position": { + "$id": "7799", + "kind": "number", + "type": { + "$ref": "3639" + }, + "value": 2 + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "parameters": [ + { + "$id": "7800", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "7801", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client" + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Search.Indexes", + "apiVersions": [ + "2024-07-01" + ], + "parent": { + "$ref": "4671" + } + }, + { + "$id": "7802", + "kind": "client", + "name": "Documents", + "namespace": "Azure.Search.Documents", + "operations": [ + { + "$id": "7803", + "name": "count", + "resourceName": "Documents", + "doc": "Queries the number of documents in the index.", + "accessibility": "public", + "parameters": [ + { + "$id": "7804", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "7805", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "7806", + "type": { + "$id": "7807", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7808", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "7809", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "7810", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7811", + "name": "indexName", + "nameInRequest": "indexName", + "doc": "The name of the index.", + "type": { + "$id": "7812", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7813", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "7814", + "kind": "constant", + "valueType": { + "$id": "7815", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "text/plain", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "7816", + "statusCodes": [ + 200 + ], + "bodyType": { + "$id": "7817", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "text/plain" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/indexes('{indexName}')/docs/$count", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Documents.count", + "decorators": [], + "examples": [ + { + "$id": "7818", + "kind": "http", + "name": "SearchIndexCountDocuments", + "description": "SearchIndexCountDocuments", + "filePath": "2024-07-01/SearchIndexCountDocuments.json", + "parameters": [ + { + "$id": "7819", + "parameter": { + "$ref": "7811" + }, + "value": { + "$id": "7820", + "kind": "string", + "type": { + "$ref": "7812" + }, + "value": "myindex" + } + }, + { + "$id": "7821", + "parameter": { + "$ref": "7804" + }, + "value": { + "$id": "7822", + "kind": "string", + "type": { + "$ref": "7805" + }, + "value": "2024-07-01" + } + } + ], + "responses": [ + { + "$id": "7823", + "response": { + "$ref": "7816" + }, + "statusCode": 200, + "bodyValue": { + "$id": "7824", + "kind": "number", + "type": { + "$ref": "7817" + }, + "value": 427 + } + } + ] + } + ] + }, + { + "$id": "7825", + "name": "searchGet", + "resourceName": "Documents", + "doc": "Searches for documents in the index.", + "accessibility": "public", + "parameters": [ + { + "$id": "7826", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "7827", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "7828", + "type": { + "$id": "7829", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7830", + "name": "searchText", + "nameInRequest": "search", + "doc": "A full-text search query expression; Use \"*\" or omit this parameter to match\nall documents.", + "type": { + "$id": "7831", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7832", + "name": "includeTotalResultCount", + "nameInRequest": "$count", + "doc": "A value that specifies whether to fetch the total count of results. Default is\nfalse. Setting this value to true may have a performance impact. Note that the\ncount returned is an approximation.", + "type": { + "$id": "7833", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7834", + "name": "facets", + "nameInRequest": "facet", + "doc": "The list of facet expressions to apply to the search query. Each facet\nexpression contains a field name, optionally followed by a comma-separated list\nof name:value pairs.", + "type": { + "$id": "7835", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "7836", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": true, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7837", + "name": "$filter", + "nameInRequest": "$filter", + "doc": "The OData $filter expression to apply to the search query.", + "type": { + "$id": "7838", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7839", + "name": "highlightFields", + "nameInRequest": "highlight", + "doc": "The list of field names to use for hit highlights. Only searchable fields can\nbe used for hit highlighting.", + "type": { + "$id": "7840", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "7841", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7842", + "name": "highlightPostTag", + "nameInRequest": "highlightPostTag", + "doc": "A string tag that is appended to hit highlights. Must be set with\nhighlightPreTag. Default is </em>.", + "type": { + "$id": "7843", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7844", + "name": "highlightPreTag", + "nameInRequest": "highlightPreTag", + "doc": "A string tag that is prepended to hit highlights. Must be set with\nhighlightPostTag. Default is <em>.", + "type": { + "$id": "7845", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7846", + "name": "minimumCoverage", + "nameInRequest": "minimumCoverage", + "doc": "A number between 0 and 100 indicating the percentage of the index that must be\ncovered by a search query in order for the query to be reported as a success.\nThis parameter can be useful for ensuring search availability even for services\nwith only one replica. The default is 100.", + "type": { + "$id": "7847", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7848", + "name": "orderBy", + "nameInRequest": "$orderby", + "doc": "The list of OData $orderby expressions by which to sort the results. Each\nexpression can be either a field name or a call to either the geo.distance() or\nthe search.score() functions. Each expression can be followed by asc to\nindicate ascending, and desc to indicate descending. The default is ascending\norder. Ties will be broken by the match scores of documents. If no OrderBy is\nspecified, the default sort order is descending by document match score. There\ncan be at most 32 $orderby clauses.", + "type": { + "$id": "7849", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "7850", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7851", + "name": "queryType", + "nameInRequest": "queryType", + "doc": "A value that specifies the syntax of the search query. The default is 'simple'.\nUse 'full' if your query uses the Lucene query syntax.", + "type": { + "$ref": "2" + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7852", + "name": "scoringParameters", + "nameInRequest": "scoringParameter", + "doc": "The list of parameter values to be used in scoring functions (for example,\nreferencePointParameter) using the format name-values. For example, if the\nscoring profile defines a function with a parameter called 'mylocation' the\nparameter string would be \"mylocation--122.2,44.8\" (without the quotes).", + "type": { + "$id": "7853", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "7854", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": true, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7855", + "name": "scoringProfile", + "nameInRequest": "scoringProfile", + "doc": "The name of a scoring profile to evaluate match scores for matching documents\nin order to sort the results.", + "type": { + "$id": "7856", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7857", + "name": "searchFields", + "nameInRequest": "searchFields", + "doc": "The list of field names to which to scope the full-text search. When using\nfielded search (fieldName:searchExpression) in a full Lucene query, the field\nnames of each fielded search expression take precedence over any field names\nlisted in this parameter.", + "type": { + "$id": "7858", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "7859", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7860", + "name": "searchMode", + "nameInRequest": "searchMode", + "doc": "A value that specifies whether any or all of the search terms must be matched\nin order to count the document as a match.", + "type": { + "$ref": "10" + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7861", + "name": "scoringStatistics", + "nameInRequest": "scoringStatistics", + "doc": "A value that specifies whether we want to calculate scoring statistics (such as\ndocument frequency) globally for more consistent scoring, or locally, for lower\nlatency.", + "type": { + "$ref": "16" + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7862", + "name": "sessionId", + "nameInRequest": "sessionId", + "doc": "A value to be used to create a sticky session, which can help to get more\nconsistent results. As long as the same sessionId is used, a best-effort\nattempt will be made to target the same replica set. Be wary that reusing the\nsame sessionID values repeatedly can interfere with the load balancing of the\nrequests across replicas and adversely affect the performance of the search\nservice. The value used as sessionId cannot start with a '_' character.", + "type": { + "$id": "7863", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7864", + "name": "$select", + "nameInRequest": "$select", + "doc": "The list of fields to retrieve. If unspecified, all fields marked as\nretrievable in the schema are included.", + "type": { + "$id": "7865", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "7866", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7867", + "name": "$skip", + "nameInRequest": "$skip", + "doc": "The number of search results to skip. This value cannot be greater than\n100,000. If you need to scan documents in sequence, but cannot use $skip due to\nthis limitation, consider using $orderby on a totally-ordered key and $filter\nwith a range query instead.", + "type": { + "$id": "7868", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7869", + "name": "$top", + "nameInRequest": "$top", + "doc": "The number of search results to retrieve. This can be used in conjunction with\n$skip to implement client-side paging of search results. If results are\ntruncated due to server-side paging, the response will include a continuation\ntoken that can be used to issue another Search request for the next page of\nresults.", + "type": { + "$id": "7870", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7871", + "name": "semanticConfiguration", + "nameInRequest": "semanticConfiguration", + "doc": "The name of the semantic configuration that lists which fields should be used\nfor semantic ranking, captions, highlights, and answers", + "type": { + "$id": "7872", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7873", + "name": "semanticErrorHandling", + "nameInRequest": "semanticErrorHandling", + "doc": "Allows the user to choose whether a semantic call should fail completely, or to\nreturn partial results (default).", + "type": { + "$ref": "22" + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7874", + "name": "semanticMaxWaitInMilliseconds", + "nameInRequest": "semanticMaxWaitInMilliseconds", + "doc": "Allows the user to set an upper bound on the amount of time it takes for\nsemantic enrichment to finish processing before the request fails.", + "type": { + "$id": "7875", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7876", + "name": "answers", + "nameInRequest": "answers", + "doc": "This parameter is only valid if the query type is `semantic`. If set, the query\nreturns answers extracted from key passages in the highest ranked documents.\nThe number of answers returned can be configured by appending the pipe\ncharacter `|` followed by the `count-` option after the\nanswers parameter value, such as `extractive|count-3`. Default count is 1. The\nconfidence threshold can be configured by appending the pipe character `|`\nfollowed by the `threshold-` option after the answers\nparameter value, such as `extractive|threshold-0.9`. Default threshold is 0.7.", + "type": { + "$ref": "28" + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7877", + "name": "captions", + "nameInRequest": "captions", + "doc": "This parameter is only valid if the query type is `semantic`. If set, the query\nreturns captions extracted from key passages in the highest ranked documents.\nWhen Captions is set to `extractive`, highlighting is enabled by default, and\ncan be configured by appending the pipe character `|` followed by the\n`highlight-` option, such as `extractive|highlight-true`. Defaults\nto `None`.", + "type": { + "$ref": "34" + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7878", + "name": "semanticQuery", + "nameInRequest": "semanticQuery", + "doc": "Allows setting a separate search query that will be solely used for semantic\nreranking, semantic captions and semantic answers. Is useful for scenarios\nwhere there is a need to use different queries between the base retrieval and\nranking phase, and the L2 semantic phase.", + "type": { + "$id": "7879", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7880", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "7881", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "7882", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7883", + "name": "indexName", + "nameInRequest": "indexName", + "doc": "The name of the index.", + "type": { + "$id": "7884", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "7885", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "7886", + "kind": "constant", + "valueType": { + "$id": "7887", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "7888", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "1980" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/indexes('{indexName}')/docs", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Documents.searchGet", + "decorators": [], + "examples": [ + { + "$id": "7889", + "kind": "http", + "name": "SearchIndexSearchDocumentsGet", + "description": "SearchIndexSearchDocumentsGet", + "filePath": "2024-07-01/SearchIndexSearchDocumentsGet.json", + "parameters": [ + { + "$id": "7890", + "parameter": { + "$ref": "7883" + }, + "value": { + "$id": "7891", + "kind": "string", + "type": { + "$ref": "7884" + }, + "value": "myindex" + } + }, + { + "$id": "7892", + "parameter": { + "$ref": "7826" + }, + "value": { + "$id": "7893", + "kind": "string", + "type": { + "$ref": "7827" + }, + "value": "2024-07-01" + } + }, + { + "$id": "7894", + "parameter": { + "$ref": "7832" + }, + "value": { + "$id": "7895", + "kind": "boolean", + "type": { + "$ref": "7833" + }, + "value": true + } + }, + { + "$id": "7896", + "parameter": { + "$ref": "7834" + }, + "value": { + "$id": "7897", + "kind": "array", + "type": { + "$ref": "7835" + }, + "value": [ + { + "$id": "7898", + "kind": "string", + "type": { + "$ref": "7836" + }, + "value": "category,count:10,sort:count" + } + ] + } + }, + { + "$id": "7899", + "parameter": { + "$ref": "7837" + }, + "value": { + "$id": "7900", + "kind": "string", + "type": { + "$ref": "7838" + }, + "value": "rating gt 10" + } + }, + { + "$id": "7901", + "parameter": { + "$ref": "7839" + }, + "value": { + "$id": "7902", + "kind": "array", + "type": { + "$ref": "7840" + }, + "value": [ + { + "$id": "7903", + "kind": "string", + "type": { + "$ref": "7841" + }, + "value": "title" + } + ] + } + }, + { + "$id": "7904", + "parameter": { + "$ref": "7842" + }, + "value": { + "$id": "7905", + "kind": "string", + "type": { + "$ref": "7843" + }, + "value": "" + } + }, + { + "$id": "7906", + "parameter": { + "$ref": "7844" + }, + "value": { + "$id": "7907", + "kind": "string", + "type": { + "$ref": "7845" + }, + "value": "" + } + }, + { + "$id": "7908", + "parameter": { + "$ref": "7846" + }, + "value": { + "$id": "7909", + "kind": "number", + "type": { + "$ref": "7847" + }, + "value": 80 + } + }, + { + "$id": "7910", + "parameter": { + "$ref": "7848" + }, + "value": { + "$id": "7911", + "kind": "array", + "type": { + "$ref": "7849" + }, + "value": [ + { + "$id": "7912", + "kind": "string", + "type": { + "$ref": "7850" + }, + "value": "search.score() desc" + }, + { + "$id": "7913", + "kind": "string", + "type": { + "$ref": "7850" + }, + "value": "rating desc" + } + ] + } + }, + { + "$id": "7914", + "parameter": { + "$ref": "7851" + }, + "value": { + "$id": "7915", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "simple" + } + }, + { + "$id": "7916", + "parameter": { + "$ref": "7862" + }, + "value": { + "$id": "7917", + "kind": "string", + "type": { + "$ref": "7863" + }, + "value": "mysessionid" + } + }, + { + "$id": "7918", + "parameter": { + "$ref": "7861" + }, + "value": { + "$id": "7919", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "global" + } + }, + { + "$id": "7920", + "parameter": { + "$ref": "7855" + }, + "value": { + "$id": "7921", + "kind": "string", + "type": { + "$ref": "7856" + }, + "value": "sp" + } + }, + { + "$id": "7922", + "parameter": { + "$ref": "7830" + }, + "value": { + "$id": "7923", + "kind": "string", + "type": { + "$ref": "7831" + }, + "value": "nice hotels" + } + }, + { + "$id": "7924", + "parameter": { + "$ref": "7857" + }, + "value": { + "$id": "7925", + "kind": "array", + "type": { + "$ref": "7858" + }, + "value": [ + { + "$id": "7926", + "kind": "string", + "type": { + "$ref": "7859" + }, + "value": "title" + }, + { + "$id": "7927", + "kind": "string", + "type": { + "$ref": "7859" + }, + "value": "description" + } + ] + } + }, + { + "$id": "7928", + "parameter": { + "$ref": "7860" + }, + "value": { + "$id": "7929", + "kind": "string", + "type": { + "$ref": "10" + }, + "value": "any" + } + }, + { + "$id": "7930", + "parameter": { + "$ref": "7864" + }, + "value": { + "$id": "7931", + "kind": "array", + "type": { + "$ref": "7865" + }, + "value": [ + { + "$id": "7932", + "kind": "string", + "type": { + "$ref": "7866" + }, + "value": "docId" + }, + { + "$id": "7933", + "kind": "string", + "type": { + "$ref": "7866" + }, + "value": "title" + }, + { + "$id": "7934", + "kind": "string", + "type": { + "$ref": "7866" + }, + "value": "description" + } + ] + } + }, + { + "$id": "7935", + "parameter": { + "$ref": "7867" + }, + "value": { + "$id": "7936", + "kind": "number", + "type": { + "$ref": "7868" + }, + "value": 100 + } + }, + { + "$id": "7937", + "parameter": { + "$ref": "7869" + }, + "value": { + "$id": "7938", + "kind": "number", + "type": { + "$ref": "7870" + }, + "value": 10 + } + } + ], + "responses": [ + { + "$id": "7939", + "response": { + "$ref": "7888" + }, + "statusCode": 200, + "bodyValue": { + "$id": "7940", + "kind": "model", + "type": { + "$ref": "1980" + }, + "value": { + "$id": "7941", + "@odata.count": { + "$id": "7942", + "kind": "number", + "type": { + "$ref": "1982" + }, + "value": 25 + }, + "@search.coverage": { + "$id": "7943", + "kind": "number", + "type": { + "$ref": "1986" + }, + "value": 80 + }, + "@search.facets": { + "$id": "7944", + "kind": "dict", + "type": { + "$ref": "1990" + }, + "value": { + "$id": "7945", + "category": { + "$id": "7946", + "kind": "array", + "type": { + "$ref": "1992" + }, + "value": [ + { + "$id": "7947", + "kind": "model", + "type": { + "$ref": "1993" + }, + "value": { + "$id": "7948", + "count": { + "$id": "7949", + "kind": "number", + "type": { + "$ref": "1996" + }, + "value": 1 + } + }, + "additionalPropertiesValue": { + "$id": "7950", + "value": { + "$id": "7951", + "kind": "unknown", + "type": { + "$ref": "1994" + }, + "value": "Economy" + } + } + }, + { + "$id": "7952", + "kind": "model", + "type": { + "$ref": "1993" + }, + "value": { + "$id": "7953", + "count": { + "$id": "7954", + "kind": "number", + "type": { + "$ref": "1996" + }, + "value": 1 + } + }, + "additionalPropertiesValue": { + "$id": "7955", + "value": { + "$id": "7956", + "kind": "unknown", + "type": { + "$ref": "1994" + }, + "value": "Luxury" + } + } + } + ] + } + } + }, + "value": { + "$id": "7957", + "kind": "array", + "type": { + "$ref": "2177" + }, + "value": [ + { + "$id": "7958", + "kind": "model", + "type": { + "$ref": "2178" + }, + "value": { + "$id": "7959", + "@search.score": { + "$id": "7960", + "kind": "number", + "type": { + "$ref": "2181" + }, + "value": 1.5 + }, + "@search.highlights": { + "$id": "7961", + "kind": "dict", + "type": { + "$ref": "2189" + }, + "value": { + "$id": "7962", + "title": { + "$id": "7963", + "kind": "array", + "type": { + "$ref": "2191" + }, + "value": [ + { + "$id": "7964", + "kind": "string", + "type": { + "$ref": "2192" + }, + "value": "Nice Hotel" + } + ] + } + } + } + }, + "additionalPropertiesValue": { + "$id": "7965", + "description": { + "$id": "7966", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "Cheapest hotel in town" + }, + "docId": { + "$id": "7967", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "1" + }, + "title": { + "$id": "7968", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "Nice Hotel" + } + } + }, + { + "$id": "7969", + "kind": "model", + "type": { + "$ref": "2178" + }, + "value": { + "$id": "7970", + "@search.score": { + "$id": "7971", + "kind": "number", + "type": { + "$ref": "2181" + }, + "value": 0.7 + }, + "@search.highlights": { + "$id": "7972", + "kind": "dict", + "type": { + "$ref": "2189" + }, + "value": { + "$id": "7973", + "title": { + "$id": "7974", + "kind": "array", + "type": { + "$ref": "2191" + }, + "value": [ + { + "$id": "7975", + "kind": "string", + "type": { + "$ref": "2192" + }, + "value": "Fancy Hotel" + } + ] + } + } + } + }, + "additionalPropertiesValue": { + "$id": "7976", + "description": { + "$id": "7977", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "Best hotel in town" + }, + "docId": { + "$id": "7978", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "2" + }, + "title": { + "$id": "7979", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "Fancy Hotel" + } + } + } + ] + } + } + } + } + ] + }, + { + "$id": "7980", + "kind": "http", + "name": "SearchIndexSearchDocumentsSemanticGet", + "description": "SearchIndexSearchDocumentsSemanticGet", + "filePath": "2024-07-01/SearchIndexSearchDocumentsSemanticGet.json", + "parameters": [ + { + "$id": "7981", + "parameter": { + "$ref": "7883" + }, + "value": { + "$id": "7982", + "kind": "string", + "type": { + "$ref": "7884" + }, + "value": "myindex" + } + }, + { + "$id": "7983", + "parameter": { + "$ref": "7826" + }, + "value": { + "$id": "7984", + "kind": "string", + "type": { + "$ref": "7827" + }, + "value": "2024-07-01" + } + }, + { + "$id": "7985", + "parameter": { + "$ref": "7832" + }, + "value": { + "$id": "7986", + "kind": "boolean", + "type": { + "$ref": "7833" + }, + "value": true + } + }, + { + "$id": "7987", + "parameter": { + "$ref": "7842" + }, + "value": { + "$id": "7988", + "kind": "string", + "type": { + "$ref": "7843" + }, + "value": "" + } + }, + { + "$id": "7989", + "parameter": { + "$ref": "7844" + }, + "value": { + "$id": "7990", + "kind": "string", + "type": { + "$ref": "7845" + }, + "value": "" + } + }, + { + "$id": "7991", + "parameter": { + "$ref": "7851" + }, + "value": { + "$id": "7992", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "semantic" + } + }, + { + "$id": "7993", + "parameter": { + "$ref": "7830" + }, + "value": { + "$id": "7994", + "kind": "string", + "type": { + "$ref": "7831" + }, + "value": "how do clouds form" + } + }, + { + "$id": "7995", + "parameter": { + "$ref": "7871" + }, + "value": { + "$id": "7996", + "kind": "string", + "type": { + "$ref": "7872" + }, + "value": "my-semantic-config" + } + }, + { + "$id": "7997", + "parameter": { + "$ref": "7876" + }, + "value": { + "$id": "7998", + "kind": "string", + "type": { + "$ref": "28" + }, + "value": "extractive|count-3" + } + }, + { + "$id": "7999", + "parameter": { + "$ref": "7877" + }, + "value": { + "$id": "8000", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "extractive|highlight-true" + } + }, + { + "$id": "8001", + "parameter": { + "$ref": "7873" + }, + "value": { + "$id": "8002", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "partial" + } + }, + { + "$id": "8003", + "parameter": { + "$ref": "7874" + }, + "value": { + "$id": "8004", + "kind": "number", + "type": { + "$ref": "7875" + }, + "value": 780 + } + } + ], + "responses": [ + { + "$id": "8005", + "response": { + "$ref": "7888" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8006", + "kind": "model", + "type": { + "$ref": "1980" + }, + "value": { + "$id": "8007", + "@odata.count": { + "$id": "8008", + "kind": "number", + "type": { + "$ref": "1982" + }, + "value": 25 + }, + "@search.answers": { + "$id": "8009", + "kind": "array", + "type": { + "$ref": "2002" + }, + "value": [ + { + "$id": "8010", + "kind": "model", + "type": { + "$ref": "2003" + }, + "value": { + "$id": "8011", + "key": { + "$id": "8012", + "kind": "string", + "type": { + "$ref": "2010" + }, + "value": "4123" + }, + "text": { + "$id": "8013", + "kind": "string", + "type": { + "$ref": "2014" + }, + "value": "Sunlight heats the land all day, warming that moist air and causing it to rise high into the atmosphere until it cools and condenses into water droplets. Clouds generally form where air is ascending (over land in this case), but not where it is descending (over the river)." + }, + "highlights": { + "$id": "8014", + "kind": "string", + "type": { + "$ref": "2018" + }, + "value": "Sunlight heats the land all day, warming that moist air and causing it to rise high into the atmosphere until it cools and condenses into water droplets. Clouds generally form where air is ascending (over land in this case), but not where it is descending (over the river)." + }, + "score": { + "$id": "8015", + "kind": "number", + "type": { + "$ref": "2006" + }, + "value": 0.94639826 + } + } + } + ] + }, + "value": { + "$id": "8016", + "kind": "array", + "type": { + "$ref": "2177" + }, + "value": [ + { + "$id": "8017", + "kind": "model", + "type": { + "$ref": "2178" + }, + "value": { + "$id": "8018", + "@search.score": { + "$id": "8019", + "kind": "number", + "type": { + "$ref": "2181" + }, + "value": 0.5479723 + }, + "@search.rerankerScore": { + "$id": "8020", + "kind": "number", + "type": { + "$ref": "2185" + }, + "value": 1.0321671911515296 + }, + "@search.captions": { + "$id": "8021", + "kind": "array", + "type": { + "$ref": "2196" + }, + "value": [ + { + "$id": "8022", + "kind": "model", + "type": { + "$ref": "2197" + }, + "value": { + "$id": "8023", + "text": { + "$id": "8024", + "kind": "string", + "type": { + "$ref": "2200" + }, + "value": "Like all clouds, it forms when the air reaches its dew point—the temperature at which an air mass is cool enough for its water vapor to condense into liquid droplets. This false-color image shows valley fog, which is common in the Pacific Northwest of North America." + }, + "highlights": { + "$id": "8025", + "kind": "string", + "type": { + "$ref": "2204" + }, + "value": "Like all clouds, it forms when the air reaches its dew point—the temperature at which an air mass is cool enough for its water vapor to condense into liquid droplets. This false-color image shows valley fog, which is common in the Pacific Northwest of North America." + } + } + } + ] + } + }, + "additionalPropertiesValue": { + "$id": "8026", + "id": { + "$id": "8027", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "4123" + }, + "title": { + "$id": "8028", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "Earth Atmosphere" + }, + "content": { + "$id": "8029", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "Fog is essentially a cloud lying on the ground. Like all clouds, it forms when the air reaches its dew point—the temperature at \n\nwhich an air mass is cool enough for its water vapor to condense into liquid droplets.\n\nThis false-color image shows valley fog, which is common in the Pacific Northwest of North America. On clear winter nights, the \n\nground and overlying air cool off rapidly, especially at high elevations. Cold air is denser than warm air, and it sinks down into the \n\nvalleys. The moist air in the valleys gets chilled to its dew point, and fog forms. If undisturbed by winds, such fog may persist for \n\ndays. The Terra satellite captured this image of foggy valleys northeast of Vancouver in February 2010.\n\n\n" + }, + "locations": { + "$id": "8030", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": [ + "Pacific Northwest", + "North America", + "Vancouver" + ] + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "8031", + "name": "searchPost", + "resourceName": "Documents", + "doc": "Searches for documents in the index.", + "accessibility": "public", + "parameters": [ + { + "$id": "8032", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "8033", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "8034", + "type": { + "$id": "8035", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8036", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "8037", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "8038", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8039", + "name": "indexName", + "nameInRequest": "indexName", + "doc": "The name of the index.", + "type": { + "$id": "8040", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8041", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "8042", + "kind": "constant", + "valueType": { + "$id": "8043", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8044", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "8045", + "kind": "constant", + "valueType": { + "$id": "8046", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8047", + "name": "searchRequest", + "nameInRequest": "searchRequest", + "doc": "The definition of the Search request.", + "type": { + "$ref": "2024" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "8048", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "1980" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/indexes('{indexName}')/docs/search.post.search", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Documents.searchPost", + "decorators": [], + "examples": [ + { + "$id": "8049", + "kind": "http", + "name": "SearchIndexSearchDocumentsPost", + "description": "SearchIndexSearchDocumentsPost", + "filePath": "2024-07-01/SearchIndexSearchDocumentsPost.json", + "parameters": [ + { + "$id": "8050", + "parameter": { + "$ref": "8039" + }, + "value": { + "$id": "8051", + "kind": "string", + "type": { + "$ref": "8040" + }, + "value": "myindex" + } + }, + { + "$id": "8052", + "parameter": { + "$ref": "8032" + }, + "value": { + "$id": "8053", + "kind": "string", + "type": { + "$ref": "8033" + }, + "value": "2024-07-01" + } + }, + { + "$id": "8054", + "parameter": { + "$ref": "8047" + }, + "value": { + "$id": "8055", + "kind": "model", + "type": { + "$ref": "2024" + }, + "value": { + "$id": "8056", + "count": { + "$id": "8057", + "kind": "boolean", + "type": { + "$ref": "2026" + }, + "value": true + }, + "facets": { + "$id": "8058", + "kind": "array", + "type": { + "$ref": "2030" + }, + "value": [ + { + "$id": "8059", + "kind": "string", + "type": { + "$ref": "2031" + }, + "value": "category,count:10,sort:count" + } + ] + }, + "filter": { + "$id": "8060", + "kind": "string", + "type": { + "$ref": "2035" + }, + "value": "rating gt 4.0" + }, + "highlight": { + "$id": "8061", + "kind": "string", + "type": { + "$ref": "2039" + }, + "value": "description" + }, + "highlightPostTag": { + "$id": "8062", + "kind": "string", + "type": { + "$ref": "2043" + }, + "value": "" + }, + "highlightPreTag": { + "$id": "8063", + "kind": "string", + "type": { + "$ref": "2047" + }, + "value": "" + }, + "orderby": { + "$id": "8064", + "kind": "string", + "type": { + "$ref": "2055" + }, + "value": "rating desc" + }, + "queryType": { + "$id": "8065", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "simple" + }, + "scoringParameters": { + "$id": "8066", + "kind": "array", + "type": { + "$ref": "2069" + }, + "value": [ + { + "$id": "8067", + "kind": "string", + "type": { + "$ref": "2070" + }, + "value": "currentLocation--122.123,44.77233" + } + ] + }, + "scoringProfile": { + "$id": "8068", + "kind": "string", + "type": { + "$ref": "2074" + }, + "value": "sp" + }, + "search": { + "$id": "8069", + "kind": "string", + "type": { + "$ref": "2078" + }, + "value": "nice hotels" + }, + "searchFields": { + "$id": "8070", + "kind": "string", + "type": { + "$ref": "2082" + }, + "value": "category,description" + }, + "searchMode": { + "$id": "8071", + "kind": "string", + "type": { + "$ref": "10" + }, + "value": "any" + }, + "sessionId": { + "$id": "8072", + "kind": "string", + "type": { + "$ref": "2065" + }, + "value": "mysessionid" + }, + "scoringStatistics": { + "$id": "8073", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "global" + }, + "select": { + "$id": "8074", + "kind": "string", + "type": { + "$ref": "2089" + }, + "value": "hotelId,category,description" + }, + "skip": { + "$id": "8075", + "kind": "number", + "type": { + "$ref": "2093" + }, + "value": 0 + }, + "top": { + "$id": "8076", + "kind": "number", + "type": { + "$ref": "2097" + }, + "value": 10 + }, + "vectorQueries": { + "$id": "8077", + "kind": "array", + "type": { + "$ref": "2122" + }, + "value": [ + { + "$id": "8078", + "kind": "model", + "type": { + "$ref": "2148" + }, + "value": { + "$id": "8079", + "kind": { + "$id": "8080", + "kind": "string", + "type": { + "$ref": "2155" + }, + "value": "vector" + }, + "vector": { + "$id": "8081", + "kind": "array", + "type": { + "$ref": "2150" + }, + "value": [ + { + "$id": "8082", + "kind": "number", + "type": { + "$ref": "2151" + }, + "value": 0.103 + }, + { + "$id": "8083", + "kind": "number", + "type": { + "$ref": "2151" + }, + "value": 0.0712 + }, + { + "$id": "8084", + "kind": "number", + "type": { + "$ref": "2151" + }, + "value": 0.0852 + }, + { + "$id": "8085", + "kind": "number", + "type": { + "$ref": "2151" + }, + "value": 0.1547 + }, + { + "$id": "8086", + "kind": "number", + "type": { + "$ref": "2151" + }, + "value": 0.1183 + } + ] + }, + "fields": { + "$id": "8087", + "kind": "string", + "type": { + "$ref": "2132" + }, + "value": "descriptionEmbedding" + }, + "k": { + "$id": "8088", + "kind": "number", + "type": { + "$ref": "2128" + }, + "value": 5 + }, + "exhaustive": { + "$id": "8089", + "kind": "boolean", + "type": { + "$ref": "2136" + }, + "value": true + }, + "oversampling": { + "$id": "8090", + "kind": "number", + "type": { + "$ref": "2140" + }, + "value": 20 + }, + "weight": { + "$id": "8091", + "kind": "number", + "type": { + "$ref": "2144" + }, + "value": 2 + } + } + } + ] + }, + "vectorFilterMode": { + "$id": "8092", + "kind": "string", + "type": { + "$ref": "46" + }, + "value": "preFilter" + } + } + } + } + ], + "responses": [ + { + "$id": "8093", + "response": { + "$ref": "8048" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8094", + "kind": "model", + "type": { + "$ref": "1980" + }, + "value": { + "$id": "8095", + "@odata.count": { + "$id": "8096", + "kind": "number", + "type": { + "$ref": "1982" + }, + "value": 25 + }, + "@search.facets": { + "$id": "8097", + "kind": "dict", + "type": { + "$ref": "1990" + }, + "value": { + "$id": "8098", + "category": { + "$id": "8099", + "kind": "array", + "type": { + "$ref": "1992" + }, + "value": [ + { + "$id": "8100", + "kind": "model", + "type": { + "$ref": "1993" + }, + "value": { + "$id": "8101", + "count": { + "$id": "8102", + "kind": "number", + "type": { + "$ref": "1996" + }, + "value": 1 + } + }, + "additionalPropertiesValue": { + "$id": "8103", + "value": { + "$id": "8104", + "kind": "unknown", + "type": { + "$ref": "1994" + }, + "value": "Economy" + } + } + }, + { + "$id": "8105", + "kind": "model", + "type": { + "$ref": "1993" + }, + "value": { + "$id": "8106", + "count": { + "$id": "8107", + "kind": "number", + "type": { + "$ref": "1996" + }, + "value": 1 + } + }, + "additionalPropertiesValue": { + "$id": "8108", + "value": { + "$id": "8109", + "kind": "unknown", + "type": { + "$ref": "1994" + }, + "value": "Luxury" + } + } + } + ] + } + } + }, + "@search.nextPageParameters": { + "$id": "8110", + "kind": "model", + "type": { + "$ref": "2024" + }, + "value": { + "$id": "8111", + "count": { + "$id": "8112", + "kind": "boolean", + "type": { + "$ref": "2026" + }, + "value": true + }, + "facets": { + "$id": "8113", + "kind": "array", + "type": { + "$ref": "2030" + }, + "value": [ + { + "$id": "8114", + "kind": "string", + "type": { + "$ref": "2031" + }, + "value": "category,count:10,sort:count" + } + ] + }, + "filter": { + "$id": "8115", + "kind": "string", + "type": { + "$ref": "2035" + }, + "value": "rating gt 4.0" + }, + "highlight": { + "$id": "8116", + "kind": "string", + "type": { + "$ref": "2039" + }, + "value": "title" + }, + "highlightPostTag": { + "$id": "8117", + "kind": "string", + "type": { + "$ref": "2043" + }, + "value": "" + }, + "highlightPreTag": { + "$id": "8118", + "kind": "string", + "type": { + "$ref": "2047" + }, + "value": "" + }, + "orderby": { + "$id": "8119", + "kind": "string", + "type": { + "$ref": "2055" + }, + "value": "search.score() desc,rating desc" + }, + "queryType": { + "$id": "8120", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "simple" + }, + "sessionId": { + "$id": "8121", + "kind": "string", + "type": { + "$ref": "2065" + }, + "value": "mysessionid" + }, + "scoringStatistics": { + "$id": "8122", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "global" + }, + "scoringParameters": { + "$id": "8123", + "kind": "array", + "type": { + "$ref": "2069" + }, + "value": [ + { + "$id": "8124", + "kind": "string", + "type": { + "$ref": "2070" + }, + "value": "currentLocation--122.123,44.77233" + } + ] + }, + "scoringProfile": { + "$id": "8125", + "kind": "string", + "type": { + "$ref": "2074" + }, + "value": "sp" + }, + "search": { + "$id": "8126", + "kind": "string", + "type": { + "$ref": "2078" + }, + "value": "nice hotels" + }, + "searchFields": { + "$id": "8127", + "kind": "string", + "type": { + "$ref": "2082" + }, + "value": "title,description" + }, + "searchMode": { + "$id": "8128", + "kind": "string", + "type": { + "$ref": "10" + }, + "value": "any" + }, + "select": { + "$id": "8129", + "kind": "string", + "type": { + "$ref": "2089" + }, + "value": "docId,title,description" + }, + "skip": { + "$id": "8130", + "kind": "number", + "type": { + "$ref": "2093" + }, + "value": 2 + }, + "top": { + "$id": "8131", + "kind": "number", + "type": { + "$ref": "2097" + }, + "value": 8 + } + } + }, + "value": { + "$id": "8132", + "kind": "array", + "type": { + "$ref": "2177" + }, + "value": [ + { + "$id": "8133", + "kind": "model", + "type": { + "$ref": "2178" + }, + "value": { + "$id": "8134", + "@search.score": { + "$id": "8135", + "kind": "number", + "type": { + "$ref": "2181" + }, + "value": 1.5 + }, + "@search.highlights": { + "$id": "8136", + "kind": "dict", + "type": { + "$ref": "2189" + }, + "value": { + "$id": "8137", + "title": { + "$id": "8138", + "kind": "array", + "type": { + "$ref": "2191" + }, + "value": [ + { + "$id": "8139", + "kind": "string", + "type": { + "$ref": "2192" + }, + "value": "Nice Hotel" + } + ] + } + } + } + }, + "additionalPropertiesValue": { + "$id": "8140", + "description": { + "$id": "8141", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "Cheapest hotel in town" + }, + "docId": { + "$id": "8142", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "1" + }, + "title": { + "$id": "8143", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "Nice Hotel" + } + } + }, + { + "$id": "8144", + "kind": "model", + "type": { + "$ref": "2178" + }, + "value": { + "$id": "8145", + "@search.score": { + "$id": "8146", + "kind": "number", + "type": { + "$ref": "2181" + }, + "value": 0.7 + }, + "@search.highlights": { + "$id": "8147", + "kind": "dict", + "type": { + "$ref": "2189" + }, + "value": { + "$id": "8148", + "title": { + "$id": "8149", + "kind": "array", + "type": { + "$ref": "2191" + }, + "value": [ + { + "$id": "8150", + "kind": "string", + "type": { + "$ref": "2192" + }, + "value": "Fancy Hotel" + } + ] + } + } + } + }, + "additionalPropertiesValue": { + "$id": "8151", + "description": { + "$id": "8152", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "Best hotel in town" + }, + "docId": { + "$id": "8153", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "2" + }, + "title": { + "$id": "8154", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "Fancy Hotel" + } + } + } + ] + }, + "@odata.nextLink": { + "$id": "8155", + "kind": "string", + "type": { + "$ref": "2212" + }, + "value": "https://myservice.search.windows.net/indexes('myindex')/docs/search.post.search?api-version=2024-07-01" + } + } + } + } + ] + }, + { + "$id": "8156", + "kind": "http", + "name": "SearchIndexSearchDocumentsSemanticPost", + "description": "SearchIndexSearchDocumentsSemanticPost", + "filePath": "2024-07-01/SearchIndexSearchDocumentsSemanticPost.json", + "parameters": [ + { + "$id": "8157", + "parameter": { + "$ref": "8039" + }, + "value": { + "$id": "8158", + "kind": "string", + "type": { + "$ref": "8040" + }, + "value": "myindex" + } + }, + { + "$id": "8159", + "parameter": { + "$ref": "8032" + }, + "value": { + "$id": "8160", + "kind": "string", + "type": { + "$ref": "8033" + }, + "value": "2024-07-01" + } + }, + { + "$id": "8161", + "parameter": { + "$ref": "8047" + }, + "value": { + "$id": "8162", + "kind": "model", + "type": { + "$ref": "2024" + }, + "value": { + "$id": "8163", + "count": { + "$id": "8164", + "kind": "boolean", + "type": { + "$ref": "2026" + }, + "value": true + }, + "highlightPostTag": { + "$id": "8165", + "kind": "string", + "type": { + "$ref": "2043" + }, + "value": "" + }, + "highlightPreTag": { + "$id": "8166", + "kind": "string", + "type": { + "$ref": "2047" + }, + "value": "" + }, + "queryType": { + "$id": "8167", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "semantic" + }, + "search": { + "$id": "8168", + "kind": "string", + "type": { + "$ref": "2078" + }, + "value": "how do clouds form" + }, + "semanticConfiguration": { + "$id": "8169", + "kind": "string", + "type": { + "$ref": "2101" + }, + "value": "my-semantic-config" + }, + "answers": { + "$id": "8170", + "kind": "string", + "type": { + "$ref": "28" + }, + "value": "extractive|count-3" + }, + "captions": { + "$id": "8171", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "extractive|highlight-true" + }, + "semanticErrorHandling": { + "$id": "8172", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "partial" + }, + "semanticMaxWaitInMilliseconds": { + "$id": "8173", + "kind": "number", + "type": { + "$ref": "2108" + }, + "value": 780 + } + } + } + } + ], + "responses": [ + { + "$id": "8174", + "response": { + "$ref": "8048" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8175", + "kind": "model", + "type": { + "$ref": "1980" + }, + "value": { + "$id": "8176", + "@odata.count": { + "$id": "8177", + "kind": "number", + "type": { + "$ref": "1982" + }, + "value": 25 + }, + "@search.answers": { + "$id": "8178", + "kind": "array", + "type": { + "$ref": "2002" + }, + "value": [ + { + "$id": "8179", + "kind": "model", + "type": { + "$ref": "2003" + }, + "value": { + "$id": "8180", + "key": { + "$id": "8181", + "kind": "string", + "type": { + "$ref": "2010" + }, + "value": "4123" + }, + "text": { + "$id": "8182", + "kind": "string", + "type": { + "$ref": "2014" + }, + "value": "Sunlight heats the land all day, warming that moist air and causing it to rise high into the atmosphere until it cools and condenses into water droplets. Clouds generally form where air is ascending (over land in this case), but not where it is descending (over the river)." + }, + "highlights": { + "$id": "8183", + "kind": "string", + "type": { + "$ref": "2018" + }, + "value": "Sunlight heats the land all day, warming that moist air and causing it to rise high into the atmosphere until it cools and condenses into water droplets. Clouds generally form where air is ascending (over land in this case), but not where it is descending (over the river)." + }, + "score": { + "$id": "8184", + "kind": "number", + "type": { + "$ref": "2006" + }, + "value": 0.94639826 + } + } + } + ] + }, + "@search.nextPageParameters": { + "$id": "8185", + "kind": "model", + "type": { + "$ref": "2024" + }, + "value": { + "$id": "8186", + "count": { + "$id": "8187", + "kind": "boolean", + "type": { + "$ref": "2026" + }, + "value": true + }, + "highlightPostTag": { + "$id": "8188", + "kind": "string", + "type": { + "$ref": "2043" + }, + "value": "" + }, + "highlightPreTag": { + "$id": "8189", + "kind": "string", + "type": { + "$ref": "2047" + }, + "value": "" + }, + "queryType": { + "$id": "8190", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "semantic" + }, + "search": { + "$id": "8191", + "kind": "string", + "type": { + "$ref": "2078" + }, + "value": "how do clouds form" + }, + "semanticConfiguration": { + "$id": "8192", + "kind": "string", + "type": { + "$ref": "2101" + }, + "value": "my-semantic-config" + }, + "answers": { + "$id": "8193", + "kind": "string", + "type": { + "$ref": "28" + }, + "value": "extractive|count-3" + }, + "captions": { + "$id": "8194", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "extractive|highlight-true" + }, + "semanticErrorHandling": { + "$id": "8195", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "partial" + }, + "semanticMaxWaitInMilliseconds": { + "$id": "8196", + "kind": "number", + "type": { + "$ref": "2108" + }, + "value": 780 + }, + "skip": { + "$id": "8197", + "kind": "number", + "type": { + "$ref": "2093" + }, + "value": 2 + }, + "top": { + "$id": "8198", + "kind": "number", + "type": { + "$ref": "2097" + }, + "value": 8 + } + } + }, + "value": { + "$id": "8199", + "kind": "array", + "type": { + "$ref": "2177" + }, + "value": [ + { + "$id": "8200", + "kind": "model", + "type": { + "$ref": "2178" + }, + "value": { + "$id": "8201", + "@search.score": { + "$id": "8202", + "kind": "number", + "type": { + "$ref": "2181" + }, + "value": 0.5479723 + }, + "@search.rerankerScore": { + "$id": "8203", + "kind": "number", + "type": { + "$ref": "2185" + }, + "value": 1.0321671911515296 + }, + "@search.captions": { + "$id": "8204", + "kind": "array", + "type": { + "$ref": "2196" + }, + "value": [ + { + "$id": "8205", + "kind": "model", + "type": { + "$ref": "2197" + }, + "value": { + "$id": "8206", + "text": { + "$id": "8207", + "kind": "string", + "type": { + "$ref": "2200" + }, + "value": "Like all clouds, it forms when the air reaches its dew point—the temperature at which an air mass is cool enough for its water vapor to condense into liquid droplets. This false-color image shows valley fog, which is common in the Pacific Northwest of North America." + }, + "highlights": { + "$id": "8208", + "kind": "string", + "type": { + "$ref": "2204" + }, + "value": "Like all clouds, it forms when the air reaches its dew point—the temperature at which an air mass is cool enough for its water vapor to condense into liquid droplets. This false-color image shows valley fog, which is common in the Pacific Northwest of North America." + } + } + } + ] + } + }, + "additionalPropertiesValue": { + "$id": "8209", + "id": { + "$id": "8210", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "4123" + }, + "title": { + "$id": "8211", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "Earth Atmosphere" + }, + "content": { + "$id": "8212", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": "Fog is essentially a cloud lying on the ground. Like all clouds, it forms when the air reaches its dew point—the temperature at \n\nwhich an air mass is cool enough for its water vapor to condense into liquid droplets.\n\nThis false-color image shows valley fog, which is common in the Pacific Northwest of North America. On clear winter nights, the \n\nground and overlying air cool off rapidly, especially at high elevations. Cold air is denser than warm air, and it sinks down into the \n\nvalleys. The moist air in the valleys gets chilled to its dew point, and fog forms. If undisturbed by winds, such fog may persist for \n\ndays. The Terra satellite captured this image of foggy valleys northeast of Vancouver in February 2010.\n\n\n" + }, + "locations": { + "$id": "8213", + "kind": "unknown", + "type": { + "$ref": "2179" + }, + "value": [ + "Pacific Northwest", + "North America", + "Vancouver" + ] + } + } + } + ] + }, + "@odata.nextLink": { + "$id": "8214", + "kind": "string", + "type": { + "$ref": "2212" + }, + "value": "https://myservice.search.windows.net/indexes('myindex')/docs/search.post.search?api-version=2024-07-01" + } + } + } + } + ] + } + ] + }, + { + "$id": "8215", + "name": "get", + "resourceName": "Documents", + "doc": "Retrieves a document from the index.", + "accessibility": "public", + "parameters": [ + { + "$id": "8216", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "8217", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "8218", + "type": { + "$id": "8219", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8220", + "name": "key", + "nameInRequest": "key", + "doc": "The key of the document to retrieve.", + "type": { + "$id": "8221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8222", + "name": "selectedFields", + "nameInRequest": "$select", + "doc": "List of field names to retrieve for the document; Any field not retrieved will\nbe missing from the returned document.", + "type": { + "$id": "8223", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "8224", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8225", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "8226", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "8227", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8228", + "name": "indexName", + "nameInRequest": "indexName", + "doc": "The name of the index.", + "type": { + "$id": "8229", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8230", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "8231", + "kind": "constant", + "valueType": { + "$id": "8232", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "8233", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "2221" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/indexes('{indexName}')/docs('{key}')", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Documents.get", + "decorators": [], + "examples": [ + { + "$id": "8234", + "kind": "http", + "name": "SearchIndexGetDocument", + "description": "SearchIndexGetDocument", + "filePath": "2024-07-01/SearchIndexGetDocument.json", + "parameters": [ + { + "$id": "8235", + "parameter": { + "$ref": "8228" + }, + "value": { + "$id": "8236", + "kind": "string", + "type": { + "$ref": "8229" + }, + "value": "getdocumentexample" + } + }, + { + "$id": "8237", + "parameter": { + "$ref": "8220" + }, + "value": { + "$id": "8238", + "kind": "string", + "type": { + "$ref": "8221" + }, + "value": "1" + } + }, + { + "$id": "8239", + "parameter": { + "$ref": "8222" + }, + "value": { + "$id": "8240", + "kind": "array", + "type": { + "$ref": "8223" + }, + "value": [ + { + "$id": "8241", + "kind": "string", + "type": { + "$ref": "8224" + }, + "value": "docId" + }, + { + "$id": "8242", + "kind": "string", + "type": { + "$ref": "8224" + }, + "value": "title" + }, + { + "$id": "8243", + "kind": "string", + "type": { + "$ref": "8224" + }, + "value": "description" + } + ] + } + }, + { + "$id": "8244", + "parameter": { + "$ref": "8216" + }, + "value": { + "$id": "8245", + "kind": "string", + "type": { + "$ref": "8217" + }, + "value": "2024-07-01" + } + }, + { + "$id": "8246", + "parameter": { + "$ref": "8225" + }, + "value": { + "$id": "8247", + "kind": "string", + "type": { + "$ref": "8226" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + ], + "responses": [ + { + "$id": "8248", + "response": { + "$ref": "8233" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8249", + "kind": "model", + "type": { + "$ref": "2221" + }, + "value": { + "$id": "8250" + }, + "additionalPropertiesValue": { + "$id": "8251", + "docId": { + "$id": "8252", + "kind": "unknown", + "type": { + "$ref": "2222" + }, + "value": "1" + }, + "title": { + "$id": "8253", + "kind": "unknown", + "type": { + "$ref": "2222" + }, + "value": "Nice Hotel" + }, + "description": { + "$id": "8254", + "kind": "unknown", + "type": { + "$ref": "2222" + }, + "value": "Cheapest hotel in town" + } + } + } + } + ] + } + ] + }, + { + "$id": "8255", + "name": "suggestGet", + "resourceName": "Documents", + "doc": "Suggests documents in the index that match the given partial query text.", + "accessibility": "public", + "parameters": [ + { + "$id": "8256", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "8257", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "8258", + "type": { + "$id": "8259", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8260", + "name": "searchText", + "nameInRequest": "search", + "doc": "The search text to use to suggest documents. Must be at least 1 character, and\nno more than 100 characters.", + "type": { + "$id": "8261", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8262", + "name": "suggesterName", + "nameInRequest": "suggesterName", + "doc": "The name of the suggester as specified in the suggesters collection that's part\nof the index definition.", + "type": { + "$id": "8263", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8264", + "name": "$filter", + "nameInRequest": "$filter", + "doc": "An OData expression that filters the documents considered for suggestions.", + "type": { + "$id": "8265", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8266", + "name": "useFuzzyMatching", + "nameInRequest": "fuzzy", + "doc": "A value indicating whether to use fuzzy matching for the suggestions query.\nDefault is false. When set to true, the query will find terms even if there's a\nsubstituted or missing character in the search text. While this provides a\nbetter experience in some scenarios, it comes at a performance cost as fuzzy\nsuggestions queries are slower and consume more resources.", + "type": { + "$id": "8267", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8268", + "name": "highlightPostTag", + "nameInRequest": "highlightPostTag", + "doc": "A string tag that is appended to hit highlights. Must be set with\nhighlightPreTag. If omitted, hit highlighting of suggestions is disabled.", + "type": { + "$id": "8269", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8270", + "name": "highlightPreTag", + "nameInRequest": "highlightPreTag", + "doc": "A string tag that is prepended to hit highlights. Must be set with\nhighlightPostTag. If omitted, hit highlighting of suggestions is disabled.", + "type": { + "$id": "8271", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8272", + "name": "minimumCoverage", + "nameInRequest": "minimumCoverage", + "doc": "A number between 0 and 100 indicating the percentage of the index that must be\ncovered by a suggestions query in order for the query to be reported as a\nsuccess. This parameter can be useful for ensuring search availability even for\nservices with only one replica. The default is 80.", + "type": { + "$id": "8273", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8274", + "name": "orderBy", + "nameInRequest": "$orderby", + "doc": "The list of OData $orderby expressions by which to sort the results. Each\nexpression can be either a field name or a call to either the geo.distance() or\nthe search.score() functions. Each expression can be followed by asc to\nindicate ascending, or desc to indicate descending. The default is ascending\norder. Ties will be broken by the match scores of documents. If no $orderby is\nspecified, the default sort order is descending by document match score. There\ncan be at most 32 $orderby clauses.", + "type": { + "$id": "8275", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "8276", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8277", + "name": "searchFields", + "nameInRequest": "searchFields", + "doc": "The list of field names to search for the specified search text. Target fields\nmust be included in the specified suggester.", + "type": { + "$id": "8278", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "8279", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8280", + "name": "$select", + "nameInRequest": "$select", + "doc": "The list of fields to retrieve. If unspecified, only the key field will be\nincluded in the results.", + "type": { + "$id": "8281", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "8282", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8283", + "name": "$top", + "nameInRequest": "$top", + "doc": "The number of suggestions to retrieve. The value must be a number between 1 and\n100. The default is 5.", + "type": { + "$id": "8284", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8285", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "8286", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "8287", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8288", + "name": "indexName", + "nameInRequest": "indexName", + "doc": "The name of the index.", + "type": { + "$id": "8289", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8290", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "8291", + "kind": "constant", + "valueType": { + "$id": "8292", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "8293", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "2223" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/indexes('{indexName}')/docs/search.suggest", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Documents.suggestGet", + "decorators": [], + "examples": [ + { + "$id": "8294", + "kind": "http", + "name": "SearchIndexSuggestDocumentsGet", + "description": "SearchIndexSuggestDocumentsGet", + "filePath": "2024-07-01/SearchIndexSuggestDocumentsGet.json", + "parameters": [ + { + "$id": "8295", + "parameter": { + "$ref": "8288" + }, + "value": { + "$id": "8296", + "kind": "string", + "type": { + "$ref": "8289" + }, + "value": "myindex" + } + }, + { + "$id": "8297", + "parameter": { + "$ref": "8256" + }, + "value": { + "$id": "8298", + "kind": "string", + "type": { + "$ref": "8257" + }, + "value": "2024-07-01" + } + }, + { + "$id": "8299", + "parameter": { + "$ref": "8264" + }, + "value": { + "$id": "8300", + "kind": "string", + "type": { + "$ref": "8265" + }, + "value": "rating gt 10" + } + }, + { + "$id": "8301", + "parameter": { + "$ref": "8266" + }, + "value": { + "$id": "8302", + "kind": "boolean", + "type": { + "$ref": "8267" + }, + "value": false + } + }, + { + "$id": "8303", + "parameter": { + "$ref": "8268" + }, + "value": { + "$id": "8304", + "kind": "string", + "type": { + "$ref": "8269" + }, + "value": "" + } + }, + { + "$id": "8305", + "parameter": { + "$ref": "8270" + }, + "value": { + "$id": "8306", + "kind": "string", + "type": { + "$ref": "8271" + }, + "value": "" + } + }, + { + "$id": "8307", + "parameter": { + "$ref": "8272" + }, + "value": { + "$id": "8308", + "kind": "number", + "type": { + "$ref": "8273" + }, + "value": 80 + } + }, + { + "$id": "8309", + "parameter": { + "$ref": "8274" + }, + "value": { + "$id": "8310", + "kind": "array", + "type": { + "$ref": "8275" + }, + "value": [ + { + "$id": "8311", + "kind": "string", + "type": { + "$ref": "8276" + }, + "value": "search.score() desc" + }, + { + "$id": "8312", + "kind": "string", + "type": { + "$ref": "8276" + }, + "value": "rating desc" + } + ] + } + }, + { + "$id": "8313", + "parameter": { + "$ref": "8260" + }, + "value": { + "$id": "8314", + "kind": "string", + "type": { + "$ref": "8261" + }, + "value": "hote" + } + }, + { + "$id": "8315", + "parameter": { + "$ref": "8277" + }, + "value": { + "$id": "8316", + "kind": "array", + "type": { + "$ref": "8278" + }, + "value": [ + { + "$id": "8317", + "kind": "string", + "type": { + "$ref": "8279" + }, + "value": "title" + } + ] + } + }, + { + "$id": "8318", + "parameter": { + "$ref": "8262" + }, + "value": { + "$id": "8319", + "kind": "string", + "type": { + "$ref": "8263" + }, + "value": "sg" + } + }, + { + "$id": "8320", + "parameter": { + "$ref": "8280" + }, + "value": { + "$id": "8321", + "kind": "array", + "type": { + "$ref": "8281" + }, + "value": [ + { + "$id": "8322", + "kind": "string", + "type": { + "$ref": "8282" + }, + "value": "docId" + }, + { + "$id": "8323", + "kind": "string", + "type": { + "$ref": "8282" + }, + "value": "title" + }, + { + "$id": "8324", + "kind": "string", + "type": { + "$ref": "8282" + }, + "value": "description" + } + ] + } + }, + { + "$id": "8325", + "parameter": { + "$ref": "8283" + }, + "value": { + "$id": "8326", + "kind": "number", + "type": { + "$ref": "8284" + }, + "value": 10 + } + } + ], + "responses": [ + { + "$id": "8327", + "response": { + "$ref": "8293" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8328", + "kind": "model", + "type": { + "$ref": "2223" + }, + "value": { + "$id": "8329", + "value": { + "$id": "8330", + "kind": "array", + "type": { + "$ref": "2225" + }, + "value": [ + { + "$id": "8331", + "kind": "model", + "type": { + "$ref": "2226" + }, + "value": { + "$id": "8332", + "@search.text": { + "$id": "8333", + "kind": "string", + "type": { + "$ref": "2229" + }, + "value": "Nice Hotel" + } + }, + "additionalPropertiesValue": { + "$id": "8334", + "description": { + "$id": "8335", + "kind": "unknown", + "type": { + "$ref": "2227" + }, + "value": "Cheapest hotel in town" + }, + "docId": { + "$id": "8336", + "kind": "unknown", + "type": { + "$ref": "2227" + }, + "value": "1" + }, + "title": { + "$id": "8337", + "kind": "unknown", + "type": { + "$ref": "2227" + }, + "value": "Nice Hotel" + } + } + }, + { + "$id": "8338", + "kind": "model", + "type": { + "$ref": "2226" + }, + "value": { + "$id": "8339", + "@search.text": { + "$id": "8340", + "kind": "string", + "type": { + "$ref": "2229" + }, + "value": "Fancy Hotel" + } + }, + "additionalPropertiesValue": { + "$id": "8341", + "description": { + "$id": "8342", + "kind": "unknown", + "type": { + "$ref": "2227" + }, + "value": "Best hotel in town" + }, + "docId": { + "$id": "8343", + "kind": "unknown", + "type": { + "$ref": "2227" + }, + "value": "2" + }, + "title": { + "$id": "8344", + "kind": "unknown", + "type": { + "$ref": "2227" + }, + "value": "Fancy Hotel" + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "8345", + "name": "suggestPost", + "resourceName": "Documents", + "doc": "Suggests documents in the index that match the given partial query text.", + "accessibility": "public", + "parameters": [ + { + "$id": "8346", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "8347", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "8348", + "type": { + "$id": "8349", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8350", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "8351", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "8352", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8353", + "name": "indexName", + "nameInRequest": "indexName", + "doc": "The name of the index.", + "type": { + "$id": "8354", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8355", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "8356", + "kind": "constant", + "valueType": { + "$id": "8357", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8358", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "8359", + "kind": "constant", + "valueType": { + "$id": "8360", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8361", + "name": "suggestRequest", + "nameInRequest": "suggestRequest", + "doc": "The Suggest request.", + "type": { + "$ref": "2238" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "8362", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "2223" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/indexes('{indexName}')/docs/search.post.suggest", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Documents.suggestPost", + "decorators": [], + "examples": [ + { + "$id": "8363", + "kind": "http", + "name": "SearchIndexSuggestDocumentsPost", + "description": "SearchIndexSuggestDocumentsPost", + "filePath": "2024-07-01/SearchIndexSuggestDocumentsPost.json", + "parameters": [ + { + "$id": "8364", + "parameter": { + "$ref": "8353" + }, + "value": { + "$id": "8365", + "kind": "string", + "type": { + "$ref": "8354" + }, + "value": "myindex" + } + }, + { + "$id": "8366", + "parameter": { + "$ref": "8346" + }, + "value": { + "$id": "8367", + "kind": "string", + "type": { + "$ref": "8347" + }, + "value": "2024-07-01" + } + }, + { + "$id": "8368", + "parameter": { + "$ref": "8361" + }, + "value": { + "$id": "8369", + "kind": "model", + "type": { + "$ref": "2238" + }, + "value": { + "$id": "8370", + "filter": { + "$id": "8371", + "kind": "string", + "type": { + "$ref": "2240" + }, + "value": "rating gt 4.0" + }, + "highlightPostTag": { + "$id": "8372", + "kind": "string", + "type": { + "$ref": "2248" + }, + "value": "" + }, + "highlightPreTag": { + "$id": "8373", + "kind": "string", + "type": { + "$ref": "2252" + }, + "value": "" + }, + "minimumCoverage": { + "$id": "8374", + "kind": "number", + "type": { + "$ref": "2256" + }, + "value": 80 + }, + "orderby": { + "$id": "8375", + "kind": "string", + "type": { + "$ref": "2260" + }, + "value": "rating desc" + }, + "search": { + "$id": "8376", + "kind": "string", + "type": { + "$ref": "2264" + }, + "value": "hote" + }, + "searchFields": { + "$id": "8377", + "kind": "string", + "type": { + "$ref": "2268" + }, + "value": "title" + }, + "select": { + "$id": "8378", + "kind": "string", + "type": { + "$ref": "2272" + }, + "value": "docId,title,description" + }, + "suggesterName": { + "$id": "8379", + "kind": "string", + "type": { + "$ref": "2276" + }, + "value": "sg" + }, + "top": { + "$id": "8380", + "kind": "number", + "type": { + "$ref": "2280" + }, + "value": 10 + } + } + } + } + ], + "responses": [ + { + "$id": "8381", + "response": { + "$ref": "8362" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8382", + "kind": "model", + "type": { + "$ref": "2223" + }, + "value": { + "$id": "8383", + "value": { + "$id": "8384", + "kind": "array", + "type": { + "$ref": "2225" + }, + "value": [ + { + "$id": "8385", + "kind": "model", + "type": { + "$ref": "2226" + }, + "value": { + "$id": "8386", + "@search.text": { + "$id": "8387", + "kind": "string", + "type": { + "$ref": "2229" + }, + "value": "Nice Hotel" + } + }, + "additionalPropertiesValue": { + "$id": "8388", + "description": { + "$id": "8389", + "kind": "unknown", + "type": { + "$ref": "2227" + }, + "value": "Cheapest hotel in town" + }, + "docId": { + "$id": "8390", + "kind": "unknown", + "type": { + "$ref": "2227" + }, + "value": "1" + }, + "title": { + "$id": "8391", + "kind": "unknown", + "type": { + "$ref": "2227" + }, + "value": "Nice Hotel" + } + } + }, + { + "$id": "8392", + "kind": "model", + "type": { + "$ref": "2226" + }, + "value": { + "$id": "8393", + "@search.text": { + "$id": "8394", + "kind": "string", + "type": { + "$ref": "2229" + }, + "value": "Fancy Hotel" + } + }, + "additionalPropertiesValue": { + "$id": "8395", + "description": { + "$id": "8396", + "kind": "unknown", + "type": { + "$ref": "2227" + }, + "value": "Best hotel in town" + }, + "docId": { + "$id": "8397", + "kind": "unknown", + "type": { + "$ref": "2227" + }, + "value": "2" + }, + "title": { + "$id": "8398", + "kind": "unknown", + "type": { + "$ref": "2227" + }, + "value": "Fancy Hotel" + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "8399", + "name": "index", + "resourceName": "Documents", + "doc": "Sends a batch of document write actions to the index.", + "accessibility": "public", + "parameters": [ + { + "$id": "8400", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "8401", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "8402", + "type": { + "$id": "8403", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8404", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "8405", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "8406", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8407", + "name": "indexName", + "nameInRequest": "indexName", + "doc": "The name of the index.", + "type": { + "$id": "8408", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8409", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "8410", + "kind": "constant", + "valueType": { + "$id": "8411", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8412", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "8413", + "kind": "constant", + "valueType": { + "$id": "8414", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8415", + "name": "batch", + "nameInRequest": "batch", + "doc": "The batch of index actions.", + "type": { + "$ref": "2283" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "8416", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "2293" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "8417", + "statusCodes": [ + 207 + ], + "bodyType": { + "$ref": "2293" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/indexes('{indexName}')/docs/search.index", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Documents.index", + "decorators": [], + "examples": [ + { + "$id": "8418", + "kind": "http", + "name": "SearchIndexIndexDocuments", + "description": "SearchIndexIndexDocuments", + "filePath": "2024-07-01/SearchIndexIndexDocuments.json", + "parameters": [ + { + "$id": "8419", + "parameter": { + "$ref": "8407" + }, + "value": { + "$id": "8420", + "kind": "string", + "type": { + "$ref": "8408" + }, + "value": "indexdocumentsexample" + } + }, + { + "$id": "8421", + "parameter": { + "$ref": "8400" + }, + "value": { + "$id": "8422", + "kind": "string", + "type": { + "$ref": "8401" + }, + "value": "2024-07-01" + } + }, + { + "$id": "8423", + "parameter": { + "$ref": "8404" + }, + "value": { + "$id": "8424", + "kind": "string", + "type": { + "$ref": "8405" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + }, + { + "$id": "8425", + "parameter": { + "$ref": "8415" + }, + "value": { + "$id": "8426", + "kind": "model", + "type": { + "$ref": "2283" + }, + "value": { + "$id": "8427", + "value": { + "$id": "8428", + "kind": "array", + "type": { + "$ref": "2285" + }, + "value": [ + { + "$id": "8429", + "kind": "model", + "type": { + "$ref": "2286" + }, + "value": { + "$id": "8430", + "@search.action": { + "$id": "8431", + "kind": "string", + "type": { + "$ref": "66" + }, + "value": "upload" + } + }, + "additionalPropertiesValue": { + "$id": "8432", + "docId": { + "$id": "8433", + "kind": "unknown", + "type": { + "$ref": "2287" + }, + "value": "1" + }, + "title": { + "$id": "8434", + "kind": "unknown", + "type": { + "$ref": "2287" + }, + "value": "Fancy Stay" + }, + "description": { + "$id": "8435", + "kind": "unknown", + "type": { + "$ref": "2287" + }, + "value": "Best hotel in town" + } + } + }, + { + "$id": "8436", + "kind": "model", + "type": { + "$ref": "2286" + }, + "value": { + "$id": "8437", + "@search.action": { + "$id": "8438", + "kind": "string", + "type": { + "$ref": "66" + }, + "value": "merge" + } + }, + "additionalPropertiesValue": { + "$id": "8439", + "docId": { + "$id": "8440", + "kind": "unknown", + "type": { + "$ref": "2287" + }, + "value": "2" + }, + "title": { + "$id": "8441", + "kind": "unknown", + "type": { + "$ref": "2287" + }, + "value": "Roach Motel" + } + } + }, + { + "$id": "8442", + "kind": "model", + "type": { + "$ref": "2286" + }, + "value": { + "$id": "8443", + "@search.action": { + "$id": "8444", + "kind": "string", + "type": { + "$ref": "66" + }, + "value": "mergeOrUpload" + } + }, + "additionalPropertiesValue": { + "$id": "8445", + "docId": { + "$id": "8446", + "kind": "unknown", + "type": { + "$ref": "2287" + }, + "value": "3" + }, + "title": { + "$id": "8447", + "kind": "unknown", + "type": { + "$ref": "2287" + }, + "value": "Econo Motel" + } + } + }, + { + "$id": "8448", + "kind": "model", + "type": { + "$ref": "2286" + }, + "value": { + "$id": "8449", + "@search.action": { + "$id": "8450", + "kind": "string", + "type": { + "$ref": "66" + }, + "value": "delete" + } + }, + "additionalPropertiesValue": { + "$id": "8451", + "docId": { + "$id": "8452", + "kind": "unknown", + "type": { + "$ref": "2287" + }, + "value": "4" + } + } + } + ] + } + } + } + } + ], + "responses": [ + { + "$id": "8453", + "response": { + "$ref": "8416" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8454", + "kind": "model", + "type": { + "$ref": "2293" + }, + "value": { + "$id": "8455", + "value": { + "$id": "8456", + "kind": "array", + "type": { + "$ref": "2295" + }, + "value": [ + { + "$id": "8457", + "kind": "model", + "type": { + "$ref": "2296" + }, + "value": { + "$id": "8458", + "key": { + "$id": "8459", + "kind": "string", + "type": { + "$ref": "2298" + }, + "value": "1" + }, + "status": { + "$id": "8460", + "kind": "boolean", + "type": { + "$ref": "2306" + }, + "value": true + }, + "statusCode": { + "$id": "8461", + "kind": "number", + "type": { + "$ref": "2310" + }, + "value": 200 + } + } + }, + { + "$id": "8462", + "kind": "model", + "type": { + "$ref": "2296" + }, + "value": { + "$id": "8463", + "key": { + "$id": "8464", + "kind": "string", + "type": { + "$ref": "2298" + }, + "value": "2" + }, + "status": { + "$id": "8465", + "kind": "boolean", + "type": { + "$ref": "2306" + }, + "value": true + }, + "statusCode": { + "$id": "8466", + "kind": "number", + "type": { + "$ref": "2310" + }, + "value": 200 + } + } + }, + { + "$id": "8467", + "kind": "model", + "type": { + "$ref": "2296" + }, + "value": { + "$id": "8468", + "key": { + "$id": "8469", + "kind": "string", + "type": { + "$ref": "2298" + }, + "value": "3" + }, + "status": { + "$id": "8470", + "kind": "boolean", + "type": { + "$ref": "2306" + }, + "value": true + }, + "statusCode": { + "$id": "8471", + "kind": "number", + "type": { + "$ref": "2310" + }, + "value": 200 + } + } + }, + { + "$id": "8472", + "kind": "model", + "type": { + "$ref": "2296" + }, + "value": { + "$id": "8473", + "key": { + "$id": "8474", + "kind": "string", + "type": { + "$ref": "2298" + }, + "value": "4" + }, + "status": { + "$id": "8475", + "kind": "boolean", + "type": { + "$ref": "2306" + }, + "value": true + }, + "statusCode": { + "$id": "8476", + "kind": "number", + "type": { + "$ref": "2310" + }, + "value": 200 + } + } + } + ] + } + } + } + }, + { + "$id": "8477", + "response": { + "$ref": "8417" + }, + "statusCode": 207, + "bodyValue": { + "$id": "8478", + "kind": "model", + "type": { + "$ref": "2293" + }, + "value": { + "$id": "8479", + "value": { + "$id": "8480", + "kind": "array", + "type": { + "$ref": "2295" + }, + "value": [ + { + "$id": "8481", + "kind": "model", + "type": { + "$ref": "2296" + }, + "value": { + "$id": "8482", + "key": { + "$id": "8483", + "kind": "string", + "type": { + "$ref": "2298" + }, + "value": "1" + }, + "status": { + "$id": "8484", + "kind": "boolean", + "type": { + "$ref": "2306" + }, + "value": true + }, + "statusCode": { + "$id": "8485", + "kind": "number", + "type": { + "$ref": "2310" + }, + "value": 201 + } + } + }, + { + "$id": "8486", + "kind": "model", + "type": { + "$ref": "2296" + }, + "value": { + "$id": "8487", + "key": { + "$id": "8488", + "kind": "string", + "type": { + "$ref": "2298" + }, + "value": "2" + }, + "status": { + "$id": "8489", + "kind": "boolean", + "type": { + "$ref": "2306" + }, + "value": false + }, + "errorMessage": { + "$id": "8490", + "kind": "string", + "type": { + "$ref": "2302" + }, + "value": "Document not found." + }, + "statusCode": { + "$id": "8491", + "kind": "number", + "type": { + "$ref": "2310" + }, + "value": 404 + } + } + }, + { + "$id": "8492", + "kind": "model", + "type": { + "$ref": "2296" + }, + "value": { + "$id": "8493", + "key": { + "$id": "8494", + "kind": "string", + "type": { + "$ref": "2298" + }, + "value": "3" + }, + "status": { + "$id": "8495", + "kind": "boolean", + "type": { + "$ref": "2306" + }, + "value": true + }, + "statusCode": { + "$id": "8496", + "kind": "number", + "type": { + "$ref": "2310" + }, + "value": 201 + } + } + }, + { + "$id": "8497", + "kind": "model", + "type": { + "$ref": "2296" + }, + "value": { + "$id": "8498", + "key": { + "$id": "8499", + "kind": "string", + "type": { + "$ref": "2298" + }, + "value": "4" + }, + "status": { + "$id": "8500", + "kind": "boolean", + "type": { + "$ref": "2306" + }, + "value": true + }, + "statusCode": { + "$id": "8501", + "kind": "number", + "type": { + "$ref": "2310" + }, + "value": 200 + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "8502", + "name": "autocompleteGet", + "resourceName": "Documents", + "doc": "Autocompletes incomplete query terms based on input text and matching terms in\nthe index.", + "accessibility": "public", + "parameters": [ + { + "$id": "8503", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "8504", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "8505", + "type": { + "$id": "8506", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8507", + "name": "searchText", + "nameInRequest": "search", + "doc": "The incomplete term which should be auto-completed.", + "type": { + "$id": "8508", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8509", + "name": "suggesterName", + "nameInRequest": "suggesterName", + "doc": "The name of the suggester as specified in the suggesters collection that's part\nof the index definition.", + "type": { + "$id": "8510", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8511", + "name": "autocompleteMode", + "nameInRequest": "autocompleteMode", + "doc": "Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms'\nto get shingles and 'oneTermWithContext' to use the current context while\nproducing auto-completed terms.", + "type": { + "$ref": "76" + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8512", + "name": "$filter", + "nameInRequest": "$filter", + "doc": "An OData expression that filters the documents used to produce completed terms\nfor the Autocomplete result.", + "type": { + "$id": "8513", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8514", + "name": "useFuzzyMatching", + "nameInRequest": "fuzzy", + "doc": "A value indicating whether to use fuzzy matching for the autocomplete query.\nDefault is false. When set to true, the query will find terms even if there's a\nsubstituted or missing character in the search text. While this provides a\nbetter experience in some scenarios, it comes at a performance cost as fuzzy\nautocomplete queries are slower and consume more resources.", + "type": { + "$id": "8515", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8516", + "name": "highlightPostTag", + "nameInRequest": "highlightPostTag", + "doc": "A string tag that is appended to hit highlights. Must be set with\nhighlightPreTag. If omitted, hit highlighting is disabled.", + "type": { + "$id": "8517", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8518", + "name": "highlightPreTag", + "nameInRequest": "highlightPreTag", + "doc": "A string tag that is prepended to hit highlights. Must be set with\nhighlightPostTag. If omitted, hit highlighting is disabled.", + "type": { + "$id": "8519", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8520", + "name": "minimumCoverage", + "nameInRequest": "minimumCoverage", + "doc": "A number between 0 and 100 indicating the percentage of the index that must be\ncovered by an autocomplete query in order for the query to be reported as a\nsuccess. This parameter can be useful for ensuring search availability even for\nservices with only one replica. The default is 80.", + "type": { + "$id": "8521", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8522", + "name": "searchFields", + "nameInRequest": "searchFields", + "doc": "The list of field names to consider when querying for auto-completed terms.\nTarget fields must be included in the specified suggester.", + "type": { + "$id": "8523", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "8524", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8525", + "name": "$top", + "nameInRequest": "$top", + "doc": "The number of auto-completed terms to retrieve. This must be a value between 1\nand 100. The default is 5.", + "type": { + "$id": "8526", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8527", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "8528", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "8529", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8530", + "name": "indexName", + "nameInRequest": "indexName", + "doc": "The name of the index.", + "type": { + "$id": "8531", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8532", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "8533", + "kind": "constant", + "valueType": { + "$id": "8534", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "8535", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "2315" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/indexes('{indexName}')/docs/search.autocomplete", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Documents.autocompleteGet", + "decorators": [], + "examples": [ + { + "$id": "8536", + "kind": "http", + "name": "SearchIndexAutocompleteDocumentsGet", + "description": "SearchIndexAutocompleteDocumentsGet", + "filePath": "2024-07-01/SearchIndexAutocompleteDocumentsGet.json", + "parameters": [ + { + "$id": "8537", + "parameter": { + "$ref": "8530" + }, + "value": { + "$id": "8538", + "kind": "string", + "type": { + "$ref": "8531" + }, + "value": "myindex" + } + }, + { + "$id": "8539", + "parameter": { + "$ref": "8503" + }, + "value": { + "$id": "8540", + "kind": "string", + "type": { + "$ref": "8504" + }, + "value": "2024-07-01" + } + }, + { + "$id": "8541", + "parameter": { + "$ref": "8511" + }, + "value": { + "$id": "8542", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "oneTerm" + } + }, + { + "$id": "8543", + "parameter": { + "$ref": "8507" + }, + "value": { + "$id": "8544", + "kind": "string", + "type": { + "$ref": "8508" + }, + "value": "washington medic" + } + }, + { + "$id": "8545", + "parameter": { + "$ref": "8509" + }, + "value": { + "$id": "8546", + "kind": "string", + "type": { + "$ref": "8510" + }, + "value": "sg" + } + }, + { + "$id": "8547", + "parameter": { + "$ref": "8514" + }, + "value": { + "$id": "8548", + "kind": "boolean", + "type": { + "$ref": "8515" + }, + "value": false + } + }, + { + "$id": "8549", + "parameter": { + "$ref": "8516" + }, + "value": { + "$id": "8550", + "kind": "string", + "type": { + "$ref": "8517" + }, + "value": "" + } + }, + { + "$id": "8551", + "parameter": { + "$ref": "8518" + }, + "value": { + "$id": "8552", + "kind": "string", + "type": { + "$ref": "8519" + }, + "value": "" + } + }, + { + "$id": "8553", + "parameter": { + "$ref": "8520" + }, + "value": { + "$id": "8554", + "kind": "number", + "type": { + "$ref": "8521" + }, + "value": 80 + } + }, + { + "$id": "8555", + "parameter": { + "$ref": "8522" + }, + "value": { + "$id": "8556", + "kind": "array", + "type": { + "$ref": "8523" + }, + "value": [ + { + "$id": "8557", + "kind": "string", + "type": { + "$ref": "8524" + }, + "value": "title" + }, + { + "$id": "8558", + "kind": "string", + "type": { + "$ref": "8524" + }, + "value": "description" + } + ] + } + } + ], + "responses": [ + { + "$id": "8559", + "response": { + "$ref": "8535" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8560", + "kind": "model", + "type": { + "$ref": "2315" + }, + "value": { + "$id": "8561" + } + } + } + ] + } + ] + }, + { + "$id": "8562", + "name": "autocompletePost", + "resourceName": "Documents", + "doc": "Autocompletes incomplete query terms based on input text and matching terms in\nthe index.", + "accessibility": "public", + "parameters": [ + { + "$id": "8563", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "8564", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "8565", + "type": { + "$id": "8566", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-07-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8567", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "8568", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "8569", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8570", + "name": "indexName", + "nameInRequest": "indexName", + "doc": "The name of the index.", + "type": { + "$id": "8571", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8572", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "8573", + "kind": "constant", + "valueType": { + "$id": "8574", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8575", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "8576", + "kind": "constant", + "valueType": { + "$id": "8577", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "8578", + "name": "autocompleteRequest", + "nameInRequest": "autocompleteRequest", + "doc": "The definition of the Autocomplete request.", + "type": { + "$ref": "2333" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "8579", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "2315" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/indexes('{indexName}')/docs/search.post.autocomplete", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Search.Documents.autocompletePost", + "decorators": [], + "examples": [ + { + "$id": "8580", + "kind": "http", + "name": "SearchIndexAutocompleteDocumentsPost", + "description": "SearchIndexAutocompleteDocumentsPost", + "filePath": "2024-07-01/SearchIndexAutocompleteDocumentsPost.json", + "parameters": [ + { + "$id": "8581", + "parameter": { + "$ref": "8570" + }, + "value": { + "$id": "8582", + "kind": "string", + "type": { + "$ref": "8571" + }, + "value": "myindex" + } + }, + { + "$id": "8583", + "parameter": { + "$ref": "8563" + }, + "value": { + "$id": "8584", + "kind": "string", + "type": { + "$ref": "8564" + }, + "value": "2024-07-01" + } + }, + { + "$id": "8585", + "parameter": { + "$ref": "8578" + }, + "value": { + "$id": "8586", + "kind": "model", + "type": { + "$ref": "2333" + }, + "value": { + "$id": "8587", + "autocompleteMode": { + "$id": "8588", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "oneTerm" + }, + "search": { + "$id": "8589", + "kind": "string", + "type": { + "$ref": "2335" + }, + "value": "washington medic" + }, + "suggesterName": { + "$id": "8590", + "kind": "string", + "type": { + "$ref": "2366" + }, + "value": "sg" + }, + "filter": { + "$id": "8591", + "kind": "string", + "type": { + "$ref": "2342" + }, + "value": "search.in(docId,'101,102,105')" + }, + "highlightPostTag": { + "$id": "8592", + "kind": "string", + "type": { + "$ref": "2350" + }, + "value": "" + }, + "highlightPreTag": { + "$id": "8593", + "kind": "string", + "type": { + "$ref": "2354" + }, + "value": "" + }, + "minimumCoverage": { + "$id": "8594", + "kind": "number", + "type": { + "$ref": "2358" + }, + "value": 80 + }, + "searchFields": { + "$id": "8595", + "kind": "string", + "type": { + "$ref": "2362" + }, + "value": "title,description" + }, + "top": { + "$id": "8596", + "kind": "number", + "type": { + "$ref": "2370" + }, + "value": 10 + } + } + } + } + ], + "responses": [ + { + "$id": "8597", + "response": { + "$ref": "8579" + }, + "statusCode": 200, + "bodyValue": { + "$id": "8598", + "kind": "model", + "type": { + "$ref": "2315" + }, + "value": { + "$id": "8599" + } + } + } + ] + } + ] + } + ], + "parameters": [ + { + "$id": "8600", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "8601", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client" + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Search.Documents", + "apiVersions": [ + "2024-07-01" + ], + "parent": { + "$ref": "4671" + } + } + ] + } + ], + "auth": { + "$id": "8602", + "apiKey": { + "$id": "8603", + "name": "api-key", + "in": "header" + }, + "oAuth2": { + "$id": "8604", + "scopes": [ + "https://search.azure.com/.default" + ] + } + } +}