def cli_documentdb_list(client,
                        resource_group_name=None):
    """Lists all Azure DocumentDB database accounts within a given resource group or subscription.
    """

    if resource_group_name:
        return client.list_by_resource_group(resource_group_name)
    else:
        return client.list()