internal static ImageAnalysisSkill DeserializeImageAnalysisSkill(JsonElement element) { ImageAnalysisSkillLanguage?defaultLanguageCode = default; IList <VisualFeature> visualFeatures = default; IList <ImageDetail> details = default; string odataType = default; string name = default; string description = default; string context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("defaultLanguageCode")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } defaultLanguageCode = new ImageAnalysisSkillLanguage(property.Value.GetString()); continue; } if (property.NameEquals("visualFeatures")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } List <VisualFeature> array = new List <VisualFeature>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(new VisualFeature(item.GetString())); } visualFeatures = array; continue; } if (property.NameEquals("details")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } List <ImageDetail> array = new List <ImageDetail>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(new ImageDetail(item.GetString())); } details = array; continue; } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } } outputs = array; continue; } } return(new ImageAnalysisSkill(odataType, name, description, context, inputs, outputs, defaultLanguageCode, visualFeatures, details)); }
internal static CustomEntityLookupSkill DeserializeCustomEntityLookupSkill(JsonElement element) { Optional <CustomEntityLookupSkillLanguage?> defaultLanguageCode = default; Optional <string> entitiesDefinitionUri = default; Optional <IList <CustomEntity> > inlineEntitiesDefinition = default; Optional <bool?> globalDefaultCaseSensitive = default; Optional <bool?> globalDefaultAccentSensitive = default; Optional <int?> globalDefaultFuzzyEditDistance = default; string odataType = default; Optional <string> name = default; Optional <string> description = default; Optional <string> context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("defaultLanguageCode")) { if (property.Value.ValueKind == JsonValueKind.Null) { defaultLanguageCode = null; continue; } defaultLanguageCode = new CustomEntityLookupSkillLanguage(property.Value.GetString()); continue; } if (property.NameEquals("entitiesDefinitionUri")) { if (property.Value.ValueKind == JsonValueKind.Null) { entitiesDefinitionUri = null; continue; } entitiesDefinitionUri = property.Value.GetString(); continue; } if (property.NameEquals("inlineEntitiesDefinition")) { if (property.Value.ValueKind == JsonValueKind.Null) { inlineEntitiesDefinition = null; continue; } List <CustomEntity> array = new List <CustomEntity>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(CustomEntity.DeserializeCustomEntity(item)); } inlineEntitiesDefinition = array; continue; } if (property.NameEquals("globalDefaultCaseSensitive")) { if (property.Value.ValueKind == JsonValueKind.Null) { globalDefaultCaseSensitive = null; continue; } globalDefaultCaseSensitive = property.Value.GetBoolean(); continue; } if (property.NameEquals("globalDefaultAccentSensitive")) { if (property.Value.ValueKind == JsonValueKind.Null) { globalDefaultAccentSensitive = null; continue; } globalDefaultAccentSensitive = property.Value.GetBoolean(); continue; } if (property.NameEquals("globalDefaultFuzzyEditDistance")) { if (property.Value.ValueKind == JsonValueKind.Null) { globalDefaultFuzzyEditDistance = null; continue; } globalDefaultFuzzyEditDistance = property.Value.GetInt32(); continue; } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } outputs = array; continue; } } return(new CustomEntityLookupSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, Optional.ToNullable(defaultLanguageCode), entitiesDefinitionUri.Value, Optional.ToList(inlineEntitiesDefinition), Optional.ToNullable(globalDefaultCaseSensitive), Optional.ToNullable(globalDefaultAccentSensitive), Optional.ToNullable(globalDefaultFuzzyEditDistance))); }
internal static AzureMachineLearningSkill DeserializeAzureMachineLearningSkill(JsonElement element) { Optional <Uri> uri = default; Optional <string> key = default; Optional <string> resourceId = default; Optional <TimeSpan?> timeout = default; Optional <string> region = default; Optional <int?> degreeOfParallelism = default; string odataType = default; Optional <string> name = default; Optional <string> description = default; Optional <string> context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("uri")) { if (property.Value.ValueKind == JsonValueKind.Null) { uri = null; continue; } uri = new Uri(property.Value.GetString()); continue; } if (property.NameEquals("key")) { if (property.Value.ValueKind == JsonValueKind.Null) { key = null; continue; } key = property.Value.GetString(); continue; } if (property.NameEquals("resourceId")) { if (property.Value.ValueKind == JsonValueKind.Null) { resourceId = null; continue; } resourceId = property.Value.GetString(); continue; } if (property.NameEquals("timeout")) { if (property.Value.ValueKind == JsonValueKind.Null) { timeout = null; continue; } timeout = property.Value.GetTimeSpan("P"); continue; } if (property.NameEquals("region")) { if (property.Value.ValueKind == JsonValueKind.Null) { region = null; continue; } region = property.Value.GetString(); continue; } if (property.NameEquals("degreeOfParallelism")) { if (property.Value.ValueKind == JsonValueKind.Null) { degreeOfParallelism = null; continue; } degreeOfParallelism = property.Value.GetInt32(); continue; } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } outputs = array; continue; } } return(new AzureMachineLearningSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, uri.Value, key.Value, resourceId.Value, Optional.ToNullable(timeout), region.Value, Optional.ToNullable(degreeOfParallelism))); }
internal static SplitSkill DeserializeSplitSkill(JsonElement element) { SplitSkillLanguage?defaultLanguageCode = default; TextSplitMode? textSplitMode = default; int? maximumPageLength = default; string odataType = default; string name = default; string description = default; string context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("defaultLanguageCode")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } defaultLanguageCode = new SplitSkillLanguage(property.Value.GetString()); continue; } if (property.NameEquals("textSplitMode")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } textSplitMode = new TextSplitMode(property.Value.GetString()); continue; } if (property.NameEquals("maximumPageLength")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } maximumPageLength = property.Value.GetInt32(); continue; } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } } outputs = array; continue; } } return(new SplitSkill(odataType, name, description, context, inputs, outputs, defaultLanguageCode, textSplitMode, maximumPageLength)); }
internal static TextTranslationSkill DeserializeTextTranslationSkill(JsonElement element) { TextTranslationSkillLanguage defaultToLanguageCode = default; Optional <TextTranslationSkillLanguage?> defaultFromLanguageCode = default; Optional <TextTranslationSkillLanguage?> suggestedFrom = default; string odataType = default; Optional <string> name = default; Optional <string> description = default; Optional <string> context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("defaultToLanguageCode")) { defaultToLanguageCode = new TextTranslationSkillLanguage(property.Value.GetString()); continue; } if (property.NameEquals("defaultFromLanguageCode")) { if (property.Value.ValueKind == JsonValueKind.Null) { defaultFromLanguageCode = null; continue; } defaultFromLanguageCode = new TextTranslationSkillLanguage(property.Value.GetString()); continue; } if (property.NameEquals("suggestedFrom")) { if (property.Value.ValueKind == JsonValueKind.Null) { suggestedFrom = null; continue; } suggestedFrom = new TextTranslationSkillLanguage(property.Value.GetString()); continue; } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } outputs = array; continue; } } return(new TextTranslationSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, defaultToLanguageCode, Optional.ToNullable(defaultFromLanguageCode), Optional.ToNullable(suggestedFrom))); }
internal static SearchIndexerSkill DeserializeSearchIndexerSkill(JsonElement element) { if (element.TryGetProperty("@odata.type", out JsonElement discriminator)) { switch (discriminator.GetString()) { case "#Microsoft.Skills.Custom.AmlSkill": return(AzureMachineLearningSkill.DeserializeAzureMachineLearningSkill(element)); case "#Microsoft.Skills.Custom.WebApiSkill": return(WebApiSkill.DeserializeWebApiSkill(element)); case "#Microsoft.Skills.Text.CustomEntityLookupSkill": return(CustomEntityLookupSkill.DeserializeCustomEntityLookupSkill(element)); case "#Microsoft.Skills.Text.EntityRecognitionSkill": return(EntityRecognitionSkill.DeserializeEntityRecognitionSkill(element)); case "#Microsoft.Skills.Text.KeyPhraseExtractionSkill": return(KeyPhraseExtractionSkill.DeserializeKeyPhraseExtractionSkill(element)); case "#Microsoft.Skills.Text.LanguageDetectionSkill": return(LanguageDetectionSkill.DeserializeLanguageDetectionSkill(element)); case "#Microsoft.Skills.Text.MergeSkill": return(MergeSkill.DeserializeMergeSkill(element)); case "#Microsoft.Skills.Text.PIIDetectionSkill": return(PiiDetectionSkill.DeserializePiiDetectionSkill(element)); case "#Microsoft.Skills.Text.SentimentSkill": return(SentimentSkill.DeserializeSentimentSkill(element)); case "#Microsoft.Skills.Text.SplitSkill": return(SplitSkill.DeserializeSplitSkill(element)); case "#Microsoft.Skills.Text.TranslationSkill": return(TextTranslationSkill.DeserializeTextTranslationSkill(element)); case "#Microsoft.Skills.Text.V3.EntityLinkingSkill": return(EntityLinkingSkill.DeserializeEntityLinkingSkill(element)); case "#Microsoft.Skills.Text.V3.EntityRecognitionSkill": return(EntityRecognitionSkillV3.DeserializeEntityRecognitionSkillV3(element)); case "#Microsoft.Skills.Text.V3.SentimentSkill": return(SentimentSkillV3.DeserializeSentimentSkillV3(element)); case "#Microsoft.Skills.Util.ConditionalSkill": return(ConditionalSkill.DeserializeConditionalSkill(element)); case "#Microsoft.Skills.Util.DocumentExtractionSkill": return(DocumentExtractionSkill.DeserializeDocumentExtractionSkill(element)); case "#Microsoft.Skills.Util.ShaperSkill": return(ShaperSkill.DeserializeShaperSkill(element)); case "#Microsoft.Skills.Vision.ImageAnalysisSkill": return(ImageAnalysisSkill.DeserializeImageAnalysisSkill(element)); case "#Microsoft.Skills.Vision.OcrSkill": return(OcrSkill.DeserializeOcrSkill(element)); } } string odataType = default; Optional <string> name = default; Optional <string> description = default; Optional <string> context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } outputs = array; continue; } } return(new SearchIndexerSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs)); }
internal static SearchIndexerSkill DeserializeSearchIndexerSkill(JsonElement element) { if (element.TryGetProperty("@odata.type", out JsonElement discriminator)) { switch (discriminator.GetString()) { case "#Microsoft.Skills.Custom.WebApiSkill": return(WebApiSkill.DeserializeWebApiSkill(element)); case "#Microsoft.Skills.Text.EntityRecognitionSkill": return(EntityRecognitionSkill.DeserializeEntityRecognitionSkill(element)); case "#Microsoft.Skills.Text.KeyPhraseExtractionSkill": return(KeyPhraseExtractionSkill.DeserializeKeyPhraseExtractionSkill(element)); case "#Microsoft.Skills.Text.LanguageDetectionSkill": return(LanguageDetectionSkill.DeserializeLanguageDetectionSkill(element)); case "#Microsoft.Skills.Text.MergeSkill": return(MergeSkill.DeserializeMergeSkill(element)); case "#Microsoft.Skills.Text.SentimentSkill": return(SentimentSkill.DeserializeSentimentSkill(element)); case "#Microsoft.Skills.Text.SplitSkill": return(SplitSkill.DeserializeSplitSkill(element)); case "#Microsoft.Skills.Text.TranslationSkill": return(TextTranslationSkill.DeserializeTextTranslationSkill(element)); case "#Microsoft.Skills.Util.ConditionalSkill": return(ConditionalSkill.DeserializeConditionalSkill(element)); case "#Microsoft.Skills.Util.ShaperSkill": return(ShaperSkill.DeserializeShaperSkill(element)); case "#Microsoft.Skills.Vision.ImageAnalysisSkill": return(ImageAnalysisSkill.DeserializeImageAnalysisSkill(element)); case "#Microsoft.Skills.Vision.OcrSkill": return(OcrSkill.DeserializeOcrSkill(element)); } } string odataType = default; string name = default; string description = default; string context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } } outputs = array; continue; } } return(new SearchIndexerSkill(odataType, name, description, context, inputs, outputs)); }
internal static EntityRecognitionSkill DeserializeEntityRecognitionSkill(JsonElement element) { IList <EntityCategory> categories = default; EntityRecognitionSkillLanguage?defaultLanguageCode = default; bool? includeTypelessEntities = default; double?minimumPrecision = default; string odataType = default; string name = default; string description = default; string context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("categories")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } List <EntityCategory> array = new List <EntityCategory>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(item.GetString().ToEntityCategory()); } categories = array; continue; } if (property.NameEquals("defaultLanguageCode")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } defaultLanguageCode = new EntityRecognitionSkillLanguage(property.Value.GetString()); continue; } if (property.NameEquals("includeTypelessEntities")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } includeTypelessEntities = property.Value.GetBoolean(); continue; } if (property.NameEquals("minimumPrecision")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } minimumPrecision = property.Value.GetDouble(); continue; } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } } outputs = array; continue; } } return(new EntityRecognitionSkill(odataType, name, description, context, inputs, outputs, categories, defaultLanguageCode, includeTypelessEntities, minimumPrecision)); }
internal static SentimentSkillV3 DeserializeSentimentSkillV3(JsonElement element) { Optional <string> defaultLanguageCode = default; Optional <bool> includeOpinionMining = default; Optional <string> modelVersion = default; string odataType = default; Optional <string> name = default; Optional <string> description = default; Optional <string> context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("defaultLanguageCode")) { if (property.Value.ValueKind == JsonValueKind.Null) { defaultLanguageCode = null; continue; } defaultLanguageCode = property.Value.GetString(); continue; } if (property.NameEquals("includeOpinionMining")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } includeOpinionMining = property.Value.GetBoolean(); continue; } if (property.NameEquals("modelVersion")) { if (property.Value.ValueKind == JsonValueKind.Null) { modelVersion = null; continue; } modelVersion = property.Value.GetString(); continue; } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } outputs = array; continue; } } return(new SentimentSkillV3(odataType, name.Value, description.Value, context.Value, inputs, outputs, defaultLanguageCode.Value, Optional.ToNullable(includeOpinionMining), modelVersion.Value)); }
internal static PiiDetectionSkill DeserializePiiDetectionSkill(JsonElement element) { Optional <string> defaultLanguageCode = default; Optional <double?> minimumPrecision = default; Optional <PiiDetectionSkillMaskingMode> maskingMode = default; Optional <string> maskingCharacter = default; Optional <string> modelVersion = default; Optional <IList <string> > piiCategories = default; Optional <string> domain = default; string odataType = default; Optional <string> name = default; Optional <string> description = default; Optional <string> context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("defaultLanguageCode")) { if (property.Value.ValueKind == JsonValueKind.Null) { defaultLanguageCode = null; continue; } defaultLanguageCode = property.Value.GetString(); continue; } if (property.NameEquals("minimumPrecision")) { if (property.Value.ValueKind == JsonValueKind.Null) { minimumPrecision = null; continue; } minimumPrecision = property.Value.GetDouble(); continue; } if (property.NameEquals("maskingMode")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } maskingMode = new PiiDetectionSkillMaskingMode(property.Value.GetString()); continue; } if (property.NameEquals("maskingCharacter")) { if (property.Value.ValueKind == JsonValueKind.Null) { maskingCharacter = null; continue; } maskingCharacter = property.Value.GetString(); continue; } if (property.NameEquals("modelVersion")) { if (property.Value.ValueKind == JsonValueKind.Null) { modelVersion = null; continue; } modelVersion = property.Value.GetString(); continue; } if (property.NameEquals("piiCategories")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <string> array = new List <string>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(item.GetString()); } piiCategories = array; continue; } if (property.NameEquals("domain")) { if (property.Value.ValueKind == JsonValueKind.Null) { domain = null; continue; } domain = property.Value.GetString(); continue; } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } outputs = array; continue; } } return(new PiiDetectionSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, defaultLanguageCode.Value, Optional.ToNullable(minimumPrecision), Optional.ToNullable(maskingMode), maskingCharacter.Value, modelVersion.Value, Optional.ToList(piiCategories), domain.Value)); }
internal static OcrSkill DeserializeOcrSkill(JsonElement element) { TextExtractionAlgorithm?textExtractionAlgorithm = default; OcrSkillLanguage? defaultLanguageCode = default; bool? detectOrientation = default; string odataType = default; string name = default; string description = default; string context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("textExtractionAlgorithm")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } textExtractionAlgorithm = property.Value.GetString().ToTextExtractionAlgorithm(); continue; } if (property.NameEquals("defaultLanguageCode")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } defaultLanguageCode = new OcrSkillLanguage(property.Value.GetString()); continue; } if (property.NameEquals("detectOrientation")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } detectOrientation = property.Value.GetBoolean(); continue; } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } } outputs = array; continue; } } return(new OcrSkill(odataType, name, description, context, inputs, outputs, textExtractionAlgorithm, defaultLanguageCode, detectOrientation)); }
internal static SplitSkill DeserializeSplitSkill(JsonElement element) { Optional <SplitSkillLanguage> defaultLanguageCode = default; Optional <TextSplitMode> textSplitMode = default; Optional <int?> maximumPageLength = default; string odataType = default; Optional <string> name = default; Optional <string> description = default; Optional <string> context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("defaultLanguageCode")) { defaultLanguageCode = new SplitSkillLanguage(property.Value.GetString()); continue; } if (property.NameEquals("textSplitMode")) { textSplitMode = new TextSplitMode(property.Value.GetString()); continue; } if (property.NameEquals("maximumPageLength")) { if (property.Value.ValueKind == JsonValueKind.Null) { maximumPageLength = null; continue; } maximumPageLength = property.Value.GetInt32(); continue; } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } outputs = array; continue; } } return(new SplitSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, Optional.ToNullable(defaultLanguageCode), Optional.ToNullable(textSplitMode), Optional.ToNullable(maximumPageLength))); }
internal static DocumentExtractionSkill DeserializeDocumentExtractionSkill(JsonElement element) { Optional <BlobIndexerParsingMode?> parsingMode = default; Optional <BlobIndexerDataToExtract?> dataToExtract = default; Optional <IDictionary <string, object> > configuration = default; string odataType = default; Optional <string> name = default; Optional <string> description = default; Optional <string> context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("parsingMode")) { if (property.Value.ValueKind == JsonValueKind.Null) { parsingMode = null; continue; } parsingMode = new BlobIndexerParsingMode(property.Value.GetString()); continue; } if (property.NameEquals("dataToExtract")) { if (property.Value.ValueKind == JsonValueKind.Null) { dataToExtract = null; continue; } dataToExtract = new BlobIndexerDataToExtract(property.Value.GetString()); continue; } if (property.NameEquals("configuration")) { if (property.Value.ValueKind == JsonValueKind.Null) { configuration = null; continue; } Dictionary <string, object> dictionary = new Dictionary <string, object>(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetObject()); } configuration = dictionary; continue; } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } outputs = array; continue; } } return(new DocumentExtractionSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, Optional.ToNullable(parsingMode), Optional.ToNullable(dataToExtract), Optional.ToDictionary(configuration))); }
internal static WebApiSkill DeserializeWebApiSkill(JsonElement element) { string uri = default; IDictionary <string, string> httpHeaders = default; string httpMethod = default; TimeSpan?timeout = default; int? batchSize = default; int? degreeOfParallelism = default; string odataType = default; string name = default; string description = default; string context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("uri")) { uri = property.Value.GetString(); continue; } if (property.NameEquals("httpHeaders")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { if (property0.Value.ValueKind == JsonValueKind.Null) { dictionary.Add(property0.Name, null); } else { dictionary.Add(property0.Name, property0.Value.GetString()); } } httpHeaders = dictionary; continue; } if (property.NameEquals("httpMethod")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } httpMethod = property.Value.GetString(); continue; } if (property.NameEquals("timeout")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } timeout = property.Value.GetTimeSpan("P"); continue; } if (property.NameEquals("batchSize")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } batchSize = property.Value.GetInt32(); continue; } if (property.NameEquals("degreeOfParallelism")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } degreeOfParallelism = property.Value.GetInt32(); continue; } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } } outputs = array; continue; } } return(new WebApiSkill(odataType, name, description, context, inputs, outputs, uri, httpHeaders, httpMethod, timeout, batchSize, degreeOfParallelism)); }
internal static EntityRecognitionSkill DeserializeEntityRecognitionSkill(JsonElement element) { Optional <IList <EntityCategory> > categories = default; Optional <EntityRecognitionSkillLanguage?> defaultLanguageCode = default; Optional <bool?> includeTypelessEntities = default; Optional <double?> minimumPrecision = default; string odataType = default; Optional <string> name = default; Optional <string> description = default; Optional <string> context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("categories")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <EntityCategory> array = new List <EntityCategory>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(new EntityCategory(item.GetString())); } categories = array; continue; } if (property.NameEquals("defaultLanguageCode")) { if (property.Value.ValueKind == JsonValueKind.Null) { defaultLanguageCode = null; continue; } defaultLanguageCode = new EntityRecognitionSkillLanguage(property.Value.GetString()); continue; } if (property.NameEquals("includeTypelessEntities")) { if (property.Value.ValueKind == JsonValueKind.Null) { includeTypelessEntities = null; continue; } includeTypelessEntities = property.Value.GetBoolean(); continue; } if (property.NameEquals("minimumPrecision")) { if (property.Value.ValueKind == JsonValueKind.Null) { minimumPrecision = null; continue; } minimumPrecision = property.Value.GetDouble(); continue; } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } outputs = array; continue; } } return(new EntityRecognitionSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, Optional.ToList(categories), Optional.ToNullable(defaultLanguageCode), Optional.ToNullable(includeTypelessEntities), Optional.ToNullable(minimumPrecision))); }
internal static LanguageDetectionSkill DeserializeLanguageDetectionSkill(JsonElement element) { Optional <string> defaultCountryHint = default; Optional <string> modelVersion = default; string odataType = default; Optional <string> name = default; Optional <string> description = default; Optional <string> context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("defaultCountryHint")) { if (property.Value.ValueKind == JsonValueKind.Null) { defaultCountryHint = null; continue; } defaultCountryHint = property.Value.GetString(); continue; } if (property.NameEquals("modelVersion")) { if (property.Value.ValueKind == JsonValueKind.Null) { modelVersion = null; continue; } modelVersion = property.Value.GetString(); continue; } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } outputs = array; continue; } } return(new LanguageDetectionSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, defaultCountryHint.Value, modelVersion.Value)); }
internal static ConditionalSkill DeserializeConditionalSkill(JsonElement element) { string odataType = default; string name = default; string description = default; string context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } } outputs = array; continue; } } return(new ConditionalSkill(odataType, name, description, context, inputs, outputs)); }
internal static WebApiSkill DeserializeWebApiSkill(JsonElement element) { string uri = default; Optional <IDictionary <string, string> > httpHeaders = default; Optional <string> httpMethod = default; Optional <TimeSpan> timeout = default; Optional <int?> batchSize = default; Optional <int?> degreeOfParallelism = default; string odataType = default; Optional <string> name = default; Optional <string> description = default; Optional <string> context = default; IList <InputFieldMappingEntry> inputs = default; IList <OutputFieldMappingEntry> outputs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("uri")) { uri = property.Value.GetString(); continue; } if (property.NameEquals("httpHeaders")) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } httpHeaders = dictionary; continue; } if (property.NameEquals("httpMethod")) { httpMethod = property.Value.GetString(); continue; } if (property.NameEquals("timeout")) { timeout = property.Value.GetTimeSpan("P"); continue; } if (property.NameEquals("batchSize")) { if (property.Value.ValueKind == JsonValueKind.Null) { batchSize = null; continue; } batchSize = property.Value.GetInt32(); continue; } if (property.NameEquals("degreeOfParallelism")) { if (property.Value.ValueKind == JsonValueKind.Null) { degreeOfParallelism = null; continue; } degreeOfParallelism = property.Value.GetInt32(); continue; } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("description")) { description = property.Value.GetString(); continue; } if (property.NameEquals("context")) { context = property.Value.GetString(); continue; } if (property.NameEquals("inputs")) { List <InputFieldMappingEntry> array = new List <InputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item)); } inputs = array; continue; } if (property.NameEquals("outputs")) { List <OutputFieldMappingEntry> array = new List <OutputFieldMappingEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item)); } outputs = array; continue; } } return(new WebApiSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, uri, Optional.ToDictionary(httpHeaders), httpMethod.Value, Optional.ToNullable(timeout), Optional.ToNullable(batchSize), Optional.ToNullable(degreeOfParallelism))); }