| | 1 | | namespace Syki.Shared; |
| | 2 | |
|
| | 3 | | public class GetWebhookCallFullOut |
| | 4 | | { |
| 0 | 5 | | public Guid Id { get; set; } |
| 0 | 6 | | public Guid WebhookId { get; set; } |
| 0 | 7 | | public string WebhookName { get; set; } |
| 0 | 8 | | public WebhookEventType Event { get; set; } |
| 0 | 9 | | public WebhookCallStatus Status { get; set; } |
| 0 | 10 | | public string Payload { get; set; } |
| 0 | 11 | | public int AttemptsCount { get; set; } |
| 0 | 12 | | public DateTime CreatedAt { get; set; } |
| 0 | 13 | | public List<GetWebhookCallAttemptOut> Attempts { get; set; } = []; |
| | 14 | |
|
| | 15 | | public static IEnumerable<(string, GetWebhookCallFullOut)> GetExamples() => |
| 0 | 16 | | [ |
| 0 | 17 | | ( |
| 0 | 18 | | "Success", |
| 0 | 19 | | new GetWebhookCallFullOut |
| 0 | 20 | | { |
| 0 | 21 | | Id = Guid.CreateVersion7(), |
| 0 | 22 | | WebhookId = Guid.CreateVersion7(), |
| 0 | 23 | | WebhookName = "GitHub", |
| 0 | 24 | | Event = WebhookEventType.StudentCreated, |
| 0 | 25 | | Status = WebhookCallStatus.Success, |
| 0 | 26 | | Payload = """{"UserId":"01983c1f-d716-75a9-ac70-12ab881415c4","InstitutionId":"01983c1f-7489-7b95-9d5a-e |
| 0 | 27 | | AttemptsCount = 1, |
| 0 | 28 | | CreatedAt = DateTime.UtcNow.AddMinutes(-30), |
| 0 | 29 | | Attempts = |
| 0 | 30 | | [ |
| 0 | 31 | | new() |
| 0 | 32 | | { |
| 0 | 33 | | Status = WebhookCallAttemptStatus.Success, |
| 0 | 34 | | StatusCode = 200, |
| 0 | 35 | | Response = "", |
| 0 | 36 | | CreatedAt = DateTime.UtcNow.AddMinutes(-29), |
| 0 | 37 | | } |
| 0 | 38 | | ] |
| 0 | 39 | | } |
| 0 | 40 | | ), |
| 0 | 41 | | ( |
| 0 | 42 | | "Error", |
| 0 | 43 | | new GetWebhookCallFullOut |
| 0 | 44 | | { |
| 0 | 45 | | Id = Guid.CreateVersion7(), |
| 0 | 46 | | WebhookId = Guid.CreateVersion7(), |
| 0 | 47 | | WebhookName = "GitHub", |
| 0 | 48 | | Event = WebhookEventType.StudentCreated, |
| 0 | 49 | | Status = WebhookCallStatus.Error, |
| 0 | 50 | | Payload = """{"UserId":"01983c1f-d716-75a9-ac70-12ab881415c4","InstitutionId":"01983c1f-7489-7b95-9d5a-e |
| 0 | 51 | | AttemptsCount = 2, |
| 0 | 52 | | CreatedAt = DateTime.UtcNow.AddMinutes(-30), |
| 0 | 53 | | Attempts = |
| 0 | 54 | | [ |
| 0 | 55 | | new() |
| 0 | 56 | | { |
| 0 | 57 | | Status = WebhookCallAttemptStatus.Error, |
| 0 | 58 | | StatusCode = 400, |
| 0 | 59 | | Response = "User Not Found", |
| 0 | 60 | | CreatedAt = DateTime.UtcNow.AddMinutes(-29), |
| 0 | 61 | | }, |
| 0 | 62 | | new() |
| 0 | 63 | | { |
| 0 | 64 | | Status = WebhookCallAttemptStatus.Error, |
| 0 | 65 | | StatusCode = 400, |
| 0 | 66 | | Response = "User Not Found", |
| 0 | 67 | | CreatedAt = DateTime.UtcNow.AddMinutes(-25), |
| 0 | 68 | | } |
| 0 | 69 | | ] |
| 0 | 70 | | } |
| 0 | 71 | | ) |
| 0 | 72 | | ]; |
| | 73 | | } |