internal static TextAnalyticsWarning DeserializeTextAnalyticsWarning(JsonElement element) { WarningCodeValue code = default; string message = default; Optional <string> targetRef = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("code")) { code = new WarningCodeValue(property.Value.GetString()); continue; } if (property.NameEquals("message")) { message = property.Value.GetString(); continue; } if (property.NameEquals("targetRef")) { targetRef = property.Value.GetString(); continue; } } return(new TextAnalyticsWarning(code, message, targetRef.Value)); }
internal TextAnalyticsWarning(WarningCodeValue code, string message) { if (message == null) { throw new ArgumentNullException(nameof(message)); } Code = code; Message = message; }
public DocumentWarning(WarningCodeValue code, string message) { if (message == null) { throw new ArgumentNullException(nameof(message)); } Code = code; Message = message; }
internal TextAnalyticsWarning(WarningCodeValue code, string message, string targetRef) { Code = code; Message = message; TargetRef = targetRef; }
public static string ToSerialString(this WarningCodeValue value) => value switch {
internal DocumentWarning(WarningCodeValue code, string message, string targetRef) { Code = code; Message = message; TargetRef = targetRef; }