def _create_listing_group_info(
    client,
    listing_group_type,
    parent_criterion_resource_name=None,
    case_value=None,
):
    """Creates the listing group info with the provided parameters.

    Args:
        client: The Google Ads API client.
        listing_group_type: The listing group type.
        parent_criterion_resource_name: Optional resource name of the parent
            criterion ID to set for this listing group info.
        case_value: Optional dimension info for the listing group.
    Returns:
        A populated ListingGroupInfo object.
    """
    listing_group_info = client.get_type("ListingGroupInfo", version="v6")
    listing_group_info.type = listing_group_type

    if parent_criterion_resource_name is not None and case_value is not None:
        listing_group_info.parent_ad_group_criterion = (
            parent_criterion_resource_name
        )
        listing_group_info.case_value.CopyFrom(case_value)

    return listing_group_info