def _build_visited_site_rule_info(client, url):
    """Creates a UserListRuleInfo object targeting a visit to a specified URL.

    Args:
        client: An initialized Google Ads client.
        url: The string URL at which the rule will be targeted.
    Returns:
        A populated UserListRuleInfo object.
    """
    user_visited_site_rule = client.get_type(
        "UserListRuleItemInfo", version="v6"
    )
    # Use a built-in parameter to create a domain URL rule.
    user_visited_site_rule.name = "url__"
    user_visited_site_rule.string_rule_item.operator = client.get_type(
        "UserListStringRuleItemOperatorEnum", version="v6"
    ).EQUALS
    user_visited_site_rule.string_rule_item.value = url

    user_visited_site_rule_info = client.get_type(
        "UserListRuleInfo", version="v6"
    )
    rule_item_group_info = user_visited_site_rule_info.rule_item_groups.add()
    rule_item_group_info.rule_items.append(user_visited_site_rule)

    return user_visited_site_rule_info