protected function firstPage()
 {
     $auth = array("api_key" => $this->config["api_key"], "expires" => time() + 5 * 60);
     $this->query = empty($this->config["parameters"]) ? $auth : array_merge($auth, Utils::json_decode($this->config["parameters"], true));
     $signature = array("signature" => $this->generateSignature($this->query));
     $url = Utils::buildUrl($this->config["endpoint"], array_merge($this->query, $signature));
     return $this->client->createRequest("GET", $url);
 }
 protected function runDaily($jobConfig)
 {
     $params = Utils::replaceDates($jobConfig["parameters"], "%%", "Y-m-d");
     $params = Utils::json_decode($params, true);
     $from = !empty($params["from"]) ? $params["from"] : Utils::formatDateTime("1 week ago", "Y-m-d");
     $to = !empty($params["until"]) ? $params["until"] : Utils::formatDateTime("today", "Y-m-d");
     $end = new \DateTime($to);
     $end->modify('+1 day');
     $period = new \DatePeriod(new \DateTime($from), new \DateInterval('P1D'), $end);
     foreach ($period as $day) {
         // 			var_dump($day);
         $job = $this->initJob(array("endpoint" => "/v2/analytics/reports/account/performance/videos/" . $day->format("Y-m-d"), "parameters" => '{"limit":"500", "order_by":"none"}', "alias" => 'videos_daily'));
         // use ParentId for day
         $job->setParent($day->format("Y-m-d"));
         $job->run();
     }
 }