| | | 1 | | namespace Syki.Back.Features.Academic.CreateWebhookSubscription; |
| | | 2 | | |
| | | 3 | | [ApiController, AuthAcademic] |
| | | 4 | | [EnableRateLimiting("Medium")] |
| | 12 | 5 | | public class CreateWebhookSubscriptionController(CreateWebhookSubscriptionService service) : ControllerBase |
| | | 6 | | { |
| | | 7 | | /// <summary> |
| | | 8 | | /// Criar Webhook |
| | | 9 | | /// </summary> |
| | | 10 | | /// <remarks> |
| | | 11 | | /// Cria uma inscrição de Webhook. |
| | | 12 | | /// </remarks> |
| | | 13 | | [HttpPost("academic/webhooks")] |
| | | 14 | | [SwaggerResponseExample(200, typeof(ResponseExamples))] |
| | | 15 | | [SwaggerResponseExample(400, typeof(ErrorsExamples))] |
| | | 16 | | public async Task<IActionResult> Create([FromBody] CreateWebhookSubscriptionIn data) |
| | | 17 | | { |
| | 12 | 18 | | var result = await service.Create(User.InstitutionId, data); |
| | 12 | 19 | | return result.Match<IActionResult>(Ok, BadRequest); |
| | 12 | 20 | | } |
| | | 21 | | } |
| | | 22 | | |
| | | 23 | | internal class RequestExamples : ExamplesProvider<CreateWebhookSubscriptionIn>; |
| | | 24 | | internal class ResponseExamples : ExamplesProvider<CreateWebhookSubscriptionOut>; |
| | | 25 | | internal class ErrorsExamples : ErrorExamplesProvider<InvalidWebhookAuthentication>; |