< Summary - Estud

Information
Class: Estud.Back.Features.Webhooks.CreateWebhookSubscription.CreateWebhookSubscriptionIn
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Webhooks/CreateWebhookSubscription/CreateWebhookSubscriptionIn.cs
Tag: 114_29044117136
Line coverage
18%
Covered lines: 4
Uncovered lines: 18
Coverable lines: 22
Total lines: 45
Line coverage: 18.1%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Name()100%11100%
get_Url()100%11100%
get_Events()100%11100%
get_CustomHeaders()100%11100%
GetExamples()100%210%

File(s)

/home/runner/work/syki/syki/Back/Features/Webhooks/CreateWebhookSubscription/CreateWebhookSubscriptionIn.cs

#LineLine coverage
 1namespace Estud.Back.Features.Webhooks.CreateWebhookSubscription;
 2
 3public class CreateWebhookSubscriptionIn : IApiDto<CreateWebhookSubscriptionIn>
 4{
 5    /// <summary>
 6    /// Nome descritivo para o Webhook.
 7    /// </summary>
 2488    public string Name { get; set; }
 9
 10    /// <summary>
 11    /// Url do Webhook.
 12    /// </summary>
 24813    public string Url { get; set; }
 14
 15    /// <summary>
 16    /// Lista de eventos que serão enviados para o Webhook.
 17    /// </summary>
 21218    public List<WebhookEventType> Events { get; set; }
 19
 20    /// <summary>
 21    /// Headers customizados (pares chave-valor) enviados em todas as chamadas feitas para a Url do Webhook.
 22    /// Útil, por exemplo, para autenticação via header.
 23    /// </summary>
 28824    public Dictionary<string, string> CustomHeaders { get; set; } = [];
 25
 26    public static IEnumerable<(string, CreateWebhookSubscriptionIn)> GetExamples() =>
 027    [
 028        ("Aluno criado",
 029        new CreateWebhookSubscriptionIn
 030        {
 031            Name = "Aluno criado",
 032            Url = "https://webhook.site/my-webhook",
 033            Events = [WebhookEventType.StudentCreated],
 034            CustomHeaders = new() { ["Estud-AuthToken"] = "6r4g654rs6g4we6f4qw684f68qwf4" }
 035        }),
 036        ("Atividade publicada",
 037        new CreateWebhookSubscriptionIn
 038        {
 039            Name = "Atividade publicada",
 040            Url = "https://webhook.site/my-other-webhook",
 041            Events = [WebhookEventType.ClassActivityCreated],
 042            CustomHeaders = []
 043        }),
 044    ];
 45}