GS2-Mission SDK API リファレンス

モデル

Complete

ミッションの達成状況

有効化条件必須デフォルト値の制限説明
completeIdstring~ 1024文字達成状況GRN
userIdstring~ 128文字ユーザーID
missionGroupNamestring~ 128文字ミッショングループ名
completedMissionTaskNamesList<string>[]~ 1000 items達成済みのタスク名リスト
receivedMissionTaskNamesList<string>[]~ 1000 items報酬の受け取り済みのタスク名リスト
nextResetAtlong次回リセットタイミング (UNIX時間 単位:ミリ秒)
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

NotificationSetting

プッシュ通知に関する設定

GS2 のマイクロサービス内で何らかのイベントが発生した際に、プッシュ通知を送信するための設定です。
ここでいうプッシュ通知は GS2-Gateway の提供する WebSocket インターフェースを経由した処理であり、スマートフォンのプッシュ通知とは性質が異なります。
たとえば、マッチメイキングが完了した時やフレンドリクエストが届いた時など、ゲームクライアントの操作とは関係なく状態が変化した際に GS2-Gateway を経由してプッシュ通知をすることで、ゲームクライアントは状態の変化を検知することができます。

GS2-Gateway のプッシュ通知は通知先のデバイスがオフラインだった時に追加の処理としてモバイルプッシュ通知を送信できます。
モバイルプッシュ通知をうまく利用すれば、マッチメイキング中にゲームを終了しても、モバイルプッシュ通知を使用してプレイヤーに通知し、ゲームに戻ってくるフローを実現できる可能性があります。

有効化条件必須デフォルト値の制限説明
gatewayNamespaceIdstring“grn:gs2:{region}:{ownerId}:gateway:default”~ 1024文字プッシュ通知に使用する GS2-Gateway のネームスペース
enableTransferMobileNotificationbool?falseモバイルプッシュ通知へ転送するか
soundstring{enableTransferMobileNotification} == true~ 1024文字モバイルプッシュ通知で使用するサウンドファイル名

CounterModelMaster

カウンターモデルマスター

カウンターモデルマスターはミッションタスクの達成条件に設定可能なエンティティです。
カウンターの値は複数のミッショングループから参照可能なため、1つのカウンターでウィークリーミッションとデイリーミッションといった複数のミッショングループの達成条件に設定ができます。

有効化条件必須デフォルト値の制限説明
counterIdstring~ 1024文字カウンターモデルマスターGRN
namestring~ 128文字カウンター名
metadatastring~ 1024文字メタデータ
descriptionstring~ 1024文字説明文
scopesList<CounterScopeModel>[]1 ~ 20 itemsカウンターのリセットタイミングリスト
challengePeriodEventIdstring~ 1024文字カウンターの操作が可能な期間を設定した GS2-Schedule イベントGRN
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

CounterScopeModel

カウンターリセットタイミングモデル

有効化条件必須デフォルト値の制限説明
scopeTypeenum {
    “resetTiming”,
    “verifyAction”
}
“resetTiming”~ 128文字スコープの種類
resetTypeenum {
    “notReset”,
    “daily”,
    “weekly”,
    “monthly”
}
{scopeType} == “resetTiming”~ 128文字リセットタイミング
resetDayOfMonthint{resetType} == “monthly”1 ~ 31リセットをする日にち(月の日数を超える場合は、最終日として扱われます)
resetDayOfWeekenum {
    “sunday”,
    “monday”,
    “tuesday”,
    “wednesday”,
    “thursday”,
    “friday”,
    “saturday”
}
{resetType} == “weekly”~ 128文字リセットする曜日
resetHourint{resetType} in [“monthly”, “weekly”, “daily”]~ 23リセット時刻
conditionNamestring{scopeType} == “verifyAction”~ 128文字条件名
conditionVerifyAction{scopeType} == “verifyAction”条件

scopeType に指定する列挙型の定義

定義説明
resetTimingリセットタイミング
verifyAction検証アクション

resetType に指定する列挙型の定義

定義説明
notResetリセットしない
daily毎日
weekly毎週
monthly毎月

resetDayOfWeek に指定する列挙型の定義

定義説明
sunday日曜日
monday月曜日
tuesday火曜日
wednesday水曜日
thursday木曜日
friday金曜日
saturday土曜日

MissionGroupModelMaster

ミッショングループモデルマスター

ミッショングループはカウンターのリセットタイミングでタスクをグルーピングするエンティティです。
たとえば、デイリーミッションで1つのグループ。ウィークリーミッションで1つのグループとなります。

有効化条件必須デフォルト値の制限説明
missionGroupIdstring~ 1024文字ミッショングループマスターGRN
namestring~ 128文字ミッショングループ名
metadatastring~ 1024文字メタデータ
descriptionstring~ 1024文字説明文
resetTypeenum {
    “notReset”,
    “daily”,
    “weekly”,
    “monthly”
}
“notReset”~ 128文字リセットタイミング
resetDayOfMonthint{resetType} == “monthly”1 ~ 31リセットをする日にち(月の日数を超える場合は、最終日として扱われます)
resetDayOfWeekenum {
    “sunday”,
    “monday”,
    “tuesday”,
    “wednesday”,
    “thursday”,
    “friday”,
    “saturday”
}
{resetType} == “weekly”~ 128文字リセットする曜日
resetHourint{resetType} in [“monthly”, “weekly”, “daily”]~ 23リセット時刻
completeNotificationNamespaceIdstring~ 1024文字ミッションのタスクを達成したときのプッシュ通知
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

resetType に指定する列挙型の定義

定義説明
notResetリセットしない
daily毎日
weekly毎週
monthly毎月

resetDayOfWeek に指定する列挙型の定義

定義説明
sunday日曜日
monday月曜日
tuesday火曜日
wednesday水曜日
thursday木曜日
friday金曜日
saturday土曜日

Namespace

ネームスペース

ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。
GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。

そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。

有効化条件必須デフォルト値の制限説明
namespaceIdstring~ 1024文字ネームスペースGRN
namestring~ 128文字ネームスペース名
descriptionstring~ 1024文字説明文
transactionSettingTransactionSettingトランザクション設定
missionCompleteScriptScriptSettingミッションを達成したときに実行するスクリプト
counterIncrementScriptScriptSettingカウンターを上昇したときに実行するスクリプト
receiveRewardsScriptScriptSetting報酬を受け取ったときに実行するスクリプト
completeNotificationNotificationSettingミッションのタスクを達成したときのプッシュ通知
logSettingLogSettingログの出力設定
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

Counter

カウンター

カウンターはミッションの進行状況をゲームプレイヤー毎に保持するエンティティです。
カウンターの値は関連付けられたタスクの期間ごとに集計されます。

そのため、1つのカウンターは複数の値を持ちます。
例えば、クエストのクリア回数カウンターであれば、今月のクリア回数、今週のクリア回数、今日のクリア回数。といった具合です。

有効化条件必須デフォルト値の制限説明
counterIdstring~ 1024文字カウンターGRN
userIdstring~ 128文字ユーザーID
namestring~ 128文字カウンター名
valuesList<ScopedValue>~ 32 items
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

CurrentMissionMaster

現在有効なマスターデータ

GS2ではマスターデータの管理にJSON形式のファイルを使用します。
ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。

JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが
よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。

有効化条件必須デフォルト値の制限説明
namespaceIdstring~ 1024文字現在有効なミッションマスターGRN
settingsstring~ 5242880文字マスターデータ

CounterModel

カウンターモデル

カウンターモデルはミッションタスクの達成条件に設定可能なエンティティです。
カウンターの値は複数のミッショングループから参照可能なため、1つのカウンターでウィークリーミッションとデイリーミッションといった複数のミッショングループの達成条件に設定ができます。

有効化条件必須デフォルト値の制限説明
counterIdstring~ 1024文字カウンターモデルGRN
namestring~ 128文字カウンター名
metadatastring~ 1024文字メタデータ
scopesList<CounterScopeModel>[]1 ~ 20 itemsカウンターのリセットタイミングリスト
challengePeriodEventIdstring~ 1024文字カウンターの操作が可能な期間を設定した GS2-Schedule イベントGRN

MissionGroupModel

ミッショングループモデル

ミッショングループはカウンターのリセットタイミングでタスクをグルーピングするエンティティです。
たとえば、デイリーミッションで1つのグループ。ウィークリーミッションで1つのグループとなります。

有効化条件必須デフォルト値の制限説明
missionGroupIdstring~ 1024文字ミッショングループGRN
namestring~ 128文字ミッショングループ名
metadatastring~ 1024文字メタデータ
tasksList<MissionTaskModel>~ 1000 itemsミッションタスクリスト
resetTypeenum {
    “notReset”,
    “daily”,
    “weekly”,
    “monthly”
}
“notReset”~ 128文字リセットタイミング
resetDayOfMonthint{resetType} == “monthly”1 ~ 31リセットをする日にち(月の日数を超える場合は、最終日として扱われます)
resetDayOfWeekenum {
    “sunday”,
    “monday”,
    “tuesday”,
    “wednesday”,
    “thursday”,
    “friday”,
    “saturday”
}
{resetType} == “weekly”~ 128文字リセットする曜日
resetHourint{resetType} in [“monthly”, “weekly”, “daily”]~ 23リセット時刻
completeNotificationNamespaceIdstring~ 1024文字ネームスペースGRN

resetType に指定する列挙型の定義

定義説明
notResetリセットしない
daily毎日
weekly毎週
monthly毎月

resetDayOfWeek に指定する列挙型の定義

定義説明
sunday日曜日
monday月曜日
tuesday火曜日
wednesday水曜日
thursday木曜日
friday金曜日
saturday土曜日

MissionTaskModel

ミッションタスクモデル

ミッションタスクは関連付けたカウンターの値が一定を超えたら報酬が貰える条件を定義するエンティティです。

有効化条件必須デフォルト値の制限説明
missionTaskIdstring~ 1024文字ミッションタスクGRN
namestring~ 128文字タスク名
metadatastring~ 1024文字メタデータ
verifyCompleteTypeenum {
    “counter”,
    “verifyActions”
}
“counter”~ 128文字達成条件種別
targetCounterTargetCounterModel{verifyCompleteType} == “counter”目標カウンター
verifyCompleteConsumeActionsList<VerifyAction>{verifyCompleteType} == “consumeActions”~ 10 itemsタスク達成判定に使用する検証アクション
completeAcquireActionsList<AcquireAction>[]~ 100 itemsミッション達成時の報酬
challengePeriodEventIdstring~ 1024文字報酬が受け取り可能な期間を設定した GS2-Schedule イベントGRN
premiseMissionTaskNamestring~ 128文字このタスクに挑戦するために達成しておく必要のあるタスクの名前

verifyCompleteType に指定する列挙型の定義

定義説明
counterカウンター
verifyActions検証アクション

MissionTaskModelMaster

ミッションタスクモデルマスター

ミッションタスクは関連付けたカウンターの値が一定を超えたら報酬が貰える条件を定義するエンティティです。

有効化条件必須デフォルト値の制限説明
missionTaskIdstring~ 1024文字ミッションタスクマスターGRN
namestring~ 128文字タスク名
metadatastring~ 1024文字メタデータ
descriptionstring~ 1024文字説明文
verifyCompleteTypeenum {
    “counter”,
    “verifyActions”
}
“counter”~ 128文字達成条件種別
targetCounterTargetCounterModel{verifyCompleteType} == “counter”目標カウンター
verifyCompleteConsumeActionsList<VerifyAction>{verifyCompleteType} == “consumeActions”~ 10 itemsタスク達成判定に使用する検証アクション
completeAcquireActionsList<AcquireAction>[]~ 100 itemsミッション達成時の報酬
challengePeriodEventIdstring~ 1024文字報酬が受け取り可能な期間を設定した GS2-Schedule イベントGRN
premiseMissionTaskNamestring~ 128文字このタスクに挑戦するために達成しておく必要のあるタスクの名前
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

verifyCompleteType に指定する列挙型の定義

定義説明
counterカウンター
verifyActions検証アクション

ScopedValue

リセットタイミング

有効化条件必須デフォルト値の制限説明
scopeTypeenum {
    “resetTiming”,
    “verifyAction”
}
“resetTiming”~ 128文字スコープの種類
resetTypeenum {
    “notReset”,
    “daily”,
    “weekly”,
    “monthly”
}
{scopeType} == “resetTiming”~ 128文字リセットタイミング
conditionNamestring{scopeType} == “verifyAction”~ 128文字条件名
valuelong0~ 9223372036854775805カウント
nextResetAtlong次回リセットタイミング (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)

scopeType に指定する列挙型の定義

定義説明
resetTimingリセットタイミング
verifyAction検証アクション

resetType に指定する列挙型の定義

定義説明
notResetリセットしない
daily毎日
weekly毎週
monthly毎月

TargetCounterModel

目標カウンター

ミッションの達成目標となるカウンターの情報

有効化条件必須デフォルト値の制限説明
counterNamestring~ 128文字カウンター名
scopeTypeenum {
    “resetTiming”,
    “verifyAction”
}
“resetTiming”~ 128文字スコープの種類
resetTypeenum {
    “notReset”,
    “daily”,
    “weekly”,
    “monthly”
}
{scopeType} == “resetTiming”~ 128文字目標リセットタイミング
conditionNamestring{scopeType} == “verifyAction”~ 128文字条件名
valuelong1 ~ 9223372036854775805目標値

scopeType に指定する列挙型の定義

定義説明
resetTimingリセットタイミング
verifyAction検証アクション

resetType に指定する列挙型の定義

定義説明
notResetリセットしない
daily毎日
weekly毎週
monthly毎月

AcquireAction

入手アクション

有効化条件必須デフォルト値の制限説明
actionenum {
"Gs2AdReward:AcquirePointByUserId",
"Gs2Dictionary:AddEntriesByUserId",
"Gs2Enchant:ReDrawBalanceParameterStatusByUserId",
"Gs2Enchant:SetBalanceParameterStatusByUserId",
"Gs2Enchant:ReDrawRarityParameterStatusByUserId",
"Gs2Enchant:AddRarityParameterStatusByUserId",
"Gs2Enchant:SetRarityParameterStatusByUserId",
"Gs2Enhance:DirectEnhanceByUserId",
"Gs2Enhance:UnleashByUserId",
"Gs2Enhance:CreateProgressByUserId",
"Gs2Exchange:ExchangeByUserId",
"Gs2Exchange:IncrementalExchangeByUserId",
"Gs2Exchange:CreateAwaitByUserId",
"Gs2Exchange:AcquireForceByUserId",
"Gs2Exchange:SkipByUserId",
"Gs2Experience:AddExperienceByUserId",
"Gs2Experience:SetExperienceByUserId",
"Gs2Experience:AddRankCapByUserId",
"Gs2Experience:SetRankCapByUserId",
"Gs2Experience:MultiplyAcquireActionsByUserId",
"Gs2Formation:AddMoldCapacityByUserId",
"Gs2Formation:SetMoldCapacityByUserId",
"Gs2Formation:AcquireActionsToFormProperties",
"Gs2Formation:SetFormByUserId",
"Gs2Formation:AcquireActionsToPropertyFormProperties",
"Gs2Friend:UpdateProfileByUserId",
"Gs2Grade:AddGradeByUserId",
"Gs2Grade:ApplyRankCapByUserId",
"Gs2Grade:MultiplyAcquireActionsByUserId",
"Gs2Guild:IncreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Guild:SetMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:IncreaseMaximumIdleMinutesByUserId",
"Gs2Idle:SetMaximumIdleMinutesByUserId",
"Gs2Idle:ReceiveByUserId",
"Gs2Inbox:SendMessageByUserId",
"Gs2Inventory:AddCapacityByUserId",
"Gs2Inventory:SetCapacityByUserId",
"Gs2Inventory:AcquireItemSetByUserId",
"Gs2Inventory:AcquireItemSetWithGradeByUserId",
"Gs2Inventory:AddReferenceOfByUserId",
"Gs2Inventory:DeleteReferenceOfByUserId",
"Gs2Inventory:AcquireSimpleItemsByUserId",
"Gs2Inventory:SetSimpleItemsByUserId",
"Gs2Inventory:AcquireBigItemByUserId",
"Gs2Inventory:SetBigItemByUserId",
"Gs2JobQueue:PushByUserId",
"Gs2Limit:CountDownByUserId",
"Gs2Limit:DeleteCounterByUserId",
"Gs2LoginReward:DeleteReceiveStatusByUserId",
"Gs2LoginReward:UnmarkReceivedByUserId",
"Gs2Lottery:DrawByUserId",
"Gs2Lottery:ResetBoxByUserId",
"Gs2Mission:RevertReceiveByUserId",
"Gs2Mission:IncreaseCounterByUserId",
"Gs2Mission:SetCounterByUserId",
"Gs2Money:DepositByUserId",
"Gs2Money:RevertRecordReceipt",
"Gs2Money2:DepositByUserId",
"Gs2Quest:CreateProgressByUserId",
"Gs2Schedule:TriggerByUserId",
"Gs2Script:InvokeScript",
"Gs2SerialKey:RevertUseByUserId",
"Gs2Showcase:DecrementPurchaseCountByUserId",
"Gs2Showcase:ForceReDrawByUserId",
"Gs2SkillTree:MarkReleaseByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
"Gs2Stamina:RaiseMaxValueByUserId",
"Gs2Stamina:SetMaxValueByUserId",
"Gs2Stamina:SetRecoverIntervalByUserId",
"Gs2Stamina:SetRecoverValueByUserId",
"Gs2StateMachine:StartStateMachineByUserId",
}
~ 128文字入手アクションで実行するアクションの種類
requeststring~ 1048576文字リクエストのJSON

ConsumeAction

消費アクション

有効化条件必須デフォルト値の制限説明
actionenum {
"Gs2Matchmaking:VerifyIncludeParticipantByUserId",
"Gs2AdReward:ConsumePointByUserId",
"Gs2Dictionary:DeleteEntriesByUserId",
"Gs2Distributor:IfExpressionByUserId",
"Gs2Enhance:DeleteProgressByUserId",
"Gs2Exchange:DeleteAwaitByUserId",
"Gs2Experience:SubExperienceByUserId",
"Gs2Experience:SubRankCapByUserId",
"Gs2Formation:SubMoldCapacityByUserId",
"Gs2Grade:SubGradeByUserId",
"Gs2Guild:DecreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:DecreaseMaximumIdleMinutesByUserId",
"Gs2Inbox:OpenMessageByUserId",
"Gs2Inbox:DeleteMessageByUserId",
"Gs2Inventory:ConsumeItemSetByUserId",
"Gs2Inventory:ConsumeSimpleItemsByUserId",
"Gs2Inventory:ConsumeBigItemByUserId",
"Gs2JobQueue:DeleteJobByUserId",
"Gs2Limit:CountUpByUserId",
"Gs2LoginReward:MarkReceivedByUserId",
"Gs2Mission:ReceiveByUserId",
"Gs2Mission:BatchReceiveByUserId",
"Gs2Mission:DecreaseCounterByUserId",
"Gs2Money:WithdrawByUserId",
"Gs2Money:RecordReceipt",
"Gs2Money2:WithdrawByUserId",
"Gs2Money2:VerifyReceiptByUserId",
"Gs2Quest:DeleteProgressByUserId",
"Gs2Ranking2:CreateGlobalRankingReceivedRewardByUserId",
"Gs2Ranking2:CreateClusterRankingReceivedRewardByUserId",
"Gs2Schedule:DeleteTriggerByUserId",
"Gs2SerialKey:UseByUserId",
"Gs2SerialKey:VerifyCodeByUserId",
"Gs2Showcase:IncrementPurchaseCountByUserId",
"Gs2SkillTree:MarkRestrainByUserId",
"Gs2Stamina:DecreaseMaxValueByUserId",
"Gs2Stamina:ConsumeStaminaByUserId",
}
~ 128文字消費アクションで実行するアクションの種類
requeststring~ 1048576文字リクエストのJSON

VerifyAction

検証アクション

有効化条件必須デフォルト値の制限説明
actionenum {
"Gs2Dictionary:VerifyEntryByUserId",
"Gs2Distributor:AndExpressionByUserId",
"Gs2Distributor:OrExpressionByUserId",
"Gs2Enchant:VerifyRarityParameterStatusByUserId",
"Gs2Experience:VerifyRankByUserId",
"Gs2Experience:VerifyRankCapByUserId",
"Gs2Grade:VerifyGradeByUserId",
"Gs2Grade:VerifyGradeUpMaterialByUserId",
"Gs2Guild:VerifyCurrentMaximumMemberCountByGuildName",
"Gs2Guild:VerifyIncludeMemberByUserId",
"Gs2Inventory:VerifyInventoryCurrentMaxCapacityByUserId",
"Gs2Inventory:VerifyItemSetByUserId",
"Gs2Inventory:VerifyReferenceOfByUserId",
"Gs2Inventory:VerifySimpleItemByUserId",
"Gs2Inventory:VerifyBigItemByUserId",
"Gs2Limit:VerifyCounterByUserId",
"Gs2Mission:VerifyCompleteByUserId",
"Gs2Mission:VerifyCounterValueByUserId",
"Gs2Ranking2:VerifyGlobalRankingScoreByUserId",
"Gs2Ranking2:VerifyClusterRankingScoreByUserId",
"Gs2Ranking2:VerifySubscribeRankingScoreByUserId",
"Gs2Schedule:VerifyTriggerByUserId",
"Gs2Schedule:VerifyEventByUserId",
}
~ 128文字検証アクションで実行するアクションの種類
requeststring~ 1048576文字リクエストのJSON

Config

コンフィグ設定

トランザクションの変数に適用する設定値

有効化条件必須デフォルト値の制限説明
keystring~ 64文字名前
valuestring~ 51200文字

LogSetting

ログの書き出し設定

ログデータの書き出し設定を管理します。この型は、ログデータを書き出すために使用されるログ名前空間の識別子(Namespace ID)を保持します。
ログ名前空間IDは、ログデータを集約し、保存する対象の GS2-Log の名前空間を指定します。
この設定を通じて、この名前空間以下のAPIリクエスト・レスポンスログデータが対象の GS2-Log へ出力されるようになります。
GS2-Log にはリアルタイムでログが提供され、システムの監視や分析、デバッグなどに利用できます。

有効化条件必須デフォルト値の制限説明
loggingNamespaceIdstring~ 1024文字ネームスペースGRN

GitHubCheckoutSetting

GitHubからマスターデータをチェックアウトする設定

有効化条件必須デフォルト値の制限説明
apiKeyIdstring~ 1024文字GitHub のAPIキーGRN
repositoryNamestring~ 1024文字リポジトリ名
sourcePathstring~ 1024文字ソースコードのファイルパス
referenceTypeenum {
    “commit_hash”,
    “branch”,
    “tag”
}
~ 128文字コードの取得元
commitHashstring{referenceType} == “commit_hash”~ 1024文字コミットハッシュ
branchNamestring{referenceType} == “branch”~ 1024文字ブランチ名
tagNamestring{referenceType} == “tag”~ 1024文字タグ名

referenceType に指定する列挙型の定義

定義説明
commit_hashコミットハッシュ
branchブランチ
tagタグ

ScriptSetting

スクリプト設定

GS2 ではマイクロサービスのイベントに関連づけて、カスタムスクリプトを実行することができます。
このモデルは、スクリプトの実行をトリガーするための設定を保持します。

スクリプトの実行方式は大きく2種類あり、それは「同期実行」と「非同期実行」です。
同期実行は、スクリプトの実行が完了するまで処理がブロックされます。
かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることができます。

一方、非同期実行は、スクリプトの実行が完了するまで処理がブロックされません。
かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることはできません。
しかし、非同期実行は、スクリプトの実行が完了するまで処理がブロックされないため、APIの応答に影響を与えないため、原則非同期実行を使用することをおすすめします。

非同期実行には実行方式が2種類あり、GS2-Script と Amazon EventBridge があります。
Amazon EventBridge を使用することで、Lua 以外の言語で処理を記述することができます。

有効化条件必須デフォルト値の制限説明
triggerScriptIdstring~ 1024文字スクリプトGRN
doneTriggerTargetTypeenum {
    “none”,
    “gs2_script”,
    “aws”
}
“none”~ 128文字完了通知の通知先
doneTriggerScriptIdstring{doneTriggerTargetType} == “gs2_script”~ 1024文字スクリプトGRN
doneTriggerQueueNamespaceIdstring{doneTriggerTargetType} == “gs2_script”~ 1024文字ネームスペースGRN

doneTriggerTargetType に指定する列挙型の定義

定義説明
noneなし
gs2_scriptGS2-Script
awsAmazon EventBridge

TransactionSetting

トランザクション設定

有効化条件必須デフォルト値の制限説明
enableAutoRunboolfalse発行したトランザクションをサーバーサイドで自動的に実行するか
distributorNamespaceIdstring“grn:gs2:{region}:{ownerId}:distributor:default”~ 1024文字トランザクションの実行に使用する GS2-Distributor ネームスペース
queueNamespaceIdstring“grn:gs2:{region}:{ownerId}:queue:default”~ 1024文字トランザクションの実行に使用する GS2-JobQueue のネームスペース

メソッド

describeCompletes

達成状況の一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
accessTokenstring~ 128文字ユーザーID
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<Complete>達成状況のリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DescribeCompletes(
    &mission.DescribeCompletesRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("accessToken-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeCompletesRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeCompletes(
        (new DescribeCompletesRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeCompletesRequest;
import io.gs2.mission.result.DescribeCompletesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    DescribeCompletesResult result = client.describeCompletes(
        new DescribeCompletesRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Complete> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.DescribeCompletesRequest;
using Gs2.Gs2Mission.Result.DescribeCompletesResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DescribeCompletesResult> asyncResult = null;
yield return client.DescribeCompletes(
    new Gs2.Gs2Mission.Request.DescribeCompletesRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("accessToken-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.describeCompletes(
        new Gs2Mission.DescribeCompletesRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.describe_completes(
        mission.DescribeCompletesRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.describe_completes({
    namespaceName="namespace1",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('mission')

api_result_handler = client.describe_completes_async({
    namespaceName="namespace1",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

describeCompletesByUserId

ユーザIDを指定して達成状況の一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
userIdstring~ 128文字ユーザーID
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemsList<Complete>達成状況のリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DescribeCompletesByUserId(
    &mission.DescribeCompletesByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeCompletesByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeCompletesByUserId(
        (new DescribeCompletesByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeCompletesByUserIdRequest;
import io.gs2.mission.result.DescribeCompletesByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    DescribeCompletesByUserIdResult result = client.describeCompletesByUserId(
        new DescribeCompletesByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Complete> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.DescribeCompletesByUserIdRequest;
using Gs2.Gs2Mission.Result.DescribeCompletesByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DescribeCompletesByUserIdResult> asyncResult = null;
yield return client.DescribeCompletesByUserId(
    new Gs2.Gs2Mission.Request.DescribeCompletesByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.describeCompletesByUserId(
        new Gs2Mission.DescribeCompletesByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.describe_completes_by_user_id(
        mission.DescribeCompletesByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.describe_completes_by_user_id({
    namespaceName="namespace1",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('mission')

api_result_handler = client.describe_completes_by_user_id_async({
    namespaceName="namespace1",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

complete

ミッション達成報酬を受領するためのトランザクションを発行

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
missionGroupNamestring~ 128文字ミッショングループ名
missionTaskNamestring~ 128文字タスク名
accessTokenstring~ 128文字ユーザーID
configList<Config>[]~ 32 itemsトランザクションの変数に適用する設定値

Result

説明
transactionIdstring発行されたトランザクションID
stampSheetstringミッションの達成報酬を受領するスタンプシート
stampSheetEncryptionKeyIdstringスタンプシートの署名計算に使用した暗号鍵GRN
autoRunStampSheetbool?トランザクションの自動実行が有効か

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.Complete(
    &mission.CompleteRequest {
        NamespaceName: pointy.String("namespace1"),
        MissionGroupName: pointy.String("mission-group-0001"),
        MissionTaskName: pointy.String("mission-task-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CompleteRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->complete(
        (new CompleteRequest())
            ->withNamespaceName(self::namespace1)
            ->withMissionGroupName("mission-group-0001")
            ->withMissionTaskName("mission-task-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withConfig(null)
    );
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.CompleteRequest;
import io.gs2.mission.result.CompleteResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    CompleteResult result = client.complete(
        new CompleteRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withAccessToken("accessToken-0001")
            .withConfig(null)
    );
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.CompleteRequest;
using Gs2.Gs2Mission.Result.CompleteResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.CompleteResult> asyncResult = null;
yield return client.Complete(
    new Gs2.Gs2Mission.Request.CompleteRequest()
        .WithNamespaceName("namespace1")
        .WithMissionGroupName("mission-group-0001")
        .WithMissionTaskName("mission-task-0001")
        .WithAccessToken("accessToken-0001")
        .WithConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.complete(
        new Gs2Mission.CompleteRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withAccessToken("accessToken-0001")
            .withConfig(null)
    );
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.complete(
        mission.CompleteRequest()
            .with_namespace_name(self.hash1)
            .with_mission_group_name('mission-group-0001')
            .with_mission_task_name('mission-task-0001')
            .with_access_token(self.access_token_0001)
            .with_config(None)
    )
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.complete({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    accessToken="accessToken-0001",
    config=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
client = gs2('mission')

api_result_handler = client.complete_async({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    accessToken="accessToken-0001",
    config=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;

completeByUserId

ユーザーIDを指定してミッション達成報酬を受領するためのトランザクションを発行

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
missionGroupNamestring~ 128文字ミッショングループ名
missionTaskNamestring~ 128文字タスク名
userIdstring~ 128文字ユーザーID
configList<Config>[]~ 32 itemsトランザクションの変数に適用する設定値
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
transactionIdstring発行されたトランザクションID
stampSheetstringミッションの達成報酬を受領するスタンプシート
stampSheetEncryptionKeyIdstringスタンプシートの署名計算に使用した暗号鍵GRN
autoRunStampSheetbool?トランザクションの自動実行が有効か

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.CompleteByUserId(
    &mission.CompleteByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        MissionGroupName: pointy.String("mission-group-0001"),
        MissionTaskName: pointy.String("mission-task-0001"),
        UserId: pointy.String("user-0001"),
        Config: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CompleteByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->completeByUserId(
        (new CompleteByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withMissionGroupName("mission-group-0001")
            ->withMissionTaskName("mission-task-0001")
            ->withUserId("user-0001")
            ->withConfig(null)
            ->withTimeOffsetToken(null)
    );
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.CompleteByUserIdRequest;
import io.gs2.mission.result.CompleteByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    CompleteByUserIdResult result = client.completeByUserId(
        new CompleteByUserIdRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withUserId("user-0001")
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.CompleteByUserIdRequest;
using Gs2.Gs2Mission.Result.CompleteByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.CompleteByUserIdResult> asyncResult = null;
yield return client.CompleteByUserId(
    new Gs2.Gs2Mission.Request.CompleteByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithMissionGroupName("mission-group-0001")
        .WithMissionTaskName("mission-task-0001")
        .WithUserId("user-0001")
        .WithConfig(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.completeByUserId(
        new Gs2Mission.CompleteByUserIdRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withUserId("user-0001")
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.complete_by_user_id(
        mission.CompleteByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_mission_group_name('mission-group-0001')
            .with_mission_task_name('mission-task-0001')
            .with_user_id('user-0001')
            .with_config(None)
            .with_time_offset_token(None)
    )
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.complete_by_user_id({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    userId="user-0001",
    config=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
client = gs2('mission')

api_result_handler = client.complete_by_user_id_async({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    userId="user-0001",
    config=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;

batchComplete

ミッション達成報酬を一括で受領するためのトランザクションを発行

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
missionGroupNamestring~ 128文字ミッショングループ名
accessTokenstring~ 128文字ユーザーID
missionTaskNamesList<string>1 ~ 100 itemsタスク名のリスト
configList<Config>[]~ 32 itemsトランザクションの変数に適用する設定値

Result

説明
transactionIdstring発行されたトランザクションID
stampSheetstringミッションの達成報酬を受領するスタンプシート
stampSheetEncryptionKeyIdstringスタンプシートの署名計算に使用した暗号鍵GRN
autoRunStampSheetbool?トランザクションの自動実行が有効か

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.BatchComplete(
    &mission.BatchCompleteRequest {
        NamespaceName: pointy.String("namespace1"),
        MissionGroupName: pointy.String("mission-group-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        MissionTaskNames: []*string{
            pointy.String("mission-task-0001"),
            pointy.String("mission-task-0002"),
        },
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\BatchCompleteRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->batchComplete(
        (new BatchCompleteRequest())
            ->withNamespaceName(self::namespace1)
            ->withMissionGroupName("mission-group-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withMissionTaskNames([
                "mission-task-0001",
                "mission-task-0002",
            ])
            ->withConfig(null)
    );
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.BatchCompleteRequest;
import io.gs2.mission.result.BatchCompleteResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    BatchCompleteResult result = client.batchComplete(
        new BatchCompleteRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withAccessToken("accessToken-0001")
            .withMissionTaskNames(Arrays.asList(
                "mission-task-0001",
                "mission-task-0002"
            ))
            .withConfig(null)
    );
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.BatchCompleteRequest;
using Gs2.Gs2Mission.Result.BatchCompleteResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.BatchCompleteResult> asyncResult = null;
yield return client.BatchComplete(
    new Gs2.Gs2Mission.Request.BatchCompleteRequest()
        .WithNamespaceName("namespace1")
        .WithMissionGroupName("mission-group-0001")
        .WithAccessToken("accessToken-0001")
        .WithMissionTaskNames(new string[] {
            "mission-task-0001",
            "mission-task-0002",
        })
        .WithConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.batchComplete(
        new Gs2Mission.BatchCompleteRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withAccessToken("accessToken-0001")
            .withMissionTaskNames([
                "mission-task-0001",
                "mission-task-0002",
            ])
            .withConfig(null)
    );
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.batch_complete(
        mission.BatchCompleteRequest()
            .with_namespace_name(self.hash1)
            .with_mission_group_name('mission-group-0001')
            .with_access_token(self.access_token_0001)
            .with_mission_task_names([
                'mission-task-0001',
                'mission-task-0002',
            ])
            .with_config(None)
    )
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.batch_complete({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    accessToken="accessToken-0001",
    missionTaskNames={
        "mission-task-0001",
        "mission-task-0002"
    },
    config=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
client = gs2('mission')

api_result_handler = client.batch_complete_async({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    accessToken="accessToken-0001",
    missionTaskNames={
        "mission-task-0001",
        "mission-task-0002"
    },
    config=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;

batchCompleteByUserId

ユーザーIDを指定してミッション達成報酬を一括で受領するためのトランザクションを発行

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
missionGroupNamestring~ 128文字ミッショングループ名
userIdstring~ 128文字ユーザーID
missionTaskNamesList<string>1 ~ 100 itemsタスク名のリスト
configList<Config>[]~ 32 itemsトランザクションの変数に適用する設定値
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
transactionIdstring発行されたトランザクションID
stampSheetstringミッションの達成報酬を受領するスタンプシート
stampSheetEncryptionKeyIdstringスタンプシートの署名計算に使用した暗号鍵GRN
autoRunStampSheetbool?トランザクションの自動実行が有効か

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.BatchCompleteByUserId(
    &mission.BatchCompleteByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        MissionGroupName: pointy.String("mission-group-0001"),
        UserId: pointy.String("user-0001"),
        MissionTaskNames: []*string{
            pointy.String("mission-task-0001"),
            pointy.String("mission-task-0002"),
        },
        Config: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\BatchCompleteByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->batchCompleteByUserId(
        (new BatchCompleteByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withMissionGroupName("mission-group-0001")
            ->withUserId("user-0001")
            ->withMissionTaskNames([
                "mission-task-0001",
                "mission-task-0002",
            ])
            ->withConfig(null)
            ->withTimeOffsetToken(null)
    );
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.BatchCompleteByUserIdRequest;
import io.gs2.mission.result.BatchCompleteByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    BatchCompleteByUserIdResult result = client.batchCompleteByUserId(
        new BatchCompleteByUserIdRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withUserId("user-0001")
            .withMissionTaskNames(Arrays.asList(
                "mission-task-0001",
                "mission-task-0002"
            ))
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.BatchCompleteByUserIdRequest;
using Gs2.Gs2Mission.Result.BatchCompleteByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.BatchCompleteByUserIdResult> asyncResult = null;
yield return client.BatchCompleteByUserId(
    new Gs2.Gs2Mission.Request.BatchCompleteByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithMissionGroupName("mission-group-0001")
        .WithUserId("user-0001")
        .WithMissionTaskNames(new string[] {
            "mission-task-0001",
            "mission-task-0002",
        })
        .WithConfig(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.batchCompleteByUserId(
        new Gs2Mission.BatchCompleteByUserIdRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withUserId("user-0001")
            .withMissionTaskNames([
                "mission-task-0001",
                "mission-task-0002",
            ])
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.batch_complete_by_user_id(
        mission.BatchCompleteByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_mission_group_name('mission-group-0001')
            .with_user_id('user-0001')
            .with_mission_task_names([
                'mission-task-0001',
                'mission-task-0002',
            ])
            .with_config(None)
            .with_time_offset_token(None)
    )
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.batch_complete_by_user_id({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    userId="user-0001",
    missionTaskNames={
        "mission-task-0001",
        "mission-task-0002"
    },
    config=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
client = gs2('mission')

api_result_handler = client.batch_complete_by_user_id_async({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    userId="user-0001",
    missionTaskNames={
        "mission-task-0001",
        "mission-task-0002"
    },
    config=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;

receiveByUserId

ミッション達成報酬を受領する

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
missionGroupNamestring~ 128文字ミッショングループ名
missionTaskNamestring~ 128文字タスク名
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemComplete受領した達成状況

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.ReceiveByUserId(
    &mission.ReceiveByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        MissionGroupName: pointy.String("mission-group-0001"),
        MissionTaskName: pointy.String("mission-task-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\ReceiveByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->receiveByUserId(
        (new ReceiveByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withMissionGroupName("mission-group-0001")
            ->withMissionTaskName("mission-task-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.ReceiveByUserIdRequest;
import io.gs2.mission.result.ReceiveByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    ReceiveByUserIdResult result = client.receiveByUserId(
        new ReceiveByUserIdRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Complete item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.ReceiveByUserIdRequest;
using Gs2.Gs2Mission.Result.ReceiveByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.ReceiveByUserIdResult> asyncResult = null;
yield return client.ReceiveByUserId(
    new Gs2.Gs2Mission.Request.ReceiveByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithMissionGroupName("mission-group-0001")
        .WithMissionTaskName("mission-task-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.receiveByUserId(
        new Gs2Mission.ReceiveByUserIdRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.receive_by_user_id(
        mission.ReceiveByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_mission_group_name('mission-group-0001')
            .with_mission_task_name('mission-task-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.receive_by_user_id({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('mission')

api_result_handler = client.receive_by_user_id_async({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

batchReceiveByUserId

複数のミッションタスクの達成報酬を一括で受領状態にする

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
missionGroupNamestring~ 128文字ミッショングループ名
userIdstring~ 128文字ユーザーID
missionTaskNamesList<string>1 ~ 100 itemsタスク名のリスト
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemComplete受領した達成状況

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.BatchReceiveByUserId(
    &mission.BatchReceiveByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        MissionGroupName: pointy.String("mission-group-0001"),
        UserId: pointy.String("user-0001"),
        MissionTaskNames: []*string{
            pointy.String("mission-task-0001"),
            pointy.String("mission-task-0002"),
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\BatchReceiveByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->batchReceiveByUserId(
        (new BatchReceiveByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withMissionGroupName("mission-group-0001")
            ->withUserId("user-0001")
            ->withMissionTaskNames([
                "mission-task-0001",
                "mission-task-0002",
            ])
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.BatchReceiveByUserIdRequest;
import io.gs2.mission.result.BatchReceiveByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    BatchReceiveByUserIdResult result = client.batchReceiveByUserId(
        new BatchReceiveByUserIdRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withUserId("user-0001")
            .withMissionTaskNames(Arrays.asList(
                "mission-task-0001",
                "mission-task-0002"
            ))
            .withTimeOffsetToken(null)
    );
    Complete item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.BatchReceiveByUserIdRequest;
using Gs2.Gs2Mission.Result.BatchReceiveByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.BatchReceiveByUserIdResult> asyncResult = null;
yield return client.BatchReceiveByUserId(
    new Gs2.Gs2Mission.Request.BatchReceiveByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithMissionGroupName("mission-group-0001")
        .WithUserId("user-0001")
        .WithMissionTaskNames(new string[] {
            "mission-task-0001",
            "mission-task-0002",
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.batchReceiveByUserId(
        new Gs2Mission.BatchReceiveByUserIdRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withUserId("user-0001")
            .withMissionTaskNames([
                "mission-task-0001",
                "mission-task-0002",
            ])
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.batch_receive_by_user_id(
        mission.BatchReceiveByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_mission_group_name('mission-group-0001')
            .with_user_id('user-0001')
            .with_mission_task_names([
                'mission-task-0001',
                'mission-task-0002',
            ])
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.batch_receive_by_user_id({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    userId="user-0001",
    missionTaskNames={
        "mission-task-0001",
        "mission-task-0002"
    },
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('mission')

api_result_handler = client.batch_receive_by_user_id_async({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    userId="user-0001",
    missionTaskNames={
        "mission-task-0001",
        "mission-task-0002"
    },
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

revertReceiveByUserId

ミッション達成報酬を未受領状態にする

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
missionGroupNamestring~ 128文字ミッショングループ名
missionTaskNamestring~ 128文字タスク名
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemComplete受領した達成状況

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.RevertReceiveByUserId(
    &mission.RevertReceiveByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        MissionGroupName: pointy.String("mission-group-0001"),
        MissionTaskName: pointy.String("mission-task-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\RevertReceiveByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->revertReceiveByUserId(
        (new RevertReceiveByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withMissionGroupName("mission-group-0001")
            ->withMissionTaskName("mission-task-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.RevertReceiveByUserIdRequest;
import io.gs2.mission.result.RevertReceiveByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    RevertReceiveByUserIdResult result = client.revertReceiveByUserId(
        new RevertReceiveByUserIdRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Complete item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.RevertReceiveByUserIdRequest;
using Gs2.Gs2Mission.Result.RevertReceiveByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.RevertReceiveByUserIdResult> asyncResult = null;
yield return client.RevertReceiveByUserId(
    new Gs2.Gs2Mission.Request.RevertReceiveByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithMissionGroupName("mission-group-0001")
        .WithMissionTaskName("mission-task-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.revertReceiveByUserId(
        new Gs2Mission.RevertReceiveByUserIdRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.revert_receive_by_user_id(
        mission.RevertReceiveByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_mission_group_name('mission-group-0001')
            .with_mission_task_name('mission-task-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.revert_receive_by_user_id({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('mission')

api_result_handler = client.revert_receive_by_user_id_async({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

getComplete

達成状況を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
missionGroupNamestring~ 128文字ミッショングループ名
accessTokenstring~ 128文字ユーザーID

Result

説明
itemComplete達成状況

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.GetComplete(
    &mission.GetCompleteRequest {
        NamespaceName: pointy.String("namespace1"),
        MissionGroupName: pointy.String("mission-group-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetCompleteRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getComplete(
        (new GetCompleteRequest())
            ->withNamespaceName(self::namespace1)
            ->withMissionGroupName("mission-group-0001")
            ->withAccessToken(self::$accessToken0001)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetCompleteRequest;
import io.gs2.mission.result.GetCompleteResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    GetCompleteResult result = client.getComplete(
        new GetCompleteRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withAccessToken("accessToken-0001")
    );
    Complete item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.GetCompleteRequest;
using Gs2.Gs2Mission.Result.GetCompleteResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.GetCompleteResult> asyncResult = null;
yield return client.GetComplete(
    new Gs2.Gs2Mission.Request.GetCompleteRequest()
        .WithNamespaceName("namespace1")
        .WithMissionGroupName("mission-group-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.getComplete(
        new Gs2Mission.GetCompleteRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.get_complete(
        mission.GetCompleteRequest()
            .with_namespace_name(self.hash1)
            .with_mission_group_name('mission-group-0001')
            .with_access_token(self.access_token_0001)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.get_complete({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    accessToken="accessToken-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('mission')

api_result_handler = client.get_complete_async({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    accessToken="accessToken-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

getCompleteByUserId

ユーザIDを指定して達成状況を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
missionGroupNamestring~ 128文字ミッショングループ名
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemComplete達成状況

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.GetCompleteByUserId(
    &mission.GetCompleteByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        MissionGroupName: pointy.String("mission-group-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetCompleteByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCompleteByUserId(
        (new GetCompleteByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withMissionGroupName("mission-group-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetCompleteByUserIdRequest;
import io.gs2.mission.result.GetCompleteByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    GetCompleteByUserIdResult result = client.getCompleteByUserId(
        new GetCompleteByUserIdRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Complete item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.GetCompleteByUserIdRequest;
using Gs2.Gs2Mission.Result.GetCompleteByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.GetCompleteByUserIdResult> asyncResult = null;
yield return client.GetCompleteByUserId(
    new Gs2.Gs2Mission.Request.GetCompleteByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithMissionGroupName("mission-group-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.getCompleteByUserId(
        new Gs2Mission.GetCompleteByUserIdRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.get_complete_by_user_id(
        mission.GetCompleteByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_mission_group_name('mission-group-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.get_complete_by_user_id({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('mission')

api_result_handler = client.get_complete_by_user_id_async({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

deleteCompleteByUserId

達成状況を削除

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
userIdstring~ 128文字ユーザーID
missionGroupNamestring~ 128文字ミッショングループ名
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemComplete削除した達成状況

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DeleteCompleteByUserId(
    &mission.DeleteCompleteByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DeleteCompleteByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteCompleteByUserId(
        (new DeleteCompleteByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DeleteCompleteByUserIdRequest;
import io.gs2.mission.result.DeleteCompleteByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    DeleteCompleteByUserIdResult result = client.deleteCompleteByUserId(
        new DeleteCompleteByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withMissionGroupName("mission-group-0001")
            .withTimeOffsetToken(null)
    );
    Complete item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.DeleteCompleteByUserIdRequest;
using Gs2.Gs2Mission.Result.DeleteCompleteByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DeleteCompleteByUserIdResult> asyncResult = null;
yield return client.DeleteCompleteByUserId(
    new Gs2.Gs2Mission.Request.DeleteCompleteByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.deleteCompleteByUserId(
        new Gs2Mission.DeleteCompleteByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withMissionGroupName("mission-group-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.delete_complete_by_user_id(
        mission.DeleteCompleteByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_mission_group_name('mission-group-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.delete_complete_by_user_id({
    namespaceName="namespace1",
    userId="user-0001",
    missionGroupName="mission-group-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('mission')

api_result_handler = client.delete_complete_by_user_id_async({
    namespaceName="namespace1",
    userId="user-0001",
    missionGroupName="mission-group-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

verifyComplete

ミッションの達成状況を検証

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
missionGroupNamestring~ 128文字ミッショングループ名
accessTokenstring~ 128文字ユーザーID
verifyTypeenum {
    “completed”,
    “notCompleted”,
    “received”,
    “notReceived”,
    “completedAndNotReceived”
}
~ 128文字検証の種類
missionTaskNamestring~ 128文字タスク名
multiplyValueSpecifyingQuantityboolfalse数量指定した際に、検証に使用する値も乗算するか

verifyType に指定する列挙型の定義

定義説明
completed条件が達成済みであること
notCompleted条件が未達成であること
received報酬を受け取り済みであること
notReceived報酬が未受け取りであること
completedAndNotReceived条件が達成済みで、報酬を未受け取りであること

Result

説明

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.VerifyComplete(
    &mission.VerifyCompleteRequest {
        NamespaceName: pointy.String("namespace1"),
        MissionGroupName: pointy.String("mission-group-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        VerifyType: pointy.String("completed"),
        MissionTaskName: pointy.String("task-0001"),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\VerifyCompleteRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyComplete(
        (new VerifyCompleteRequest())
            ->withNamespaceName(self::namespace1)
            ->withMissionGroupName("mission-group-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withVerifyType("completed")
            ->withMissionTaskName("task-0001")
            ->withMultiplyValueSpecifyingQuantity(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.VerifyCompleteRequest;
import io.gs2.mission.result.VerifyCompleteResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    VerifyCompleteResult result = client.verifyComplete(
        new VerifyCompleteRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withAccessToken("accessToken-0001")
            .withVerifyType("completed")
            .withMissionTaskName("task-0001")
            .withMultiplyValueSpecifyingQuantity(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.VerifyCompleteRequest;
using Gs2.Gs2Mission.Result.VerifyCompleteResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.VerifyCompleteResult> asyncResult = null;
yield return client.VerifyComplete(
    new Gs2.Gs2Mission.Request.VerifyCompleteRequest()
        .WithNamespaceName("namespace1")
        .WithMissionGroupName("mission-group-0001")
        .WithAccessToken("accessToken-0001")
        .WithVerifyType("completed")
        .WithMissionTaskName("task-0001")
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.verifyComplete(
        new Gs2Mission.VerifyCompleteRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withAccessToken("accessToken-0001")
            .withVerifyType("completed")
            .withMissionTaskName("task-0001")
            .withMultiplyValueSpecifyingQuantity(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.verify_complete(
        mission.VerifyCompleteRequest()
            .with_namespace_name(self.hash1)
            .with_mission_group_name('mission-group-0001')
            .with_access_token(self.access_token_0001)
            .with_verify_type('completed')
            .with_mission_task_name('task-0001')
            .with_multiply_value_specifying_quantity(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.verify_complete({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    accessToken="accessToken-0001",
    verifyType="completed",
    missionTaskName="task-0001",
    multiplyValueSpecifyingQuantity=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
client = gs2('mission')

api_result_handler = client.verify_complete_async({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    accessToken="accessToken-0001",
    verifyType="completed",
    missionTaskName="task-0001",
    multiplyValueSpecifyingQuantity=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result

verifyCompleteByUserId

ユーザーIDを指定してミッションの達成状況を検証

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
missionGroupNamestring~ 128文字ミッショングループ名
userIdstring~ 128文字ユーザーID
verifyTypeenum {
    “completed”,
    “notCompleted”,
    “received”,
    “notReceived”,
    “completedAndNotReceived”
}
~ 128文字検証の種類
missionTaskNamestring~ 128文字タスク名
multiplyValueSpecifyingQuantityboolfalse数量指定した際に、検証に使用する値も乗算するか
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

verifyType に指定する列挙型の定義

定義説明
completed条件が達成済みであること
notCompleted条件が未達成であること
received報酬を受け取り済みであること
notReceived報酬が未受け取りであること
completedAndNotReceived条件が達成済みで、報酬を未受け取りであること

Result

説明

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.VerifyCompleteByUserId(
    &mission.VerifyCompleteByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        MissionGroupName: pointy.String("mission-group-0001"),
        UserId: pointy.String("user-0001"),
        VerifyType: pointy.String("completed"),
        MissionTaskName: pointy.String("task-0001"),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\VerifyCompleteByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyCompleteByUserId(
        (new VerifyCompleteByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withMissionGroupName("mission-group-0001")
            ->withUserId("user-0001")
            ->withVerifyType("completed")
            ->withMissionTaskName("task-0001")
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.VerifyCompleteByUserIdRequest;
import io.gs2.mission.result.VerifyCompleteByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    VerifyCompleteByUserIdResult result = client.verifyCompleteByUserId(
        new VerifyCompleteByUserIdRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withUserId("user-0001")
            .withVerifyType("completed")
            .withMissionTaskName("task-0001")
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.VerifyCompleteByUserIdRequest;
using Gs2.Gs2Mission.Result.VerifyCompleteByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.VerifyCompleteByUserIdResult> asyncResult = null;
yield return client.VerifyCompleteByUserId(
    new Gs2.Gs2Mission.Request.VerifyCompleteByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithMissionGroupName("mission-group-0001")
        .WithUserId("user-0001")
        .WithVerifyType("completed")
        .WithMissionTaskName("task-0001")
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.verifyCompleteByUserId(
        new Gs2Mission.VerifyCompleteByUserIdRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withUserId("user-0001")
            .withVerifyType("completed")
            .withMissionTaskName("task-0001")
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.verify_complete_by_user_id(
        mission.VerifyCompleteByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_mission_group_name('mission-group-0001')
            .with_user_id('user-0001')
            .with_verify_type('completed')
            .with_mission_task_name('task-0001')
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.verify_complete_by_user_id({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    userId="user-0001",
    verifyType="completed",
    missionTaskName="task-0001",
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
client = gs2('mission')

api_result_handler = client.verify_complete_by_user_id_async({
    namespaceName="namespace1",
    missionGroupName="mission-group-0001",
    userId="user-0001",
    verifyType="completed",
    missionTaskName="task-0001",
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result

receiveByStampTask

達成状況を作成

Request

有効化条件必須デフォルト値の制限説明
stampTaskstring~ 5242880文字消費アクション
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
itemComplete達成状況
newContextStackstring消費アクションの実行結果を記録したコンテキスト

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.ReceiveByStampTask(
    &mission.ReceiveByStampTaskRequest {
        StampTask: pointy.String("stampTask"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\ReceiveByStampTaskRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->receiveByStampTask(
        (new ReceiveByStampTaskRequest())
            ->withStampTask(self::stampTask)
            ->withKeyId(self::key-0001)
    );
    $item = $result->getItem();
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.ReceiveByStampTaskRequest;
import io.gs2.mission.result.ReceiveByStampTaskResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    ReceiveByStampTaskResult result = client.receiveByStampTask(
        new ReceiveByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    Complete item = result.getItem();
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.ReceiveByStampTaskRequest;
using Gs2.Gs2Mission.Result.ReceiveByStampTaskResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.ReceiveByStampTaskResult> asyncResult = null;
yield return client.ReceiveByStampTask(
    new Gs2.Gs2Mission.Request.ReceiveByStampTaskRequest()
        .WithStampTask("stampTask")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.receiveByStampTask(
        new Gs2Mission.ReceiveByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    const item = result.getItem();
    const newContextStack = result.getNewContextStack();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.receive_by_stamp_task(
        mission.ReceiveByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.receive_by_stamp_task({
    stampTask="stampTask",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
newContextStack = result.newContextStack;
client = gs2('mission')

api_result_handler = client.receive_by_stamp_task_async({
    stampTask="stampTask",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
newContextStack = result.newContextStack;

batchReceiveByStampTask

達成状況を作成

Request

有効化条件必須デフォルト値の制限説明
stampTaskstring~ 5242880文字消費アクション
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
itemComplete達成状況
newContextStackstring消費アクションの実行結果を記録したコンテキスト

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.BatchReceiveByStampTask(
    &mission.BatchReceiveByStampTaskRequest {
        StampTask: pointy.String("stampTask"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\BatchReceiveByStampTaskRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->batchReceiveByStampTask(
        (new BatchReceiveByStampTaskRequest())
            ->withStampTask(self::stampTask)
            ->withKeyId(self::key-0001)
    );
    $item = $result->getItem();
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.BatchReceiveByStampTaskRequest;
import io.gs2.mission.result.BatchReceiveByStampTaskResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    BatchReceiveByStampTaskResult result = client.batchReceiveByStampTask(
        new BatchReceiveByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    Complete item = result.getItem();
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.BatchReceiveByStampTaskRequest;
using Gs2.Gs2Mission.Result.BatchReceiveByStampTaskResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.BatchReceiveByStampTaskResult> asyncResult = null;
yield return client.BatchReceiveByStampTask(
    new Gs2.Gs2Mission.Request.BatchReceiveByStampTaskRequest()
        .WithStampTask("stampTask")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.batchReceiveByStampTask(
        new Gs2Mission.BatchReceiveByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    const item = result.getItem();
    const newContextStack = result.getNewContextStack();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.batch_receive_by_stamp_task(
        mission.BatchReceiveByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.batch_receive_by_stamp_task({
    stampTask="stampTask",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
newContextStack = result.newContextStack;
client = gs2('mission')

api_result_handler = client.batch_receive_by_stamp_task_async({
    stampTask="stampTask",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
newContextStack = result.newContextStack;

revertReceiveByStampSheet

達成状況を作成

Request

有効化条件必須デフォルト値の制限説明
stampSheetstring~ 5242880文字トランザクション
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
itemComplete達成状況

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.RevertReceiveByStampSheet(
    &mission.RevertReceiveByStampSheetRequest {
        StampSheet: pointy.String("stampSheet"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\RevertReceiveByStampSheetRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->revertReceiveByStampSheet(
        (new RevertReceiveByStampSheetRequest())
            ->withStampSheet(self::stampSheet)
            ->withKeyId(self::key-0001)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.RevertReceiveByStampSheetRequest;
import io.gs2.mission.result.RevertReceiveByStampSheetResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    RevertReceiveByStampSheetResult result = client.revertReceiveByStampSheet(
        new RevertReceiveByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-0001")
    );
    Complete item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.RevertReceiveByStampSheetRequest;
using Gs2.Gs2Mission.Result.RevertReceiveByStampSheetResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.RevertReceiveByStampSheetResult> asyncResult = null;
yield return client.RevertReceiveByStampSheet(
    new Gs2.Gs2Mission.Request.RevertReceiveByStampSheetRequest()
        .WithStampSheet("stampSheet")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.revertReceiveByStampSheet(
        new Gs2Mission.RevertReceiveByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.revert_receive_by_stamp_sheet(
        mission.RevertReceiveByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.revert_receive_by_stamp_sheet({
    stampSheet="stampSheet",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('mission')

api_result_handler = client.revert_receive_by_stamp_sheet_async({
    stampSheet="stampSheet",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

verifyCompleteByStampTask

検証アクションとしてミッションの達成状況の検証を実行

Request

有効化条件必須デフォルト値の制限説明
stampTaskstring~ 5242880文字検証アクション
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
newContextStackstring検証アクションの実行結果を記録したコンテキスト

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.VerifyCompleteByStampTask(
    &mission.VerifyCompleteByStampTaskRequest {
        StampTask: pointy.String("stampTask"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\VerifyCompleteByStampTaskRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyCompleteByStampTask(
        (new VerifyCompleteByStampTaskRequest())
            ->withStampTask(self::stampTask)
            ->withKeyId(self::key-0001)
    );
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.VerifyCompleteByStampTaskRequest;
import io.gs2.mission.result.VerifyCompleteByStampTaskResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    VerifyCompleteByStampTaskResult result = client.verifyCompleteByStampTask(
        new VerifyCompleteByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.VerifyCompleteByStampTaskRequest;
using Gs2.Gs2Mission.Result.VerifyCompleteByStampTaskResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.VerifyCompleteByStampTaskResult> asyncResult = null;
yield return client.VerifyCompleteByStampTask(
    new Gs2.Gs2Mission.Request.VerifyCompleteByStampTaskRequest()
        .WithStampTask("stampTask")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.verifyCompleteByStampTask(
        new Gs2Mission.VerifyCompleteByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    const newContextStack = result.getNewContextStack();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.verify_complete_by_stamp_task(
        mission.VerifyCompleteByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.verify_complete_by_stamp_task({
    stampTask="stampTask",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
newContextStack = result.newContextStack;
client = gs2('mission')

api_result_handler = client.verify_complete_by_stamp_task_async({
    stampTask="stampTask",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
newContextStack = result.newContextStack;

describeCounterModelMasters

カウンターモデルマスターの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<CounterModelMaster>カウンターモデルマスターのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例