internal InnerError(string code, string message, IReadOnlyDictionary <string, string> details, string target, InnerError innererror)
 {
     Code       = code;
     Message    = message;
     Details    = details;
     Target     = target;
     Innererror = innererror;
 }
 internal TextAnalyticsErrorInternal(string code, string message, string target, InnerError innererror, IReadOnlyList <TextAnalyticsErrorInternal> details)
 {
     Code       = code;
     Message    = message;
     Target     = target;
     Innererror = innererror;
     Details    = details;
 }
        internal static TextAnalyticsErrorInternal DeserializeTextAnalyticsErrorInternal(JsonElement element)
        {
            string                code       = default;
            string                message    = default;
            Optional <string>     target     = default;
            Optional <InnerError> innererror = default;
            Optional <IReadOnlyList <TextAnalyticsErrorInternal> > details = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("code"))
                {
                    code = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("message"))
                {
                    message = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("target"))
                {
                    target = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("innererror"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    innererror = InnerError.DeserializeInnerError(property.Value);
                    continue;
                }
                if (property.NameEquals("details"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <TextAnalyticsErrorInternal> array = new List <TextAnalyticsErrorInternal>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DeserializeTextAnalyticsErrorInternal(item));
                    }
                    details = array;
                    continue;
                }
            }
            return(new TextAnalyticsErrorInternal(code, message, target.Value, innererror.Value, Optional.ToList(details)));
        }