Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DataFeed"/> class for mocking
 /// purposes.
 /// </summary>
 internal DataFeed(string id, DataFeedStatus?status, DateTimeOffset?createdOn, string creator, bool?isAdministrator,
                   IReadOnlyDictionary <string, string> metricIds, string name, DataFeedSource dataSource, DataFeedSchema schema,
                   DataFeedGranularity granularity, DataFeedIngestionSettings ingestionSettings, string description, string actionLinkTemplate,
                   DataFeedAccessMode?accessMode, DataFeedRollupSettings rollupSettings, DataFeedMissingDataPointFillSettings missingDataPointFillSettings,
                   IList <string> administrators, IList <string> viewers)
 {
     Id                           = id;
     Status                       = status;
     CreatedOn                    = createdOn;
     Creator                      = creator;
     IsAdministrator              = isAdministrator;
     MetricIds                    = metricIds;
     Name                         = name;
     DataSource                   = dataSource;
     Schema                       = schema;
     Granularity                  = granularity;
     IngestionSettings            = ingestionSettings;
     Description                  = description;
     ActionLinkTemplate           = actionLinkTemplate;
     AccessMode                   = accessMode;
     RollupSettings               = rollupSettings;
     MissingDataPointFillSettings = missingDataPointFillSettings;
     Administrators               = administrators;
     Viewers                      = viewers;
 }
Exemplo n.º 2
0
 internal DataFeedOptions(DataFeedDetail dataFeedDetail)
 {
     Administrators  = dataFeedDetail.Admins;
     Viewers         = dataFeedDetail.Viewers;
     FeedDescription = dataFeedDetail.DataFeedDescription;
     AccessMode      = dataFeedDetail.ViewMode;
     RollupSettings  = new DataFeedRollupSettings(dataFeedDetail);
     MissingDataPointFillSettings = new DataFeedMissingDataPointFillSettings(dataFeedDetail);
 }
Exemplo n.º 3
0
 internal DataFeed(DataFeedDetail dataFeedDetail)
 {
     Id                           = dataFeedDetail.DataFeedId;
     Status                       = dataFeedDetail.Status;
     CreatedTime                  = dataFeedDetail.CreatedTime;
     Creator                      = dataFeedDetail.Creator;
     IsAdministrator              = dataFeedDetail.IsAdmin;
     MetricIds                    = dataFeedDetail.Metrics.ToDictionary(metric => metric.MetricName, metric => metric.MetricId);
     Name                         = dataFeedDetail.DataFeedName;
     DataSource                   = DataFeedSource.GetDataFeedSource(dataFeedDetail);
     Schema                       = new DataFeedSchema(dataFeedDetail);
     Granularity                  = new DataFeedGranularity(dataFeedDetail);
     IngestionSettings            = new DataFeedIngestionSettings(dataFeedDetail);
     Description                  = dataFeedDetail.DataFeedDescription;
     ActionLinkTemplate           = dataFeedDetail.ActionLinkTemplate;
     AccessMode                   = dataFeedDetail.ViewMode;
     RollupSettings               = new DataFeedRollupSettings(dataFeedDetail);
     MissingDataPointFillSettings = new DataFeedMissingDataPointFillSettings(dataFeedDetail);
     Administrators               = dataFeedDetail.Admins;
     Viewers                      = dataFeedDetail.Viewers;
 }
        /// <summary>
        /// Initializes a new instance of <see cref="Models.DataFeed"/> for mocking purposes.
        /// </summary>
        /// <param name="id">Sets the <see cref="DataFeed.Id"/> property.</param>
        /// <param name="status">Sets the <see cref="DataFeed.Status"/> property.</param>
        /// <param name="createdOn">Sets the <see cref="DataFeed.CreatedOn"/> property.</param>
        /// <param name="creator">Sets the <see cref="DataFeed.Creator"/> property.</param>
        /// <param name="isAdministrator">Sets the <see cref="DataFeed.IsAdministrator"/> property.</param>
        /// <param name="metricIds">Sets the <see cref="DataFeed.MetricIds"/> property.</param>
        /// <param name="name">Sets the <see cref="DataFeed.Name"/> property.</param>
        /// <param name="dataSource">Sets the <see cref="DataFeed.DataSource"/> property.</param>
        /// <param name="schema">Sets the <see cref="DataFeed.Schema"/> property.</param>
        /// <param name="granularity">Sets the <see cref="DataFeed.Granularity"/> property.</param>
        /// <param name="ingestionSettings">Sets the <see cref="DataFeed.IngestionSettings"/> property.</param>
        /// <param name="description">Sets the <see cref="DataFeed.Description"/> property.</param>
        /// <param name="actionLinkTemplate">Sets the <see cref="DataFeed.ActionLinkTemplate"/> property.</param>
        /// <param name="accessMode">Sets the <see cref="DataFeed.AccessMode"/> property.</param>
        /// <param name="rollupSettings">Sets the <see cref="DataFeed.RollupSettings"/> property.</param>
        /// <param name="missingDataPointFillSettings">Sets the <see cref="DataFeed.MissingDataPointFillSettings"/> property.</param>
        /// <param name="administrators">Sets the <see cref="DataFeed.Administrators"/> property.</param>
        /// <param name="viewers">Sets the <see cref="DataFeed.Viewers"/> property.</param>
        /// <returns>A new instance of <see cref="Models.AnomalyIncident"/> for mocking purposes.</returns>
        public static DataFeed DataFeed(string id = null, DataFeedStatus?status = null, DateTimeOffset?createdOn = null, string creator = null, bool?isAdministrator = null, IReadOnlyDictionary <string, string> metricIds = null, string name = null, DataFeedSource dataSource = null, DataFeedSchema schema = null, DataFeedGranularity granularity = null, DataFeedIngestionSettings ingestionSettings = null, string description = null, string actionLinkTemplate = null, DataFeedAccessMode?accessMode = null, DataFeedRollupSettings rollupSettings = null, DataFeedMissingDataPointFillSettings missingDataPointFillSettings = null, IEnumerable <string> administrators = null, IEnumerable <string> viewers = null)
        {
            metricIds      = metricIds ?? new Dictionary <string, string>();
            administrators = administrators ?? new List <string>();
            viewers        = viewers ?? new List <string>();

            return(new DataFeed(id, status, createdOn, creator, isAdministrator, metricIds, name, dataSource, schema, granularity, ingestionSettings, description, actionLinkTemplate, accessMode, rollupSettings, missingDataPointFillSettings, administrators.ToList(), viewers.ToList()));
        }