GS2-Mission SDK API リファレンス
モデル
Complete
ミッションの達成状況
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
completeId | string | ✓ | ~ 1024文字 | 達成状況GRN | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
completedMissionTaskNames | List<string> | [] | ~ 1000 items | 達成済みのタスク名リスト | ||
receivedMissionTaskNames | List<string> | [] | ~ 1000 items | 報酬の受け取り済みのタスク名リスト | ||
nextResetAt | long | 次回リセットタイミング (UNIX時間 単位:ミリ秒) | ||||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
NotificationSetting
プッシュ通知に関する設定
GS2 のマイクロサービス内で何らかのイベントが発生した際に、プッシュ通知を送信するための設定です。
ここでいうプッシュ通知は GS2-Gateway の提供する WebSocket インターフェースを経由した処理であり、スマートフォンのプッシュ通知とは性質が異なります。
たとえば、マッチメイキングが完了した時やフレンドリクエストが届いた時など、ゲームクライアントの操作とは関係なく状態が変化した際に GS2-Gateway を経由してプッシュ通知をすることで、ゲームクライアントは状態の変化を検知することができます。
GS2-Gateway のプッシュ通知は通知先のデバイスがオフラインだった時に追加の処理としてモバイルプッシュ通知を送信できます。
モバイルプッシュ通知をうまく利用すれば、マッチメイキング中にゲームを終了しても、モバイルプッシュ通知を使用してプレイヤーに通知し、ゲームに戻ってくるフローを実現できる可能性があります。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
gatewayNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:gateway:default” | ~ 1024文字 | プッシュ通知に使用する GS2-Gateway のネームスペース | |
enableTransferMobileNotification | bool? | false | モバイルプッシュ通知へ転送するか | |||
sound | string | {enableTransferMobileNotification} == true | ~ 1024文字 | モバイルプッシュ通知で使用するサウンドファイル名 |
CounterModelMaster
カウンターモデルマスター
カウンターモデルマスターはミッションタスクの達成条件に設定可能なエンティティです。
カウンターの値は複数のミッショングループから参照可能なため、1つのカウンターでウィークリーミッションとデイリーミッションといった複数のミッショングループの達成条件に設定ができます。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
counterId | string | ✓ | ~ 1024文字 | カウンターモデルマスターGRN | ||
name | string | ✓ | ~ 128文字 | カウンター名 | ||
metadata | string | ~ 1024文字 | メタデータ | |||
description | string | ~ 1024文字 | 説明文 | |||
scopes | List<CounterScopeModel> | ✓ | [] | 1 ~ 20 items | カウンターのリセットタイミングリスト | |
challengePeriodEventId | string | ~ 1024文字 | カウンターの操作が可能な期間を設定した GS2-Schedule イベントGRN | |||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
CounterScopeModel
カウンターリセットタイミングモデル
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
scopeType | enum { “resetTiming”, “verifyAction” } | ✓ | “resetTiming” | ~ 128文字 | スコープの種類 | |
resetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | {scopeType} == “resetTiming” | ✓ | ~ 128文字 | リセットタイミング | |
resetDayOfMonth | int | {resetType} == “monthly” | ✓ | 1 ~ 31 | リセットをする日にち(月の日数を超える場合は、最終日として扱われます) | |
resetDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {resetType} == “weekly” | ✓ | ~ 128文字 | リセットする曜日 | |
resetHour | int | {resetType} in [“monthly”, “weekly”, “daily”] | ✓ | ~ 23 | リセット時刻 | |
conditionName | string | {scopeType} == “verifyAction” | ✓ | ~ 128文字 | 条件名 | |
condition | VerifyAction | {scopeType} == “verifyAction” | ✓ | 条件 |
scopeType に指定する列挙型の定義
定義 | 説明 |
---|---|
resetTiming | リセットタイミング |
verifyAction | 検証アクション |
resetType に指定する列挙型の定義
定義 | 説明 |
---|---|
notReset | リセットしない |
daily | 毎日 |
weekly | 毎週 |
monthly | 毎月 |
resetDayOfWeek に指定する列挙型の定義
定義 | 説明 |
---|---|
sunday | 日曜日 |
monday | 月曜日 |
tuesday | 火曜日 |
wednesday | 水曜日 |
thursday | 木曜日 |
friday | 金曜日 |
saturday | 土曜日 |
MissionGroupModelMaster
ミッショングループモデルマスター
ミッショングループはカウンターのリセットタイミングでタスクをグルーピングするエンティティです。
たとえば、デイリーミッションで1つのグループ。ウィークリーミッションで1つのグループとなります。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
missionGroupId | string | ✓ | ~ 1024文字 | ミッショングループマスターGRN | ||
name | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
metadata | string | ~ 1024文字 | メタデータ | |||
description | string | ~ 1024文字 | 説明文 | |||
resetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | ✓ | “notReset” | ~ 128文字 | リセットタイミング | |
resetDayOfMonth | int | {resetType} == “monthly” | ✓ | 1 ~ 31 | リセットをする日にち(月の日数を超える場合は、最終日として扱われます) | |
resetDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {resetType} == “weekly” | ✓ | ~ 128文字 | リセットする曜日 | |
resetHour | int | {resetType} in [“monthly”, “weekly”, “daily”] | ✓ | ~ 23 | リセット時刻 | |
completeNotificationNamespaceId | string | ~ 1024文字 | ミッションのタスクを達成したときのプッシュ通知 | |||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
resetType に指定する列挙型の定義
定義 | 説明 |
---|---|
notReset | リセットしない |
daily | 毎日 |
weekly | 毎週 |
monthly | 毎月 |
resetDayOfWeek に指定する列挙型の定義
定義 | 説明 |
---|---|
sunday | 日曜日 |
monday | 月曜日 |
tuesday | 火曜日 |
wednesday | 水曜日 |
thursday | 木曜日 |
friday | 金曜日 |
saturday | 土曜日 |
Namespace
ネームスペース
ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。
GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。
そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024文字 | ネームスペースGRN | ||
name | string | ✓ | ~ 128文字 | ネームスペース名 | ||
description | string | ~ 1024文字 | 説明文 | |||
transactionSetting | TransactionSetting | ✓ | トランザクション設定 | |||
missionCompleteScript | ScriptSetting | ミッションを達成したときに実行するスクリプト | ||||
counterIncrementScript | ScriptSetting | カウンターを上昇したときに実行するスクリプト | ||||
receiveRewardsScript | ScriptSetting | 報酬を受け取ったときに実行するスクリプト | ||||
completeNotification | NotificationSetting | ✓ | ミッションのタスクを達成したときのプッシュ通知 | |||
logSetting | LogSetting | ログの出力設定 | ||||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
Counter
カウンター
カウンターはミッションの進行状況をゲームプレイヤー毎に保持するエンティティです。
カウンターの値は関連付けられたタスクの期間ごとに集計されます。
そのため、1つのカウンターは複数の値を持ちます。
例えば、クエストのクリア回数カウンターであれば、今月のクリア回数、今週のクリア回数、今日のクリア回数。といった具合です。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
counterId | string | ✓ | ~ 1024文字 | カウンターGRN | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
name | string | ✓ | ~ 128文字 | カウンター名 | ||
values | List<ScopedValue> | ~ 32 items | 値 | |||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
CurrentMissionMaster
現在有効なマスターデータ
GS2ではマスターデータの管理にJSON形式のファイルを使用します。
ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。
JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが
よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。
Note
JSONファイルの形式については GS2-Mission マスターデータリファレンス をご参照ください。型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024文字 | 現在有効なミッションマスターGRN | ||
settings | string | ✓ | ~ 5242880文字 | マスターデータ |
CounterModel
カウンターモデル
カウンターモデルはミッションタスクの達成条件に設定可能なエンティティです。
カウンターの値は複数のミッショングループから参照可能なため、1つのカウンターでウィークリーミッションとデイリーミッションといった複数のミッショングループの達成条件に設定ができます。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
counterId | string | ✓ | ~ 1024文字 | カウンターモデルGRN | ||
name | string | ✓ | ~ 128文字 | カウンター名 | ||
metadata | string | ~ 1024文字 | メタデータ | |||
scopes | List<CounterScopeModel> | ✓ | [] | 1 ~ 20 items | カウンターのリセットタイミングリスト | |
challengePeriodEventId | string | ~ 1024文字 | カウンターの操作が可能な期間を設定した GS2-Schedule イベントGRN |
MissionGroupModel
ミッショングループモデル
ミッショングループはカウンターのリセットタイミングでタスクをグルーピングするエンティティです。
たとえば、デイリーミッションで1つのグループ。ウィークリーミッションで1つのグループとなります。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
missionGroupId | string | ✓ | ~ 1024文字 | ミッショングループGRN | ||
name | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
metadata | string | ~ 1024文字 | メタデータ | |||
tasks | List<MissionTaskModel> | ~ 1000 items | ミッションタスクリスト | |||
resetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | ✓ | “notReset” | ~ 128文字 | リセットタイミング | |
resetDayOfMonth | int | {resetType} == “monthly” | ✓ | 1 ~ 31 | リセットをする日にち(月の日数を超える場合は、最終日として扱われます) | |
resetDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {resetType} == “weekly” | ✓ | ~ 128文字 | リセットする曜日 | |
resetHour | int | {resetType} in [“monthly”, “weekly”, “daily”] | ✓ | ~ 23 | リセット時刻 | |
completeNotificationNamespaceId | string | ~ 1024文字 | ネームスペースGRN |
resetType に指定する列挙型の定義
定義 | 説明 |
---|---|
notReset | リセットしない |
daily | 毎日 |
weekly | 毎週 |
monthly | 毎月 |
resetDayOfWeek に指定する列挙型の定義
定義 | 説明 |
---|---|
sunday | 日曜日 |
monday | 月曜日 |
tuesday | 火曜日 |
wednesday | 水曜日 |
thursday | 木曜日 |
friday | 金曜日 |
saturday | 土曜日 |
MissionTaskModel
ミッションタスクモデル
ミッションタスクは関連付けたカウンターの値が一定を超えたら報酬が貰える条件を定義するエンティティです。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
missionTaskId | string | ✓ | ~ 1024文字 | ミッションタスクGRN | ||
name | string | ✓ | ~ 128文字 | タスク名 | ||
metadata | string | ~ 1024文字 | メタデータ | |||
verifyCompleteType | enum { “counter”, “verifyActions” } | ✓ | “counter” | ~ 128文字 | 達成条件種別 | |
targetCounter | TargetCounterModel | {verifyCompleteType} == “counter” | ✓ | 目標カウンター | ||
verifyCompleteConsumeActions | List<VerifyAction> | {verifyCompleteType} == “consumeActions” | ~ 10 items | タスク達成判定に使用する検証アクション | ||
completeAcquireActions | List<AcquireAction> | [] | ~ 100 items | ミッション達成時の報酬 | ||
challengePeriodEventId | string | ~ 1024文字 | 報酬が受け取り可能な期間を設定した GS2-Schedule イベントGRN | |||
premiseMissionTaskName | string | ~ 128文字 | このタスクに挑戦するために達成しておく必要のあるタスクの名前 |
verifyCompleteType に指定する列挙型の定義
定義 | 説明 |
---|---|
counter | カウンター |
verifyActions | 検証アクション |
MissionTaskModelMaster
ミッションタスクモデルマスター
ミッションタスクは関連付けたカウンターの値が一定を超えたら報酬が貰える条件を定義するエンティティです。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
missionTaskId | string | ✓ | ~ 1024文字 | ミッションタスクマスターGRN | ||
name | string | ✓ | ~ 128文字 | タスク名 | ||
metadata | string | ~ 1024文字 | メタデータ | |||
description | string | ~ 1024文字 | 説明文 | |||
verifyCompleteType | enum { “counter”, “verifyActions” } | ✓ | “counter” | ~ 128文字 | 達成条件種別 | |
targetCounter | TargetCounterModel | {verifyCompleteType} == “counter” | ✓ | 目標カウンター | ||
verifyCompleteConsumeActions | List<VerifyAction> | {verifyCompleteType} == “consumeActions” | ~ 10 items | タスク達成判定に使用する検証アクション | ||
completeAcquireActions | List<AcquireAction> | [] | ~ 100 items | ミッション達成時の報酬 | ||
challengePeriodEventId | string | ~ 1024文字 | 報酬が受け取り可能な期間を設定した GS2-Schedule イベントGRN | |||
premiseMissionTaskName | string | ~ 128文字 | このタスクに挑戦するために達成しておく必要のあるタスクの名前 | |||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
verifyCompleteType に指定する列挙型の定義
定義 | 説明 |
---|---|
counter | カウンター |
verifyActions | 検証アクション |
ScopedValue
リセットタイミング
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
scopeType | enum { “resetTiming”, “verifyAction” } | ✓ | “resetTiming” | ~ 128文字 | スコープの種類 | |
resetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | {scopeType} == “resetTiming” | ✓ | ~ 128文字 | リセットタイミング | |
conditionName | string | {scopeType} == “verifyAction” | ✓ | ~ 128文字 | 条件名 | |
value | long | ✓ | 0 | ~ 9223372036854775805 | カウント | |
nextResetAt | long | 次回リセットタイミング (UNIX時間 単位:ミリ秒) | ||||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) |
scopeType に指定する列挙型の定義
定義 | 説明 |
---|---|
resetTiming | リセットタイミング |
verifyAction | 検証アクション |
resetType に指定する列挙型の定義
定義 | 説明 |
---|---|
notReset | リセットしない |
daily | 毎日 |
weekly | 毎週 |
monthly | 毎月 |
TargetCounterModel
目標カウンター
ミッションの達成目標となるカウンターの情報
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
counterName | string | ✓ | ~ 128文字 | カウンター名 | ||
scopeType | enum { “resetTiming”, “verifyAction” } | ✓ | “resetTiming” | ~ 128文字 | スコープの種類 | |
resetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | {scopeType} == “resetTiming” | ~ 128文字 | 目標リセットタイミング | ||
conditionName | string | {scopeType} == “verifyAction” | ✓ | ~ 128文字 | 条件名 | |
value | long | ✓ | 1 ~ 9223372036854775805 | 目標値 |
scopeType に指定する列挙型の定義
定義 | 説明 |
---|---|
resetTiming | リセットタイミング |
verifyAction | 検証アクション |
resetType に指定する列挙型の定義
定義 | 説明 |
---|---|
notReset | リセットしない |
daily | 毎日 |
weekly | 毎週 |
monthly | 毎月 |
AcquireAction
入手アクション
ConsumeAction
消費アクション
VerifyAction
検証アクション
Config
コンフィグ設定
トランザクションの変数に適用する設定値
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
key | string | ✓ | ~ 64文字 | 名前 | ||
value | string | ~ 51200文字 | 値 |
LogSetting
ログの書き出し設定
ログデータの書き出し設定を管理します。この型は、ログデータを書き出すために使用されるログ名前空間の識別子(Namespace ID)を保持します。
ログ名前空間IDは、ログデータを集約し、保存する対象の GS2-Log の名前空間を指定します。
この設定を通じて、この名前空間以下のAPIリクエスト・レスポンスログデータが対象の GS2-Log へ出力されるようになります。
GS2-Log にはリアルタイムでログが提供され、システムの監視や分析、デバッグなどに利用できます。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
loggingNamespaceId | string | ✓ | ~ 1024文字 | ネームスペースGRN |
GitHubCheckoutSetting
GitHubからマスターデータをチェックアウトする設定
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
apiKeyId | string | ✓ | ~ 1024文字 | GitHub のAPIキーGRN | ||
repositoryName | string | ✓ | ~ 1024文字 | リポジトリ名 | ||
sourcePath | string | ✓ | ~ 1024文字 | ソースコードのファイルパス | ||
referenceType | enum { “commit_hash”, “branch”, “tag” } | ✓ | ~ 128文字 | コードの取得元 | ||
commitHash | string | {referenceType} == “commit_hash” | ✓ | ~ 1024文字 | コミットハッシュ | |
branchName | string | {referenceType} == “branch” | ✓ | ~ 1024文字 | ブランチ名 | |
tagName | string | {referenceType} == “tag” | ✓ | ~ 1024文字 | タグ名 |
referenceType に指定する列挙型の定義
定義 | 説明 |
---|---|
commit_hash | コミットハッシュ |
branch | ブランチ |
tag | タグ |
ScriptSetting
スクリプト設定
GS2 ではマイクロサービスのイベントに関連づけて、カスタムスクリプトを実行することができます。
このモデルは、スクリプトの実行をトリガーするための設定を保持します。
スクリプトの実行方式は大きく2種類あり、それは「同期実行」と「非同期実行」です。
同期実行は、スクリプトの実行が完了するまで処理がブロックされます。
かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることができます。
一方、非同期実行は、スクリプトの実行が完了するまで処理がブロックされません。
かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることはできません。
しかし、非同期実行は、スクリプトの実行が完了するまで処理がブロックされないため、APIの応答に影響を与えないため、原則非同期実行を使用することをおすすめします。
非同期実行には実行方式が2種類あり、GS2-Script と Amazon EventBridge があります。
Amazon EventBridge を使用することで、Lua 以外の言語で処理を記述することができます。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
triggerScriptId | string | ~ 1024文字 | スクリプトGRN | |||
doneTriggerTargetType | enum { “none”, “gs2_script”, “aws” } | ✓ | “none” | ~ 128文字 | 完了通知の通知先 | |
doneTriggerScriptId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024文字 | スクリプトGRN | ||
doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024文字 | ネームスペースGRN |
doneTriggerTargetType に指定する列挙型の定義
定義 | 説明 |
---|---|
none | なし |
gs2_script | GS2-Script |
aws | Amazon EventBridge |
TransactionSetting
トランザクション設定
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
enableAutoRun | bool | ✓ | false | 発行したトランザクションをサーバーサイドで自動的に実行するか | ||
distributorNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:distributor:default” | ~ 1024文字 | トランザクションの実行に使用する GS2-Distributor ネームスペース | |
queueNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:queue:default” | ~ 1024文字 | トランザクションの実行に使用する GS2-JobQueue のネームスペース |
メソッド
describeCompletes
達成状況の一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<Complete> | 達成状況のリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | |
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
items | List<Complete> | 達成状況のリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
missionTaskName | string | ✓ | ~ 128文字 | タスク名 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID | ||
config | List<Config> | [] | ~ 32 items | トランザクションの変数に適用する設定値 |
Result
型 | 説明 | |
---|---|---|
transactionId | string | 発行されたトランザクションID |
stampSheet | string | ミッションの達成報酬を受領するスタンプシート |
stampSheetEncryptionKeyId | string | スタンプシートの署名計算に使用した暗号鍵GRN |
autoRunStampSheet | bool? | トランザクションの自動実行が有効か |
実装例
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
missionTaskName | string | ✓ | ~ 128文字 | タスク名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
config | List<Config> | [] | ~ 32 items | トランザクションの変数に適用する設定値 | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
transactionId | string | 発行されたトランザクションID |
stampSheet | string | ミッションの達成報酬を受領するスタンプシート |
stampSheetEncryptionKeyId | string | スタンプシートの署名計算に使用した暗号鍵GRN |
autoRunStampSheet | bool? | トランザクションの自動実行が有効か |
実装例
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID | ||
missionTaskNames | List<string> | ✓ | 1 ~ 100 items | タスク名のリスト | ||
config | List<Config> | [] | ~ 32 items | トランザクションの変数に適用する設定値 |
Result
型 | 説明 | |
---|---|---|
transactionId | string | 発行されたトランザクションID |
stampSheet | string | ミッションの達成報酬を受領するスタンプシート |
stampSheetEncryptionKeyId | string | スタンプシートの署名計算に使用した暗号鍵GRN |
autoRunStampSheet | bool? | トランザクションの自動実行が有効か |
実装例
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
missionTaskNames | List<string> | ✓ | 1 ~ 100 items | タスク名のリスト | ||
config | List<Config> | [] | ~ 32 items | トランザクションの変数に適用する設定値 | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
transactionId | string | 発行されたトランザクションID |
stampSheet | string | ミッションの達成報酬を受領するスタンプシート |
stampSheetEncryptionKeyId | string | スタンプシートの署名計算に使用した暗号鍵GRN |
autoRunStampSheet | bool? | トランザクションの自動実行が有効か |
実装例
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
missionTaskName | string | ✓ | ~ 128文字 | タスク名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Complete | 受領した達成状況 |
実装例
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
missionTaskNames | List<string> | ✓ | 1 ~ 100 items | タスク名のリスト | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Complete | 受領した達成状況 |
実装例
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
missionTaskName | string | ✓ | ~ 128文字 | タスク名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Complete | 受領した達成状況 |
実装例
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID |
Result
型 | 説明 | |
---|---|---|
item | Complete | 達成状況 |
実装例
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Complete | 達成状況 |
実装例
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Complete | 削除した達成状況 |
実装例
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID | ||
verifyType | enum { “completed”, “notCompleted”, “received”, “notReceived”, “completedAndNotReceived” } | ✓ | ~ 128文字 | 検証の種類 | ||
missionTaskName | string | ✓ | ~ 128文字 | タスク名 | ||
multiplyValueSpecifyingQuantity | bool | ✓ | false | 数量指定した際に、検証に使用する値も乗算するか |
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
verifyType | enum { “completed”, “notCompleted”, “received”, “notReceived”, “completedAndNotReceived” } | ✓ | ~ 128文字 | 検証の種類 | ||
missionTaskName | string | ✓ | ~ 128文字 | タスク名 | ||
multiplyValueSpecifyingQuantity | bool | ✓ | false | 数量指定した際に、検証に使用する値も乗算するか | ||
timeOffsetToken | string | ~ 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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
stampTask | string | ✓ | ~ 5242880文字 | 消費アクション | ||
keyId | string | ✓ | ~ 1024文字 | 暗号鍵GRN |
Result
型 | 説明 | |
---|---|---|
item | Complete | 達成状況 |
newContextStack | string | 消費アクションの実行結果を記録したコンテキスト |
実装例
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
stampTask | string | ✓ | ~ 5242880文字 | 消費アクション | ||
keyId | string | ✓ | ~ 1024文字 | 暗号鍵GRN |
Result
型 | 説明 | |
---|---|---|
item | Complete | 達成状況 |
newContextStack | string | 消費アクションの実行結果を記録したコンテキスト |
実装例
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
stampSheet | string | ✓ | ~ 5242880文字 | トランザクション | ||
keyId | string | ✓ | ~ 1024文字 | 暗号鍵GRN |
Result
型 | 説明 | |
---|---|---|
item | Complete | 達成状況 |
実装例
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
stampTask | string | ✓ | ~ 5242880文字 | 検証アクション | ||
keyId | string | ✓ | ~ 1024文字 | 暗号鍵GRN |
Result
型 | 説明 | |
---|---|---|
newContextStack | string | 検証アクションの実行結果を記録したコンテキスト |
実装例
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
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<CounterModelMaster> | カウンターモデルマスターのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |