| | 1 | | namespace Syki.Shared; |
| | 2 | |
|
| | 3 | | public class CreateWebhookSubscriptionIn |
| | 4 | | { |
| | 5 | | /// <summary> |
| | 6 | | /// Nome descritivo para o Webhook. |
| | 7 | | /// </summary> |
| 42 | 8 | | public string Name { get; set; } |
| | 9 | |
|
| | 10 | | /// <summary> |
| | 11 | | /// Url do Webhook. |
| | 12 | | /// </summary> |
| 42 | 13 | | public string Url { get; set; } |
| | 14 | |
|
| | 15 | | /// <summary> |
| | 16 | | /// Lista de eventos que serão enviados para o Webhook. |
| | 17 | | /// </summary> |
| 52 | 18 | | public List<WebhookEventType> Events { get; set; } |
| | 19 | |
|
| | 20 | | /// <summary> |
| | 21 | | /// Tipo de autenticação do endpoint. |
| | 22 | | /// </summary> |
| 48 | 23 | | public WebhookAuthenticationType AuthenticationType { get; set; } |
| | 24 | |
|
| | 25 | | /// <summary> |
| | 26 | | /// Chave de Api para autenticação no endpoint. |
| | 27 | | /// </summary> |
| 50 | 28 | | public string? ApiKey { get; set; } |
| | 29 | |
|
| | 30 | | public static IEnumerable<(string, CreateWebhookSubscriptionIn)> GetExamples() => |
| 0 | 31 | | [ |
| 0 | 32 | | ("Aluno criado", |
| 0 | 33 | | new CreateWebhookSubscriptionIn |
| 0 | 34 | | { |
| 0 | 35 | | Name = "Aluno criado", |
| 0 | 36 | | Url = "https://webhook.site/my-webhook", |
| 0 | 37 | | AuthenticationType = WebhookAuthenticationType.ApiKey, |
| 0 | 38 | | ApiKey = "z3Q6uDUJYTDCIo16myBKZrlCS63IvpCUOAE5X", |
| 0 | 39 | | Events = [WebhookEventType.StudentCreated] |
| 0 | 40 | | }), |
| 0 | 41 | | ("Atividade publicada", |
| 0 | 42 | | new CreateWebhookSubscriptionIn |
| 0 | 43 | | { |
| 0 | 44 | | Name = "Atividade publicada", |
| 0 | 45 | | Url = "https://webhook.site/my-other-webhook", |
| 0 | 46 | | AuthenticationType = WebhookAuthenticationType.ApiKey, |
| 0 | 47 | | ApiKey = "z3Q6uDUJYTDCIo16myBKZrlCS63IvpCUOAE5X", |
| 0 | 48 | | Events = [WebhookEventType.ClassActivityCreated] |
| 0 | 49 | | }), |
| 0 | 50 | | ]; |
| | 51 | | } |