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 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 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 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))); }