Ejemplo 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));
        }
Ejemplo n.º 2
0
 internal AzureReachabilityReportParameters(AzureReachabilityReportLocation providerLocation, IList <string> providers, IList <string> azureLocations, DateTimeOffset startTime, DateTimeOffset endTime)
 {
     ProviderLocation = providerLocation;
     Providers        = providers;
     AzureLocations   = azureLocations;
     StartTime        = startTime;
     EndTime          = endTime;
 }
Ejemplo n.º 3
0
        public AzureReachabilityReportParameters(AzureReachabilityReportLocation providerLocation, DateTimeOffset startTime, DateTimeOffset endTime)
        {
            if (providerLocation == null)
            {
                throw new ArgumentNullException(nameof(providerLocation));
            }

            ProviderLocation = providerLocation;
            StartTime        = startTime;
            EndTime          = endTime;
        }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 5
0
        public AzureReachabilityReportContent(AzureReachabilityReportLocation providerLocation, DateTimeOffset startOn, DateTimeOffset endOn)
        {
            if (providerLocation == null)
            {
                throw new ArgumentNullException(nameof(providerLocation));
            }

            ProviderLocation = providerLocation;
            Providers        = new ChangeTrackingList <string>();
            AzureLocations   = new ChangeTrackingList <AzureLocation>();
            StartOn          = startOn;
            EndOn            = endOn;
        }
        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.ToList();
        }
 internal AzureReachabilityReport(string aggregationLevel, AzureReachabilityReportLocation providerLocation, IReadOnlyList <AzureReachabilityReportItem> reachabilityReport)
 {
     AggregationLevel   = aggregationLevel;
     ProviderLocation   = providerLocation;
     ReachabilityReport = reachabilityReport;
 }