internal AnomalyFeedback(FeedbackType feedbackType, Guid?feedbackId, DateTimeOffset?createdTime, string userPrincipal, Guid metricId, FeedbackDimensionFilter dimensionFilter, DateTimeOffset startTime, DateTimeOffset endTime, AnomalyFeedbackValue value, Guid?anomalyDetectionConfigurationId, MetricAnomalyDetectionConfiguration anomalyDetectionConfigurationSnapshot) : base(feedbackType, feedbackId, createdTime, userPrincipal, metricId, dimensionFilter)
 {
     StartTime = startTime;
     EndTime   = endTime;
     Value     = value;
     AnomalyDetectionConfigurationId       = anomalyDetectionConfigurationId;
     AnomalyDetectionConfigurationSnapshot = anomalyDetectionConfigurationSnapshot;
     FeedbackType = feedbackType;
 }
        internal static AnomalyDetectionConfigurationList DeserializeAnomalyDetectionConfigurationList(JsonElement element)
        {
            IReadOnlyList <MetricAnomalyDetectionConfiguration> value = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    List <MetricAnomalyDetectionConfiguration> array = new List <MetricAnomalyDetectionConfiguration>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(MetricAnomalyDetectionConfiguration.DeserializeMetricAnomalyDetectionConfiguration(item));
                    }
                    value = array;
                    continue;
                }
            }
            return(new AnomalyDetectionConfigurationList(value));
        }
        internal static MetricAnomalyFeedback DeserializeMetricAnomalyFeedback(JsonElement element)
        {
            DateTimeOffset       startTime = default;
            DateTimeOffset       endTime   = default;
            AnomalyFeedbackValue value     = default;
            Optional <Guid?>     anomalyDetectionConfigurationId = default;
            Optional <MetricAnomalyDetectionConfiguration> anomalyDetectionConfigurationSnapshot = default;
            FeedbackType              feedbackType  = default;
            Optional <string>         feedbackId    = default;
            Optional <DateTimeOffset> createdTime   = default;
            Optional <string>         userPrincipal = default;
            string metricId = default;
            FeedbackDimensionFilter dimensionFilter = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("startTime"))
                {
                    startTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("endTime"))
                {
                    endTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("value"))
                {
                    value = AnomalyFeedbackValue.DeserializeAnomalyFeedbackValue(property.Value);
                    continue;
                }
                if (property.NameEquals("anomalyDetectionConfigurationId"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        anomalyDetectionConfigurationId = null;
                        continue;
                    }
                    anomalyDetectionConfigurationId = property.Value.GetGuid();
                    continue;
                }
                if (property.NameEquals("anomalyDetectionConfigurationSnapshot"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        anomalyDetectionConfigurationSnapshot = null;
                        continue;
                    }
                    anomalyDetectionConfigurationSnapshot = MetricAnomalyDetectionConfiguration.DeserializeMetricAnomalyDetectionConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("feedbackType"))
                {
                    feedbackType = new FeedbackType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("feedbackId"))
                {
                    feedbackId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("createdTime"))
                {
                    createdTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("userPrincipal"))
                {
                    userPrincipal = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("metricId"))
                {
                    metricId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("dimensionFilter"))
                {
                    dimensionFilter = FeedbackDimensionFilter.DeserializeFeedbackDimensionFilter(property.Value);
                    continue;
                }
            }
            return(new MetricAnomalyFeedback(feedbackType, feedbackId.Value, Optional.ToNullable(createdTime), userPrincipal.Value, metricId, dimensionFilter, startTime, endTime, value, Optional.ToNullable(anomalyDetectionConfigurationId), anomalyDetectionConfigurationSnapshot.Value));
        }