(ctx, command)
List, enable, and disable event sources specified in the config file
List, enable, and disable event sources specified in the config file
List enable and disable event sources specified in the config file
def event_sources(ctx, command):
    """List, enable, and disable event sources specified in the config file"""
    if command == 'list':
        click.echo('listing event sources')
        event_sources = ctx.list_event_sources()
        for es in event_sources:
            click.echo('arn: {}'.format(es['arn']))
            click.echo('starting position: {}'.format(es['starting_position']))
            click.echo('batch size: {}'.format(es['batch_size']))
            click.echo('enabled: {}'.format(es['enabled']))
        click.echo('done')
    elif command == 'enable':
        click.echo('enabling event sources')
        ctx.enable_event_sources()
        click.echo('done')
    elif command == 'disable':
        click.echo('disabling event sources')
        ctx.disable_event_sources()
        click.echo('done')
def event_sources ( ctx , command ) : if command == 'list' : click . echo ( 'listing event sources' ) event_sources = ctx . list_event_sources ( ) for es in event_sources : click . echo ( 'arn: {}' . format ( es [ 'arn' ] ) ) click . echo ( 'starting position: {}' . format ( es [ 'starting_position' ] ) ) click . echo ( 'batch size: {}' . format ( es [ 'batch_size' ] ) ) click . echo ( 'enabled: {}' . format ( es [ 'enabled' ] ) ) click . echo ( 'done' ) elif command == 'enable' : click . echo ( 'enabling event sources' ) ctx . enable_event_sources ( ) click . echo ( 'done' ) elif command == 'disable' : click . echo ( 'disabling event sources' ) ctx . disable_event_sources ( ) click . echo ( 'done' )