public function upgradeDeployment(
        $name,
        $mode,
        $packageUrl,
        $configuration,
        $label,
        $force,
        UpgradeDeploymentOptions $options
    ) {
        Validate::isString($name, 'name');
        Validate::notNullOrEmpty($name, 'name');
        Validate::isString($mode, 'mode');
        Validate::isTrue(Mode::isValid($mode), Resources::INVALID_CHANGE_MODE_MSG);
        Validate::isString($packageUrl, 'packageUrl');
        Validate::notNullOrEmpty($packageUrl, 'packageUrl');
        Validate::isString($configuration, 'configuration');
        Validate::notNullOrEmpty($configuration, 'configuration');
        Validate::isString($label, 'label');
        Validate::notNullOrEmpty($label, 'label');
        Validate::isBoolean($force, 'force');
        Validate::notNullOrEmpty($force, 'force');
        Validate::notNullOrEmpty($options, 'options');

        $configuration = $this->_encodeConfiguration($configuration);

        $xmlElements = [
            Resources::XTAG_MODE => $mode,
            Resources::XTAG_PACKAGE_URL => $packageUrl,
            Resources::XTAG_CONFIGURATION => $configuration,
            Resources::XTAG_LABEL => $label,
            Resources::XTAG_ROLE_TO_UPGRADE => $options->getRoleToUpgrade(),
            Resources::XTAG_FORCE => Utilities::booleanToString($force),
        ];
        $body = $this->_createRequestXml(
            $xmlElements,
            Resources::XTAG_UPGRADE_DEPLOYMENT
        );
        $context = new HttpCallContext();
        $context->setMethod(Resources::HTTP_POST);
        $context->setPath($this->_getDeploymentPath($name, $options).'/');
        $context->addStatusCode(Resources::STATUS_ACCEPTED);
        $context->addQueryParameter(
            Resources::QP_COMP,
            Resources::QPV_UPGRADE
        );
        $context->setBody($body);
        $context->addHeader(
            Resources::CONTENT_TYPE,
            Resources::XML_CONTENT_TYPE
        );

        assert(Utilities::endsWith($context->getPath(), '/'));
        $response = $this->sendHttpContext($context);

        return AsynchronousOperationResult::create(HttpClient::getResponseHeaders($response));
    }