Ejemplo n.º 1
0
        internal static ConversationTargetIntentResult DeserializeConversationTargetIntentResult(JsonElement element)
        {
            Optional <ConversationResult> result            = default;
            TargetProjectKind             targetProjectKind = default;
            Optional <string>             apiVersion        = default;
            double confidenceScore = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("result"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    result = ConversationResult.DeserializeConversationResult(property.Value);
                    continue;
                }
                if (property.NameEquals("targetProjectKind"))
                {
                    targetProjectKind = new TargetProjectKind(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("apiVersion"))
                {
                    apiVersion = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("confidenceScore"))
                {
                    confidenceScore = property.Value.GetDouble();
                    continue;
                }
            }
            return(new ConversationTargetIntentResult(targetProjectKind, apiVersion.Value, confidenceScore, result.Value));
        }
        internal static NoneLinkedTargetIntentResult DeserializeNoneLinkedTargetIntentResult(JsonElement element)
        {
            Optional <ConversationResult> result = default;
            TargetKind        targetKind         = default;
            Optional <string> apiVersion         = default;
            float             confidenceScore    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("result"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        result = null;
                        continue;
                    }
                    result = ConversationResult.DeserializeConversationResult(property.Value);
                    continue;
                }
                if (property.NameEquals("targetKind"))
                {
                    targetKind = new TargetKind(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("apiVersion"))
                {
                    apiVersion = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("confidenceScore"))
                {
                    confidenceScore = property.Value.GetSingle();
                    continue;
                }
            }
            return(new NoneLinkedTargetIntentResult(targetKind, apiVersion.Value, confidenceScore, result.Value));
        }
Ejemplo n.º 3
0
 public static NoneLinkedTargetIntentResult NoneLinkedTargetIntentResult(TargetKind targetKind = default, string apiVersion = null, double confidenceScore = default, ConversationResult result = null)
 {
     return(new NoneLinkedTargetIntentResult(targetKind, apiVersion, confidenceScore, result));
 }
 public static ConversationTargetIntentResult ConversationTargetIntentResult(TargetKind targetKind = default, string apiVersion = null, float confidence = default, ConversationResult result = null)
 {
     return(new ConversationTargetIntentResult(targetKind, apiVersion, confidence, result));
 }