private function createQueryParameters($pageIndex, $pageSize, $fromDate, $toDate, $contactIds, $contactEmails, $contactExternalIds, $mailingIds, $source, $embedFieldBackups)
    {
        $queryParameters = array(
            'page_index' => $pageIndex,
            'page_size' => $pageSize
        );

        if (isset ($fromDate))
            $queryParameters ['from_date'] = $fromDate;
        if (isset ($toDate))
            $queryParameters ['to_date'] = $toDate;
        if (isset ($source))
            $queryParameters ['source'] = $source;

        $queryParameters = $this->appendArrayFields($queryParameters, "ids", $contactIds);
        $queryParameters = $this->appendArrayFields($queryParameters, "emails", $contactEmails);
        $queryParameters = $this->appendArrayFields($queryParameters, "eids", $contactExternalIds);

        if (isset ($embedFieldBackups))
            $queryParameters ['embed_field_backups'] = ($embedFieldBackups == true) ? "true" : "false";

        if (isset ($mailingIds)) {
            $queryParameters ['mailing_id'] = array();

            foreach ($mailingIds as $mailingId) {
                $queryParameters ['mailing_id'] [] = $mailingId;
            }
        }
        return $queryParameters;
    }