<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cli(obj, origin, tags, timeout, customer, delete):
 """Send or delete a heartbeat."""

    client = obj['client']
    if delete:
        client.delete_heartbeat(delete)
    else:
        try:
            heartbeat = client.heartbeat(origin=origin, tags=tags, timeout=timeout, customer=customer)
        except Exception as e:
            click.echo('ERROR: {}'.format(e))
            sys.exit(1)
        click.echo(heartbeat.id)