original_string: private function getTraverseManagementApiHtml() {
      $accounts = $this->analytics->management_accounts
                       ->listManagementAccounts();
  
      $html = $this->getAccountsHtml($accounts);
  
      if (count($accounts->getItems()) > 0) {
  
        $firstAccountId = $this->getFirstId($accounts);
        $webproperties = $this->analytics->management_webproperties
                              ->listManagementWebproperties($firstAccountId);
        $html .= $this->getWebpropertiesHtml($webproperties);
  
        if (count($webproperties->getItems()) > 0) {
  
          $firstWebpropertyId = $this->getFirstId($webproperties);
          $profiles = $this->analytics->management_profiles
                           ->listManagementProfiles($firstAccountId,
                                                    $firstWebpropertyId);
          $html .= $this->getProfilesHtml($profiles);
  
          if (count($profiles->getItems()) > 0) {
            $firstProfileId = $this->getFirstId($profiles);
            $goals = $this->analytics->management_goals
                          ->listManagementGoals($firstAccountId,
                                                $firstWebpropertyId,
                                                $firstProfileId);
            $html .= $this->getGoalsHtml($goals);
  
          }
        }
      }
  
      $segments = $this->analytics->management_segments
                       ->listManagementSegments();
  
      $html .= $this->getSegmentsHtml($segments);
      return $html;
    }
code: private function getTraverseManagementApiHtml() {
      $accounts = $this->analytics->management_accounts
                       ->listManagementAccounts();
  
      $html = $this->getAccountsHtml($accounts);
  
      if (count($accounts->getItems()) > 0) {
  
        $firstAccountId = $this->getFirstId($accounts);
        $webproperties = $this->analytics->management_webproperties
                              ->listManagementWebproperties($firstAccountId);
        $html .= $this->getWebpropertiesHtml($webproperties);
  
        if (count($webproperties->getItems()) > 0) {
  
          $firstWebpropertyId = $this->getFirstId($webproperties);
          $profiles = $this->analytics->management_profiles
                           ->listManagementProfiles($firstAccountId,
                                                    $firstWebpropertyId);
          $html .= $this->getProfilesHtml($profiles);
  
          if (count($profiles->getItems()) > 0) {
            $firstProfileId = $this->getFirstId($profiles);
            $goals = $this->analytics->management_goals
                          ->listManagementGoals($firstAccountId,
                                                $firstWebpropertyId,
                                                $firstProfileId);
            $html .= $this->getGoalsHtml($goals);
  
          }
        }
      }
  
      $segments = $this->analytics->management_segments
                       ->listManagementSegments();
  
      $html .= $this->getSegmentsHtml($segments);
      return $html;
    }
code_tokens: private function getTraverseManagementApiHtml ( ) { $ accounts = $ this -> analytics -> management_accounts -> listManagementAccounts ( ) ; $ html = $ this -> getAccountsHtml ( $ accounts ) ; if ( count ( $ accounts -> getItems ( ) ) > 0 ) { $ firstAccountId = $ this -> getFirstId ( $ accounts ) ; $ webproperties = $ this -> analytics -> management_webproperties -> listManagementWebproperties ( $ firstAccountId ) ; $ html .= $ this -> getWebpropertiesHtml ( $ webproperties ) ; if ( count ( $ webproperties -> getItems ( ) ) > 0 ) { $ firstWebpropertyId = $ this -> getFirstId ( $ webproperties ) ; $ profiles = $ this -> analytics -> management_profiles -> listManagementProfiles ( $ firstAccountId , $ firstWebpropertyId ) ; $ html .= $ this -> getProfilesHtml ( $ profiles ) ; if ( count ( $ profiles -> getItems ( ) ) > 0 ) { $ firstProfileId = $ this -> getFirstId ( $ profiles ) ; $ goals = $ this -> analytics -> management_goals -> listManagementGoals ( $ firstAccountId , $ firstWebpropertyId , $ firstProfileId ) ; $ html .= $ this -> getGoalsHtml ( $ goals ) ; } } } $ segments = $ this -> analytics -> management_segments -> listManagementSegments ( ) ; $ html .= $ this -> getSegmentsHtml ( $ segments ) ; return $ html ; }
docstring: Traverses the Management API. A query is made to the Accounts collection.
  The first account ID is used to then query the webproperties collection.
  The first webproperty ID is used to query the profiles collection. The
  first profile is used to query the goals collection. Finally the segments
  collection is queries. At each level, an HTML representation is rendered
  of the entire collection. If one of the levels has no entities to query
  for a child level, then traversal stops.
  @return string The HTML representation of the Management API traversal.
docstring_tokens: Traverses the Management API . A query is made to the Accounts collection . The first account ID is used to then query the webproperties collection . The first webproperty ID is used to query the profiles collection . The first profile is used to query the goals collection . Finally the segments collection is queries . At each level an HTML representation is rendered of the entire collection . If one of the levels has no entities to query for a child level then traversal stops .