def add_event_source(event_source, lambda_arn, target_function, boto_session, dry=False):
 (event_source_obj, ctx, funk) = get_event_source(event_source, lambda_arn, target_function, boto_session, dry=False)
 if (not dry):
  if (not event_source_obj.status(funk)):
   event_source_obj.add(funk)
   if event_source_obj.status(funk):
    return 'successful'
   else:
    return 'failed'
  else:
   return 'exists'
 return 'dryrun'

def add_event_source ( event_source , lambda_arn , target_function , boto_session , dry = False ) : ( event_source_obj , ctx , funk ) = get_event_source ( event_source , lambda_arn , target_function , boto_session , dry = False ) if ( not dry ) : if ( not event_source_obj . status ( funk ) ) : event_source_obj . add ( funk ) if event_source_obj . status ( funk ) : return 'successful' else : return 'failed' else : return 'exists' return 'dryrun'
given an event_source dictionary .