handlers.conditionally_delete_subscriptions_handler

class ConditionallyDeleteSubscriptionsHandler(handlers.eventhandler.EventHandler):

Whenever all conditions are fulfilled, we delete all subscriptions.

Configuration:
condition: Key/value pair that will be checked, e.g. approvalStatus: approved. If the condition holds true, we will set the field as specified. If the condition value starts with "!", the condition is negated (must not match).

name = 'Conditionally delete all subscriptions'
description = 'Whenever certain conditions are fulfilled, delete all subscriptions of the fact sheet.'
conditions = {'event_types': ['FactSheetUpdatedEvent']}
supports_initial_sync = True
config_template = {'fs_types': ['Application'], 'condition': {'lifecycle_status': 'endOfLife'}}
def handle(self, event, fs, **kwargs):

Called automatically whenever a matching event comes in via webhook.