public function setMaxRetries($retries)
    {
        switch (gettype($retries)) {
            case 'integer':
                $this->maxRetries = new Retries($retries);
                break;
            case 'object':
                $this->maxRetries = $retries;
                break;
            default:
                throw new InvalidArgumentException('Invalid type for max retries given.');
                break;
        }
    }