Webhook

さまざまな種類の Webhook のメタデータ。inlineCloudFunction を使用している場合、ソースコードは executeFunction キーの値と同じ名前のディレクトリに配置する必要があります。たとえば、executeFunction キーの値が my_webhook の場合は、次のようなコード構造になります。- /webhooks/my_webhook.yaml - /webhooks/my_webhook/index.js - /webhooks/my_webhook/package.json

YAML 表現
handlers: 
  - object (Handler)

# Union field webhook_type can be only one of the following:
httpsEndpoint: 
  object (HttpsEndpoint)
inlineCloudFunction: 
  object (InlineCloudFunction)
# End of list of possible types for union field webhook_type.
フィールド
handlers[]

object (Handler)

この Webhook のハンドラのリスト。

共用体フィールド webhook_type。サポートされている Webhook タイプは 1 つのみです。webhook_type は次のいずれかになります。
httpsEndpoint

object (HttpsEndpoint)

カスタム Webhook HTTPS エンドポイント。

inlineCloudFunction

object (InlineCloudFunction)

Webhook フォルダ内のコードからデプロイされた Cloud Functions の関数のメタデータ。

Handler

webhoook ハンドラの名前を宣言します。1 つの Webhook に複数のハンドラを登録できます。これらのハンドラは、Actions プロジェクトの複数の場所から呼び出すことができます。

YAML 表現
name: string
フィールド
name

string

必須。ハンドラの名前。Actions プロジェクトのすべてのハンドラで一意である必要があります。このハンドラの名前を確認することで、フルフィルメントのソースコード内で正しい関数を呼び出すことができます。

HttpsEndpoint

インライン エディタを使用していない場合に通知する REST エンドポイント。

YAML 表現
baseUrl: string
httpHeaders: 
  string: string
endpointApiVersion: integer
フィールド
baseUrl

string

フルフィルメント エンドポイントの HTTPS ベース URL(HTTP はサポートされていません)。ハンドラ名は、ベース URL パスのコロンの後に追加されます(https://cloud.google.com/apis/design/custom_methods) のスタイルガイドに従います)。たとえば、ベース URL「https://gactions.service.com/api」は、URL「https://gactions.service.com/api:{method}」のリクエストを受信します。

httpHeaders

map (key: string, value: string)

POST リクエストに含まれる HTTP パラメータのマップ。

"key": value ペアのリストを含むオブジェクト。例: { "name": "wrench", "mass": "1.3kg", "count": "3" }

endpointApiVersion

integer

エンドポイントで使用されるプロトコルのバージョン。これはすべてのフルフィルメント タイプで共有されるプロトコルで、Google フルフィルメント タイプに固有のものではありません。

InlineCloudFunction

Webhook フォルダからデプロイされたインライン Cloud Functions の関数のメタデータを保持します。

YAML 表現
executeFunction: string
フィールド
executeFunction

string

Cloud Functions のエントリ ポイントの名前。このフィールドの値は、ソースコードからエクスポートされたメソッドの名前と一致する必要があります。