From 799b554a1740051f12e4b7d16d66d22130261656 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Thu, 17 Sep 2020 13:07:53 -0700 Subject: [PATCH] Fix nullability on Search models Fixes #15108 --- .../Azure.Search.Documents/CHANGELOG.md | 5 + .../EntityRecognitionSkill.Serialization.cs | 18 +- .../ImageAnalysisSkill.Serialization.cs | 18 +- .../KeyPhraseExtractionSkill.Serialization.cs | 18 +- .../Models/OcrSkill.Serialization.cs | 36 +- .../Models/SentimentSkill.Serialization.cs | 18 +- .../Models/SplitSkill.Serialization.cs | 18 +- .../TextTranslationSkill.Serialization.cs | 18 +- .../Models/WebApiSkill.Serialization.cs | 42 +- .../Azure.Search.Documents/src/autorest.md | 47 ++ .../tests/SearchIndexerClientTests.cs | 73 +- .../RoundtripAllSkills.json | 687 ++++++++++++++++++ .../RoundtripAllSkillsAsync.json | 687 ++++++++++++++++++ 13 files changed, 1650 insertions(+), 35 deletions(-) create mode 100644 sdk/search/Azure.Search.Documents/tests/SessionRecords/SearchIndexerClientTests/RoundtripAllSkills.json create mode 100644 sdk/search/Azure.Search.Documents/tests/SessionRecords/SearchIndexerClientTests/RoundtripAllSkillsAsync.json diff --git a/sdk/search/Azure.Search.Documents/CHANGELOG.md b/sdk/search/Azure.Search.Documents/CHANGELOG.md index 9689cf6e4f6ff..fe795edba9e3d 100644 --- a/sdk/search/Azure.Search.Documents/CHANGELOG.md +++ b/sdk/search/Azure.Search.Documents/CHANGELOG.md @@ -2,9 +2,14 @@ ## 11.2.0-preview.1 (Unreleased) +### Fixed + +- Support deserializing null values during deserialization of skills ([#15108](https://github.com/Azure/azure-sdk-for-net/issues/15108)) + ## 11.1.1 (2020-08-18) ### Fixed + - Bug in TaskExtensions.EnsureCompleted method that causes it to unconditionally throw an exception in the environments with synchronization context ## 11.1.0 (2020-08-11) diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/EntityRecognitionSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/EntityRecognitionSkill.Serialization.cs index 4cf29d72fdaeb..5a52b546dfa08 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/EntityRecognitionSkill.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/EntityRecognitionSkill.Serialization.cs @@ -28,8 +28,15 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } if (Optional.IsDefined(DefaultLanguageCode)) { - writer.WritePropertyName("defaultLanguageCode"); - writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + if (DefaultLanguageCode != null) + { + writer.WritePropertyName("defaultLanguageCode"); + writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + } + else + { + writer.WriteNull("defaultLanguageCode"); + } } if (Optional.IsDefined(IncludeTypelessEntities)) { @@ -92,7 +99,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static EntityRecognitionSkill DeserializeEntityRecognitionSkill(JsonElement element) { Optional> categories = default; - Optional defaultLanguageCode = default; + Optional defaultLanguageCode = default; Optional includeTypelessEntities = default; Optional minimumPrecision = default; string odataType = default; @@ -115,6 +122,11 @@ internal static EntityRecognitionSkill DeserializeEntityRecognitionSkill(JsonEle } if (property.NameEquals("defaultLanguageCode")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + defaultLanguageCode = null; + continue; + } defaultLanguageCode = new EntityRecognitionSkillLanguage(property.Value.GetString()); continue; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/ImageAnalysisSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/ImageAnalysisSkill.Serialization.cs index b009f9f98ab66..a012d8b531cc2 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/ImageAnalysisSkill.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/ImageAnalysisSkill.Serialization.cs @@ -18,8 +18,15 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); if (Optional.IsDefined(DefaultLanguageCode)) { - writer.WritePropertyName("defaultLanguageCode"); - writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + if (DefaultLanguageCode != null) + { + writer.WritePropertyName("defaultLanguageCode"); + writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + } + else + { + writer.WriteNull("defaultLanguageCode"); + } } if (Optional.IsCollectionDefined(VisualFeatures)) { @@ -77,7 +84,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static ImageAnalysisSkill DeserializeImageAnalysisSkill(JsonElement element) { - Optional defaultLanguageCode = default; + Optional defaultLanguageCode = default; Optional> visualFeatures = default; Optional> details = default; string odataType = default; @@ -90,6 +97,11 @@ internal static ImageAnalysisSkill DeserializeImageAnalysisSkill(JsonElement ele { if (property.NameEquals("defaultLanguageCode")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + defaultLanguageCode = null; + continue; + } defaultLanguageCode = new ImageAnalysisSkillLanguage(property.Value.GetString()); continue; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KeyPhraseExtractionSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KeyPhraseExtractionSkill.Serialization.cs index a351ea7646a60..37d06a83d58c6 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/KeyPhraseExtractionSkill.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KeyPhraseExtractionSkill.Serialization.cs @@ -18,8 +18,15 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); if (Optional.IsDefined(DefaultLanguageCode)) { - writer.WritePropertyName("defaultLanguageCode"); - writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + if (DefaultLanguageCode != null) + { + writer.WritePropertyName("defaultLanguageCode"); + writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + } + else + { + writer.WriteNull("defaultLanguageCode"); + } } if (Optional.IsDefined(MaxKeyPhraseCount)) { @@ -69,7 +76,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static KeyPhraseExtractionSkill DeserializeKeyPhraseExtractionSkill(JsonElement element) { - Optional defaultLanguageCode = default; + Optional defaultLanguageCode = default; Optional maxKeyPhraseCount = default; string odataType = default; Optional name = default; @@ -81,6 +88,11 @@ internal static KeyPhraseExtractionSkill DeserializeKeyPhraseExtractionSkill(Jso { if (property.NameEquals("defaultLanguageCode")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + defaultLanguageCode = null; + continue; + } defaultLanguageCode = new KeyPhraseExtractionSkillLanguage(property.Value.GetString()); continue; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/OcrSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/OcrSkill.Serialization.cs index 6a8d8e1784d3b..182f45c1a1f18 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/OcrSkill.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/OcrSkill.Serialization.cs @@ -18,13 +18,27 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); if (Optional.IsDefined(DefaultLanguageCode)) { - writer.WritePropertyName("defaultLanguageCode"); - writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + if (DefaultLanguageCode != null) + { + writer.WritePropertyName("defaultLanguageCode"); + writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + } + else + { + writer.WriteNull("defaultLanguageCode"); + } } if (Optional.IsDefined(ShouldDetectOrientation)) { - writer.WritePropertyName("detectOrientation"); - writer.WriteBooleanValue(ShouldDetectOrientation.Value); + if (ShouldDetectOrientation != null) + { + writer.WritePropertyName("detectOrientation"); + writer.WriteBooleanValue(ShouldDetectOrientation.Value); + } + else + { + writer.WriteNull("detectOrientation"); + } } writer.WritePropertyName("@odata.type"); writer.WriteStringValue(ODataType); @@ -62,8 +76,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static OcrSkill DeserializeOcrSkill(JsonElement element) { - Optional defaultLanguageCode = default; - Optional detectOrientation = default; + Optional defaultLanguageCode = default; + Optional detectOrientation = default; string odataType = default; Optional name = default; Optional description = default; @@ -74,11 +88,21 @@ internal static OcrSkill DeserializeOcrSkill(JsonElement element) { if (property.NameEquals("defaultLanguageCode")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + defaultLanguageCode = null; + continue; + } defaultLanguageCode = new OcrSkillLanguage(property.Value.GetString()); continue; } if (property.NameEquals("detectOrientation")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + detectOrientation = null; + continue; + } detectOrientation = property.Value.GetBoolean(); continue; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SentimentSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SentimentSkill.Serialization.cs index 1d350445c634d..ae0678934c0e0 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SentimentSkill.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SentimentSkill.Serialization.cs @@ -18,8 +18,15 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); if (Optional.IsDefined(DefaultLanguageCode)) { - writer.WritePropertyName("defaultLanguageCode"); - writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + if (DefaultLanguageCode != null) + { + writer.WritePropertyName("defaultLanguageCode"); + writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + } + else + { + writer.WriteNull("defaultLanguageCode"); + } } writer.WritePropertyName("@odata.type"); writer.WriteStringValue(ODataType); @@ -57,7 +64,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static SentimentSkill DeserializeSentimentSkill(JsonElement element) { - Optional defaultLanguageCode = default; + Optional defaultLanguageCode = default; string odataType = default; Optional name = default; Optional description = default; @@ -68,6 +75,11 @@ internal static SentimentSkill DeserializeSentimentSkill(JsonElement element) { if (property.NameEquals("defaultLanguageCode")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + defaultLanguageCode = null; + continue; + } defaultLanguageCode = new SentimentSkillLanguage(property.Value.GetString()); continue; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SplitSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SplitSkill.Serialization.cs index 33243fe578990..09be70c881886 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SplitSkill.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SplitSkill.Serialization.cs @@ -18,8 +18,15 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); if (Optional.IsDefined(DefaultLanguageCode)) { - writer.WritePropertyName("defaultLanguageCode"); - writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + if (DefaultLanguageCode != null) + { + writer.WritePropertyName("defaultLanguageCode"); + writer.WriteStringValue(DefaultLanguageCode.Value.ToString()); + } + else + { + writer.WriteNull("defaultLanguageCode"); + } } if (Optional.IsDefined(TextSplitMode)) { @@ -74,7 +81,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static SplitSkill DeserializeSplitSkill(JsonElement element) { - Optional defaultLanguageCode = default; + Optional defaultLanguageCode = default; Optional textSplitMode = default; Optional maximumPageLength = default; string odataType = default; @@ -87,6 +94,11 @@ internal static SplitSkill DeserializeSplitSkill(JsonElement element) { if (property.NameEquals("defaultLanguageCode")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + defaultLanguageCode = null; + continue; + } defaultLanguageCode = new SplitSkillLanguage(property.Value.GetString()); continue; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/TextTranslationSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/TextTranslationSkill.Serialization.cs index 78fb177c75bae..b05987d7cea3b 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/TextTranslationSkill.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/TextTranslationSkill.Serialization.cs @@ -20,8 +20,15 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(DefaultToLanguageCode.ToString()); if (Optional.IsDefined(DefaultFromLanguageCode)) { - writer.WritePropertyName("defaultFromLanguageCode"); - writer.WriteStringValue(DefaultFromLanguageCode.Value.ToString()); + if (DefaultFromLanguageCode != null) + { + writer.WritePropertyName("defaultFromLanguageCode"); + writer.WriteStringValue(DefaultFromLanguageCode.Value.ToString()); + } + else + { + writer.WriteNull("defaultFromLanguageCode"); + } } if (Optional.IsDefined(SuggestedFrom)) { @@ -72,7 +79,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static TextTranslationSkill DeserializeTextTranslationSkill(JsonElement element) { TextTranslationSkillLanguage defaultToLanguageCode = default; - Optional defaultFromLanguageCode = default; + Optional defaultFromLanguageCode = default; Optional suggestedFrom = default; string odataType = default; Optional name = default; @@ -89,6 +96,11 @@ internal static TextTranslationSkill DeserializeTextTranslationSkill(JsonElement } if (property.NameEquals("defaultFromLanguageCode")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + defaultFromLanguageCode = null; + continue; + } defaultFromLanguageCode = new TextTranslationSkillLanguage(property.Value.GetString()); continue; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/WebApiSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/WebApiSkill.Serialization.cs index a3e276557ea25..9010d82a7a03d 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/WebApiSkill.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/WebApiSkill.Serialization.cs @@ -21,14 +21,21 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(Uri); if (Optional.IsCollectionDefined(HttpHeaders)) { - writer.WritePropertyName("httpHeaders"); - writer.WriteStartObject(); - foreach (var item in HttpHeaders) + if (HttpHeaders != null) { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); + writer.WritePropertyName("httpHeaders"); + writer.WriteStartObject(); + foreach (var item in HttpHeaders) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("httpHeaders"); } - writer.WriteEndObject(); } if (Optional.IsDefined(HttpMethod)) { @@ -37,8 +44,15 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } if (Optional.IsDefined(Timeout)) { - writer.WritePropertyName("timeout"); - writer.WriteStringValue(Timeout.Value, "P"); + if (Timeout != null) + { + writer.WritePropertyName("timeout"); + writer.WriteStringValue(Timeout.Value, "P"); + } + else + { + writer.WriteNull("timeout"); + } } if (Optional.IsDefined(BatchSize)) { @@ -103,7 +117,7 @@ internal static WebApiSkill DeserializeWebApiSkill(JsonElement element) string uri = default; Optional> httpHeaders = default; Optional httpMethod = default; - Optional timeout = default; + Optional timeout = default; Optional batchSize = default; Optional degreeOfParallelism = default; string odataType = default; @@ -121,6 +135,11 @@ internal static WebApiSkill DeserializeWebApiSkill(JsonElement element) } if (property.NameEquals("httpHeaders")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + httpHeaders = null; + continue; + } Dictionary dictionary = new Dictionary(); foreach (var property0 in property.Value.EnumerateObject()) { @@ -136,6 +155,11 @@ internal static WebApiSkill DeserializeWebApiSkill(JsonElement element) } if (property.NameEquals("timeout")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + timeout = null; + continue; + } timeout = property.Value.GetTimeSpan("P"); continue; } diff --git a/sdk/search/Azure.Search.Documents/src/autorest.md b/sdk/search/Azure.Search.Documents/src/autorest.md index 2d2378cc586d0..c3a2dd4396521 100644 --- a/sdk/search/Azure.Search.Documents/src/autorest.md +++ b/sdk/search/Azure.Search.Documents/src/autorest.md @@ -191,6 +191,53 @@ directive: $.properties.endTime["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. diff --git a/sdk/search/Azure.Search.Documents/tests/SearchIndexerClientTests.cs b/sdk/search/Azure.Search.Documents/tests/SearchIndexerClientTests.cs index 83ee0933edfe0..1b63731ac143a 100644 --- a/sdk/search/Azure.Search.Documents/tests/SearchIndexerClientTests.cs +++ b/sdk/search/Azure.Search.Documents/tests/SearchIndexerClientTests.cs @@ -3,8 +3,7 @@ using System; using System.Collections.Generic; -using System.Text; -using System.Threading; +using System.Linq; using System.Threading.Tasks; using Azure.Core.TestFramework; using Azure.Search.Documents.Indexes; @@ -523,5 +522,75 @@ public async Task CrudSkillset() throw; } } + + [Test] + public async Task RoundtripAllSkills() + { + // BUGBUG: https://github.com/Azure/azure-sdk-for-net/issues/15108 + + await using SearchResources resources = SearchResources.CreateWithNoIndexes(this); + + SearchIndexerClient client = resources.GetIndexerClient(); + string skillsetName = Recording.Random.GetName(); + + // Enumerate all skills and create them with consistently fake input to test for nullability during deserialization. + SearchIndexerSkill CreateSkill(Type t, string[] inputNames, string[] outputNames) + { + var inputs = inputNames.Select(input => new InputFieldMappingEntry(input) { Source = "/document/content" } ).ToList(); + var outputs = outputNames.Select(output => new OutputFieldMappingEntry(output, targetName: Recording.Random.GetName())).ToList(); + + return t switch + { + // TODO: Should TextSplitMode be added to constructor (required input)? + Type _ when t == typeof(SplitSkill) => new SplitSkill(inputs, outputs) { TextSplitMode = TextSplitMode.Pages }, + + Type _ when t == typeof(TextTranslationSkill) => new TextTranslationSkill(inputs, outputs, TextTranslationSkillLanguage.En), + Type _ when t == typeof(WebApiSkill) => new WebApiSkill(inputs, outputs, "https://microsoft.com"), + _ => (SearchIndexerSkill)Activator.CreateInstance(t, new object[] { inputs, outputs }), + }; + } + + List skills = typeof(SearchIndexerSkill).Assembly.GetExportedTypes() + .Where(t => t != typeof(SearchIndexerSkill) && typeof(SearchIndexerSkill).IsAssignableFrom(t)) + .Select(t => t switch + { + Type _ when t == typeof(ConditionalSkill) => CreateSkill(t, new[] { "condition", "whenTrue", "whenFalse" }, new[] { "output" }), + Type _ when t == typeof(EntityRecognitionSkill) => CreateSkill(t, new[] { "languageCode", "text" }, new[] { "persons" }), + Type _ when t == typeof(ImageAnalysisSkill) => CreateSkill(t, new[] { "image" }, new[] { "categories" }), + Type _ when t == typeof(KeyPhraseExtractionSkill) => CreateSkill(t, new[] { "text", "languageCode" }, new[] { "keyPhrases" }), + Type _ when t == typeof(LanguageDetectionSkill) => CreateSkill(t, new[] { "text" }, new[] { "languageCode", "languageName", "score" }), + Type _ when t == typeof(MergeSkill) => CreateSkill(t, new[] { "text", "itemsToInsert", "offsets" }, new[] { "mergedText" }), + Type _ when t == typeof(OcrSkill) => CreateSkill(t, new[] { "image" }, new[] { "text", "layoutText" }), + Type _ when t == typeof(SentimentSkill) => CreateSkill(t, new[] { "text", "languageCode" }, new[] { "score" }), + Type _ when t == typeof(ShaperSkill) => CreateSkill(t, new[] { "text" }, new[] { "output" }), + Type _ when t == typeof(SplitSkill) => CreateSkill(t, new[] { "text", "languageCode" }, new[] { "textItems" }), + Type _ when t == typeof(TextTranslationSkill) => CreateSkill(t, new[] { "text", "toLanguageCode", "fromLanguageCode" }, new[] { "translatedText", "translatedToLanguageCode", "translatedFromLanguageCode" }), + Type _ when t == typeof(WebApiSkill) => CreateSkill(t, new[] { "input" }, new[] { "output" }), + _ => throw new NotSupportedException(), + }) + .ToList(); + + SearchIndexerSkillset specifiedSkillset = new SearchIndexerSkillset(skillsetName, skills) + { + CognitiveServicesAccount = new DefaultCognitiveServicesAccount(), + }; + + try + { + SearchIndexerSkillset createdSkillset = await client.CreateSkillsetAsync(specifiedSkillset); + + Assert.AreEqual(skillsetName, createdSkillset.Name); + Assert.AreEqual(skills.Count, createdSkillset.Skills.Count); + } + catch + { + if (Recording.Mode != RecordedTestMode.Playback) + { + await client.DeleteSkillsetAsync(skillsetName); + } + + throw; + } + } } } diff --git a/sdk/search/Azure.Search.Documents/tests/SessionRecords/SearchIndexerClientTests/RoundtripAllSkills.json b/sdk/search/Azure.Search.Documents/tests/SessionRecords/SearchIndexerClientTests/RoundtripAllSkills.json new file mode 100644 index 0000000000000..2c75bdd6b0bd3 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/tests/SessionRecords/SearchIndexerClientTests/RoundtripAllSkills.json @@ -0,0 +1,687 @@ +{ + "Entries": [ + { + "RequestUri": "https://azs-net-heathsrch.search.windows.net/skillsets?api-version=2020-06-30", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json; odata.metadata=minimal", + "api-key": "Sanitized", + "Content-Length": "3029", + "Content-Type": "application/json", + "traceparent": "00-de8751ff69893949b3ba65ba6dc701d4-b3ef055fbce55544-00", + "User-Agent": [ + "azsdk-net-Search.Documents/11.2.0-alpha.20200916.1", + "(.NET Core 4.6.29220.03; Microsoft Windows 10.0.19041 )" + ], + "x-ms-client-request-id": "7c15986df0790821cfd9e7040b8a411b", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "name": "fpmjeogx", + "skills": [ + { + "@odata.type": "#Microsoft.Skills.Util.ConditionalSkill", + "inputs": [ + { + "name": "condition", + "source": "/document/content" + }, + { + "name": "whenTrue", + "source": "/document/content" + }, + { + "name": "whenFalse", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "output", + "targetName": "lgnlkuyy" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.EntityRecognitionSkill", + "inputs": [ + { + "name": "languageCode", + "source": "/document/content" + }, + { + "name": "text", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "persons", + "targetName": "upyugkjy" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Vision.ImageAnalysisSkill", + "inputs": [ + { + "name": "image", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "categories", + "targetName": "cojtwncd" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.KeyPhraseExtractionSkill", + "inputs": [ + { + "name": "text", + "source": "/document/content" + }, + { + "name": "languageCode", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "keyPhrases", + "targetName": "xyafuysk" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.LanguageDetectionSkill", + "inputs": [ + { + "name": "text", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "languageCode", + "targetName": "lripadri" + }, + { + "name": "languageName", + "targetName": "oxeepvou" + }, + { + "name": "score", + "targetName": "gnhofmax" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.MergeSkill", + "inputs": [ + { + "name": "text", + "source": "/document/content" + }, + { + "name": "itemsToInsert", + "source": "/document/content" + }, + { + "name": "offsets", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "mergedText", + "targetName": "djmltsdu" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Vision.OcrSkill", + "inputs": [ + { + "name": "image", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "text", + "targetName": "wojnbsyy" + }, + { + "name": "layoutText", + "targetName": "vaeyixnb" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.SentimentSkill", + "inputs": [ + { + "name": "text", + "source": "/document/content" + }, + { + "name": "languageCode", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "score", + "targetName": "jexhrdex" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Util.ShaperSkill", + "inputs": [ + { + "name": "text", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "output", + "targetName": "rkmppgnu" + } + ] + }, + { + "textSplitMode": "pages", + "@odata.type": "#Microsoft.Skills.Text.SplitSkill", + "inputs": [ + { + "name": "text", + "source": "/document/content" + }, + { + "name": "languageCode", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "textItems", + "targetName": "tjgbmatn" + } + ] + }, + { + "defaultToLanguageCode": "en", + "@odata.type": "#Microsoft.Skills.Text.TranslationSkill", + "inputs": [ + { + "name": "text", + "source": "/document/content" + }, + { + "name": "toLanguageCode", + "source": "/document/content" + }, + { + "name": "fromLanguageCode", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "translatedText", + "targetName": "nisfhboe" + }, + { + "name": "translatedToLanguageCode", + "targetName": "vlbotvcs" + }, + { + "name": "translatedFromLanguageCode", + "targetName": "jkvqfjip" + } + ] + }, + { + "uri": "https://microsoft.com", + "@odata.type": "#Microsoft.Skills.Custom.WebApiSkill", + "inputs": [ + { + "name": "input", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "output", + "targetName": "ljeyqloi" + } + ] + } + ], + "cognitiveServices": { + "@odata.type": "#Microsoft.Azure.Search.DefaultCognitiveServices" + } + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "client-request-id": "7c15986d-f079-0821-cfd9-e7040b8a411b", + "Content-Length": "5097", + "Content-Type": "application/json; odata.metadata=minimal", + "Date": "Thu, 17 Sep 2020 17:17:36 GMT", + "elapsed-time": "338", + "ETag": "W/\u00220x8D85B2D9320858C\u0022", + "Expires": "-1", + "Location": "https://azs-net-heathsrch.search.windows.net/skillsets(\u0027fpmjeogx\u0027)?api-version=2020-06-30", + "OData-Version": "4.0", + "Pragma": "no-cache", + "Preference-Applied": "odata.include-annotations=\u0022*\u0022", + "request-id": "7c15986d-f079-0821-cfd9-e7040b8a411b", + "Strict-Transport-Security": "max-age=15724800; includeSubDomains", + "x-ms-client-request-id": "7c15986d-f079-0821-cfd9-e7040b8a411b" + }, + "ResponseBody": { + "@odata.context": "https://azs-net-heathsrch.search.windows.net/$metadata#skillsets/$entity", + "@odata.etag": "\u00220x8D85B2D9320858C\u0022", + "name": "fpmjeogx", + "description": null, + "skills": [ + { + "@odata.type": "#Microsoft.Skills.Util.ConditionalSkill", + "name": null, + "description": null, + "context": null, + "inputs": [ + { + "name": "condition", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "whenTrue", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "whenFalse", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "output", + "targetName": "lgnlkuyy" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.EntityRecognitionSkill", + "name": null, + "description": null, + "context": null, + "categories": [], + "defaultLanguageCode": null, + "minimumPrecision": null, + "includeTypelessEntities": null, + "inputs": [ + { + "name": "languageCode", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "persons", + "targetName": "upyugkjy" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Vision.ImageAnalysisSkill", + "name": null, + "description": null, + "context": null, + "defaultLanguageCode": null, + "visualFeatures": [], + "details": [], + "inputs": [ + { + "name": "image", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "categories", + "targetName": "cojtwncd" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.KeyPhraseExtractionSkill", + "name": null, + "description": null, + "context": null, + "defaultLanguageCode": null, + "maxKeyPhraseCount": null, + "inputs": [ + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "languageCode", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "keyPhrases", + "targetName": "xyafuysk" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.LanguageDetectionSkill", + "name": null, + "description": null, + "context": null, + "inputs": [ + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "languageCode", + "targetName": "lripadri" + }, + { + "name": "languageName", + "targetName": "oxeepvou" + }, + { + "name": "score", + "targetName": "gnhofmax" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.MergeSkill", + "name": null, + "description": null, + "context": null, + "insertPreTag": null, + "insertPostTag": null, + "inputs": [ + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "itemsToInsert", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "offsets", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "mergedText", + "targetName": "djmltsdu" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Vision.OcrSkill", + "name": null, + "description": null, + "context": null, + "textExtractionAlgorithm": null, + "lineEnding": null, + "defaultLanguageCode": null, + "detectOrientation": null, + "inputs": [ + { + "name": "image", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "text", + "targetName": "wojnbsyy" + }, + { + "name": "layoutText", + "targetName": "vaeyixnb" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.SentimentSkill", + "name": null, + "description": null, + "context": null, + "defaultLanguageCode": null, + "inputs": [ + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "languageCode", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "score", + "targetName": "jexhrdex" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Util.ShaperSkill", + "name": null, + "description": null, + "context": null, + "inputs": [ + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "output", + "targetName": "rkmppgnu" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.SplitSkill", + "name": null, + "description": null, + "context": null, + "defaultLanguageCode": null, + "textSplitMode": "pages", + "maximumPageLength": null, + "inputs": [ + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "languageCode", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "textItems", + "targetName": "tjgbmatn" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.TranslationSkill", + "name": null, + "description": null, + "context": null, + "defaultFromLanguageCode": null, + "defaultToLanguageCode": "en", + "suggestedFrom": null, + "inputs": [ + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "toLanguageCode", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "fromLanguageCode", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "translatedText", + "targetName": "nisfhboe" + }, + { + "name": "translatedToLanguageCode", + "targetName": "vlbotvcs" + }, + { + "name": "translatedFromLanguageCode", + "targetName": "jkvqfjip" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Custom.WebApiSkill", + "name": null, + "description": null, + "context": null, + "uri": "https://microsoft.com", + "httpMethod": null, + "timeout": null, + "batchSize": null, + "degreeOfParallelism": null, + "inputs": [ + { + "name": "input", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "output", + "targetName": "ljeyqloi" + } + ], + "httpHeaders": null + } + ], + "cognitiveServices": { + "@odata.type": "#Microsoft.Azure.Search.DefaultCognitiveServices", + "description": null + }, + "knowledgeStore": null, + "encryptionKey": null + } + }, + { + "RequestUri": "https://azs-net-heathsrch.search.windows.net/skillsets(\u0027fpmjeogx\u0027)?api-version=2020-06-30", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json; odata.metadata=minimal", + "api-key": "Sanitized", + "traceparent": "00-ad62df3d68ae6b41a3b9df549439780a-4ad8d3b90e34f441-00", + "User-Agent": [ + "azsdk-net-Search.Documents/11.2.0-alpha.20200916.1", + "(.NET Core 4.6.29220.03; Microsoft Windows 10.0.19041 )" + ], + "x-ms-client-request-id": "fa668dadfb5ce9a8b96c015d47059289", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "client-request-id": "fa668dad-fb5c-e9a8-b96c-015d47059289", + "Date": "Thu, 17 Sep 2020 17:17:36 GMT", + "elapsed-time": "97", + "Expires": "-1", + "Pragma": "no-cache", + "request-id": "fa668dad-fb5c-e9a8-b96c-015d47059289", + "Strict-Transport-Security": "max-age=15724800; includeSubDomains", + "x-ms-client-request-id": "fa668dad-fb5c-e9a8-b96c-015d47059289" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "1560392185", + "SearchIndexName": null, + "SEARCH_ADMIN_API_KEY": "Sanitized", + "SEARCH_SERVICE_NAME": "azs-net-heathsrch" + } +} \ No newline at end of file diff --git a/sdk/search/Azure.Search.Documents/tests/SessionRecords/SearchIndexerClientTests/RoundtripAllSkillsAsync.json b/sdk/search/Azure.Search.Documents/tests/SessionRecords/SearchIndexerClientTests/RoundtripAllSkillsAsync.json new file mode 100644 index 0000000000000..391ab3f9ea251 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/tests/SessionRecords/SearchIndexerClientTests/RoundtripAllSkillsAsync.json @@ -0,0 +1,687 @@ +{ + "Entries": [ + { + "RequestUri": "https://azs-net-heathsrch.search.windows.net/skillsets?api-version=2020-06-30", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json; odata.metadata=minimal", + "api-key": "Sanitized", + "Content-Length": "3029", + "Content-Type": "application/json", + "traceparent": "00-633356135bf01f47a792fb78d75990df-5f520a83414eda44-00", + "User-Agent": [ + "azsdk-net-Search.Documents/11.2.0-alpha.20200916.1", + "(.NET Core 4.6.29220.03; Microsoft Windows 10.0.19041 )" + ], + "x-ms-client-request-id": "36f442407343fbea34a8a7608ea1160a", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "name": "lefvvewn", + "skills": [ + { + "@odata.type": "#Microsoft.Skills.Util.ConditionalSkill", + "inputs": [ + { + "name": "condition", + "source": "/document/content" + }, + { + "name": "whenTrue", + "source": "/document/content" + }, + { + "name": "whenFalse", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "output", + "targetName": "sfvgibhd" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.EntityRecognitionSkill", + "inputs": [ + { + "name": "languageCode", + "source": "/document/content" + }, + { + "name": "text", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "persons", + "targetName": "xnehbjyk" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Vision.ImageAnalysisSkill", + "inputs": [ + { + "name": "image", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "categories", + "targetName": "alqyjdbi" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.KeyPhraseExtractionSkill", + "inputs": [ + { + "name": "text", + "source": "/document/content" + }, + { + "name": "languageCode", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "keyPhrases", + "targetName": "ptidacek" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.LanguageDetectionSkill", + "inputs": [ + { + "name": "text", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "languageCode", + "targetName": "niyhrstv" + }, + { + "name": "languageName", + "targetName": "wgomeenc" + }, + { + "name": "score", + "targetName": "fuvknxeo" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.MergeSkill", + "inputs": [ + { + "name": "text", + "source": "/document/content" + }, + { + "name": "itemsToInsert", + "source": "/document/content" + }, + { + "name": "offsets", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "mergedText", + "targetName": "dmqnsedu" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Vision.OcrSkill", + "inputs": [ + { + "name": "image", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "text", + "targetName": "jtsskqrg" + }, + { + "name": "layoutText", + "targetName": "qtbcoodl" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.SentimentSkill", + "inputs": [ + { + "name": "text", + "source": "/document/content" + }, + { + "name": "languageCode", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "score", + "targetName": "fgxegswp" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Util.ShaperSkill", + "inputs": [ + { + "name": "text", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "output", + "targetName": "ejefcfds" + } + ] + }, + { + "textSplitMode": "pages", + "@odata.type": "#Microsoft.Skills.Text.SplitSkill", + "inputs": [ + { + "name": "text", + "source": "/document/content" + }, + { + "name": "languageCode", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "textItems", + "targetName": "dtcklurn" + } + ] + }, + { + "defaultToLanguageCode": "en", + "@odata.type": "#Microsoft.Skills.Text.TranslationSkill", + "inputs": [ + { + "name": "text", + "source": "/document/content" + }, + { + "name": "toLanguageCode", + "source": "/document/content" + }, + { + "name": "fromLanguageCode", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "translatedText", + "targetName": "dpsswbyn" + }, + { + "name": "translatedToLanguageCode", + "targetName": "ieilgxop" + }, + { + "name": "translatedFromLanguageCode", + "targetName": "wdnammdl" + } + ] + }, + { + "uri": "https://microsoft.com", + "@odata.type": "#Microsoft.Skills.Custom.WebApiSkill", + "inputs": [ + { + "name": "input", + "source": "/document/content" + } + ], + "outputs": [ + { + "name": "output", + "targetName": "pixulsyk" + } + ] + } + ], + "cognitiveServices": { + "@odata.type": "#Microsoft.Azure.Search.DefaultCognitiveServices" + } + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "client-request-id": "36f44240-7343-fbea-34a8-a7608ea1160a", + "Content-Length": "5097", + "Content-Type": "application/json; odata.metadata=minimal", + "Date": "Thu, 17 Sep 2020 17:17:37 GMT", + "elapsed-time": "84", + "ETag": "W/\u00220x8D85B2D93A73B41\u0022", + "Expires": "-1", + "Location": "https://azs-net-heathsrch.search.windows.net/skillsets(\u0027lefvvewn\u0027)?api-version=2020-06-30", + "OData-Version": "4.0", + "Pragma": "no-cache", + "Preference-Applied": "odata.include-annotations=\u0022*\u0022", + "request-id": "36f44240-7343-fbea-34a8-a7608ea1160a", + "Strict-Transport-Security": "max-age=15724800; includeSubDomains", + "x-ms-client-request-id": "36f44240-7343-fbea-34a8-a7608ea1160a" + }, + "ResponseBody": { + "@odata.context": "https://azs-net-heathsrch.search.windows.net/$metadata#skillsets/$entity", + "@odata.etag": "\u00220x8D85B2D93A73B41\u0022", + "name": "lefvvewn", + "description": null, + "skills": [ + { + "@odata.type": "#Microsoft.Skills.Util.ConditionalSkill", + "name": null, + "description": null, + "context": null, + "inputs": [ + { + "name": "condition", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "whenTrue", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "whenFalse", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "output", + "targetName": "sfvgibhd" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.EntityRecognitionSkill", + "name": null, + "description": null, + "context": null, + "categories": [], + "defaultLanguageCode": null, + "minimumPrecision": null, + "includeTypelessEntities": null, + "inputs": [ + { + "name": "languageCode", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "persons", + "targetName": "xnehbjyk" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Vision.ImageAnalysisSkill", + "name": null, + "description": null, + "context": null, + "defaultLanguageCode": null, + "visualFeatures": [], + "details": [], + "inputs": [ + { + "name": "image", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "categories", + "targetName": "alqyjdbi" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.KeyPhraseExtractionSkill", + "name": null, + "description": null, + "context": null, + "defaultLanguageCode": null, + "maxKeyPhraseCount": null, + "inputs": [ + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "languageCode", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "keyPhrases", + "targetName": "ptidacek" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.LanguageDetectionSkill", + "name": null, + "description": null, + "context": null, + "inputs": [ + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "languageCode", + "targetName": "niyhrstv" + }, + { + "name": "languageName", + "targetName": "wgomeenc" + }, + { + "name": "score", + "targetName": "fuvknxeo" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.MergeSkill", + "name": null, + "description": null, + "context": null, + "insertPreTag": null, + "insertPostTag": null, + "inputs": [ + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "itemsToInsert", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "offsets", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "mergedText", + "targetName": "dmqnsedu" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Vision.OcrSkill", + "name": null, + "description": null, + "context": null, + "textExtractionAlgorithm": null, + "lineEnding": null, + "defaultLanguageCode": null, + "detectOrientation": null, + "inputs": [ + { + "name": "image", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "text", + "targetName": "jtsskqrg" + }, + { + "name": "layoutText", + "targetName": "qtbcoodl" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.SentimentSkill", + "name": null, + "description": null, + "context": null, + "defaultLanguageCode": null, + "inputs": [ + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "languageCode", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "score", + "targetName": "fgxegswp" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Util.ShaperSkill", + "name": null, + "description": null, + "context": null, + "inputs": [ + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "output", + "targetName": "ejefcfds" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.SplitSkill", + "name": null, + "description": null, + "context": null, + "defaultLanguageCode": null, + "textSplitMode": "pages", + "maximumPageLength": null, + "inputs": [ + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "languageCode", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "textItems", + "targetName": "dtcklurn" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Text.TranslationSkill", + "name": null, + "description": null, + "context": null, + "defaultFromLanguageCode": null, + "defaultToLanguageCode": "en", + "suggestedFrom": null, + "inputs": [ + { + "name": "text", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "toLanguageCode", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + }, + { + "name": "fromLanguageCode", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "translatedText", + "targetName": "dpsswbyn" + }, + { + "name": "translatedToLanguageCode", + "targetName": "ieilgxop" + }, + { + "name": "translatedFromLanguageCode", + "targetName": "wdnammdl" + } + ] + }, + { + "@odata.type": "#Microsoft.Skills.Custom.WebApiSkill", + "name": null, + "description": null, + "context": null, + "uri": "https://microsoft.com", + "httpMethod": null, + "timeout": null, + "batchSize": null, + "degreeOfParallelism": null, + "inputs": [ + { + "name": "input", + "source": "/document/content", + "sourceContext": null, + "inputs": [] + } + ], + "outputs": [ + { + "name": "output", + "targetName": "pixulsyk" + } + ], + "httpHeaders": null + } + ], + "cognitiveServices": { + "@odata.type": "#Microsoft.Azure.Search.DefaultCognitiveServices", + "description": null + }, + "knowledgeStore": null, + "encryptionKey": null + } + }, + { + "RequestUri": "https://azs-net-heathsrch.search.windows.net/skillsets(\u0027lefvvewn\u0027)?api-version=2020-06-30", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json; odata.metadata=minimal", + "api-key": "Sanitized", + "traceparent": "00-d8cc2fffc52fde4092d84acef04dbde5-1a2338cfa2cd5c4a-00", + "User-Agent": [ + "azsdk-net-Search.Documents/11.2.0-alpha.20200916.1", + "(.NET Core 4.6.29220.03; Microsoft Windows 10.0.19041 )" + ], + "x-ms-client-request-id": "76cadfcf3f2be92844ba398e61894ad1", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "client-request-id": "76cadfcf-3f2b-e928-44ba-398e61894ad1", + "Date": "Thu, 17 Sep 2020 17:17:37 GMT", + "elapsed-time": "60", + "Expires": "-1", + "Pragma": "no-cache", + "request-id": "76cadfcf-3f2b-e928-44ba-398e61894ad1", + "Strict-Transport-Security": "max-age=15724800; includeSubDomains", + "x-ms-client-request-id": "76cadfcf-3f2b-e928-44ba-398e61894ad1" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "1020949430", + "SearchIndexName": null, + "SEARCH_ADMIN_API_KEY": "Sanitized", + "SEARCH_SERVICE_NAME": "azs-net-heathsrch" + } +} \ No newline at end of file