Method: projects.locations.connections.gitRepositoryLinks.fetchFileBlame

擷取檔案或檔案中某行範圍的 blame 資訊。

HTTP 要求

GET https://developerconnect.googleapis.com/v1/{name=projects/*/locations/*/connections/*/gitRepositoryLinks/*}:fetchFileBlame

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
name

string

這是必要旗標,GitRepositoryLink 的資源名稱,格式為 projects/*/locations/*/connections/*/gitRepositoryLinks/*。

查詢參數

參數
ref

string

這是必要旗標,SCM 提交 SHA 或符號修訂版本 (例如分支版本名稱、標記),用於擷取 blame。

path

string

這是必要旗標,存放區中的檔案路徑。

firstLine

integer

選用。要追溯的範圍起始行號 (從 1 開始,含)。如未指定,則會從第 1 行開始。

lastLine

integer

選用。要追溯的範圍結束行號 (以 1 為索引,含該行)。如未指定,則會追溯至檔案結尾。

要求主體

要求主體必須為空白。

回應主體

gitRepositoryLinks.fetchFileBlame 的回應訊息。

如果成功,回應主體會含有以下結構的資料:

JSON 表示法
{
  "ranges": [
    {
      object (BlameRange)
    }
  ]
}
欄位
ranges[]

object (BlameRange)

檔案的 blame 範圍清單。

授權範圍

需要下列 OAuth 範圍:

  • https://www.googleapis.com/auth/cloud-platform

詳情請參閱Authentication Overview。

IAM 權限

需要 name 資源的下列 IAM 權限:

  • developerconnect.gitRepositoryLinks.fetchFileBlame

詳情請參閱 IAM 說明文件。

BlameRange

BlameRange 代表一系列行的歸責資訊。

JSON 表示法
{
  "firstLine": integer,
  "lastLine": integer,
  "commit": {
    object (SCMCommit)
  }
}
欄位
firstLine

integer

範圍的起始行號 (含),以 1 為索引。

lastLine

integer

範圍的結束行號 (含),以 1 為索引。

commit

object (SCMCommit)

這個行範圍的修訂版本中繼資料。