public async Task <IActionResult> RecheckSpf(SpfDomainRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(new ErrorResponse(ModelState.Values)));
            }

            await _messagePublisher.Publish(new SpfRecordExpired(request.Domain), _config.SnsTopicArn);

            return(new OkObjectResult("{}"));
        }
        public async Task <IActionResult> GetSpfHistory(SpfDomainRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(new ErrorResponse(ModelState.Values)));
            }

            string history = await _dao.GetSpfHistory(request.Domain);

            if (history == null)
            {
                return(new NotFoundObjectResult(new ErrorResponse($"No Spf History found for {request.Domain}",
                                                                  ErrorStatus.Information)));
            }

            return(Content(history, "application/json"));
        }
        public async Task <IActionResult> GetSpf(SpfDomainRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(new ErrorResponse(ModelState.Values)));
            }

            SpfInfoResponse response = await _spfService.GetSpfForDomain(request.Domain);

            if (response == null)
            {
                return(new NotFoundObjectResult(new ErrorResponse($"No Spf found for {request.Domain}",
                                                                  ErrorStatus.Information)));
            }

            return(new ObjectResult(response));
        }