public function pollUntilComplete(array $options = [])
    {
        $options += [
            'pollingIntervalSeconds' => $this::WAIT_INTERVAL,
            'maxPollingDurationSeconds' => 0.0,
        ];

        $pollingIntervalMicros = $options['pollingIntervalSeconds'] * 1000000;
        $maxPollingDuration = $options['maxPollingDurationSeconds'];
        $hasMaxPollingDuration = $maxPollingDuration > 0.0;
        $endTime = microtime(true) + $maxPollingDuration;

        do {
            usleep($pollingIntervalMicros);
            $this->reload($options);
        } while (!$this->done() && (!$hasMaxPollingDuration || microtime(true) < $endTime));

        return $this->result;
    }