| | | 1 | | namespace Estud.Back.Features.Webhooks.UpdateWebhookSubscription; |
| | | 2 | | |
| | | 3 | | public class UpdateWebhookSubscriptionIn : IApiDto<UpdateWebhookSubscriptionIn> |
| | | 4 | | { |
| | 76 | 5 | | public int Id { get; set; } |
| | 106 | 6 | | public string Name { get; set; } |
| | 106 | 7 | | public string Url { get; set; } |
| | 74 | 8 | | public bool IsActive { get; set; } |
| | 90 | 9 | | public List<WebhookEventType> Events { get; set; } |
| | | 10 | | |
| | | 11 | | /// <summary> |
| | | 12 | | /// Headers customizados (pares chave-valor) enviados em todas as chamadas feitas para a Url do Webhook. |
| | | 13 | | /// Útil, por exemplo, para autenticação via header. |
| | | 14 | | /// </summary> |
| | 126 | 15 | | public Dictionary<string, string> CustomHeaders { get; set; } = []; |
| | | 16 | | |
| | | 17 | | public static IEnumerable<(string, UpdateWebhookSubscriptionIn)> GetExamples() => |
| | 0 | 18 | | [ |
| | 0 | 19 | | ("Exemplo", |
| | 0 | 20 | | new UpdateWebhookSubscriptionIn |
| | 0 | 21 | | { |
| | 0 | 22 | | Id = 1, |
| | 0 | 23 | | Name = "Aluno criado", |
| | 0 | 24 | | Url = "https://webhook.site/my-webhook", |
| | 0 | 25 | | IsActive = true, |
| | 0 | 26 | | Events = [WebhookEventType.StudentCreated], |
| | 0 | 27 | | CustomHeaders = new() { ["Estud-AuthToken"] = "6r4g654rs6g4we6f4qw684f68qwf4" }, |
| | 0 | 28 | | }), |
| | 0 | 29 | | ]; |
| | | 30 | | } |