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));
        }
Esempio n. 2
0
        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;
        }
Esempio n. 4
0
 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;
 }