internal static SentimentResponseDocumentsItem DeserializeSentimentResponseDocumentsItem(JsonElement element)
        {
            TextSentiment                     sentiment        = default;
            SentimentConfidenceScores         confidenceScores = default;
            IList <SentenceSentimentInternal> sentences        = default;
            string id = default;
            IList <DocumentWarning>           warnings   = default;
            Optional <TextDocumentStatistics> statistics = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("sentiment"))
                {
                    sentiment = property.Value.GetString().ToTextSentiment();
                    continue;
                }
                if (property.NameEquals("confidenceScores"))
                {
                    confidenceScores = SentimentConfidenceScores.DeserializeSentimentConfidenceScores(property.Value);
                    continue;
                }
                if (property.NameEquals("sentences"))
                {
                    List <SentenceSentimentInternal> array = new List <SentenceSentimentInternal>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(SentenceSentimentInternal.DeserializeSentenceSentimentInternal(item));
                    }
                    sentences = array;
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("warnings"))
                {
                    List <DocumentWarning> array = new List <DocumentWarning>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DocumentWarning.DeserializeDocumentWarning(item));
                    }
                    warnings = array;
                    continue;
                }
                if (property.NameEquals("statistics"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    statistics = TextDocumentStatistics.DeserializeTextDocumentStatistics(property.Value);
                    continue;
                }
            }
            return(new SentimentResponseDocumentsItem(id, warnings, Optional.ToNullable(statistics), sentiment, confidenceScores, sentences));
        }
        internal static DocumentSentimentInternal DeserializeDocumentSentimentInternal(JsonElement element)
        {
            string        id        = default;
            TextSentiment sentiment = default;
            Optional <TextDocumentStatistics>            statistics       = default;
            SentimentConfidenceScores                    confidenceScores = default;
            IReadOnlyList <SentenceSentimentInternal>    sentences        = default;
            IReadOnlyList <TextAnalyticsWarningInternal> warnings         = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sentiment"))
                {
                    sentiment = property.Value.GetString().ToTextSentiment();
                    continue;
                }
                if (property.NameEquals("statistics"))
                {
                    statistics = TextDocumentStatistics.DeserializeTextDocumentStatistics(property.Value);
                    continue;
                }
                if (property.NameEquals("confidenceScores"))
                {
                    confidenceScores = SentimentConfidenceScores.DeserializeSentimentConfidenceScores(property.Value);
                    continue;
                }
                if (property.NameEquals("sentences"))
                {
                    List <SentenceSentimentInternal> array = new List <SentenceSentimentInternal>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(SentenceSentimentInternal.DeserializeSentenceSentimentInternal(item));
                    }
                    sentences = array;
                    continue;
                }
                if (property.NameEquals("warnings"))
                {
                    List <TextAnalyticsWarningInternal> array = new List <TextAnalyticsWarningInternal>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(TextAnalyticsWarningInternal.DeserializeTextAnalyticsWarningInternal(item));
                    }
                    warnings = array;
                    continue;
                }
            }
            return(new DocumentSentimentInternal(id, sentiment, Optional.ToNullable(statistics), confidenceScores, sentences, warnings));
        }