Method: projects.locations.customClasses.create

建立自訂類別。

HTTP 要求

POST https://speech.googleapis.com/v1/{parent=projects/*/locations/*}/customClasses

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

路徑參數

參數
parent

string

這是必要旗標,表示將建立這個自訂類別的父項資源。格式:

projects/{project}/locations/{location}/customClasses

Speech-to-Text 支援三個位置:globalus (北美洲美國) 和 eu (歐洲)。如果您要呼叫 speech.googleapis.com 端點,請使用 global 位置。如要指定區域,請使用相符的 useu 位置值搭配區域端點

授權需要指定資源 parent 的下列 IAM 權限:

  • speech.customClasses.create

要求主體

要求主體包含下列結構的資料:

JSON 表示法
{
  "customClassId": string,
  "customClass": {
    object (CustomClass)
  }
}
欄位
customClassId

string

這是必要旗標,自訂類別的 ID,會成為自訂類別資源名稱的最終元件。

這個值應僅限於英文字母、數字和連字號,第一個字元須為英文字母,最後一個字元則須為英文字母或數字,且長度應為 4 至 63 個字元。

customClass

object (CustomClass)

這是必要旗標,要建立的自訂類別。

回應主體

如果成功,回應主體會包含新建立的 CustomClass 執行個體。

授權範圍

需要下列 OAuth 範圍:

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

詳情請參閱Authentication Overview