code: protected function createResponseFromData($data)
      {
          if (isset($data['rows']) || (isset($data['data']) && ArrayUtils::isNumericKeys($data['data']))) {
              $response = new EntryCollection($data);
          } else {
              $response = new Entry($data);
          }
  
          return $response;
      }
docs: Creates a response object
  
  @param $data
  
  @return \Directus\SDK\Response\EntryCollection|\Directus\SDK\Response\Entry