get_list_interest_categories() public method

Gets the interest categories for a given List
public get_list_interest_categories ( string $list_id, array $args = [] ) : array
$list_id string
$args array
return array
 /**
  * @param string $list_id
  *
  * @return MC4WP_MailChimp_List
  */
 private function fetch_list($list_id)
 {
     $list_data = $this->api->get_list($list_id, array('fields' => 'id,name,stats'));
     // create local object
     $list = new MC4WP_MailChimp_List($list_data->id, $list_data->name);
     $list->subscriber_count = $list_data->stats->member_count;
     // parse web_id from the "link" response header
     $headers = $this->api->get_last_response_headers();
     $link_header = $headers['link'];
     preg_match('/\\?id=(\\d+)/', $link_header, $matches);
     if (!empty($matches[1])) {
         $list->web_id = $matches[1];
     }
     // get merge fields (if any)
     if ($list_data->stats->merge_field_count > 0) {
         $field_data = $this->api->get_list_merge_fields($list->id, array('count' => 100, 'fields' => 'merge_fields.name,merge_fields.tag,merge_fields.type,merge_fields.required,merge_fields.default_value,merge_fields.options,merge_fields.public'));
         // hydrate data into object
         foreach ($field_data as $data) {
             $object = MC4WP_MailChimp_Merge_Field::from_data($data);
             $list->merge_fields[] = $object;
         }
     }
     // get interest categories
     $interest_categories_data = $this->api->get_list_interest_categories($list->id, array('count' => 100, 'fields' => 'categories.id,categories.title,categories.type'));
     foreach ($interest_categories_data as $interest_category_data) {
         $interest_category = MC4WP_MailChimp_Interest_Category::from_data($interest_category_data);
         // fetch groups for this interest
         $interests_data = $this->api->get_list_interest_category_interests($list->id, $interest_category->id, array('count' => 100, 'fields' => 'interests.id,interests.name'));
         foreach ($interests_data as $interest_data) {
             $interest_category->interests[$interest_data->id] = $interest_data->name;
         }
         $list->interest_categories[] = $interest_category;
     }
     return $list;
 }
if (empty($lists)) {
    return;
}
@set_time_limit(600);
$api_v3 = new MC4WP_API_v3($options['api_key']);
$map = array();
foreach ($lists as $list) {
    // cast to stdClass because of missing classes
    $list = (object) (array) $list;
    // no groupings? easy!
    if (empty($list->groupings)) {
        continue;
    }
    // fetch (new) interest categories for this list
    try {
        $interest_categories = $api_v3->get_list_interest_categories($list->id);
    } catch (MC4WP_API_Exception $e) {
        continue;
    }
    foreach ($interest_categories as $interest_category) {
        // compare interest title with grouping name, if it matches, get new id.
        $grouping = _mc4wp_400_find_grouping_for_interest_category($list->groupings, $interest_category);
        if (!$grouping) {
            continue;
        }
        $groups = array();
        try {
            $interests = $api_v3->get_list_interest_category_interests($list->id, $interest_category->id);
        } catch (MC4WP_API_Exception $e) {
            continue;
        }