public virtual bool IsMatch(WebHookRequestMessage request)
        {
            bool matchesType   = ForTypes != null && (ForTypes.Contains("*") || ForTypes.Contains(request.ContentfulType));
            bool matchesAction = ForActions != null && (ForActions.Contains("*") || ForActions.Contains(request.ContentfulAction));

            return(matchesType && matchesAction);
        }
Exemple #2
0
        public override WebHookResponseMessage Process(WebHookRequestMessage request)
        {
            JsonSerializerSettings settings = new JsonSerializerSettings();
            var jsonObject = request.GetJsonObject();

            Entry <dynamic> updatedEntry = jsonObject.ToObject <Entry <dynamic> >(JsonSerializer.Create(settings));

            _purge.PurgeCache(updatedEntry.SystemProperties.Id, updatedEntry.SystemProperties.ContentType.SystemProperties.Id);

            return(new WebHookResponseMessage($"Cache purged for {updatedEntry.SystemProperties.Id}"));
        }
 public abstract WebHookResponseMessage Process(WebHookRequestMessage request);