internal SnapChannel([NotNull] string channelName, bool current, [NotNull] SnapNugetFeed pushFeed, [NotNull] SnapFeed updateFeed) { Name = channelName ?? throw new ArgumentNullException(nameof(channelName)); PushFeed = pushFeed ?? throw new ArgumentNullException(nameof(pushFeed)); UpdateFeed = updateFeed ?? throw new ArgumentNullException(nameof(updateFeed)); Current = current; }
public SnapsNugetFeed([NotNull] SnapNugetFeed feed) : this(new SnapsNugetFeed { Name = feed.Name }) { if (feed == null) { throw new ArgumentNullException(nameof(feed)); } }
internal SnapNugetFeed([NotNull] SnapNugetFeed snapFeed) { if (snapFeed == null) { throw new ArgumentNullException(nameof(snapFeed)); } Name = snapFeed.Name; Source = snapFeed.Source; Username = snapFeed.Username; Password = snapFeed.Password; ProtocolVersion = snapFeed.ProtocolVersion; ApiKey = snapFeed.ApiKey; }
internal SnapsChannel([NotNull] SnapChannel snapChannel) { if (snapChannel == null) { throw new ArgumentNullException(nameof(snapChannel)); } Name = snapChannel.Name; PushFeed = new SnapsNugetFeed(snapChannel.PushFeed); UpdateFeed = snapChannel.UpdateFeed switch { SnapNugetFeed snapNugetFeed => new SnapsNugetFeed(snapNugetFeed), SnapHttpFeed snapHttpFeed => new SnapsHttpFeed(snapHttpFeed), _ => throw new NotSupportedException($"Unknown update feed type: {snapChannel.UpdateFeed?.GetType()}.") }; }
internal SnapChannel([NotNull] SnapChannel channel) { if (channel == null) { throw new ArgumentNullException(nameof(channel)); } Name = channel.Name; PushFeed = new SnapNugetFeed(channel.PushFeed); Current = channel.Current; UpdateFeed = channel.UpdateFeed switch { SnapNugetFeed snapNugetFeed => new SnapNugetFeed(snapNugetFeed), SnapHttpFeed snapHttpFeed => new SnapHttpFeed(snapHttpFeed), _ => throw new NotSupportedException(channel.UpdateFeed?.GetType().ToString()) }; }
internal SnapChannel([NotNull] SnapChannel channel) { if (channel == null) { throw new ArgumentNullException(nameof(channel)); } Name = channel.Name; PushFeed = new SnapNugetFeed(channel.PushFeed); Current = channel.Current; switch (channel.UpdateFeed) { case SnapNugetFeed snapNugetFeed: UpdateFeed = new SnapNugetFeed(snapNugetFeed); break; case SnapHttpFeed snapHttpFeed: UpdateFeed = new SnapHttpFeed(snapHttpFeed); break; default: throw new NotSupportedException(channel.UpdateFeed?.GetType().ToString()); } }