public function invokeGitkitApiWithServiceAccount($method, $data) {
    $httpRequest = new Google_Http_Request(
        $this->gitkitApisUrl . $method,
        'POST',
        null,
        json_encode($data));
    $contentTypeHeader = array();
    $contentTypeHeader['content-type'] = 'application/json; charset=UTF-8';
    $httpRequest->setRequestHeaders($contentTypeHeader);
    $response = $this->oauth2Client->authenticatedRequest($httpRequest)
        ->getResponseBody();
    return $this->checkGitkitError(json_decode($response, true));
  }