Exemplo n.º 1
0
        internal static AzureReachabilityReport DeserializeAzureReachabilityReport(JsonElement element)
        {
            string aggregationLevel = default;
            AzureReachabilityReportLocation             providerLocation   = default;
            IReadOnlyList <AzureReachabilityReportItem> reachabilityReport = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("aggregationLevel"))
                {
                    aggregationLevel = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("providerLocation"))
                {
                    providerLocation = AzureReachabilityReportLocation.DeserializeAzureReachabilityReportLocation(property.Value);
                    continue;
                }
                if (property.NameEquals("reachabilityReport"))
                {
                    List <AzureReachabilityReportItem> array = new List <AzureReachabilityReportItem>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(AzureReachabilityReportItem.DeserializeAzureReachabilityReportItem(item));
                    }
                    reachabilityReport = array;
                    continue;
                }
            }
            return(new AzureReachabilityReport(aggregationLevel, providerLocation, reachabilityReport));
        }
 internal AzureReachabilityReportParameters(AzureReachabilityReportLocation providerLocation, IList <string> providers, IList <string> azureLocations, DateTimeOffset startTime, DateTimeOffset endTime)
 {
     ProviderLocation = providerLocation;
     Providers        = providers;
     AzureLocations   = azureLocations;
     StartTime        = startTime;
     EndTime          = endTime;
 }
        public AzureReachabilityReportParameters(AzureReachabilityReportLocation providerLocation, DateTimeOffset startTime, DateTimeOffset endTime)
        {
            if (providerLocation == null)
            {
                throw new ArgumentNullException(nameof(providerLocation));
            }

            ProviderLocation = providerLocation;
            StartTime        = startTime;
            EndTime          = endTime;
        }
        public AzureReachabilityReportParameters(AzureReachabilityReportLocation providerLocation, DateTimeOffset startTime, DateTimeOffset endTime)
        {
            if (providerLocation == null)
            {
                throw new ArgumentNullException(nameof(providerLocation));
            }

            ProviderLocation = providerLocation;
            Providers        = new ChangeTrackingList <string>();
            AzureLocations   = new ChangeTrackingList <string>();
            StartTime        = startTime;
            EndTime          = endTime;
        }
        internal AzureReachabilityReport(string aggregationLevel, AzureReachabilityReportLocation providerLocation, IEnumerable <AzureReachabilityReportItem> reachabilityReport)
        {
            if (aggregationLevel == null)
            {
                throw new ArgumentNullException(nameof(aggregationLevel));
            }
            if (providerLocation == null)
            {
                throw new ArgumentNullException(nameof(providerLocation));
            }
            if (reachabilityReport == null)
            {
                throw new ArgumentNullException(nameof(reachabilityReport));
            }

            AggregationLevel   = aggregationLevel;
            ProviderLocation   = providerLocation;
            ReachabilityReport = reachabilityReport.ToArray();
        }
 internal AzureReachabilityReport(string aggregationLevel, AzureReachabilityReportLocation providerLocation, IReadOnlyList <AzureReachabilityReportItem> reachabilityReport)
 {
     AggregationLevel   = aggregationLevel;
     ProviderLocation   = providerLocation;
     ReachabilityReport = reachabilityReport ?? new List <AzureReachabilityReportItem>();
 }