|
| 1 | +namespace sigtran.net.Core.Utilities; |
| 2 | + |
| 3 | +/// <summary> |
| 4 | +/// Identifies a support intake channel. |
| 5 | +/// </summary> |
| 6 | +public enum SigtranSupportChannel |
| 7 | +{ |
| 8 | + /// <summary>GitHub issue support channel.</summary> |
| 9 | + GitHubIssues, |
| 10 | + |
| 11 | + /// <summary>Private security disclosure support channel.</summary> |
| 12 | + PrivateSecurity, |
| 13 | + |
| 14 | + /// <summary>Commercial support support channel.</summary> |
| 15 | + Commercial |
| 16 | +} |
| 17 | + |
| 18 | +/// <summary> |
| 19 | +/// Describes one support intake rule. |
| 20 | +/// </summary> |
| 21 | +public sealed class SigtranSupportRule |
| 22 | +{ |
| 23 | + /// <summary>Creates a support rule.</summary> |
| 24 | + /// <param name="channel">The support channel.</param> |
| 25 | + /// <param name="scope">The support scope.</param> |
| 26 | + /// <param name="escalatesIncidents">Whether incidents can be escalated through this channel.</param> |
| 27 | + public SigtranSupportRule(SigtranSupportChannel channel, string scope, bool escalatesIncidents) |
| 28 | + { |
| 29 | + Channel = channel; |
| 30 | + Scope = string.IsNullOrWhiteSpace(scope) ? throw new ArgumentException("Scope is required.", nameof(scope)) : scope; |
| 31 | + EscalatesIncidents = escalatesIncidents; |
| 32 | + } |
| 33 | + |
| 34 | + /// <summary>The support channel.</summary> |
| 35 | + public SigtranSupportChannel Channel { get; } |
| 36 | + |
| 37 | + /// <summary>The support scope.</summary> |
| 38 | + public string Scope { get; } |
| 39 | + |
| 40 | + /// <summary>Whether incidents can be escalated through this channel.</summary> |
| 41 | + public bool EscalatesIncidents { get; } |
| 42 | +} |
| 43 | + |
| 44 | +/// <summary> |
| 45 | +/// Provides support handbook metadata. |
| 46 | +/// </summary> |
| 47 | +public static class SigtranSupportHandbook |
| 48 | +{ |
| 49 | + /// <summary>Returns the support intake rules.</summary> |
| 50 | + /// <returns>The support intake rules.</returns> |
| 51 | + public static IReadOnlyList<SigtranSupportRule> GetRules() |
| 52 | + { |
| 53 | + return |
| 54 | + [ |
| 55 | + new SigtranSupportRule(SigtranSupportChannel.GitHubIssues, "Public bugs, questions, and feature requests.", escalatesIncidents: false), |
| 56 | + new SigtranSupportRule(SigtranSupportChannel.PrivateSecurity, "Security reports and coordinated disclosure.", escalatesIncidents: true), |
| 57 | + new SigtranSupportRule(SigtranSupportChannel.Commercial, "Enterprise support, interoperability incidents, and release escalations.", escalatesIncidents: true) |
| 58 | + ]; |
| 59 | + } |
| 60 | +} |
0 commit comments