GS2-Dictionary Script トリガー リファレンス
拡張スクリプトを呼び出す イベントトリガー のリファレンス
トリガー
entry
エントリー登録
同期実行スクリプト
エントリー登録処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| entryModels | EntryModel[] | エントリーモデルのリスト |
| userId | string | ユーザーID |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | エントリー登録を許可するか |
実装例
-- Request
local namespace = args.namespace
local entryModels = args.entryModels
local userId = args.userId
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}非同期実行スクリプト
エントリー登録処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| entryModels | EntryModel[] | エントリーモデルのリスト |
| userId | string | ユーザーID |
実装例
-- Request
local namespace = args.namespace
local entryModels = args.entryModels
local userId = args.userId
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}duplicateEntry
既に登録済みのエントリーへの再登録
同期実行スクリプト
既に登録済みのエントリーへの再登録処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| entryModel | EntryModel | エントリーモデル |
| userId | string | ユーザーID |
実装例
-- Request
local namespace = args.namespace
local entryModel = args.entryModel
local userId = args.userId
-- Business logic:
-- Result
result = {
}