public function beginTransaction($projectId, array $optionalArgs = [])
    {
        $request = new BeginTransactionRequest();
        $request->setProjectId($projectId);
        if (isset($optionalArgs['transactionOptions'])) {
            $request->setTransactionOptions($optionalArgs['transactionOptions']);
        }

        $requestParams = new RequestParamsHeaderDescriptor([
          'project_id' => $request->getProjectId(),
        ]);
        $optionalArgs['headers'] = isset($optionalArgs['headers'])
            ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
            : $requestParams->getHeader();

        return $this->startCall(
            'BeginTransaction',
            BeginTransactionResponse::class,
            $optionalArgs,
            $request
        )->wait();
    }