private static void SetAuthenticationProperties(DataFeedDetailPatch patch, DataFeedSource dataSource) { string authentication; switch (dataSource) { case AzureBlobDataFeedSource s: authentication = s.Authentication?.ToString(); patch.AuthenticationType = (authentication == null) ? default(AuthenticationTypeEnum?) : new AuthenticationTypeEnum(authentication); break; case AzureDataExplorerDataFeedSource s: authentication = s.Authentication?.ToString(); patch.AuthenticationType = (authentication == null) ? default(AuthenticationTypeEnum?) : new AuthenticationTypeEnum(authentication); patch.CredentialId = s.DataSourceCredentialId; break; case AzureDataLakeStorageDataFeedSource s: authentication = s.Authentication?.ToString(); patch.AuthenticationType = (authentication == null) ? default(AuthenticationTypeEnum?) : new AuthenticationTypeEnum(authentication); patch.CredentialId = s.DataSourceCredentialId; break; case SqlServerDataFeedSource s: authentication = s.Authentication?.ToString(); patch.AuthenticationType = (authentication == null) ? default(AuthenticationTypeEnum?) : new AuthenticationTypeEnum(authentication); patch.CredentialId = s.DataSourceCredentialId; break; } }
/// <summary> /// Converts a data source specific <see cref="DataFeed"/> into its equivalent data source specific <see cref="DataFeedDetailPatch"/>. /// </summary> internal DataFeedDetailPatch GetPatchModel() { DataFeedDetailPatch patch = DataSource?.InstantiateDataFeedDetailPatch() ?? new DataFeedDetailPatch(); patch.DataFeedName = Name; patch.Status = Status; if (Schema != null) { patch.TimestampColumn = Schema.TimestampColumn; } if (IngestionSettings != null) { patch.DataStartFrom = ClientCommon.NormalizeDateTimeOffset(IngestionSettings.IngestionStartsOn); patch.MaxConcurrency = IngestionSettings.DataSourceRequestConcurrency; patch.MinRetryIntervalInSeconds = (long?)IngestionSettings.IngestionRetryDelay?.TotalSeconds; patch.StartOffsetInSeconds = (long?)IngestionSettings.IngestionStartOffset?.TotalSeconds; patch.StopRetryAfterInSeconds = (long?)IngestionSettings.StopRetryAfter?.TotalSeconds; } patch.DataFeedDescription = Description; patch.ActionLinkTemplate = ActionLinkTemplate; patch.ViewMode = AccessMode; if (RollupSettings != null) { patch.AllUpIdentification = RollupSettings.RollupIdentificationValue; patch.NeedRollup = RollupSettings.RollupType; patch.RollUpMethod = RollupSettings.AutoRollupMethod; patch.RollUpColumns = RollupSettings.AutoRollupGroupByColumnNames; } if (MissingDataPointFillSettings != null) { patch.FillMissingPointType = MissingDataPointFillSettings.FillType; patch.FillMissingPointValue = MissingDataPointFillSettings.CustomFillValue; } patch.Admins = Administrators; patch.Viewers = Viewers; SetAuthenticationProperties(patch, DataSource); return(patch); }
/// <summary> /// Converts a data source specific <see cref="DataFeed"/> into its equivalent data source specific <see cref="DataFeedDetailPatch"/>. /// </summary> internal DataFeedDetailPatch GetPatchModel() { DataFeedDetailPatch patch = DataSource?.InstantiateDataFeedDetailPatch() ?? new DataFeedDetailPatch(); patch.DataFeedName = Name; patch.Status = Status.HasValue ? new DataFeedDetailPatchStatus(Status.ToString()) : default(DataFeedDetailPatchStatus?); if (Schema != null) { patch.TimestampColumn = Schema.TimestampColumn; } if (IngestionSettings != null) { patch.DataStartFrom = IngestionSettings.IngestionStartTime.HasValue ? ClientCommon.NormalizeDateTimeOffset(IngestionSettings.IngestionStartTime.Value) : null; patch.MaxConcurrency = IngestionSettings.DataSourceRequestConcurrency; patch.MinRetryIntervalInSeconds = (long?)IngestionSettings.IngestionRetryDelay?.TotalSeconds; patch.StartOffsetInSeconds = (long?)IngestionSettings.IngestionStartOffset?.TotalSeconds; patch.StopRetryAfterInSeconds = (long?)IngestionSettings.StopRetryAfter?.TotalSeconds; } patch.DataFeedDescription = Description; patch.ActionLinkTemplate = ActionLinkTemplate; patch.ViewMode = AccessMode.HasValue == true ? new DataFeedDetailPatchViewMode(AccessMode.ToString()) : default(DataFeedDetailPatchViewMode?); if (RollupSettings != null) { patch.AllUpIdentification = RollupSettings.AlreadyRollupIdentificationValue; patch.NeedRollup = RollupSettings.RollupType.HasValue ? new DataFeedDetailPatchNeedRollup(RollupSettings.RollupType.ToString()) : default(DataFeedDetailPatchNeedRollup?); patch.RollUpMethod = RollupSettings.RollupMethod.HasValue ? new DataFeedDetailPatchRollUpMethod(RollupSettings.RollupMethod.ToString()) : default(DataFeedDetailPatchRollUpMethod?); patch.RollUpColumns = RollupSettings.AutoRollupGroupByColumnNames; } if (MissingDataPointFillSettings != null) { patch.FillMissingPointType = MissingDataPointFillSettings.FillType.HasValue ? new DataFeedDetailPatchFillMissingPointType(MissingDataPointFillSettings.FillType.ToString()) : default(DataFeedDetailPatchFillMissingPointType?); patch.FillMissingPointValue = MissingDataPointFillSettings.CustomFillValue; } patch.Admins = Administrators; patch.Viewers = Viewers; return(patch); }
private static void SetAuthenticationProperties(DataFeedDetailPatch patch, DataFeedSource dataSource) { switch (dataSource) { case AzureBlobDataFeedSource s: patch.AuthenticationType = s.GetAuthenticationTypeEnum(); break; case AzureDataExplorerDataFeedSource s: patch.AuthenticationType = s.GetAuthenticationTypeEnum(); patch.CredentialId = s.DatasourceCredentialId; break; case AzureDataLakeStorageGen2DataFeedSource s: patch.AuthenticationType = s.GetAuthenticationTypeEnum(); patch.CredentialId = s.DatasourceCredentialId; break; case SqlServerDataFeedSource s: patch.AuthenticationType = s.GetAuthenticationTypeEnum(); patch.CredentialId = s.DatasourceCredentialId; break; } }