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 | リストの続きを取得するためのページトークン |
実装例
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.DescribeCounterModelMasters(
&mission.DescribeCounterModelMastersRequest {
NamespaceName: pointy.String("namespace1"),
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\DescribeCounterModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeCounterModelMasters(
(new DescribeCounterModelMastersRequest())
->withNamespaceName(self::namespace1)
->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.DescribeCounterModelMastersRequest;
import io.gs2.mission.result.DescribeCounterModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DescribeCounterModelMastersResult result = client.describeCounterModelMasters(
new DescribeCounterModelMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
List<CounterModelMaster> 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.DescribeCounterModelMastersRequest;
using Gs2.Gs2Mission.Result.DescribeCounterModelMastersResult;
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.DescribeCounterModelMastersResult> asyncResult = null;
yield return client.DescribeCounterModelMasters(
new Gs2.Gs2Mission.Request.DescribeCounterModelMastersRequest()
.WithNamespaceName("namespace1")
.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.describeCounterModelMasters(
new Gs2Mission.DescribeCounterModelMastersRequest()
.withNamespaceName("namespace1")
.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_counter_model_masters(
mission.DescribeCounterModelMastersRequest()
.with_namespace_name(self.hash1)
.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_counter_model_masters({
namespaceName="namespace1",
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_counter_model_masters_async({
namespaceName="namespace1",
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;
createCounterModelMaster
カウンターモデルマスターを新規作成
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
name | string | ✓ | ~ 128文字 | カウンター名 | ||
metadata | string | ~ 1024文字 | メタデータ | |||
description | string | ~ 1024文字 | 説明文 | |||
scopes | List<CounterScopeModel> | ✓ | [] | 1 ~ 20 items | カウンターのリセットタイミングリスト | |
challengePeriodEventId | string | ~ 1024文字 | カウンターの操作が可能な期間を設定した GS2-Schedule イベントGRN |
Result
型 | 説明 | |
---|---|---|
item | CounterModelMaster | 作成したカウンターモデルマスター |
実装例
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.CreateCounterModelMaster(
&mission.CreateCounterModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
Name: pointy.String("counter-0001"),
Metadata: nil,
Description: nil,
Scopes: []mission.CounterScopeModel{
mission.CounterScopeModel{
ResetType: pointy.String("notReset"),
},
},
ChallengePeriodEventId: 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\CreateCounterModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createCounterModelMaster(
(new CreateCounterModelMasterRequest())
->withNamespaceName(self::namespace1)
->withName("counter-0001")
->withMetadata(null)
->withDescription(null)
->withScopes([
(new \Gs2\Mission\Model\CounterScopeModel())
->withResetType("notReset"),
])
->withChallengePeriodEventId(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.CreateCounterModelMasterRequest;
import io.gs2.mission.result.CreateCounterModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
CreateCounterModelMasterResult result = client.createCounterModelMaster(
new CreateCounterModelMasterRequest()
.withNamespaceName("namespace1")
.withName("counter-0001")
.withMetadata(null)
.withDescription(null)
.withScopes(Arrays.asList(
new io.gs2.mission.model.CounterScopeModel()
.withResetType("notReset")
))
.withChallengePeriodEventId(null)
);
CounterModelMaster 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.CreateCounterModelMasterRequest;
using Gs2.Gs2Mission.Result.CreateCounterModelMasterResult;
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.CreateCounterModelMasterResult> asyncResult = null;
yield return client.CreateCounterModelMaster(
new Gs2.Gs2Mission.Request.CreateCounterModelMasterRequest()
.WithNamespaceName("namespace1")
.WithName("counter-0001")
.WithMetadata(null)
.WithDescription(null)
.WithScopes(new Gs2.Gs2Mission.Model.CounterScopeModel[] {
new Gs2.Gs2Mission.Model.CounterScopeModel()
.WithResetType("notReset"),
})
.WithChallengePeriodEventId(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.createCounterModelMaster(
new Gs2Mission.CreateCounterModelMasterRequest()
.withNamespaceName("namespace1")
.withName("counter-0001")
.withMetadata(null)
.withDescription(null)
.withScopes([
new Gs2Mission.model.CounterScopeModel()
.withResetType("notReset"),
])
.withChallengePeriodEventId(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.create_counter_model_master(
mission.CreateCounterModelMasterRequest()
.with_namespace_name(self.hash1)
.with_name('counter-0001')
.with_metadata(None)
.with_description(None)
.with_scopes([
mission.CounterScopeModel()
.with_reset_type('notReset'),
])
.with_challenge_period_event_id(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.create_counter_model_master({
namespaceName="namespace1",
name="counter-0001",
metadata=nil,
description=nil,
scopes={
{
resetType="notReset",
}
},
challengePeriodEventId=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.create_counter_model_master_async({
namespaceName="namespace1",
name="counter-0001",
metadata=nil,
description=nil,
scopes={
{
resetType="notReset",
}
},
challengePeriodEventId=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;
getCounterModelMaster
カウンターモデルマスターを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
counterName | string | ✓ | ~ 128文字 | カウンター名 |
Result
型 | 説明 | |
---|---|---|
item | CounterModelMaster | カウンターモデルマスター |
実装例
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.GetCounterModelMaster(
&mission.GetCounterModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
CounterName: pointy.String("counter-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\GetCounterModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getCounterModelMaster(
(new GetCounterModelMasterRequest())
->withNamespaceName(self::namespace1)
->withCounterName("counter-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.GetCounterModelMasterRequest;
import io.gs2.mission.result.GetCounterModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
GetCounterModelMasterResult result = client.getCounterModelMaster(
new GetCounterModelMasterRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
);
CounterModelMaster 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.GetCounterModelMasterRequest;
using Gs2.Gs2Mission.Result.GetCounterModelMasterResult;
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.GetCounterModelMasterResult> asyncResult = null;
yield return client.GetCounterModelMaster(
new Gs2.Gs2Mission.Request.GetCounterModelMasterRequest()
.WithNamespaceName("namespace1")
.WithCounterName("counter-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.getCounterModelMaster(
new Gs2Mission.GetCounterModelMasterRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-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_counter_model_master(
mission.GetCounterModelMasterRequest()
.with_namespace_name(self.hash1)
.with_counter_name('counter-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.get_counter_model_master({
namespaceName="namespace1",
counterName="counter-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_counter_model_master_async({
namespaceName="namespace1",
counterName="counter-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;
updateCounterModelMaster
カウンターモデルマスターを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
counterName | string | ✓ | ~ 128文字 | カウンター名 | ||
metadata | string | ~ 1024文字 | メタデータ | |||
description | string | ~ 1024文字 | 説明文 | |||
scopes | List<CounterScopeModel> | ✓ | [] | 1 ~ 20 items | カウンターのリセットタイミングリスト | |
challengePeriodEventId | string | ~ 1024文字 | カウンターの操作が可能な期間を設定した GS2-Schedule イベントGRN |
Result
型 | 説明 | |
---|---|---|
item | CounterModelMaster | 更新したカウンターモデルマスター |
実装例
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.UpdateCounterModelMaster(
&mission.UpdateCounterModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
CounterName: pointy.String("counter-0001"),
Metadata: pointy.String("COUNTER1"),
Description: pointy.String("description1"),
Scopes: []mission.CounterScopeModel{
mission.CounterScopeModel{
ResetType: pointy.String("monthly"),
ResetHour: pointy.Int32(5),
ResetDayOfMonth: pointy.Int32(1),
},
},
ChallengePeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-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\UpdateCounterModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCounterModelMaster(
(new UpdateCounterModelMasterRequest())
->withNamespaceName(self::namespace1)
->withCounterName("counter-0001")
->withMetadata("COUNTER1")
->withDescription("description1")
->withScopes([
(new \Gs2\Mission\Model\CounterScopeModel())
->withResetType("monthly")
->withResetHour(5)
->withResetDayOfMonth(1),
])
->withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:\namespace1:event:event-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.UpdateCounterModelMasterRequest;
import io.gs2.mission.result.UpdateCounterModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
UpdateCounterModelMasterResult result = client.updateCounterModelMaster(
new UpdateCounterModelMasterRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
.withMetadata("COUNTER1")
.withDescription("description1")
.withScopes(Arrays.asList(
new io.gs2.mission.model.CounterScopeModel()
.withResetType("monthly")
.withResetHour(5)
.withResetDayOfMonth(1)
))
.withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-0001")
);
CounterModelMaster 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.UpdateCounterModelMasterRequest;
using Gs2.Gs2Mission.Result.UpdateCounterModelMasterResult;
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.UpdateCounterModelMasterResult> asyncResult = null;
yield return client.UpdateCounterModelMaster(
new Gs2.Gs2Mission.Request.UpdateCounterModelMasterRequest()
.WithNamespaceName("namespace1")
.WithCounterName("counter-0001")
.WithMetadata("COUNTER1")
.WithDescription("description1")
.WithScopes(new Gs2.Gs2Mission.Model.CounterScopeModel[] {
new Gs2.Gs2Mission.Model.CounterScopeModel()
.WithResetType("monthly")
.WithResetHour(5)
.WithResetDayOfMonth(1),
})
.WithChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-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.updateCounterModelMaster(
new Gs2Mission.UpdateCounterModelMasterRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
.withMetadata("COUNTER1")
.withDescription("description1")
.withScopes([
new Gs2Mission.model.CounterScopeModel()
.withResetType("monthly")
.withResetHour(5)
.withResetDayOfMonth(1),
])
.withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-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.update_counter_model_master(
mission.UpdateCounterModelMasterRequest()
.with_namespace_name(self.hash1)
.with_counter_name('counter-0001')
.with_metadata('COUNTER1')
.with_description('description1')
.with_scopes([
mission.CounterScopeModel()
.with_reset_type('monthly')
.with_reset_hour(5)
.with_reset_day_of_month(1),
])
.with_challenge_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.update_counter_model_master({
namespaceName="namespace1",
counterName="counter-0001",
metadata="COUNTER1",
description="description1",
scopes={
{
resetType="monthly",
resetHour=5,
resetDayOfMonth=1,
}
},
challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-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.update_counter_model_master_async({
namespaceName="namespace1",
counterName="counter-0001",
metadata="COUNTER1",
description="description1",
scopes={
{
resetType="monthly",
resetHour=5,
resetDayOfMonth=1,
}
},
challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-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;
deleteCounterModelMaster
カウンターモデルマスターを削除
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
counterName | string | ✓ | ~ 128文字 | カウンター名 |
Result
型 | 説明 | |
---|---|---|
item | CounterModelMaster | 削除したカウンターモデルマスター |
実装例
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.DeleteCounterModelMaster(
&mission.DeleteCounterModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
CounterName: pointy.String("counter-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\DeleteCounterModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteCounterModelMaster(
(new DeleteCounterModelMasterRequest())
->withNamespaceName(self::namespace1)
->withCounterName("counter-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.DeleteCounterModelMasterRequest;
import io.gs2.mission.result.DeleteCounterModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DeleteCounterModelMasterResult result = client.deleteCounterModelMaster(
new DeleteCounterModelMasterRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
);
CounterModelMaster 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.DeleteCounterModelMasterRequest;
using Gs2.Gs2Mission.Result.DeleteCounterModelMasterResult;
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.DeleteCounterModelMasterResult> asyncResult = null;
yield return client.DeleteCounterModelMaster(
new Gs2.Gs2Mission.Request.DeleteCounterModelMasterRequest()
.WithNamespaceName("namespace1")
.WithCounterName("counter-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.deleteCounterModelMaster(
new Gs2Mission.DeleteCounterModelMasterRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-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.delete_counter_model_master(
mission.DeleteCounterModelMasterRequest()
.with_namespace_name(self.hash1)
.with_counter_name('counter-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.delete_counter_model_master({
namespaceName="namespace1",
counterName="counter-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.delete_counter_model_master_async({
namespaceName="namespace1",
counterName="counter-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;
describeMissionGroupModelMasters
ミッショングループマスターの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<MissionGroupModelMaster> | ミッショングループマスターのリスト |
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.DescribeMissionGroupModelMasters(
&mission.DescribeMissionGroupModelMastersRequest {
NamespaceName: pointy.String("namespace1"),
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\DescribeMissionGroupModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeMissionGroupModelMasters(
(new DescribeMissionGroupModelMastersRequest())
->withNamespaceName(self::namespace1)
->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.DescribeMissionGroupModelMastersRequest;
import io.gs2.mission.result.DescribeMissionGroupModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DescribeMissionGroupModelMastersResult result = client.describeMissionGroupModelMasters(
new DescribeMissionGroupModelMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
List<MissionGroupModelMaster> 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.DescribeMissionGroupModelMastersRequest;
using Gs2.Gs2Mission.Result.DescribeMissionGroupModelMastersResult;
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.DescribeMissionGroupModelMastersResult> asyncResult = null;
yield return client.DescribeMissionGroupModelMasters(
new Gs2.Gs2Mission.Request.DescribeMissionGroupModelMastersRequest()
.WithNamespaceName("namespace1")
.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.describeMissionGroupModelMasters(
new Gs2Mission.DescribeMissionGroupModelMastersRequest()
.withNamespaceName("namespace1")
.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_mission_group_model_masters(
mission.DescribeMissionGroupModelMastersRequest()
.with_namespace_name(self.hash1)
.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_mission_group_model_masters({
namespaceName="namespace1",
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_mission_group_model_masters_async({
namespaceName="namespace1",
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;
createMissionGroupModelMaster
ミッショングループマスターを新規作成
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
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文字 | ミッションのタスクを達成したときのプッシュ通知 |
resetType に指定する列挙型の定義
定義 | 説明 |
---|---|
notReset | リセットしない |
daily | 毎日 |
weekly | 毎週 |
monthly | 毎月 |
resetDayOfWeek に指定する列挙型の定義
定義 | 説明 |
---|---|
sunday | 日曜日 |
monday | 月曜日 |
tuesday | 火曜日 |
wednesday | 水曜日 |
thursday | 木曜日 |
friday | 金曜日 |
saturday | 土曜日 |
Result
型 | 説明 | |
---|---|---|
item | MissionGroupModelMaster | 作成したミッショングループマスター |
実装例
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.CreateMissionGroupModelMaster(
&mission.CreateMissionGroupModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
Name: pointy.String("mission-group-0001"),
Metadata: nil,
Description: nil,
ResetType: pointy.String("notReset"),
ResetDayOfMonth: pointy.Int32(1),
ResetDayOfWeek: pointy.String("monday"),
ResetHour: pointy.Int32(10),
CompleteNotificationNamespaceId: 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\CreateMissionGroupModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createMissionGroupModelMaster(
(new CreateMissionGroupModelMasterRequest())
->withNamespaceName(self::namespace1)
->withName("mission-group-0001")
->withMetadata(null)
->withDescription(null)
->withResetType("notReset")
->withResetDayOfMonth(1)
->withResetDayOfWeek("monday")
->withResetHour(10)
->withCompleteNotificationNamespaceId(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.CreateMissionGroupModelMasterRequest;
import io.gs2.mission.result.CreateMissionGroupModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
CreateMissionGroupModelMasterResult result = client.createMissionGroupModelMaster(
new CreateMissionGroupModelMasterRequest()
.withNamespaceName("namespace1")
.withName("mission-group-0001")
.withMetadata(null)
.withDescription(null)
.withResetType("notReset")
.withResetDayOfMonth(1)
.withResetDayOfWeek("monday")
.withResetHour(10)
.withCompleteNotificationNamespaceId(null)
);
MissionGroupModelMaster 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.CreateMissionGroupModelMasterRequest;
using Gs2.Gs2Mission.Result.CreateMissionGroupModelMasterResult;
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.CreateMissionGroupModelMasterResult> asyncResult = null;
yield return client.CreateMissionGroupModelMaster(
new Gs2.Gs2Mission.Request.CreateMissionGroupModelMasterRequest()
.WithNamespaceName("namespace1")
.WithName("mission-group-0001")
.WithMetadata(null)
.WithDescription(null)
.WithResetType("notReset")
.WithResetDayOfMonth(1)
.WithResetDayOfWeek("monday")
.WithResetHour(10)
.WithCompleteNotificationNamespaceId(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.createMissionGroupModelMaster(
new Gs2Mission.CreateMissionGroupModelMasterRequest()
.withNamespaceName("namespace1")
.withName("mission-group-0001")
.withMetadata(null)
.withDescription(null)
.withResetType("notReset")
.withResetDayOfMonth(1)
.withResetDayOfWeek("monday")
.withResetHour(10)
.withCompleteNotificationNamespaceId(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.create_mission_group_model_master(
mission.CreateMissionGroupModelMasterRequest()
.with_namespace_name(self.hash1)
.with_name('mission-group-0001')
.with_metadata(None)
.with_description(None)
.with_reset_type('notReset')
.with_reset_day_of_month(1)
.with_reset_day_of_week('monday')
.with_reset_hour(10)
.with_complete_notification_namespace_id(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.create_mission_group_model_master({
namespaceName="namespace1",
name="mission-group-0001",
metadata=nil,
description=nil,
resetType="notReset",
resetDayOfMonth=1,
resetDayOfWeek="monday",
resetHour=10,
completeNotificationNamespaceId=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.create_mission_group_model_master_async({
namespaceName="namespace1",
name="mission-group-0001",
metadata=nil,
description=nil,
resetType="notReset",
resetDayOfMonth=1,
resetDayOfWeek="monday",
resetHour=10,
completeNotificationNamespaceId=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;
getMissionGroupModelMaster
ミッショングループマスターを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 |
Result
型 | 説明 | |
---|---|---|
item | MissionGroupModelMaster | ミッショングループマスター |
実装例
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.GetMissionGroupModelMaster(
&mission.GetMissionGroupModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-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\GetMissionGroupModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getMissionGroupModelMaster(
(new GetMissionGroupModelMasterRequest())
->withNamespaceName(self::namespace1)
->withMissionGroupName("mission-group-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.GetMissionGroupModelMasterRequest;
import io.gs2.mission.result.GetMissionGroupModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
GetMissionGroupModelMasterResult result = client.getMissionGroupModelMaster(
new GetMissionGroupModelMasterRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
);
MissionGroupModelMaster 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.GetMissionGroupModelMasterRequest;
using Gs2.Gs2Mission.Result.GetMissionGroupModelMasterResult;
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.GetMissionGroupModelMasterResult> asyncResult = null;
yield return client.GetMissionGroupModelMaster(
new Gs2.Gs2Mission.Request.GetMissionGroupModelMasterRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-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.getMissionGroupModelMaster(
new Gs2Mission.GetMissionGroupModelMasterRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-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_mission_group_model_master(
mission.GetMissionGroupModelMasterRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.get_mission_group_model_master({
namespaceName="namespace1",
missionGroupName="mission-group-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_mission_group_model_master_async({
namespaceName="namespace1",
missionGroupName="mission-group-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;
updateMissionGroupModelMaster
ミッショングループマスターを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | 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文字 | ミッションのタスクを達成したときのプッシュ通知 |
resetType に指定する列挙型の定義
定義 | 説明 |
---|---|
notReset | リセットしない |
daily | 毎日 |
weekly | 毎週 |
monthly | 毎月 |
resetDayOfWeek に指定する列挙型の定義
定義 | 説明 |
---|---|
sunday | 日曜日 |
monday | 月曜日 |
tuesday | 火曜日 |
wednesday | 水曜日 |
thursday | 木曜日 |
friday | 金曜日 |
saturday | 土曜日 |
Result
型 | 説明 | |
---|---|---|
item | MissionGroupModelMaster | 更新したミッショングループマスター |
実装例
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.UpdateMissionGroupModelMaster(
&mission.UpdateMissionGroupModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-0001"),
Metadata: pointy.String("MISSION_GROUP1"),
Description: pointy.String("description1"),
ResetType: pointy.String("weekly"),
ResetDayOfMonth: pointy.Int32(5),
ResetDayOfWeek: pointy.String("monday"),
ResetHour: pointy.Int32(10),
CompleteNotificationNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-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\UpdateMissionGroupModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateMissionGroupModelMaster(
(new UpdateMissionGroupModelMasterRequest())
->withNamespaceName(self::namespace1)
->withMissionGroupName("mission-group-0001")
->withMetadata("MISSION_GROUP1")
->withDescription("description1")
->withResetType("weekly")
->withResetDayOfMonth(5)
->withResetDayOfWeek("monday")
->withResetHour(10)
->withCompleteNotificationNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-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.UpdateMissionGroupModelMasterRequest;
import io.gs2.mission.result.UpdateMissionGroupModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
UpdateMissionGroupModelMasterResult result = client.updateMissionGroupModelMaster(
new UpdateMissionGroupModelMasterRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMetadata("MISSION_GROUP1")
.withDescription("description1")
.withResetType("weekly")
.withResetDayOfMonth(5)
.withResetDayOfWeek("monday")
.withResetHour(10)
.withCompleteNotificationNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-0001")
);
MissionGroupModelMaster 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.UpdateMissionGroupModelMasterRequest;
using Gs2.Gs2Mission.Result.UpdateMissionGroupModelMasterResult;
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.UpdateMissionGroupModelMasterResult> asyncResult = null;
yield return client.UpdateMissionGroupModelMaster(
new Gs2.Gs2Mission.Request.UpdateMissionGroupModelMasterRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-0001")
.WithMetadata("MISSION_GROUP1")
.WithDescription("description1")
.WithResetType("weekly")
.WithResetDayOfMonth(5)
.WithResetDayOfWeek("monday")
.WithResetHour(10)
.WithCompleteNotificationNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-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.updateMissionGroupModelMaster(
new Gs2Mission.UpdateMissionGroupModelMasterRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMetadata("MISSION_GROUP1")
.withDescription("description1")
.withResetType("weekly")
.withResetDayOfMonth(5)
.withResetDayOfWeek("monday")
.withResetHour(10)
.withCompleteNotificationNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-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.update_mission_group_model_master(
mission.UpdateMissionGroupModelMasterRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-0001')
.with_metadata('MISSION_GROUP1')
.with_description('description1')
.with_reset_type('weekly')
.with_reset_day_of_month(5)
.with_reset_day_of_week('monday')
.with_reset_hour(10)
.with_complete_notification_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.update_mission_group_model_master({
namespaceName="namespace1",
missionGroupName="mission-group-0001",
metadata="MISSION_GROUP1",
description="description1",
resetType="weekly",
resetDayOfMonth=5,
resetDayOfWeek="monday",
resetHour=10,
completeNotificationNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-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.update_mission_group_model_master_async({
namespaceName="namespace1",
missionGroupName="mission-group-0001",
metadata="MISSION_GROUP1",
description="description1",
resetType="weekly",
resetDayOfMonth=5,
resetDayOfWeek="monday",
resetHour=10,
completeNotificationNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-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;
deleteMissionGroupModelMaster
ミッショングループマスターを削除
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 |
Result
型 | 説明 | |
---|---|---|
item | MissionGroupModelMaster | 削除したミッショングループ |
実装例
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.DeleteMissionGroupModelMaster(
&mission.DeleteMissionGroupModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-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\DeleteMissionGroupModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteMissionGroupModelMaster(
(new DeleteMissionGroupModelMasterRequest())
->withNamespaceName(self::namespace1)
->withMissionGroupName("mission-group-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.DeleteMissionGroupModelMasterRequest;
import io.gs2.mission.result.DeleteMissionGroupModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DeleteMissionGroupModelMasterResult result = client.deleteMissionGroupModelMaster(
new DeleteMissionGroupModelMasterRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
);
MissionGroupModelMaster 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.DeleteMissionGroupModelMasterRequest;
using Gs2.Gs2Mission.Result.DeleteMissionGroupModelMasterResult;
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.DeleteMissionGroupModelMasterResult> asyncResult = null;
yield return client.DeleteMissionGroupModelMaster(
new Gs2.Gs2Mission.Request.DeleteMissionGroupModelMasterRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-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.deleteMissionGroupModelMaster(
new Gs2Mission.DeleteMissionGroupModelMasterRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-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.delete_mission_group_model_master(
mission.DeleteMissionGroupModelMasterRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.delete_mission_group_model_master({
namespaceName="namespace1",
missionGroupName="mission-group-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.delete_mission_group_model_master_async({
namespaceName="namespace1",
missionGroupName="mission-group-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;
describeNamespaces
ネームスペースの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<Namespace> | ネームスペースのリスト |
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.DescribeNamespaces(
&mission.DescribeNamespacesRequest {
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\DescribeNamespacesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeNamespaces(
(new DescribeNamespacesRequest())
->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.DescribeNamespacesRequest;
import io.gs2.mission.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DescribeNamespacesResult result = client.describeNamespaces(
new DescribeNamespacesRequest()
.withPageToken(null)
.withLimit(null)
);
List<Namespace> 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.DescribeNamespacesRequest;
using Gs2.Gs2Mission.Result.DescribeNamespacesResult;
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.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2Mission.Request.DescribeNamespacesRequest()
.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.describeNamespaces(
new Gs2Mission.DescribeNamespacesRequest()
.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_namespaces(
mission.DescribeNamespacesRequest()
.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_namespaces({
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_namespaces_async({
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;
createNamespace
ネームスペースを新規作成
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | ネームスペース名 | ||
description | string | ~ 1024文字 | 説明文 | |||
transactionSetting | TransactionSetting | ✓ | トランザクション設定 | |||
missionCompleteScript | ScriptSetting | ミッションを達成したときに実行するスクリプト | ||||
counterIncrementScript | ScriptSetting | カウンターを上昇したときに実行するスクリプト | ||||
receiveRewardsScript | ScriptSetting | 報酬を受け取ったときに実行するスクリプト | ||||
completeNotification | NotificationSetting | ✓ | ミッションのタスクを達成したときのプッシュ通知 | |||
logSetting | LogSetting | ログの出力設定 | ||||
queueNamespaceId | string | ~ 1024文字 | トランザクションの実行に使用する GS2-JobQueue のネームスペース | |||
keyId | string | ~ 1024文字 | スタンプシートの発行に使用する GS2-Key のネームスペース |
Result
型 | 説明 | |
---|---|---|
item | Namespace | 作成したネームスペース |
実装例
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.CreateNamespace(
&mission.CreateNamespaceRequest {
Name: pointy.String("namespace1"),
Description: nil,
TransactionSetting: &mission.TransactionSetting{
EnableAutoRun: pointy.Bool(false),
QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"),
KeyId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"),
},
MissionCompleteScript: nil,
CounterIncrementScript: nil,
ReceiveRewardsScript: nil,
CompleteNotification: nil,
LogSetting: &mission.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
},
}
)
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\CreateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createNamespace(
(new CreateNamespaceRequest())
->withName(self::namespace1)
->withDescription(null)
->withTransactionSetting((new \Gs2\Mission\Model\TransactionSetting())
->withEnableAutoRun(False)
->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
->withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:\namespace1:key:key-0001"))
->withMissionCompleteScript(null)
->withCounterIncrementScript(null)
->withReceiveRewardsScript(null)
->withCompleteNotification(null)
->withLogSetting((new \Gs2\Mission\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\namespace1"))
);
$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.CreateNamespaceRequest;
import io.gs2.mission.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
CreateNamespaceResult result = client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withTransactionSetting(new io.gs2.mission.model.TransactionSetting()
.withEnableAutoRun(false)
.withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
.withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
.withMissionCompleteScript(null)
.withCounterIncrementScript(null)
.withReceiveRewardsScript(null)
.withCompleteNotification(null)
.withLogSetting(new io.gs2.mission.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
);
Namespace 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.CreateNamespaceRequest;
using Gs2.Gs2Mission.Result.CreateNamespaceResult;
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.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2Mission.Request.CreateNamespaceRequest()
.WithName("namespace1")
.WithDescription(null)
.WithTransactionSetting(new Gs2.Gs2Mission.Model.TransactionSetting()
.WithEnableAutoRun(false)
.WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
.WithKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
.WithMissionCompleteScript(null)
.WithCounterIncrementScript(null)
.WithReceiveRewardsScript(null)
.WithCompleteNotification(null)
.WithLogSetting(new Gs2.Gs2Mission.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
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.createNamespace(
new Gs2Mission.CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withTransactionSetting(new Gs2Mission.model.TransactionSetting()
.withEnableAutoRun(false)
.withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
.withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
.withMissionCompleteScript(null)
.withCounterIncrementScript(null)
.withReceiveRewardsScript(null)
.withCompleteNotification(null)
.withLogSetting(new Gs2Mission.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
);
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.create_namespace(
mission.CreateNamespaceRequest()
.with_name(self.hash1)
.with_description(None)
.with_transaction_setting(
mission.TransactionSetting()
.with_enable_auto_run(False)
.with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001')
.with_key_id('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001'))
.with_mission_complete_script(None)
.with_counter_increment_script(None)
.with_receive_rewards_script(None)
.with_complete_notification(None)
.with_log_setting(
mission.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.create_namespace({
name="namespace1",
description=nil,
transactionSetting={
enableAutoRun=false,
queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001",
},
missionCompleteScript=nil,
counterIncrementScript=nil,
receiveRewardsScript=nil,
completeNotification=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
},
})
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.create_namespace_async({
name="namespace1",
description=nil,
transactionSetting={
enableAutoRun=false,
queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001",
},
missionCompleteScript=nil,
counterIncrementScript=nil,
receiveRewardsScript=nil,
completeNotification=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
},
})
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;
getNamespaceStatus
ネームスペースの状態を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
status | 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.GetNamespaceStatus(
&mission.GetNamespaceStatusRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
status := result.Status
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\GetNamespaceStatusRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getNamespaceStatus(
(new GetNamespaceStatusRequest())
->withNamespaceName(self::namespace1)
);
$status = $result->getStatus();
} 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.GetNamespaceStatusRequest;
import io.gs2.mission.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
GetNamespaceStatusResult result = client.getNamespaceStatus(
new GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
String status = result.getStatus();
} 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.GetNamespaceStatusRequest;
using Gs2.Gs2Mission.Result.GetNamespaceStatusResult;
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.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2Mission.Request.GetNamespaceStatusRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
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.getNamespaceStatus(
new Gs2Mission.GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
const status = result.getStatus();
} 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_namespace_status(
mission.GetNamespaceStatusRequest()
.with_namespace_name(self.hash1)
)
status = result.status
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.get_namespace_status({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
client = gs2('mission')
api_result_handler = client.get_namespace_status_async({
namespaceName="namespace1",
})
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
status = result.status;
getNamespace
ネームスペースを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | ネームスペース |
実装例
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.GetNamespace(
&mission.GetNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
}
)
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\GetNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getNamespace(
(new GetNamespaceRequest())
->withNamespaceName(self::namespace1)
);
$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.GetNamespaceRequest;
import io.gs2.mission.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
GetNamespaceResult result = client.getNamespace(
new GetNamespaceRequest()
.withNamespaceName("namespace1")
);
Namespace 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.GetNamespaceRequest;
using Gs2.Gs2Mission.Result.GetNamespaceResult;
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.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2Mission.Request.GetNamespaceRequest()
.WithNamespaceName("namespace1"),
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.getNamespace(
new Gs2Mission.GetNamespaceRequest()
.withNamespaceName("namespace1")
);
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_namespace(
mission.GetNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.get_namespace({
namespaceName="namespace1",
})
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_namespace_async({
namespaceName="namespace1",
})
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;
updateNamespace
ネームスペースを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
description | string | ~ 1024文字 | 説明文 | |||
transactionSetting | TransactionSetting | ✓ | トランザクション設定 | |||
missionCompleteScript | ScriptSetting | ミッションを達成したときに実行するスクリプト | ||||
counterIncrementScript | ScriptSetting | カウンターを上昇したときに実行するスクリプト | ||||
receiveRewardsScript | ScriptSetting | 報酬を受け取ったときに実行するスクリプト | ||||
completeNotification | NotificationSetting | ✓ | ミッションのタスクを達成したときのプッシュ通知 | |||
logSetting | LogSetting | ログの出力設定 | ||||
queueNamespaceId | string | ~ 1024文字 | トランザクションの実行に使用する GS2-JobQueue のネームスペース | |||
keyId | string | ~ 1024文字 | スタンプシートの発行に使用する GS2-Key のネームスペース |
Result
型 | 説明 | |
---|---|---|
item | Namespace | 更新したネームスペース |
実装例
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.UpdateNamespace(
&mission.UpdateNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
Description: pointy.String("description1"),
TransactionSetting: &mission.TransactionSetting{
EnableAutoRun: pointy.Bool(false),
QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"),
KeyId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"),
},
MissionCompleteScript: &mission.ScriptSetting{
TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"),
DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"),
},
CounterIncrementScript: &mission.ScriptSetting{
TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"),
DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"),
},
ReceiveRewardsScript: &mission.ScriptSetting{
TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"),
DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"),
},
CompleteNotification: nil,
LogSetting: &mission.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
},
}
)
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\UpdateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateNamespace(
(new UpdateNamespaceRequest())
->withNamespaceName(self::namespace1)
->withDescription("description1")
->withTransactionSetting((new \Gs2\Mission\Model\TransactionSetting())
->withEnableAutoRun(False)
->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
->withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:\namespace1:key:key-0002"))
->withMissionCompleteScript((new \Gs2\Mission\Model\ScriptSetting())
->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-0002")
->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-0002"))
->withCounterIncrementScript((new \Gs2\Mission\Model\ScriptSetting())
->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-0002")
->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-0002"))
->withReceiveRewardsScript((new \Gs2\Mission\Model\ScriptSetting())
->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-0002")
->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-0002"))
->withCompleteNotification(null)
->withLogSetting((new \Gs2\Mission\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\namespace1"))
);
$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.UpdateNamespaceRequest;
import io.gs2.mission.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
UpdateNamespaceResult result = client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withTransactionSetting(new io.gs2.mission.model.TransactionSetting()
.withEnableAutoRun(false)
.withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
.withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
.withMissionCompleteScript(new io.gs2.mission.model.ScriptSetting()
.withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
.withCounterIncrementScript(new io.gs2.mission.model.ScriptSetting()
.withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
.withReceiveRewardsScript(new io.gs2.mission.model.ScriptSetting()
.withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
.withCompleteNotification(null)
.withLogSetting(new io.gs2.mission.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
);
Namespace 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.UpdateNamespaceRequest;
using Gs2.Gs2Mission.Result.UpdateNamespaceResult;
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.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2Mission.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace1")
.WithDescription("description1")
.WithTransactionSetting(new Gs2.Gs2Mission.Model.TransactionSetting()
.WithEnableAutoRun(false)
.WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
.WithKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
.WithMissionCompleteScript(new Gs2.Gs2Mission.Model.ScriptSetting()
.WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
.WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
.WithCounterIncrementScript(new Gs2.Gs2Mission.Model.ScriptSetting()
.WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
.WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
.WithReceiveRewardsScript(new Gs2.Gs2Mission.Model.ScriptSetting()
.WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
.WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
.WithCompleteNotification(null)
.WithLogSetting(new Gs2.Gs2Mission.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
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.updateNamespace(
new Gs2Mission.UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withTransactionSetting(new Gs2Mission.model.TransactionSetting()
.withEnableAutoRun(false)
.withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
.withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
.withMissionCompleteScript(new Gs2Mission.model.ScriptSetting()
.withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
.withCounterIncrementScript(new Gs2Mission.model.ScriptSetting()
.withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
.withReceiveRewardsScript(new Gs2Mission.model.ScriptSetting()
.withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
.withCompleteNotification(null)
.withLogSetting(new Gs2Mission.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
);
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.update_namespace(
mission.UpdateNamespaceRequest()
.with_namespace_name(self.hash1)
.with_description('description1')
.with_transaction_setting(
mission.TransactionSetting()
.with_enable_auto_run(False)
.with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002')
.with_key_id('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002'))
.with_mission_complete_script(
mission.ScriptSetting()
.with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002')
.with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002'))
.with_counter_increment_script(
mission.ScriptSetting()
.with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002')
.with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002'))
.with_receive_rewards_script(
mission.ScriptSetting()
.with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002')
.with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002'))
.with_complete_notification(None)
.with_log_setting(
mission.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.update_namespace({
namespaceName="namespace1",
description="description1",
transactionSetting={
enableAutoRun=false,
queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002",
keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002",
},
missionCompleteScript={
triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002",
doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002",
},
counterIncrementScript={
triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002",
doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002",
},
receiveRewardsScript={
triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002",
doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002",
},
completeNotification=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
},
})
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.update_namespace_async({
namespaceName="namespace1",
description="description1",
transactionSetting={
enableAutoRun=false,
queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002",
keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002",
},
missionCompleteScript={
triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002",
doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002",
},
counterIncrementScript={
triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002",
doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002",
},
receiveRewardsScript={
triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002",
doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002",
},
completeNotification=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
},
})
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;
deleteNamespace
ネームスペースを削除
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | 削除したネームスペース |
実装例
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.DeleteNamespace(
&mission.DeleteNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
}
)
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\DeleteNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteNamespace(
(new DeleteNamespaceRequest())
->withNamespaceName(self::namespace1)
);
$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.DeleteNamespaceRequest;
import io.gs2.mission.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DeleteNamespaceResult result = client.deleteNamespace(
new DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
Namespace 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.DeleteNamespaceRequest;
using Gs2.Gs2Mission.Result.DeleteNamespaceResult;
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.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2Mission.Request.DeleteNamespaceRequest()
.WithNamespaceName("namespace1"),
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.deleteNamespace(
new Gs2Mission.DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
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_namespace(
mission.DeleteNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.delete_namespace({
namespaceName="namespace1",
})
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_namespace_async({
namespaceName="namespace1",
})
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;
dumpUserDataByUserId
指定したユーザーIDに紐づくデータのダンプを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
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.DumpUserDataByUserId(
&mission.DumpUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
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\DumpUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->dumpUserDataByUserId(
(new DumpUserDataByUserIdRequest())
->withUserId("user-0001")
->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.DumpUserDataByUserIdRequest;
import io.gs2.mission.result.DumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
new DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.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.DumpUserDataByUserIdRequest;
using Gs2.Gs2Mission.Result.DumpUserDataByUserIdResult;
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.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
new Gs2.Gs2Mission.Request.DumpUserDataByUserIdRequest()
.WithUserId("user-0001")
.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.dumpUserDataByUserId(
new Gs2Mission.DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.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.dump_user_data_by_user_id(
mission.DumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.dump_user_data_by_user_id({
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
client = gs2('mission')
api_result_handler = client.dump_user_data_by_user_id_async({
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
checkDumpUserDataByUserId
指定したユーザーIDに紐づくデータのダンプが完了しているか確認
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
url | string | 出力データのURL |
実装例
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.CheckDumpUserDataByUserId(
&mission.CheckDumpUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
url := result.Url
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\CheckDumpUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->checkDumpUserDataByUserId(
(new CheckDumpUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$url = $result->getUrl();
} 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.CheckDumpUserDataByUserIdRequest;
import io.gs2.mission.result.CheckDumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
CheckDumpUserDataByUserIdResult result = client.checkDumpUserDataByUserId(
new CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
String url = result.getUrl();
} 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.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Mission.Result.CheckDumpUserDataByUserIdResult;
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.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
new Gs2.Gs2Mission.Request.CheckDumpUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
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.checkDumpUserDataByUserId(
new Gs2Mission.CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} 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.check_dump_user_data_by_user_id(
mission.CheckDumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.check_dump_user_data_by_user_id({
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
url = result.url;
client = gs2('mission')
api_result_handler = client.check_dump_user_data_by_user_id_async({
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
url = result.url;
cleanUserDataByUserId
指定したユーザーIDに紐づくデータのダンプを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
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.CleanUserDataByUserId(
&mission.CleanUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
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\CleanUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->cleanUserDataByUserId(
(new CleanUserDataByUserIdRequest())
->withUserId("user-0001")
->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.CleanUserDataByUserIdRequest;
import io.gs2.mission.result.CleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
new CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.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.CleanUserDataByUserIdRequest;
using Gs2.Gs2Mission.Result.CleanUserDataByUserIdResult;
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.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
new Gs2.Gs2Mission.Request.CleanUserDataByUserIdRequest()
.WithUserId("user-0001")
.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.cleanUserDataByUserId(
new Gs2Mission.CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.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.clean_user_data_by_user_id(
mission.CleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.clean_user_data_by_user_id({
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
client = gs2('mission')
api_result_handler = client.clean_user_data_by_user_id_async({
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
checkCleanUserDataByUserId
指定したユーザーIDに紐づくデータのダンプが完了しているか確認
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
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.CheckCleanUserDataByUserId(
&mission.CheckCleanUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
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\CheckCleanUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->checkCleanUserDataByUserId(
(new CheckCleanUserDataByUserIdRequest())
->withUserId("user-0001")
->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.CheckCleanUserDataByUserIdRequest;
import io.gs2.mission.result.CheckCleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
new CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.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.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Mission.Result.CheckCleanUserDataByUserIdResult;
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.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
new Gs2.Gs2Mission.Request.CheckCleanUserDataByUserIdRequest()
.WithUserId("user-0001")
.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.checkCleanUserDataByUserId(
new Gs2Mission.CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.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.check_clean_user_data_by_user_id(
mission.CheckCleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.check_clean_user_data_by_user_id({
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
client = gs2('mission')
api_result_handler = client.check_clean_user_data_by_user_id_async({
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
prepareImportUserDataByUserId
指定したユーザーIDに紐づくデータのインポートを開始
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
uploadToken | string | アップロード後に結果を反映する際に使用するトークン |
uploadUrl | string | ユーザーデータアップロード処理の実行に使用するURL |
実装例
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.PrepareImportUserDataByUserId(
&mission.PrepareImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl
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\PrepareImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->prepareImportUserDataByUserId(
(new PrepareImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$uploadToken = $result->getUploadToken();
$uploadUrl = $result->getUploadUrl();
} 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.PrepareImportUserDataByUserIdRequest;
import io.gs2.mission.result.PrepareImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
PrepareImportUserDataByUserIdResult result = client.prepareImportUserDataByUserId(
new PrepareImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
String uploadToken = result.getUploadToken();
String uploadUrl = result.getUploadUrl();
} 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.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Mission.Result.PrepareImportUserDataByUserIdResult;
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.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
new Gs2.Gs2Mission.Request.PrepareImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;
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.prepareImportUserDataByUserId(
new Gs2Mission.PrepareImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const uploadToken = result.getUploadToken();
const uploadUrl = result.getUploadUrl();
} 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.prepare_import_user_data_by_user_id(
mission.PrepareImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
upload_token = result.upload_token
upload_url = result.upload_url
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.prepare_import_user_data_by_user_id({
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
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('mission')
api_result_handler = client.prepare_import_user_data_by_user_id_async({
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
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
importUserDataByUserId
指定したユーザーIDに紐づくデータのインポートを開始
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
uploadToken | string | ✓ | ~ 1024文字 | アップロード準備で受け取ったトークン | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
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.ImportUserDataByUserId(
&mission.ImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
UploadToken: pointy.String("upload-0001"),
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\ImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->importUserDataByUserId(
(new ImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withUploadToken("upload-0001")
->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.ImportUserDataByUserIdRequest;
import io.gs2.mission.result.ImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
ImportUserDataByUserIdResult result = client.importUserDataByUserId(
new ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.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.ImportUserDataByUserIdRequest;
using Gs2.Gs2Mission.Result.ImportUserDataByUserIdResult;
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.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
new Gs2.Gs2Mission.Request.ImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithUploadToken("upload-0001")
.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.importUserDataByUserId(
new Gs2Mission.ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.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.import_user_data_by_user_id(
mission.ImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_upload_token('upload-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
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.import_user_data_by_user_id_async({
userId="user-0001",
uploadToken="upload-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
checkImportUserDataByUserId
指定したユーザーIDに紐づくデータのインポートが完了しているか確認
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
uploadToken | string | ✓ | ~ 1024文字 | アップロード準備で受け取ったトークン | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
url | string | 出力ログのURL |
実装例
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.CheckImportUserDataByUserId(
&mission.CheckImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
UploadToken: pointy.String("upload-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
url := result.Url
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\CheckImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->checkImportUserDataByUserId(
(new CheckImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withUploadToken("upload-0001")
->withTimeOffsetToken(null)
);
$url = $result->getUrl();
} 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.CheckImportUserDataByUserIdRequest;
import io.gs2.mission.result.CheckImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
CheckImportUserDataByUserIdResult result = client.checkImportUserDataByUserId(
new CheckImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
String url = result.getUrl();
} 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.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Mission.Result.CheckImportUserDataByUserIdResult;
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.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
new Gs2.Gs2Mission.Request.CheckImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithUploadToken("upload-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
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.checkImportUserDataByUserId(
new Gs2Mission.CheckImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} 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.check_import_user_data_by_user_id(
mission.CheckImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_upload_token('upload-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.check_import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
client = gs2('mission')
api_result_handler = client.check_import_user_data_by_user_id_async({
userId="user-0001",
uploadToken="upload-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
url = result.url;
describeCounters
カウンターの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<Counter> | カウンターのリスト |
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.DescribeCounters(
&mission.DescribeCountersRequest {
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\DescribeCountersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeCounters(
(new DescribeCountersRequest())
->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.DescribeCountersRequest;
import io.gs2.mission.result.DescribeCountersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DescribeCountersResult result = client.describeCounters(
new DescribeCountersRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
List<Counter> 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.DescribeCountersRequest;
using Gs2.Gs2Mission.Result.DescribeCountersResult;
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.DescribeCountersResult> asyncResult = null;
yield return client.DescribeCounters(
new Gs2.Gs2Mission.Request.DescribeCountersRequest()
.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.describeCounters(
new Gs2Mission.DescribeCountersRequest()
.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_counters(
mission.DescribeCountersRequest()
.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_counters({
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_counters_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;
describeCountersByUserId
ユーザIDを指定してカウンターの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | |
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
items | List<Counter> | カウンターのリスト |
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.DescribeCountersByUserId(
&mission.DescribeCountersByUserIdRequest {
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\DescribeCountersByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeCountersByUserId(
(new DescribeCountersByUserIdRequest())
->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.DescribeCountersByUserIdRequest;
import io.gs2.mission.result.DescribeCountersByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DescribeCountersByUserIdResult result = client.describeCountersByUserId(
new DescribeCountersByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<Counter> 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.DescribeCountersByUserIdRequest;
using Gs2.Gs2Mission.Result.DescribeCountersByUserIdResult;
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.DescribeCountersByUserIdResult> asyncResult = null;
yield return client.DescribeCountersByUserId(
new Gs2.Gs2Mission.Request.DescribeCountersByUserIdRequest()
.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.describeCountersByUserId(
new Gs2Mission.DescribeCountersByUserIdRequest()
.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_counters_by_user_id(
mission.DescribeCountersByUserIdRequest()
.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_counters_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_counters_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;
increaseCounterByUserId
ユーザーIDを指定してカウンターを加算
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
counterName | string | ✓ | ~ 128文字 | カウンター名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
value | long | ✓ | 1 ~ 9223372036854775805 | 加算する値 | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Counter | 加算したカウンター |
changedCompletes | List<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.IncreaseCounterByUserId(
&mission.IncreaseCounterByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
CounterName: pointy.String("quest_complete"),
UserId: pointy.String("user-0001"),
Value: pointy.Int64(1),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
changedCompletes := result.ChangedCompletes
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\IncreaseCounterByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->increaseCounterByUserId(
(new IncreaseCounterByUserIdRequest())
->withNamespaceName(self::namespace1)
->withCounterName("quest_complete")
->withUserId("user-0001")
->withValue(1)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$changedCompletes = $result->getChangedCompletes();
} 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.IncreaseCounterByUserIdRequest;
import io.gs2.mission.result.IncreaseCounterByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
IncreaseCounterByUserIdResult result = client.increaseCounterByUserId(
new IncreaseCounterByUserIdRequest()
.withNamespaceName("namespace1")
.withCounterName("quest_complete")
.withUserId("user-0001")
.withValue(1L)
.withTimeOffsetToken(null)
);
Counter item = result.getItem();
List<Complete> changedCompletes = result.getChangedCompletes();
} 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.IncreaseCounterByUserIdRequest;
using Gs2.Gs2Mission.Result.IncreaseCounterByUserIdResult;
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.IncreaseCounterByUserIdResult> asyncResult = null;
yield return client.IncreaseCounterByUserId(
new Gs2.Gs2Mission.Request.IncreaseCounterByUserIdRequest()
.WithNamespaceName("namespace1")
.WithCounterName("quest_complete")
.WithUserId("user-0001")
.WithValue(1L)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var changedCompletes = result.ChangedCompletes;
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.increaseCounterByUserId(
new Gs2Mission.IncreaseCounterByUserIdRequest()
.withNamespaceName("namespace1")
.withCounterName("quest_complete")
.withUserId("user-0001")
.withValue(1)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const changedCompletes = result.getChangedCompletes();
} 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.increase_counter_by_user_id(
mission.IncreaseCounterByUserIdRequest()
.with_namespace_name(self.hash1)
.with_counter_name('quest_complete')
.with_user_id('user-0001')
.with_value(1)
.with_time_offset_token(None)
)
item = result.item
changed_completes = result.changed_completes
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.increase_counter_by_user_id({
namespaceName="namespace1",
counterName="quest_complete",
userId="user-0001",
value=1,
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;
changedCompletes = result.changedCompletes;
client = gs2('mission')
api_result_handler = client.increase_counter_by_user_id_async({
namespaceName="namespace1",
counterName="quest_complete",
userId="user-0001",
value=1,
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;
changedCompletes = result.changedCompletes;
setCounterByUserId
ユーザーIDを指定してカウンターを設定
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
counterName | string | ✓ | ~ 128文字 | カウンター名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
values | List<ScopedValue> | ~ 10 items | 設定する値のリスト | |||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Counter | 加算したカウンター |
old | Counter | カウンター加算後のカウンター |
changedCompletes | List<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.SetCounterByUserId(
&mission.SetCounterByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
CounterName: pointy.String("counter-0001"),
UserId: pointy.String("user-0001"),
Values: []mission.ScopedValue{
mission.ScopedValue{
ResetType: pointy.String("daily"),
Value: pointy.Int64(1),
},
mission.ScopedValue{
ResetType: pointy.String("weekly"),
Value: pointy.Int64(2),
},
},
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
old := result.Old
changedCompletes := result.ChangedCompletes
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\SetCounterByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->setCounterByUserId(
(new SetCounterByUserIdRequest())
->withNamespaceName(self::namespace1)
->withCounterName("counter-0001")
->withUserId("user-0001")
->withValues([
(new ScopedValue())
->withResetType("daily")
->withValue(1),
(new ScopedValue())
->withResetType("weekly")
->withValue(2),
])
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$old = $result->getOld();
$changedCompletes = $result->getChangedCompletes();
} 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.SetCounterByUserIdRequest;
import io.gs2.mission.result.SetCounterByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
SetCounterByUserIdResult result = client.setCounterByUserId(
new SetCounterByUserIdRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
.withUserId("user-0001")
.withValues(Arrays.asList(
new ScopedValue()
.withResetType("daily")
.withValue(1L),
new ScopedValue()
.withResetType("weekly")
.withValue(2L)
))
.withTimeOffsetToken(null)
);
Counter item = result.getItem();
Counter old = result.getOld();
List<Complete> changedCompletes = result.getChangedCompletes();
} 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.SetCounterByUserIdRequest;
using Gs2.Gs2Mission.Result.SetCounterByUserIdResult;
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.SetCounterByUserIdResult> asyncResult = null;
yield return client.SetCounterByUserId(
new Gs2.Gs2Mission.Request.SetCounterByUserIdRequest()
.WithNamespaceName("namespace1")
.WithCounterName("counter-0001")
.WithUserId("user-0001")
.WithValues(new Gs2.Gs2Mission.Model.ScopedValue[] {
new Gs2.Gs2Mission.Model.ScopedValue()
.WithResetType("daily")
.WithValue(1L),
new Gs2.Gs2Mission.Model.ScopedValue()
.WithResetType("weekly")
.WithValue(2L),
})
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var changedCompletes = result.ChangedCompletes;
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.setCounterByUserId(
new Gs2Mission.SetCounterByUserIdRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
.withUserId("user-0001")
.withValues([
new Gs2Mission.model.ScopedValue()
.withResetType("daily")
.withValue(1),
new Gs2Mission.model.ScopedValue()
.withResetType("weekly")
.withValue(2),
])
.withTimeOffsetToken(null)
);
const item = result.getItem();
const old = result.getOld();
const changedCompletes = result.getChangedCompletes();
} 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.set_counter_by_user_id(
mission.SetCounterByUserIdRequest()
.with_namespace_name(self.hash1)
.with_counter_name('counter-0001')
.with_user_id('user-0001')
.with_values([
mission.ScopedValue()
.with_reset_type('daily')
.with_value(1),
mission.ScopedValue()
.with_reset_type('weekly')
.with_value(2),
])
.with_time_offset_token(None)
)
item = result.item
old = result.old
changed_completes = result.changed_completes
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.set_counter_by_user_id({
namespaceName="namespace1",
counterName="counter-0001",
userId="user-0001",
values={
{
reset_type="daily",
value=1,
},
{
reset_type="weekly",
value=2,
}
},
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;
old = result.old;
changedCompletes = result.changedCompletes;
client = gs2('mission')
api_result_handler = client.set_counter_by_user_id_async({
namespaceName="namespace1",
counterName="counter-0001",
userId="user-0001",
values={
{
reset_type="daily",
value=1,
},
{
reset_type="weekly",
value=2,
}
},
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;
old = result.old;
changedCompletes = result.changedCompletes;
decreaseCounter
カウンターを減算
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
counterName | string | ✓ | ~ 128文字 | カウンター名 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID | ||
value | long | ✓ | 1 ~ 9223372036854775805 | 減算する値 |
Result
型 | 説明 | |
---|---|---|
item | Counter | 減算したカウンター |
changedCompletes | List<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.DecreaseCounter(
&mission.DecreaseCounterRequest {
NamespaceName: pointy.String("namespace1"),
CounterName: pointy.String("counter-0001"),
AccessToken: pointy.String("accessToken-0001"),
Value: pointy.Int64(1),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
changedCompletes := result.ChangedCompletes
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\DecreaseCounterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->decreaseCounter(
(new DecreaseCounterRequest())
->withNamespaceName(self::namespace1)
->withCounterName("counter-0001")
->withAccessToken(self::$accessToken0001)
->withValue(1)
);
$item = $result->getItem();
$changedCompletes = $result->getChangedCompletes();
} 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.DecreaseCounterRequest;
import io.gs2.mission.result.DecreaseCounterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DecreaseCounterResult result = client.decreaseCounter(
new DecreaseCounterRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
.withAccessToken("accessToken-0001")
.withValue(1L)
);
Counter item = result.getItem();
List<Complete> changedCompletes = result.getChangedCompletes();
} 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.DecreaseCounterRequest;
using Gs2.Gs2Mission.Result.DecreaseCounterResult;
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.DecreaseCounterResult> asyncResult = null;
yield return client.DecreaseCounter(
new Gs2.Gs2Mission.Request.DecreaseCounterRequest()
.WithNamespaceName("namespace1")
.WithCounterName("counter-0001")
.WithAccessToken("accessToken-0001")
.WithValue(1L),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var changedCompletes = result.ChangedCompletes;
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.decreaseCounter(
new Gs2Mission.DecreaseCounterRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
.withAccessToken("accessToken-0001")
.withValue(1)
);
const item = result.getItem();
const changedCompletes = result.getChangedCompletes();
} 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.decrease_counter(
mission.DecreaseCounterRequest()
.with_namespace_name(self.hash1)
.with_counter_name('counter-0001')
.with_access_token(self.access_token_0001)
.with_value(1)
)
item = result.item
changed_completes = result.changed_completes
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.decrease_counter({
namespaceName="namespace1",
counterName="counter-0001",
accessToken="accessToken-0001",
value=1,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
changedCompletes = result.changedCompletes;
client = gs2('mission')
api_result_handler = client.decrease_counter_async({
namespaceName="namespace1",
counterName="counter-0001",
accessToken="accessToken-0001",
value=1,
})
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;
changedCompletes = result.changedCompletes;
decreaseCounterByUserId
ユーザーIDを指定してカウンターを減算
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
counterName | string | ✓ | ~ 128文字 | カウンター名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
value | long | ✓ | 1 ~ 9223372036854775805 | 減算する値 | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Counter | 減算したカウンター |
changedCompletes | List<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.DecreaseCounterByUserId(
&mission.DecreaseCounterByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
CounterName: pointy.String("counter-0001"),
UserId: pointy.String("user-0001"),
Value: pointy.Int64(1),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
changedCompletes := result.ChangedCompletes
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\DecreaseCounterByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->decreaseCounterByUserId(
(new DecreaseCounterByUserIdRequest())
->withNamespaceName(self::namespace1)
->withCounterName("counter-0001")
->withUserId("user-0001")
->withValue(1)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$changedCompletes = $result->getChangedCompletes();
} 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.DecreaseCounterByUserIdRequest;
import io.gs2.mission.result.DecreaseCounterByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DecreaseCounterByUserIdResult result = client.decreaseCounterByUserId(
new DecreaseCounterByUserIdRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
.withUserId("user-0001")
.withValue(1L)
.withTimeOffsetToken(null)
);
Counter item = result.getItem();
List<Complete> changedCompletes = result.getChangedCompletes();
} 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.DecreaseCounterByUserIdRequest;
using Gs2.Gs2Mission.Result.DecreaseCounterByUserIdResult;
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.DecreaseCounterByUserIdResult> asyncResult = null;
yield return client.DecreaseCounterByUserId(
new Gs2.Gs2Mission.Request.DecreaseCounterByUserIdRequest()
.WithNamespaceName("namespace1")
.WithCounterName("counter-0001")
.WithUserId("user-0001")
.WithValue(1L)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var changedCompletes = result.ChangedCompletes;
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.decreaseCounterByUserId(
new Gs2Mission.DecreaseCounterByUserIdRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
.withUserId("user-0001")
.withValue(1)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const changedCompletes = result.getChangedCompletes();
} 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.decrease_counter_by_user_id(
mission.DecreaseCounterByUserIdRequest()
.with_namespace_name(self.hash1)
.with_counter_name('counter-0001')
.with_user_id('user-0001')
.with_value(1)
.with_time_offset_token(None)
)
item = result.item
changed_completes = result.changed_completes
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.decrease_counter_by_user_id({
namespaceName="namespace1",
counterName="counter-0001",
userId="user-0001",
value=1,
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;
changedCompletes = result.changedCompletes;
client = gs2('mission')
api_result_handler = client.decrease_counter_by_user_id_async({
namespaceName="namespace1",
counterName="counter-0001",
userId="user-0001",
value=1,
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;
changedCompletes = result.changedCompletes;
getCounter
カウンターを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
counterName | string | ✓ | ~ 128文字 | カウンター名 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID |
Result
型 | 説明 | |
---|---|---|
item | Counter | カウンター |
実装例
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.GetCounter(
&mission.GetCounterRequest {
NamespaceName: pointy.String("namespace1"),
CounterName: pointy.String("quest_complete"),
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\GetCounterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getCounter(
(new GetCounterRequest())
->withNamespaceName(self::namespace1)
->withCounterName("quest_complete")
->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.GetCounterRequest;
import io.gs2.mission.result.GetCounterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
GetCounterResult result = client.getCounter(
new GetCounterRequest()
.withNamespaceName("namespace1")
.withCounterName("quest_complete")
.withAccessToken("accessToken-0001")
);
Counter 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.GetCounterRequest;
using Gs2.Gs2Mission.Result.GetCounterResult;
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.GetCounterResult> asyncResult = null;
yield return client.GetCounter(
new Gs2.Gs2Mission.Request.GetCounterRequest()
.WithNamespaceName("namespace1")
.WithCounterName("quest_complete")
.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.getCounter(
new Gs2Mission.GetCounterRequest()
.withNamespaceName("namespace1")
.withCounterName("quest_complete")
.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_counter(
mission.GetCounterRequest()
.with_namespace_name(self.hash1)
.with_counter_name('quest_complete')
.with_access_token(self.access_token_0001)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.get_counter({
namespaceName="namespace1",
counterName="quest_complete",
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_counter_async({
namespaceName="namespace1",
counterName="quest_complete",
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;
getCounterByUserId
ユーザIDを指定してカウンターを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
counterName | string | ✓ | ~ 128文字 | カウンター名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Counter | カウンター |
実装例
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.GetCounterByUserId(
&mission.GetCounterByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
CounterName: pointy.String("counter-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\GetCounterByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getCounterByUserId(
(new GetCounterByUserIdRequest())
->withNamespaceName(self::namespace1)
->withCounterName("counter-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.GetCounterByUserIdRequest;
import io.gs2.mission.result.GetCounterByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
GetCounterByUserIdResult result = client.getCounterByUserId(
new GetCounterByUserIdRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
Counter 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.GetCounterByUserIdRequest;
using Gs2.Gs2Mission.Result.GetCounterByUserIdResult;
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.GetCounterByUserIdResult> asyncResult = null;
yield return client.GetCounterByUserId(
new Gs2.Gs2Mission.Request.GetCounterByUserIdRequest()
.WithNamespaceName("namespace1")
.WithCounterName("counter-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.getCounterByUserId(
new Gs2Mission.GetCounterByUserIdRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-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_counter_by_user_id(
mission.GetCounterByUserIdRequest()
.with_namespace_name(self.hash1)
.with_counter_name('counter-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_counter_by_user_id({
namespaceName="namespace1",
counterName="counter-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_counter_by_user_id_async({
namespaceName="namespace1",
counterName="counter-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;
verifyCounterValue
カウンター値を検証
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID | ||
counterName | string | ✓ | ~ 128文字 | カウンター名 | ||
verifyType | enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | ~ 128文字 | 検証の種類 | ||
scopeType | enum { “resetTiming”, “verifyAction” } | ✓ | “resetTiming” | ~ 128文字 | スコープの種類 | |
resetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | {scopeType} == “resetTiming” | ✓ | ~ 128文字 | リセットタイミング | |
conditionName | string | {scopeType} == “verifyAction” | ✓ | ~ 128文字 | 条件名 | |
value | long | ✓ | 0 | ~ 9223372036854775805 | カウント | |
multiplyValueSpecifyingQuantity | bool | ✓ | false | 数量指定した際に、検証に使用する値も乗算するか |
verifyType に指定する列挙型の定義
定義 | 説明 |
---|---|
less | カウンター値が指定値未満であること |
lessEqual | カウンター値が指定値以下であること |
greater | カウンター値が指定値超過であること |
greaterEqual | カウンター値が指定値以上であること |
equal | カウンター値が指定値と一致すること |
notEqual | カウンター値が指定値と一致しないこと |
scopeType に指定する列挙型の定義
定義 | 説明 |
---|---|
resetTiming | リセットタイミング |
verifyAction | 検証アクション |
resetType に指定する列挙型の定義
定義 | 説明 |
---|---|
notReset | リセットしない |
daily | 毎日 |
weekly | 毎週 |
monthly | 毎月 |
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.VerifyCounterValue(
&mission.VerifyCounterValueRequest {
NamespaceName: pointy.String("namespace1"),
AccessToken: pointy.String("accessToken-0001"),
CounterName: pointy.String("counter-0001"),
VerifyType: pointy.String("less"),
ScopeType: nil,
ResetType: pointy.String("daily"),
ConditionName: nil,
Value: pointy.Int64(10),
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\VerifyCounterValueRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyCounterValue(
(new VerifyCounterValueRequest())
->withNamespaceName(self::namespace1)
->withAccessToken(self::$accessToken0001)
->withCounterName("counter-0001")
->withVerifyType("less")
->withScopeType(null)
->withResetType("daily")
->withConditionName(null)
->withValue(10)
->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.VerifyCounterValueRequest;
import io.gs2.mission.result.VerifyCounterValueResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
VerifyCounterValueResult result = client.verifyCounterValue(
new VerifyCounterValueRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withCounterName("counter-0001")
.withVerifyType("less")
.withScopeType(null)
.withResetType("daily")
.withConditionName(null)
.withValue(10L)
.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.VerifyCounterValueRequest;
using Gs2.Gs2Mission.Result.VerifyCounterValueResult;
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.VerifyCounterValueResult> asyncResult = null;
yield return client.VerifyCounterValue(
new Gs2.Gs2Mission.Request.VerifyCounterValueRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("accessToken-0001")
.WithCounterName("counter-0001")
.WithVerifyType("less")
.WithScopeType(null)
.WithResetType("daily")
.WithConditionName(null)
.WithValue(10L)
.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.verifyCounterValue(
new Gs2Mission.VerifyCounterValueRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withCounterName("counter-0001")
.withVerifyType("less")
.withScopeType(null)
.withResetType("daily")
.withConditionName(null)
.withValue(10)
.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_counter_value(
mission.VerifyCounterValueRequest()
.with_namespace_name(self.hash1)
.with_access_token(self.access_token_0001)
.with_counter_name('counter-0001')
.with_verify_type('less')
.with_scope_type(None)
.with_reset_type('daily')
.with_condition_name(None)
.with_value(10)
.with_multiply_value_specifying_quantity(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.verify_counter_value({
namespaceName="namespace1",
accessToken="accessToken-0001",
counterName="counter-0001",
verifyType="less",
scopeType=nil,
resetType="daily",
conditionName=nil,
value=10,
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_counter_value_async({
namespaceName="namespace1",
accessToken="accessToken-0001",
counterName="counter-0001",
verifyType="less",
scopeType=nil,
resetType="daily",
conditionName=nil,
value=10,
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
verifyCounterValueByUserId
ユーザーIDを指定してカウンター値を検証
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
counterName | string | ✓ | ~ 128文字 | カウンター名 | ||
verifyType | enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | ~ 128文字 | 検証の種類 | ||
scopeType | enum { “resetTiming”, “verifyAction” } | ✓ | “resetTiming” | ~ 128文字 | スコープの種類 | |
resetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | {scopeType} == “resetTiming” | ✓ | ~ 128文字 | リセットタイミング | |
conditionName | string | {scopeType} == “verifyAction” | ✓ | ~ 128文字 | 条件名 | |
value | long | ✓ | 0 | ~ 9223372036854775805 | カウント | |
multiplyValueSpecifyingQuantity | bool | ✓ | false | 数量指定した際に、検証に使用する値も乗算するか | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
verifyType に指定する列挙型の定義
定義 | 説明 |
---|---|
less | カウンター値が指定値未満であること |
lessEqual | カウンター値が指定値以下であること |
greater | カウンター値が指定値超過であること |
greaterEqual | カウンター値が指定値以上であること |
equal | カウンター値が指定値と一致すること |
notEqual | カウンター値が指定値と一致しないこと |
scopeType に指定する列挙型の定義
定義 | 説明 |
---|---|
resetTiming | リセットタイミング |
verifyAction | 検証アクション |
resetType に指定する列挙型の定義
定義 | 説明 |
---|---|
notReset | リセットしない |
daily | 毎日 |
weekly | 毎週 |
monthly | 毎月 |
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.VerifyCounterValueByUserId(
&mission.VerifyCounterValueByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-0001"),
CounterName: pointy.String("counter-0001"),
VerifyType: pointy.String("less"),
ScopeType: nil,
ResetType: pointy.String("daily"),
ConditionName: nil,
Value: pointy.Int64(10),
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\VerifyCounterValueByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyCounterValueByUserId(
(new VerifyCounterValueByUserIdRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withCounterName("counter-0001")
->withVerifyType("less")
->withScopeType(null)
->withResetType("daily")
->withConditionName(null)
->withValue(10)
->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.VerifyCounterValueByUserIdRequest;
import io.gs2.mission.result.VerifyCounterValueByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
VerifyCounterValueByUserIdResult result = client.verifyCounterValueByUserId(
new VerifyCounterValueByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withCounterName("counter-0001")
.withVerifyType("less")
.withScopeType(null)
.withResetType("daily")
.withConditionName(null)
.withValue(10L)
.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.VerifyCounterValueByUserIdRequest;
using Gs2.Gs2Mission.Result.VerifyCounterValueByUserIdResult;
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.VerifyCounterValueByUserIdResult> asyncResult = null;
yield return client.VerifyCounterValueByUserId(
new Gs2.Gs2Mission.Request.VerifyCounterValueByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithCounterName("counter-0001")
.WithVerifyType("less")
.WithScopeType(null)
.WithResetType("daily")
.WithConditionName(null)
.WithValue(10L)
.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.verifyCounterValueByUserId(
new Gs2Mission.VerifyCounterValueByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withCounterName("counter-0001")
.withVerifyType("less")
.withScopeType(null)
.withResetType("daily")
.withConditionName(null)
.withValue(10)
.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_counter_value_by_user_id(
mission.VerifyCounterValueByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_counter_name('counter-0001')
.with_verify_type('less')
.with_scope_type(None)
.with_reset_type('daily')
.with_condition_name(None)
.with_value(10)
.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_counter_value_by_user_id({
namespaceName="namespace1",
userId="user-0001",
counterName="counter-0001",
verifyType="less",
scopeType=nil,
resetType="daily",
conditionName=nil,
value=10,
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_counter_value_by_user_id_async({
namespaceName="namespace1",
userId="user-0001",
counterName="counter-0001",
verifyType="less",
scopeType=nil,
resetType="daily",
conditionName=nil,
value=10,
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
deleteCounterByUserId
カウンターを削除
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
counterName | string | ✓ | ~ 128文字 | カウンター名 | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Counter | 削除したカウンター |
実装例
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.DeleteCounterByUserId(
&mission.DeleteCounterByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-0001"),
CounterName: pointy.String("quest_complete"),
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\DeleteCounterByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteCounterByUserId(
(new DeleteCounterByUserIdRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withCounterName("quest_complete")
->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.DeleteCounterByUserIdRequest;
import io.gs2.mission.result.DeleteCounterByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DeleteCounterByUserIdResult result = client.deleteCounterByUserId(
new DeleteCounterByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withCounterName("quest_complete")
.withTimeOffsetToken(null)
);
Counter 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.DeleteCounterByUserIdRequest;
using Gs2.Gs2Mission.Result.DeleteCounterByUserIdResult;
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.DeleteCounterByUserIdResult> asyncResult = null;
yield return client.DeleteCounterByUserId(
new Gs2.Gs2Mission.Request.DeleteCounterByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithCounterName("quest_complete")
.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.deleteCounterByUserId(
new Gs2Mission.DeleteCounterByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withCounterName("quest_complete")
.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_counter_by_user_id(
mission.DeleteCounterByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_counter_name('quest_complete')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.delete_counter_by_user_id({
namespaceName="namespace1",
userId="user-0001",
counterName="quest_complete",
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_counter_by_user_id_async({
namespaceName="namespace1",
userId="user-0001",
counterName="quest_complete",
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;
increaseByStampSheet
入手アクションとしてカウンターの加算を実行
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
stampSheet | string | ✓ | ~ 5242880文字 | トランザクション | ||
keyId | string | ✓ | ~ 1024文字 | 暗号鍵GRN |
Result
型 | 説明 | |
---|---|---|
item | Counter | カウンター加算後のカウンター |
changedCompletes | List<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.IncreaseByStampSheet(
&mission.IncreaseByStampSheetRequest {
StampSheet: pointy.String("stampSheet"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
changedCompletes := result.ChangedCompletes
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\IncreaseByStampSheetRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->increaseByStampSheet(
(new IncreaseByStampSheetRequest())
->withStampSheet(self::stampSheet)
->withKeyId(self::key-0001)
);
$item = $result->getItem();
$changedCompletes = $result->getChangedCompletes();
} 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.IncreaseByStampSheetRequest;
import io.gs2.mission.result.IncreaseByStampSheetResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
IncreaseByStampSheetResult result = client.increaseByStampSheet(
new IncreaseByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
Counter item = result.getItem();
List<Complete> changedCompletes = result.getChangedCompletes();
} 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.IncreaseByStampSheetRequest;
using Gs2.Gs2Mission.Result.IncreaseByStampSheetResult;
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.IncreaseByStampSheetResult> asyncResult = null;
yield return client.IncreaseByStampSheet(
new Gs2.Gs2Mission.Request.IncreaseByStampSheetRequest()
.WithStampSheet("stampSheet")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var changedCompletes = result.ChangedCompletes;
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.increaseByStampSheet(
new Gs2Mission.IncreaseByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
const item = result.getItem();
const changedCompletes = result.getChangedCompletes();
} 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.increase_by_stamp_sheet(
mission.IncreaseByStampSheetRequest()
.with_stamp_sheet(self.stamp_sheet)
.with_key_id(self.key1.key_id)
)
item = result.item
changed_completes = result.changed_completes
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.increase_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;
changedCompletes = result.changedCompletes;
client = gs2('mission')
api_result_handler = client.increase_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;
changedCompletes = result.changedCompletes;
setByStampSheet
入手アクションとしてカウンターを設定
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
stampSheet | string | ✓ | ~ 5242880文字 | トランザクション | ||
keyId | string | ✓ | ~ 1024文字 | 暗号鍵GRN |
Result
型 | 説明 | |
---|---|---|
item | Counter | カウンター加算後のカウンター |
old | Counter | カウンター加算後のカウンター |
changedCompletes | List<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.SetByStampSheet(
&mission.SetByStampSheetRequest {
StampSheet: pointy.String("stampSheet"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
old := result.Old
changedCompletes := result.ChangedCompletes
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\SetByStampSheetRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->setByStampSheet(
(new SetByStampSheetRequest())
->withStampSheet(self::stampSheet)
->withKeyId(self::key-0001)
);
$item = $result->getItem();
$old = $result->getOld();
$changedCompletes = $result->getChangedCompletes();
} 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.SetByStampSheetRequest;
import io.gs2.mission.result.SetByStampSheetResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
SetByStampSheetResult result = client.setByStampSheet(
new SetByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
Counter item = result.getItem();
Counter old = result.getOld();
List<Complete> changedCompletes = result.getChangedCompletes();
} 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.SetByStampSheetRequest;
using Gs2.Gs2Mission.Result.SetByStampSheetResult;
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.SetByStampSheetResult> asyncResult = null;
yield return client.SetByStampSheet(
new Gs2.Gs2Mission.Request.SetByStampSheetRequest()
.WithStampSheet("stampSheet")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var changedCompletes = result.ChangedCompletes;
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.setByStampSheet(
new Gs2Mission.SetByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
const item = result.getItem();
const old = result.getOld();
const changedCompletes = result.getChangedCompletes();
} 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.set_by_stamp_sheet(
mission.SetByStampSheetRequest()
.with_stamp_sheet(self.stamp_sheet)
.with_key_id(self.key1.key_id)
)
item = result.item
old = result.old
changed_completes = result.changed_completes
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.set_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;
old = result.old;
changedCompletes = result.changedCompletes;
client = gs2('mission')
api_result_handler = client.set_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;
old = result.old;
changedCompletes = result.changedCompletes;
decreaseByStampTask
消費アクションとしてカウンターの減算を実行
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
stampTask | string | ✓ | ~ 5242880文字 | 消費アクション | ||
keyId | string | ✓ | ~ 1024文字 | 暗号鍵GRN |
Result
型 | 説明 | |
---|---|---|
item | Counter | カウンター加算後のカウンター |
changedCompletes | List<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.DecreaseByStampTask(
&mission.DecreaseByStampTaskRequest {
StampTask: pointy.String("stampTask"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
changedCompletes := result.ChangedCompletes
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\DecreaseByStampTaskRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->decreaseByStampTask(
(new DecreaseByStampTaskRequest())
->withStampTask(self::stampTask)
->withKeyId(self::key-0001)
);
$item = $result->getItem();
$changedCompletes = $result->getChangedCompletes();
$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.DecreaseByStampTaskRequest;
import io.gs2.mission.result.DecreaseByStampTaskResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DecreaseByStampTaskResult result = client.decreaseByStampTask(
new DecreaseByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
Counter item = result.getItem();
List<Complete> changedCompletes = result.getChangedCompletes();
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.DecreaseByStampTaskRequest;
using Gs2.Gs2Mission.Result.DecreaseByStampTaskResult;
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.DecreaseByStampTaskResult> asyncResult = null;
yield return client.DecreaseByStampTask(
new Gs2.Gs2Mission.Request.DecreaseByStampTaskRequest()
.WithStampTask("stampTask")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var changedCompletes = result.ChangedCompletes;
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.decreaseByStampTask(
new Gs2Mission.DecreaseByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
const item = result.getItem();
const changedCompletes = result.getChangedCompletes();
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.decrease_by_stamp_task(
mission.DecreaseByStampTaskRequest()
.with_stamp_task(self.stamp_task)
.with_key_id(self.key1.key_id)
)
item = result.item
changed_completes = result.changed_completes
new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.decrease_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;
changedCompletes = result.changedCompletes;
newContextStack = result.newContextStack;
client = gs2('mission')
api_result_handler = client.decrease_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;
changedCompletes = result.changedCompletes;
newContextStack = result.newContextStack;
verifyCounterValueByStampTask
検証アクションとしてカウンター値の検証を実行
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.VerifyCounterValueByStampTask(
&mission.VerifyCounterValueByStampTaskRequest {
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\VerifyCounterValueByStampTaskRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyCounterValueByStampTask(
(new VerifyCounterValueByStampTaskRequest())
->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.VerifyCounterValueByStampTaskRequest;
import io.gs2.mission.result.VerifyCounterValueByStampTaskResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
VerifyCounterValueByStampTaskResult result = client.verifyCounterValueByStampTask(
new VerifyCounterValueByStampTaskRequest()
.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.VerifyCounterValueByStampTaskRequest;
using Gs2.Gs2Mission.Result.VerifyCounterValueByStampTaskResult;
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.VerifyCounterValueByStampTaskResult> asyncResult = null;
yield return client.VerifyCounterValueByStampTask(
new Gs2.Gs2Mission.Request.VerifyCounterValueByStampTaskRequest()
.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.verifyCounterValueByStampTask(
new Gs2Mission.VerifyCounterValueByStampTaskRequest()
.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_counter_value_by_stamp_task(
mission.VerifyCounterValueByStampTaskRequest()
.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_counter_value_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_counter_value_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;
exportMaster
現在有効なミッションマスターのマスターデータをエクスポート
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | CurrentMissionMaster | 現在有効なミッションマスター |
実装例
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.ExportMaster(
&mission.ExportMasterRequest {
NamespaceName: pointy.String("namespace1"),
}
)
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\ExportMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->exportMaster(
(new ExportMasterRequest())
->withNamespaceName(self::namespace1)
);
$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.ExportMasterRequest;
import io.gs2.mission.result.ExportMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
ExportMasterResult result = client.exportMaster(
new ExportMasterRequest()
.withNamespaceName("namespace1")
);
CurrentMissionMaster 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.ExportMasterRequest;
using Gs2.Gs2Mission.Result.ExportMasterResult;
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.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
new Gs2.Gs2Mission.Request.ExportMasterRequest()
.WithNamespaceName("namespace1"),
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.exportMaster(
new Gs2Mission.ExportMasterRequest()
.withNamespaceName("namespace1")
);
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.export_master(
mission.ExportMasterRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.export_master({
namespaceName="namespace1",
})
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.export_master_async({
namespaceName="namespace1",
})
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;
getCurrentMissionMaster
現在有効なミッションマスターを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | CurrentMissionMaster | 現在有効なミッションマスター |
実装例
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.GetCurrentMissionMaster(
&mission.GetCurrentMissionMasterRequest {
NamespaceName: pointy.String("namespace1"),
}
)
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\GetCurrentMissionMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getCurrentMissionMaster(
(new GetCurrentMissionMasterRequest())
->withNamespaceName(self::namespace1)
);
$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.GetCurrentMissionMasterRequest;
import io.gs2.mission.result.GetCurrentMissionMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
GetCurrentMissionMasterResult result = client.getCurrentMissionMaster(
new GetCurrentMissionMasterRequest()
.withNamespaceName("namespace1")
);
CurrentMissionMaster 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.GetCurrentMissionMasterRequest;
using Gs2.Gs2Mission.Result.GetCurrentMissionMasterResult;
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.GetCurrentMissionMasterResult> asyncResult = null;
yield return client.GetCurrentMissionMaster(
new Gs2.Gs2Mission.Request.GetCurrentMissionMasterRequest()
.WithNamespaceName("namespace1"),
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.getCurrentMissionMaster(
new Gs2Mission.GetCurrentMissionMasterRequest()
.withNamespaceName("namespace1")
);
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_current_mission_master(
mission.GetCurrentMissionMasterRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.get_current_mission_master({
namespaceName="namespace1",
})
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_current_mission_master_async({
namespaceName="namespace1",
})
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;
updateCurrentMissionMaster
現在有効なミッションマスターを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
settings | string | ✓ | ~ 5242880文字 | マスターデータ |
Result
型 | 説明 | |
---|---|---|
item | CurrentMissionMaster | 更新した現在有効なミッションマスター |
実装例
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.UpdateCurrentMissionMaster(
&mission.UpdateCurrentMissionMasterRequest {
NamespaceName: pointy.String("namespace1"),
Settings: pointy.String("{\n \"version\": \"2019-05-28\",\n \"groups\": [\n {\n \"name\": \"daily\",\n \"metadata\": \"DAILY\",\n \"tasks\": [\n {\n \"name\": \"quest_x10\",\n \"metadata\": \"QUEST_X10\",\n \"counterName\": \"quest_complete\",\n \"targetValue\": 10,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n }\n ]\n },\n {\n \"name\": \"quest_x20\",\n \"metadata\": \"QUEST_X20\",\n \"counterName\": \"quest_complete\",\n \"premiseMissionTaskName\": \"quest_x10\",\n \"targetValue\": 20,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n }\n ]\n },\n {\n \"name\": \"gacha\",\n \"metadata\": \"GACHA\",\n \"counterName\": \"lot_gacha\",\n \"targetValue\": 1,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n }\n ]\n }\n ],\n \"resetType\": \"daily\",\n \"resetHour\": 10\n },\n {\n \"name\": \"weekly\",\n \"metadata\": \"WEEKLY\",\n \"tasks\": [\n {\n \"name\": \"quest_x100\",\n \"metadata\": \"QUEST_X100\",\n \"counterName\": \"quest_complete\",\n \"targetValue\": 100,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n }\n ]\n },\n {\n \"name\": \"quest_x1000\",\n \"metadata\": \"QUEST_X1000\",\n \"counterName\": \"quest_complete\",\n \"premiseMissionTaskName\": \"quest_x100\",\n \"targetValue\": 1000,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n }\n ]\n }\n ],\n \"resetType\": \"weekly\",\n \"resetDayOfWeek\": \"monday\",\n \"resetHour\": 10\n },\n {\n \"name\": \"story\",\n \"metadata\": \"STORY\",\n \"tasks\": [\n {\n \"name\": \"quest_1-1\",\n \"metadata\": \"QUEST_1-1\",\n \"counterName\": \"quest1\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_1-2\",\n \"metadata\": \"QUEST_1-2\",\n \"counterName\": \"quest1\",\n \"premiseMissionTaskName\": \"quest_1-1\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_1-3\",\n \"metadata\": \"QUEST_1-3\",\n \"counterName\": \"quest1\",\n \"premiseMissionTaskName\": \"quest_1-2\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_1-4\",\n \"metadata\": \"QUEST_1-4\",\n \"counterName\": \"quest1\",\n \"premiseMissionTaskName\": \"quest_1-3\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_2-1\",\n \"metadata\": \"QUEST_2-1\",\n \"counterName\": \"quest2\",\n \"premiseMissionTaskName\": \"quest_1-4\",\n \"targetValue\": 1\n }\n ],\n \"resetType\": \"notReset\"\n }\n ],\n \"counters\": [\n {\n \"name\": \"quest_complete\",\n \"metadata\": \"QUEST_COMPLETE\",\n \"scopes\": [\n {\n \"resetType\": \"daily\",\n \"resetHour\": 5\n },\n {\n \"resetType\": \"weekly\",\n \"resetDayOfWeek\": \"monday\",\n \"resetHour\": 5\n }\n ]\n },\n {\n \"name\": \"lot_gacha\",\n \"metadata\": \"LOT_GACHA\",\n \"scopes\": [\n {\n \"resetType\": \"daily\",\n \"resetHour\": 5\n }\n ]\n },\n {\n \"name\": \"quest1\",\n \"metadata\": \"QUEST1\",\n \"scopes\": [\n {\n \"resetType\": \"notReset\"\n }\n ]\n },\n {\n \"name\": \"quest2\",\n \"metadata\": \"QUEST2\",\n \"scopes\": [\n {\n \"resetType\": \"notReset\"\n }\n ]\n }\n ]\n}"),
}
)
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\UpdateCurrentMissionMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCurrentMissionMaster(
(new UpdateCurrentMissionMasterRequest())
->withNamespaceName(self::namespace1)
->withSettings("{\n \"version\": \"2019-05-28\",\n \"groups\": [\n {\n \"name\": \"daily\",\n \"metadata\": \"DAILY\",\n \"tasks\": [\n {\n \"name\": \"quest_x10\",\n \"metadata\": \"QUEST_X10\",\n \"counterName\": \"quest_complete\",\n \"targetValue\": 10,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n }\n ]\n },\n {\n \"name\": \"quest_x20\",\n \"metadata\": \"QUEST_X20\",\n \"counterName\": \"quest_complete\",\n \"premiseMissionTaskName\": \"quest_x10\",\n \"targetValue\": 20,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n }\n ]\n },\n {\n \"name\": \"gacha\",\n \"metadata\": \"GACHA\",\n \"counterName\": \"lot_gacha\",\n \"targetValue\": 1,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n }\n ]\n }\n ],\n \"resetType\": \"daily\",\n \"resetHour\": 10\n },\n {\n \"name\": \"weekly\",\n \"metadata\": \"WEEKLY\",\n \"tasks\": [\n {\n \"name\": \"quest_x100\",\n \"metadata\": \"QUEST_X100\",\n \"counterName\": \"quest_complete\",\n \"targetValue\": 100,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n }\n ]\n },\n {\n \"name\": \"quest_x1000\",\n \"metadata\": \"QUEST_X1000\",\n \"counterName\": \"quest_complete\",\n \"premiseMissionTaskName\": \"quest_x100\",\n \"targetValue\": 1000,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n }\n ]\n }\n ],\n \"resetType\": \"weekly\",\n \"resetDayOfWeek\": \"monday\",\n \"resetHour\": 10\n },\n {\n \"name\": \"story\",\n \"metadata\": \"STORY\",\n \"tasks\": [\n {\n \"name\": \"quest_1-1\",\n \"metadata\": \"QUEST_1-1\",\n \"counterName\": \"quest1\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_1-2\",\n \"metadata\": \"QUEST_1-2\",\n \"counterName\": \"quest1\",\n \"premiseMissionTaskName\": \"quest_1-1\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_1-3\",\n \"metadata\": \"QUEST_1-3\",\n \"counterName\": \"quest1\",\n \"premiseMissionTaskName\": \"quest_1-2\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_1-4\",\n \"metadata\": \"QUEST_1-4\",\n \"counterName\": \"quest1\",\n \"premiseMissionTaskName\": \"quest_1-3\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_2-1\",\n \"metadata\": \"QUEST_2-1\",\n \"counterName\": \"quest2\",\n \"premiseMissionTaskName\": \"quest_1-4\",\n \"targetValue\": 1\n }\n ],\n \"resetType\": \"notReset\"\n }\n ],\n \"counters\": [\n {\n \"name\": \"quest_complete\",\n \"metadata\": \"QUEST_COMPLETE\",\n \"scopes\": [\n {\n \"resetType\": \"daily\",\n \"resetHour\": 5\n },\n {\n \"resetType\": \"weekly\",\n \"resetDayOfWeek\": \"monday\",\n \"resetHour\": 5\n }\n ]\n },\n {\n \"name\": \"lot_gacha\",\n \"metadata\": \"LOT_GACHA\",\n \"scopes\": [\n {\n \"resetType\": \"daily\",\n \"resetHour\": 5\n }\n ]\n },\n {\n \"name\": \"quest1\",\n \"metadata\": \"QUEST1\",\n \"scopes\": [\n {\n \"resetType\": \"notReset\"\n }\n ]\n },\n {\n \"name\": \"quest2\",\n \"metadata\": \"QUEST2\",\n \"scopes\": [\n {\n \"resetType\": \"notReset\"\n }\n ]\n }\n ]\n}")
);
$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.UpdateCurrentMissionMasterRequest;
import io.gs2.mission.result.UpdateCurrentMissionMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
UpdateCurrentMissionMasterResult result = client.updateCurrentMissionMaster(
new UpdateCurrentMissionMasterRequest()
.withNamespaceName("namespace1")
.withSettings("{\n \"version\": \"2019-05-28\",\n \"groups\": [\n {\n \"name\": \"daily\",\n \"metadata\": \"DAILY\",\n \"tasks\": [\n {\n \"name\": \"quest_x10\",\n \"metadata\": \"QUEST_X10\",\n \"counterName\": \"quest_complete\",\n \"targetValue\": 10,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n }\n ]\n },\n {\n \"name\": \"quest_x20\",\n \"metadata\": \"QUEST_X20\",\n \"counterName\": \"quest_complete\",\n \"premiseMissionTaskName\": \"quest_x10\",\n \"targetValue\": 20,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n }\n ]\n },\n {\n \"name\": \"gacha\",\n \"metadata\": \"GACHA\",\n \"counterName\": \"lot_gacha\",\n \"targetValue\": 1,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n }\n ]\n }\n ],\n \"resetType\": \"daily\",\n \"resetHour\": 10\n },\n {\n \"name\": \"weekly\",\n \"metadata\": \"WEEKLY\",\n \"tasks\": [\n {\n \"name\": \"quest_x100\",\n \"metadata\": \"QUEST_X100\",\n \"counterName\": \"quest_complete\",\n \"targetValue\": 100,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n }\n ]\n },\n {\n \"name\": \"quest_x1000\",\n \"metadata\": \"QUEST_X1000\",\n \"counterName\": \"quest_complete\",\n \"premiseMissionTaskName\": \"quest_x100\",\n \"targetValue\": 1000,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n }\n ]\n }\n ],\n \"resetType\": \"weekly\",\n \"resetDayOfWeek\": \"monday\",\n \"resetHour\": 10\n },\n {\n \"name\": \"story\",\n \"metadata\": \"STORY\",\n \"tasks\": [\n {\n \"name\": \"quest_1-1\",\n \"metadata\": \"QUEST_1-1\",\n \"counterName\": \"quest1\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_1-2\",\n \"metadata\": \"QUEST_1-2\",\n \"counterName\": \"quest1\",\n \"premiseMissionTaskName\": \"quest_1-1\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_1-3\",\n \"metadata\": \"QUEST_1-3\",\n \"counterName\": \"quest1\",\n \"premiseMissionTaskName\": \"quest_1-2\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_1-4\",\n \"metadata\": \"QUEST_1-4\",\n \"counterName\": \"quest1\",\n \"premiseMissionTaskName\": \"quest_1-3\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_2-1\",\n \"metadata\": \"QUEST_2-1\",\n \"counterName\": \"quest2\",\n \"premiseMissionTaskName\": \"quest_1-4\",\n \"targetValue\": 1\n }\n ],\n \"resetType\": \"notReset\"\n }\n ],\n \"counters\": [\n {\n \"name\": \"quest_complete\",\n \"metadata\": \"QUEST_COMPLETE\",\n \"scopes\": [\n {\n \"resetType\": \"daily\",\n \"resetHour\": 5\n },\n {\n \"resetType\": \"weekly\",\n \"resetDayOfWeek\": \"monday\",\n \"resetHour\": 5\n }\n ]\n },\n {\n \"name\": \"lot_gacha\",\n \"metadata\": \"LOT_GACHA\",\n \"scopes\": [\n {\n \"resetType\": \"daily\",\n \"resetHour\": 5\n }\n ]\n },\n {\n \"name\": \"quest1\",\n \"metadata\": \"QUEST1\",\n \"scopes\": [\n {\n \"resetType\": \"notReset\"\n }\n ]\n },\n {\n \"name\": \"quest2\",\n \"metadata\": \"QUEST2\",\n \"scopes\": [\n {\n \"resetType\": \"notReset\"\n }\n ]\n }\n ]\n}")
);
CurrentMissionMaster 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.UpdateCurrentMissionMasterRequest;
using Gs2.Gs2Mission.Result.UpdateCurrentMissionMasterResult;
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.UpdateCurrentMissionMasterResult> asyncResult = null;
yield return client.UpdateCurrentMissionMaster(
new Gs2.Gs2Mission.Request.UpdateCurrentMissionMasterRequest()
.WithNamespaceName("namespace1")
.WithSettings("{\n \"version\": \"2019-05-28\",\n \"groups\": [\n {\n \"name\": \"daily\",\n \"metadata\": \"DAILY\",\n \"tasks\": [\n {\n \"name\": \"quest_x10\",\n \"metadata\": \"QUEST_X10\",\n \"counterName\": \"quest_complete\",\n \"targetValue\": 10,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n }\n ]\n },\n {\n \"name\": \"quest_x20\",\n \"metadata\": \"QUEST_X20\",\n \"counterName\": \"quest_complete\",\n \"premiseMissionTaskName\": \"quest_x10\",\n \"targetValue\": 20,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n }\n ]\n },\n {\n \"name\": \"gacha\",\n \"metadata\": \"GACHA\",\n \"counterName\": \"lot_gacha\",\n \"targetValue\": 1,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n }\n ]\n }\n ],\n \"resetType\": \"daily\",\n \"resetHour\": 10\n },\n {\n \"name\": \"weekly\",\n \"metadata\": \"WEEKLY\",\n \"tasks\": [\n {\n \"name\": \"quest_x100\",\n \"metadata\": \"QUEST_X100\",\n \"counterName\": \"quest_complete\",\n \"targetValue\": 100,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n }\n ]\n },\n {\n \"name\": \"quest_x1000\",\n \"metadata\": \"QUEST_X1000\",\n \"counterName\": \"quest_complete\",\n \"premiseMissionTaskName\": \"quest_x100\",\n \"targetValue\": 1000,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n }\n ]\n }\n ],\n \"resetType\": \"weekly\",\n \"resetDayOfWeek\": \"monday\",\n \"resetHour\": 10\n },\n {\n \"name\": \"story\",\n \"metadata\": \"STORY\",\n \"tasks\": [\n {\n \"name\": \"quest_1-1\",\n \"metadata\": \"QUEST_1-1\",\n \"counterName\": \"quest1\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_1-2\",\n \"metadata\": \"QUEST_1-2\",\n \"counterName\": \"quest1\",\n \"premiseMissionTaskName\": \"quest_1-1\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_1-3\",\n \"metadata\": \"QUEST_1-3\",\n \"counterName\": \"quest1\",\n \"premiseMissionTaskName\": \"quest_1-2\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_1-4\",\n \"metadata\": \"QUEST_1-4\",\n \"counterName\": \"quest1\",\n \"premiseMissionTaskName\": \"quest_1-3\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_2-1\",\n \"metadata\": \"QUEST_2-1\",\n \"counterName\": \"quest2\",\n \"premiseMissionTaskName\": \"quest_1-4\",\n \"targetValue\": 1\n }\n ],\n \"resetType\": \"notReset\"\n }\n ],\n \"counters\": [\n {\n \"name\": \"quest_complete\",\n \"metadata\": \"QUEST_COMPLETE\",\n \"scopes\": [\n {\n \"resetType\": \"daily\",\n \"resetHour\": 5\n },\n {\n \"resetType\": \"weekly\",\n \"resetDayOfWeek\": \"monday\",\n \"resetHour\": 5\n }\n ]\n },\n {\n \"name\": \"lot_gacha\",\n \"metadata\": \"LOT_GACHA\",\n \"scopes\": [\n {\n \"resetType\": \"daily\",\n \"resetHour\": 5\n }\n ]\n },\n {\n \"name\": \"quest1\",\n \"metadata\": \"QUEST1\",\n \"scopes\": [\n {\n \"resetType\": \"notReset\"\n }\n ]\n },\n {\n \"name\": \"quest2\",\n \"metadata\": \"QUEST2\",\n \"scopes\": [\n {\n \"resetType\": \"notReset\"\n }\n ]\n }\n ]\n}"),
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.updateCurrentMissionMaster(
new Gs2Mission.UpdateCurrentMissionMasterRequest()
.withNamespaceName("namespace1")
.withSettings("{\n \"version\": \"2019-05-28\",\n \"groups\": [\n {\n \"name\": \"daily\",\n \"metadata\": \"DAILY\",\n \"tasks\": [\n {\n \"name\": \"quest_x10\",\n \"metadata\": \"QUEST_X10\",\n \"counterName\": \"quest_complete\",\n \"targetValue\": 10,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n }\n ]\n },\n {\n \"name\": \"quest_x20\",\n \"metadata\": \"QUEST_X20\",\n \"counterName\": \"quest_complete\",\n \"premiseMissionTaskName\": \"quest_x10\",\n \"targetValue\": 20,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n }\n ]\n },\n {\n \"name\": \"gacha\",\n \"metadata\": \"GACHA\",\n \"counterName\": \"lot_gacha\",\n \"targetValue\": 1,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n }\n ]\n }\n ],\n \"resetType\": \"daily\",\n \"resetHour\": 10\n },\n {\n \"name\": \"weekly\",\n \"metadata\": \"WEEKLY\",\n \"tasks\": [\n {\n \"name\": \"quest_x100\",\n \"metadata\": \"QUEST_X100\",\n \"counterName\": \"quest_complete\",\n \"targetValue\": 100,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n }\n ]\n },\n {\n \"name\": \"quest_x1000\",\n \"metadata\": \"QUEST_X1000\",\n \"counterName\": \"quest_complete\",\n \"premiseMissionTaskName\": \"quest_x100\",\n \"targetValue\": 1000,\n \"completeAcquireActions\": [\n {\n \"action\": \"Gs2Experience:AddExperienceByUserId\",\n \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n }\n ]\n }\n ],\n \"resetType\": \"weekly\",\n \"resetDayOfWeek\": \"monday\",\n \"resetHour\": 10\n },\n {\n \"name\": \"story\",\n \"metadata\": \"STORY\",\n \"tasks\": [\n {\n \"name\": \"quest_1-1\",\n \"metadata\": \"QUEST_1-1\",\n \"counterName\": \"quest1\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_1-2\",\n \"metadata\": \"QUEST_1-2\",\n \"counterName\": \"quest1\",\n \"premiseMissionTaskName\": \"quest_1-1\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_1-3\",\n \"metadata\": \"QUEST_1-3\",\n \"counterName\": \"quest1\",\n \"premiseMissionTaskName\": \"quest_1-2\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_1-4\",\n \"metadata\": \"QUEST_1-4\",\n \"counterName\": \"quest1\",\n \"premiseMissionTaskName\": \"quest_1-3\",\n \"targetValue\": 1\n },\n {\n \"name\": \"quest_2-1\",\n \"metadata\": \"QUEST_2-1\",\n \"counterName\": \"quest2\",\n \"premiseMissionTaskName\": \"quest_1-4\",\n \"targetValue\": 1\n }\n ],\n \"resetType\": \"notReset\"\n }\n ],\n \"counters\": [\n {\n \"name\": \"quest_complete\",\n \"metadata\": \"QUEST_COMPLETE\",\n \"scopes\": [\n {\n \"resetType\": \"daily\",\n \"resetHour\": 5\n },\n {\n \"resetType\": \"weekly\",\n \"resetDayOfWeek\": \"monday\",\n \"resetHour\": 5\n }\n ]\n },\n {\n \"name\": \"lot_gacha\",\n \"metadata\": \"LOT_GACHA\",\n \"scopes\": [\n {\n \"resetType\": \"daily\",\n \"resetHour\": 5\n }\n ]\n },\n {\n \"name\": \"quest1\",\n \"metadata\": \"QUEST1\",\n \"scopes\": [\n {\n \"resetType\": \"notReset\"\n }\n ]\n },\n {\n \"name\": \"quest2\",\n \"metadata\": \"QUEST2\",\n \"scopes\": [\n {\n \"resetType\": \"notReset\"\n }\n ]\n }\n ]\n}")
);
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.update_current_mission_master(
mission.UpdateCurrentMissionMasterRequest()
.with_namespace_name(self.hash1)
.with_settings('{\n "version": "2019-05-28",\n "groups": [\n {\n "name": "daily",\n "metadata": "DAILY",\n "tasks": [\n {\n "name": "quest_x10",\n "metadata": "QUEST_X10",\n "counterName": "quest_complete",\n "targetValue": 10,\n "completeAcquireActions": [\n {\n "action": "Gs2Experience:AddExperienceByUserId",\n "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 10}"\n }\n ]\n },\n {\n "name": "quest_x20",\n "metadata": "QUEST_X20",\n "counterName": "quest_complete",\n "premiseMissionTaskName": "quest_x10",\n "targetValue": 20,\n "completeAcquireActions": [\n {\n "action": "Gs2Experience:AddExperienceByUserId",\n "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 20}"\n }\n ]\n },\n {\n "name": "gacha",\n "metadata": "GACHA",\n "counterName": "lot_gacha",\n "targetValue": 1,\n "completeAcquireActions": [\n {\n "action": "Gs2Experience:AddExperienceByUserId",\n "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 30}"\n }\n ]\n }\n ],\n "resetType": "daily",\n "resetHour": 10\n },\n {\n "name": "weekly",\n "metadata": "WEEKLY",\n "tasks": [\n {\n "name": "quest_x100",\n "metadata": "QUEST_X100",\n "counterName": "quest_complete",\n "targetValue": 100,\n "completeAcquireActions": [\n {\n "action": "Gs2Experience:AddExperienceByUserId",\n "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 40}"\n }\n ]\n },\n {\n "name": "quest_x1000",\n "metadata": "QUEST_X1000",\n "counterName": "quest_complete",\n "premiseMissionTaskName": "quest_x100",\n "targetValue": 1000,\n "completeAcquireActions": [\n {\n "action": "Gs2Experience:AddExperienceByUserId",\n "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 50}"\n }\n ]\n }\n ],\n "resetType": "weekly",\n "resetDayOfWeek": "monday",\n "resetHour": 10\n },\n {\n "name": "story",\n "metadata": "STORY",\n "tasks": [\n {\n "name": "quest_1-1",\n "metadata": "QUEST_1-1",\n "counterName": "quest1",\n "targetValue": 1\n },\n {\n "name": "quest_1-2",\n "metadata": "QUEST_1-2",\n "counterName": "quest1",\n "premiseMissionTaskName": "quest_1-1",\n "targetValue": 1\n },\n {\n "name": "quest_1-3",\n "metadata": "QUEST_1-3",\n "counterName": "quest1",\n "premiseMissionTaskName": "quest_1-2",\n "targetValue": 1\n },\n {\n "name": "quest_1-4",\n "metadata": "QUEST_1-4",\n "counterName": "quest1",\n "premiseMissionTaskName": "quest_1-3",\n "targetValue": 1\n },\n {\n "name": "quest_2-1",\n "metadata": "QUEST_2-1",\n "counterName": "quest2",\n "premiseMissionTaskName": "quest_1-4",\n "targetValue": 1\n }\n ],\n "resetType": "notReset"\n }\n ],\n "counters": [\n {\n "name": "quest_complete",\n "metadata": "QUEST_COMPLETE",\n "scopes": [\n {\n "resetType": "daily",\n "resetHour": 5\n },\n {\n "resetType": "weekly",\n "resetDayOfWeek": "monday",\n "resetHour": 5\n }\n ]\n },\n {\n "name": "lot_gacha",\n "metadata": "LOT_GACHA",\n "scopes": [\n {\n "resetType": "daily",\n "resetHour": 5\n }\n ]\n },\n {\n "name": "quest1",\n "metadata": "QUEST1",\n "scopes": [\n {\n "resetType": "notReset"\n }\n ]\n },\n {\n "name": "quest2",\n "metadata": "QUEST2",\n "scopes": [\n {\n "resetType": "notReset"\n }\n ]\n }\n ]\n}')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.update_current_mission_master({
namespaceName="namespace1",
settings="{\n "version": "2019-05-28",\n "groups": [\n {\n "name": "daily",\n "metadata": "DAILY",\n "tasks": [\n {\n "name": "quest_x10",\n "metadata": "QUEST_X10",\n "counterName": "quest_complete",\n "targetValue": 10,\n "completeAcquireActions": [\n {\n "action": "Gs2Experience:AddExperienceByUserId",\n "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 10}"\n }\n ]\n },\n {\n "name": "quest_x20",\n "metadata": "QUEST_X20",\n "counterName": "quest_complete",\n "premiseMissionTaskName": "quest_x10",\n "targetValue": 20,\n "completeAcquireActions": [\n {\n "action": "Gs2Experience:AddExperienceByUserId",\n "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 20}"\n }\n ]\n },\n {\n "name": "gacha",\n "metadata": "GACHA",\n "counterName": "lot_gacha",\n "targetValue": 1,\n "completeAcquireActions": [\n {\n "action": "Gs2Experience:AddExperienceByUserId",\n "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 30}"\n }\n ]\n }\n ],\n "resetType": "daily",\n "resetHour": 10\n },\n {\n "name": "weekly",\n "metadata": "WEEKLY",\n "tasks": [\n {\n "name": "quest_x100",\n "metadata": "QUEST_X100",\n "counterName": "quest_complete",\n "targetValue": 100,\n "completeAcquireActions": [\n {\n "action": "Gs2Experience:AddExperienceByUserId",\n "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 40}"\n }\n ]\n },\n {\n "name": "quest_x1000",\n "metadata": "QUEST_X1000",\n "counterName": "quest_complete",\n "premiseMissionTaskName": "quest_x100",\n "targetValue": 1000,\n "completeAcquireActions": [\n {\n "action": "Gs2Experience:AddExperienceByUserId",\n "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 50}"\n }\n ]\n }\n ],\n "resetType": "weekly",\n "resetDayOfWeek": "monday",\n "resetHour": 10\n },\n {\n "name": "story",\n "metadata": "STORY",\n "tasks": [\n {\n "name": "quest_1-1",\n "metadata": "QUEST_1-1",\n "counterName": "quest1",\n "targetValue": 1\n },\n {\n "name": "quest_1-2",\n "metadata": "QUEST_1-2",\n "counterName": "quest1",\n "premiseMissionTaskName": "quest_1-1",\n "targetValue": 1\n },\n {\n "name": "quest_1-3",\n "metadata": "QUEST_1-3",\n "counterName": "quest1",\n "premiseMissionTaskName": "quest_1-2",\n "targetValue": 1\n },\n {\n "name": "quest_1-4",\n "metadata": "QUEST_1-4",\n "counterName": "quest1",\n "premiseMissionTaskName": "quest_1-3",\n "targetValue": 1\n },\n {\n "name": "quest_2-1",\n "metadata": "QUEST_2-1",\n "counterName": "quest2",\n "premiseMissionTaskName": "quest_1-4",\n "targetValue": 1\n }\n ],\n "resetType": "notReset"\n }\n ],\n "counters": [\n {\n "name": "quest_complete",\n "metadata": "QUEST_COMPLETE",\n "scopes": [\n {\n "resetType": "daily",\n "resetHour": 5\n },\n {\n "resetType": "weekly",\n "resetDayOfWeek": "monday",\n "resetHour": 5\n }\n ]\n },\n {\n "name": "lot_gacha",\n "metadata": "LOT_GACHA",\n "scopes": [\n {\n "resetType": "daily",\n "resetHour": 5\n }\n ]\n },\n {\n "name": "quest1",\n "metadata": "QUEST1",\n "scopes": [\n {\n "resetType": "notReset"\n }\n ]\n },\n {\n "name": "quest2",\n "metadata": "QUEST2",\n "scopes": [\n {\n "resetType": "notReset"\n }\n ]\n }\n ]\n}",
})
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.update_current_mission_master_async({
namespaceName="namespace1",
settings="{\n "version": "2019-05-28",\n "groups": [\n {\n "name": "daily",\n "metadata": "DAILY",\n "tasks": [\n {\n "name": "quest_x10",\n "metadata": "QUEST_X10",\n "counterName": "quest_complete",\n "targetValue": 10,\n "completeAcquireActions": [\n {\n "action": "Gs2Experience:AddExperienceByUserId",\n "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 10}"\n }\n ]\n },\n {\n "name": "quest_x20",\n "metadata": "QUEST_X20",\n "counterName": "quest_complete",\n "premiseMissionTaskName": "quest_x10",\n "targetValue": 20,\n "completeAcquireActions": [\n {\n "action": "Gs2Experience:AddExperienceByUserId",\n "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 20}"\n }\n ]\n },\n {\n "name": "gacha",\n "metadata": "GACHA",\n "counterName": "lot_gacha",\n "targetValue": 1,\n "completeAcquireActions": [\n {\n "action": "Gs2Experience:AddExperienceByUserId",\n "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 30}"\n }\n ]\n }\n ],\n "resetType": "daily",\n "resetHour": 10\n },\n {\n "name": "weekly",\n "metadata": "WEEKLY",\n "tasks": [\n {\n "name": "quest_x100",\n "metadata": "QUEST_X100",\n "counterName": "quest_complete",\n "targetValue": 100,\n "completeAcquireActions": [\n {\n "action": "Gs2Experience:AddExperienceByUserId",\n "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 40}"\n }\n ]\n },\n {\n "name": "quest_x1000",\n "metadata": "QUEST_X1000",\n "counterName": "quest_complete",\n "premiseMissionTaskName": "quest_x100",\n "targetValue": 1000,\n "completeAcquireActions": [\n {\n "action": "Gs2Experience:AddExperienceByUserId",\n "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 50}"\n }\n ]\n }\n ],\n "resetType": "weekly",\n "resetDayOfWeek": "monday",\n "resetHour": 10\n },\n {\n "name": "story",\n "metadata": "STORY",\n "tasks": [\n {\n "name": "quest_1-1",\n "metadata": "QUEST_1-1",\n "counterName": "quest1",\n "targetValue": 1\n },\n {\n "name": "quest_1-2",\n "metadata": "QUEST_1-2",\n "counterName": "quest1",\n "premiseMissionTaskName": "quest_1-1",\n "targetValue": 1\n },\n {\n "name": "quest_1-3",\n "metadata": "QUEST_1-3",\n "counterName": "quest1",\n "premiseMissionTaskName": "quest_1-2",\n "targetValue": 1\n },\n {\n "name": "quest_1-4",\n "metadata": "QUEST_1-4",\n "counterName": "quest1",\n "premiseMissionTaskName": "quest_1-3",\n "targetValue": 1\n },\n {\n "name": "quest_2-1",\n "metadata": "QUEST_2-1",\n "counterName": "quest2",\n "premiseMissionTaskName": "quest_1-4",\n "targetValue": 1\n }\n ],\n "resetType": "notReset"\n }\n ],\n "counters": [\n {\n "name": "quest_complete",\n "metadata": "QUEST_COMPLETE",\n "scopes": [\n {\n "resetType": "daily",\n "resetHour": 5\n },\n {\n "resetType": "weekly",\n "resetDayOfWeek": "monday",\n "resetHour": 5\n }\n ]\n },\n {\n "name": "lot_gacha",\n "metadata": "LOT_GACHA",\n "scopes": [\n {\n "resetType": "daily",\n "resetHour": 5\n }\n ]\n },\n {\n "name": "quest1",\n "metadata": "QUEST1",\n "scopes": [\n {\n "resetType": "notReset"\n }\n ]\n },\n {\n "name": "quest2",\n "metadata": "QUEST2",\n "scopes": [\n {\n "resetType": "notReset"\n }\n ]\n }\n ]\n}",
})
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;
updateCurrentMissionMasterFromGitHub
現在有効なミッションマスターを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
checkoutSetting | GitHubCheckoutSetting | ✓ | GitHubからマスターデータをチェックアウトしてくる設定 |
Result
型 | 説明 | |
---|---|---|
item | CurrentMissionMaster | 更新した現在有効なミッションマスター |
実装例
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.UpdateCurrentMissionMasterFromGitHub(
&mission.UpdateCurrentMissionMasterFromGitHubRequest {
NamespaceName: pointy.String("namespace1"),
CheckoutSetting: &mission.GitHubCheckoutSetting{
ApiKeyId: pointy.String("$gitHubApiKey1.apiKeyId"),
RepositoryName: pointy.String("gs2io/master-data"),
SourcePath: pointy.String("path/to/file.json"),
ReferenceType: pointy.String("branch"),
BranchName: pointy.String("develop"),
},
}
)
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\UpdateCurrentMissionMasterFromGitHubRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCurrentMissionMasterFromGitHub(
(new UpdateCurrentMissionMasterFromGitHubRequest())
->withNamespaceName(self::namespace1)
->withCheckoutSetting((new GitHubCheckoutSetting())
->withApiKeyId(self::$gitHubApiKey1.apiKeyId)
->withRepositoryName("gs2io/master-data")
->withSourcePath("path/to/file.json")
->withReferenceType("branch")
->withBranchName("develop")
)
);
$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.UpdateCurrentMissionMasterFromGitHubRequest;
import io.gs2.mission.result.UpdateCurrentMissionMasterFromGitHubResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
UpdateCurrentMissionMasterFromGitHubResult result = client.updateCurrentMissionMasterFromGitHub(
new UpdateCurrentMissionMasterFromGitHubRequest()
.withNamespaceName("namespace1")
.withCheckoutSetting(new GitHubCheckoutSetting()
.withApiKeyId("$gitHubApiKey1.apiKeyId")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
CurrentMissionMaster 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.UpdateCurrentMissionMasterFromGitHubRequest;
using Gs2.Gs2Mission.Result.UpdateCurrentMissionMasterFromGitHubResult;
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.UpdateCurrentMissionMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentMissionMasterFromGitHub(
new Gs2.Gs2Mission.Request.UpdateCurrentMissionMasterFromGitHubRequest()
.WithNamespaceName("namespace1")
.WithCheckoutSetting(new Gs2.Gs2Mission.Model.GitHubCheckoutSetting()
.WithApiKeyId("$gitHubApiKey1.apiKeyId")
.WithRepositoryName("gs2io/master-data")
.WithSourcePath("path/to/file.json")
.WithReferenceType("branch")
.WithBranchName("develop")
),
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.updateCurrentMissionMasterFromGitHub(
new Gs2Mission.UpdateCurrentMissionMasterFromGitHubRequest()
.withNamespaceName("namespace1")
.withCheckoutSetting(new Gs2Mission.model.GitHubCheckoutSetting()
.withApiKeyId("$gitHubApiKey1.apiKeyId")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
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.update_current_mission_master_from_git_hub(
mission.UpdateCurrentMissionMasterFromGitHubRequest()
.with_namespace_name(self.hash1)
.with_checkout_setting(mission.GitHubCheckoutSetting()
.with_api_key_id(self.git_hub_api_key1.api_key_id)
.with_repository_name('gs2io/master-data')
.with_source_path('path/to/file.json')
.with_reference_type('branch')
.with_branch_name('develop')
)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.update_current_mission_master_from_git_hub({
namespaceName="namespace1",
checkoutSetting={
api_key_id="$gitHubApiKey1.apiKeyId",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
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.update_current_mission_master_from_git_hub_async({
namespaceName="namespace1",
checkoutSetting={
api_key_id="$gitHubApiKey1.apiKeyId",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
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;
describeCounterModels
カウンターモデルの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
items | List<CounterModel> | カウンターモデルのリスト |
実装例
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.DescribeCounterModels(
&mission.DescribeCounterModelsRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
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\DescribeCounterModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeCounterModels(
(new DescribeCounterModelsRequest())
->withNamespaceName(self::namespace1)
);
$items = $result->getItems();
} 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.DescribeCounterModelsRequest;
import io.gs2.mission.result.DescribeCounterModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DescribeCounterModelsResult result = client.describeCounterModels(
new DescribeCounterModelsRequest()
.withNamespaceName("namespace1")
);
List<CounterModel> items = result.getItems();
} 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.DescribeCounterModelsRequest;
using Gs2.Gs2Mission.Result.DescribeCounterModelsResult;
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.DescribeCounterModelsResult> asyncResult = null;
yield return client.DescribeCounterModels(
new Gs2.Gs2Mission.Request.DescribeCounterModelsRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
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.describeCounterModels(
new Gs2Mission.DescribeCounterModelsRequest()
.withNamespaceName("namespace1")
);
const items = result.getItems();
} 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_counter_models(
mission.DescribeCounterModelsRequest()
.with_namespace_name(self.hash1)
)
items = result.items
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.describe_counter_models({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
client = gs2('mission')
api_result_handler = client.describe_counter_models_async({
namespaceName="namespace1",
})
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;
getCounterModel
カウンターモデルを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
counterName | string | ✓ | ~ 128文字 | カウンター名 |
Result
型 | 説明 | |
---|---|---|
item | CounterModel | カウンターモデル |
実装例
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.GetCounterModel(
&mission.GetCounterModelRequest {
NamespaceName: pointy.String("namespace1"),
CounterName: pointy.String("counter-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\GetCounterModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getCounterModel(
(new GetCounterModelRequest())
->withNamespaceName(self::namespace1)
->withCounterName("counter-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.GetCounterModelRequest;
import io.gs2.mission.result.GetCounterModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
GetCounterModelResult result = client.getCounterModel(
new GetCounterModelRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
);
CounterModel 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.GetCounterModelRequest;
using Gs2.Gs2Mission.Result.GetCounterModelResult;
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.GetCounterModelResult> asyncResult = null;
yield return client.GetCounterModel(
new Gs2.Gs2Mission.Request.GetCounterModelRequest()
.WithNamespaceName("namespace1")
.WithCounterName("counter-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.getCounterModel(
new Gs2Mission.GetCounterModelRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-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_counter_model(
mission.GetCounterModelRequest()
.with_namespace_name(self.hash1)
.with_counter_name('counter-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.get_counter_model({
namespaceName="namespace1",
counterName="counter-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_counter_model_async({
namespaceName="namespace1",
counterName="counter-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;
describeMissionGroupModels
ミッショングループモデルの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
items | List<MissionGroupModel> | ミッショングループモデルのリスト |
実装例
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.DescribeMissionGroupModels(
&mission.DescribeMissionGroupModelsRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
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\DescribeMissionGroupModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeMissionGroupModels(
(new DescribeMissionGroupModelsRequest())
->withNamespaceName(self::namespace1)
);
$items = $result->getItems();
} 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.DescribeMissionGroupModelsRequest;
import io.gs2.mission.result.DescribeMissionGroupModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DescribeMissionGroupModelsResult result = client.describeMissionGroupModels(
new DescribeMissionGroupModelsRequest()
.withNamespaceName("namespace1")
);
List<MissionGroupModel> items = result.getItems();
} 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.DescribeMissionGroupModelsRequest;
using Gs2.Gs2Mission.Result.DescribeMissionGroupModelsResult;
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.DescribeMissionGroupModelsResult> asyncResult = null;
yield return client.DescribeMissionGroupModels(
new Gs2.Gs2Mission.Request.DescribeMissionGroupModelsRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
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.describeMissionGroupModels(
new Gs2Mission.DescribeMissionGroupModelsRequest()
.withNamespaceName("namespace1")
);
const items = result.getItems();
} 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_mission_group_models(
mission.DescribeMissionGroupModelsRequest()
.with_namespace_name(self.hash1)
)
items = result.items
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.describe_mission_group_models({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
client = gs2('mission')
api_result_handler = client.describe_mission_group_models_async({
namespaceName="namespace1",
})
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;
getMissionGroupModel
ミッショングループモデルを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 |
Result
型 | 説明 | |
---|---|---|
item | MissionGroupModel | ミッショングループモデル |
実装例
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.GetMissionGroupModel(
&mission.GetMissionGroupModelRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-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\GetMissionGroupModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getMissionGroupModel(
(new GetMissionGroupModelRequest())
->withNamespaceName(self::namespace1)
->withMissionGroupName("mission-group-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.GetMissionGroupModelRequest;
import io.gs2.mission.result.GetMissionGroupModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
GetMissionGroupModelResult result = client.getMissionGroupModel(
new GetMissionGroupModelRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
);
MissionGroupModel 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.GetMissionGroupModelRequest;
using Gs2.Gs2Mission.Result.GetMissionGroupModelResult;
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.GetMissionGroupModelResult> asyncResult = null;
yield return client.GetMissionGroupModel(
new Gs2.Gs2Mission.Request.GetMissionGroupModelRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-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.getMissionGroupModel(
new Gs2Mission.GetMissionGroupModelRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-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_mission_group_model(
mission.GetMissionGroupModelRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.get_mission_group_model({
namespaceName="namespace1",
missionGroupName="mission-group-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_mission_group_model_async({
namespaceName="namespace1",
missionGroupName="mission-group-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;
describeMissionTaskModels
ミッションタスクモデルの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 |
Result
型 | 説明 | |
---|---|---|
items | List<MissionTaskModel> | ミッションタスクモデルのリスト |
実装例
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.DescribeMissionTaskModels(
&mission.DescribeMissionTaskModelsRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-0001"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
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\DescribeMissionTaskModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeMissionTaskModels(
(new DescribeMissionTaskModelsRequest())
->withNamespaceName(self::namespace1)
->withMissionGroupName("mission-group-0001")
);
$items = $result->getItems();
} 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.DescribeMissionTaskModelsRequest;
import io.gs2.mission.result.DescribeMissionTaskModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DescribeMissionTaskModelsResult result = client.describeMissionTaskModels(
new DescribeMissionTaskModelsRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
);
List<MissionTaskModel> items = result.getItems();
} 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.DescribeMissionTaskModelsRequest;
using Gs2.Gs2Mission.Result.DescribeMissionTaskModelsResult;
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.DescribeMissionTaskModelsResult> asyncResult = null;
yield return client.DescribeMissionTaskModels(
new Gs2.Gs2Mission.Request.DescribeMissionTaskModelsRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
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.describeMissionTaskModels(
new Gs2Mission.DescribeMissionTaskModelsRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
);
const items = result.getItems();
} 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_mission_task_models(
mission.DescribeMissionTaskModelsRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-0001')
)
items = result.items
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.describe_mission_task_models({
namespaceName="namespace1",
missionGroupName="mission-group-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
client = gs2('mission')
api_result_handler = client.describe_mission_task_models_async({
namespaceName="namespace1",
missionGroupName="mission-group-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
items = result.items;
getMissionTaskModel
ミッションタスクモデルを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
missionTaskName | string | ✓ | ~ 128文字 | タスク名 |
Result
型 | 説明 | |
---|---|---|
item | MissionTaskModel | ミッションタスクモデル |
実装例
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.GetMissionTaskModel(
&mission.GetMissionTaskModelRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-0001"),
MissionTaskName: pointy.String("mission-task-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\GetMissionTaskModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getMissionTaskModel(
(new GetMissionTaskModelRequest())
->withNamespaceName(self::namespace1)
->withMissionGroupName("mission-group-0001")
->withMissionTaskName("mission-task-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.GetMissionTaskModelRequest;
import io.gs2.mission.result.GetMissionTaskModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
GetMissionTaskModelResult result = client.getMissionTaskModel(
new GetMissionTaskModelRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMissionTaskName("mission-task-0001")
);
MissionTaskModel 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.GetMissionTaskModelRequest;
using Gs2.Gs2Mission.Result.GetMissionTaskModelResult;
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.GetMissionTaskModelResult> asyncResult = null;
yield return client.GetMissionTaskModel(
new Gs2.Gs2Mission.Request.GetMissionTaskModelRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-0001")
.WithMissionTaskName("mission-task-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.getMissionTaskModel(
new Gs2Mission.GetMissionTaskModelRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMissionTaskName("mission-task-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_mission_task_model(
mission.GetMissionTaskModelRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-0001')
.with_mission_task_name('mission-task-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.get_mission_task_model({
namespaceName="namespace1",
missionGroupName="mission-group-0001",
missionTaskName="mission-task-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_mission_task_model_async({
namespaceName="namespace1",
missionGroupName="mission-group-0001",
missionTaskName="mission-task-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;
describeMissionTaskModelMasters
ミッションタスクマスターの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<MissionTaskModelMaster> | ミッションタスクマスターのリスト |
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.DescribeMissionTaskModelMasters(
&mission.DescribeMissionTaskModelMastersRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-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\DescribeMissionTaskModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeMissionTaskModelMasters(
(new DescribeMissionTaskModelMastersRequest())
->withNamespaceName(self::namespace1)
->withMissionGroupName("mission-group-0001")
->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.DescribeMissionTaskModelMastersRequest;
import io.gs2.mission.result.DescribeMissionTaskModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DescribeMissionTaskModelMastersResult result = client.describeMissionTaskModelMasters(
new DescribeMissionTaskModelMastersRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withPageToken(null)
.withLimit(null)
);
List<MissionTaskModelMaster> 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.DescribeMissionTaskModelMastersRequest;
using Gs2.Gs2Mission.Result.DescribeMissionTaskModelMastersResult;
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.DescribeMissionTaskModelMastersResult> asyncResult = null;
yield return client.DescribeMissionTaskModelMasters(
new Gs2.Gs2Mission.Request.DescribeMissionTaskModelMastersRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-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.describeMissionTaskModelMasters(
new Gs2Mission.DescribeMissionTaskModelMastersRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-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_mission_task_model_masters(
mission.DescribeMissionTaskModelMastersRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-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_mission_task_model_masters({
namespaceName="namespace1",
missionGroupName="mission-group-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_mission_task_model_masters_async({
namespaceName="namespace1",
missionGroupName="mission-group-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;
createMissionTaskModelMaster
ミッションタスクマスターを新規作成
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
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文字 | このタスクに挑戦するために達成しておく必要のあるタスクの名前 | |||
counterName | string | ✓ | ~ 128文字 | カウンター名 | ||
targetResetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | ~ 128文字 | 目標リセットタイミング | |||
targetValue | long | ✓ | 1 ~ 9223372036854775805 | 目標値 |
verifyCompleteType に指定する列挙型の定義
定義 | 説明 |
---|---|
counter | カウンター |
verifyActions | 検証アクション |
targetResetType に指定する列挙型の定義
定義 | 説明 |
---|---|
notReset | リセットしない |
daily | 毎日 |
weekly | 毎週 |
monthly | 毎月 |
Result
型 | 説明 | |
---|---|---|
item | MissionTaskModelMaster | 作成したミッションタスクマスター |
実装例
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.CreateMissionTaskModelMaster(
&mission.CreateMissionTaskModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-0001"),
Name: pointy.String("mission-task-0001"),
Metadata: nil,
Description: nil,
VerifyCompleteType: pointy.String("counter"),
TargetCounter: &mission.TargetCounterModel{
CounterName: pointy.String("counter-0001"),
Value: pointy.Int64(10),
},
VerifyCompleteConsumeActions: nil,
CompleteAcquireActions: []mission.AcquireAction{
mission.AcquireAction{
Action: pointy.String("Gs2Experience:AddExperienceByUserId"),
Request: pointy.String("Gs2Experience:AddExperienceByUserId-request1"),
},
},
ChallengePeriodEventId: nil,
PremiseMissionTaskName: 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\CreateMissionTaskModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createMissionTaskModelMaster(
(new CreateMissionTaskModelMasterRequest())
->withNamespaceName(self::namespace1)
->withMissionGroupName("mission-group-0001")
->withName("mission-task-0001")
->withMetadata(null)
->withDescription(null)
->withVerifyCompleteType("counter")
->withTargetCounter((new \Gs2\Mission\Model\TargetCounterModel())
->withCounterName("counter-0001")
->withValue(10))
->withVerifyCompleteConsumeActions(null)
->withCompleteAcquireActions([
(new \Gs2\Mission\Model\AcquireAction())
->withAction("Gs2Experience:AddExperienceByUserId")
->withRequest("Gs2Experience:AddExperienceByUserId-request1"),
])
->withChallengePeriodEventId(null)
->withPremiseMissionTaskName(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.CreateMissionTaskModelMasterRequest;
import io.gs2.mission.result.CreateMissionTaskModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
CreateMissionTaskModelMasterResult result = client.createMissionTaskModelMaster(
new CreateMissionTaskModelMasterRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withName("mission-task-0001")
.withMetadata(null)
.withDescription(null)
.withVerifyCompleteType("counter")
.withTargetCounter(new io.gs2.mission.model.TargetCounterModel()
.withCounterName("counter-0001")
.withValue(10L))
.withVerifyCompleteConsumeActions(null)
.withCompleteAcquireActions(Arrays.asList(
new io.gs2.mission.model.AcquireAction()
.withAction("Gs2Experience:AddExperienceByUserId")
.withRequest("Gs2Experience:AddExperienceByUserId-request1")
))
.withChallengePeriodEventId(null)
.withPremiseMissionTaskName(null)
);
MissionTaskModelMaster 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.CreateMissionTaskModelMasterRequest;
using Gs2.Gs2Mission.Result.CreateMissionTaskModelMasterResult;
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.CreateMissionTaskModelMasterResult> asyncResult = null;
yield return client.CreateMissionTaskModelMaster(
new Gs2.Gs2Mission.Request.CreateMissionTaskModelMasterRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-0001")
.WithName("mission-task-0001")
.WithMetadata(null)
.WithDescription(null)
.WithVerifyCompleteType("counter")
.WithTargetCounter(new Gs2.Gs2Mission.Model.TargetCounterModel()
.WithCounterName("counter-0001")
.WithValue(10L))
.WithVerifyCompleteConsumeActions(null)
.WithCompleteAcquireActions(new Gs2.Core.Model.AcquireAction[] {
new Gs2.Core.Model.AcquireAction()
.WithAction("Gs2Experience:AddExperienceByUserId")
.WithRequest("Gs2Experience:AddExperienceByUserId-request1"),
})
.WithChallengePeriodEventId(null)
.WithPremiseMissionTaskName(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.createMissionTaskModelMaster(
new Gs2Mission.CreateMissionTaskModelMasterRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withName("mission-task-0001")
.withMetadata(null)
.withDescription(null)
.withVerifyCompleteType("counter")
.withTargetCounter(new Gs2Mission.model.TargetCounterModel()
.withCounterName("counter-0001")
.withValue(10))
.withVerifyCompleteConsumeActions(null)
.withCompleteAcquireActions([
new Gs2Mission.model.AcquireAction()
.withAction("Gs2Experience:AddExperienceByUserId")
.withRequest("Gs2Experience:AddExperienceByUserId-request1"),
])
.withChallengePeriodEventId(null)
.withPremiseMissionTaskName(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.create_mission_task_model_master(
mission.CreateMissionTaskModelMasterRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-0001')
.with_name('mission-task-0001')
.with_metadata(None)
.with_description(None)
.with_verify_complete_type('counter')
.with_target_counter(
mission.TargetCounterModel()
.with_counter_name('counter-0001')
.with_value(10))
.with_verify_complete_consume_actions(None)
.with_complete_acquire_actions([
mission.AcquireAction()
.with_action('Gs2Experience:AddExperienceByUserId')
.with_request('Gs2Experience:AddExperienceByUserId-request1'),
])
.with_challenge_period_event_id(None)
.with_premise_mission_task_name(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.create_mission_task_model_master({
namespaceName="namespace1",
missionGroupName="mission-group-0001",
name="mission-task-0001",
metadata=nil,
description=nil,
verifyCompleteType="counter",
targetCounter={
counterName="counter-0001",
value=10,
},
verifyCompleteConsumeActions=nil,
completeAcquireActions={
{
action="Gs2Experience:AddExperienceByUserId",
request="Gs2Experience:AddExperienceByUserId-request1",
}
},
challengePeriodEventId=nil,
premiseMissionTaskName=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.create_mission_task_model_master_async({
namespaceName="namespace1",
missionGroupName="mission-group-0001",
name="mission-task-0001",
metadata=nil,
description=nil,
verifyCompleteType="counter",
targetCounter={
counterName="counter-0001",
value=10,
},
verifyCompleteConsumeActions=nil,
completeAcquireActions={
{
action="Gs2Experience:AddExperienceByUserId",
request="Gs2Experience:AddExperienceByUserId-request1",
}
},
challengePeriodEventId=nil,
premiseMissionTaskName=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;
getMissionTaskModelMaster
ミッションタスクマスターを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
missionTaskName | string | ✓ | ~ 128文字 | タスク名 |
Result
型 | 説明 | |
---|---|---|
item | MissionTaskModelMaster | ミッションタスクマスター |
実装例
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.GetMissionTaskModelMaster(
&mission.GetMissionTaskModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-0001"),
MissionTaskName: pointy.String("mission-task-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\GetMissionTaskModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getMissionTaskModelMaster(
(new GetMissionTaskModelMasterRequest())
->withNamespaceName(self::namespace1)
->withMissionGroupName("mission-group-0001")
->withMissionTaskName("mission-task-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.GetMissionTaskModelMasterRequest;
import io.gs2.mission.result.GetMissionTaskModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
GetMissionTaskModelMasterResult result = client.getMissionTaskModelMaster(
new GetMissionTaskModelMasterRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMissionTaskName("mission-task-0001")
);
MissionTaskModelMaster 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.GetMissionTaskModelMasterRequest;
using Gs2.Gs2Mission.Result.GetMissionTaskModelMasterResult;
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.GetMissionTaskModelMasterResult> asyncResult = null;
yield return client.GetMissionTaskModelMaster(
new Gs2.Gs2Mission.Request.GetMissionTaskModelMasterRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-0001")
.WithMissionTaskName("mission-task-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.getMissionTaskModelMaster(
new Gs2Mission.GetMissionTaskModelMasterRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMissionTaskName("mission-task-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_mission_task_model_master(
mission.GetMissionTaskModelMasterRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-0001')
.with_mission_task_name('mission-task-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.get_mission_task_model_master({
namespaceName="namespace1",
missionGroupName="mission-group-0001",
missionTaskName="mission-task-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_mission_task_model_master_async({
namespaceName="namespace1",
missionGroupName="mission-group-0001",
missionTaskName="mission-task-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;
updateMissionTaskModelMaster
ミッションタスクマスターを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
missionTaskName | 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文字 | このタスクに挑戦するために達成しておく必要のあるタスクの名前 | |||
counterName | string | ✓ | ~ 128文字 | カウンター名 | ||
targetResetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | ~ 128文字 | 目標リセットタイミング | |||
targetValue | long | ✓ | 1 ~ 9223372036854775805 | 目標値 |
verifyCompleteType に指定する列挙型の定義
定義 | 説明 |
---|---|
counter | カウンター |
verifyActions | 検証アクション |
targetResetType に指定する列挙型の定義
定義 | 説明 |
---|---|
notReset | リセットしない |
daily | 毎日 |
weekly | 毎週 |
monthly | 毎月 |
Result
型 | 説明 | |
---|---|---|
item | MissionTaskModelMaster | 更新したミッションタスクマスター |
実装例
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.UpdateMissionTaskModelMaster(
&mission.UpdateMissionTaskModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-0001"),
MissionTaskName: pointy.String("mission-task-0001"),
Metadata: pointy.String("MISSION_TASK1"),
Description: pointy.String("description1"),
VerifyCompleteType: pointy.String("counter"),
TargetCounter: &mission.TargetCounterModel{
CounterName: pointy.String("counter-0001"),
Value: pointy.Int64(100),
},
VerifyCompleteConsumeActions: nil,
CompleteAcquireActions: []mission.AcquireAction{
mission.AcquireAction{
Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
Request: pointy.String("Gs2Stamina:RecoverStaminaByUserId-request"),
},
},
ChallengePeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-0001"),
PremiseMissionTaskName: 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\UpdateMissionTaskModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateMissionTaskModelMaster(
(new UpdateMissionTaskModelMasterRequest())
->withNamespaceName(self::namespace1)
->withMissionGroupName("mission-group-0001")
->withMissionTaskName("mission-task-0001")
->withMetadata("MISSION_TASK1")
->withDescription("description1")
->withVerifyCompleteType("counter")
->withTargetCounter((new \Gs2\Mission\Model\TargetCounterModel())
->withCounterName("counter-0001")
->withValue(100))
->withVerifyCompleteConsumeActions(null)
->withCompleteAcquireActions([
(new \Gs2\Mission\Model\AcquireAction())
->withAction("Gs2Stamina:RecoverStaminaByUserId")
->withRequest("Gs2Stamina:RecoverStaminaByUserId-request"),
])
->withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:\namespace1:event:event-0001")
->withPremiseMissionTaskName(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.UpdateMissionTaskModelMasterRequest;
import io.gs2.mission.result.UpdateMissionTaskModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
UpdateMissionTaskModelMasterResult result = client.updateMissionTaskModelMaster(
new UpdateMissionTaskModelMasterRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMissionTaskName("mission-task-0001")
.withMetadata("MISSION_TASK1")
.withDescription("description1")
.withVerifyCompleteType("counter")
.withTargetCounter(new io.gs2.mission.model.TargetCounterModel()
.withCounterName("counter-0001")
.withValue(100L))
.withVerifyCompleteConsumeActions(null)
.withCompleteAcquireActions(Arrays.asList(
new io.gs2.mission.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("Gs2Stamina:RecoverStaminaByUserId-request")
))
.withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-0001")
.withPremiseMissionTaskName(null)
);
MissionTaskModelMaster 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.UpdateMissionTaskModelMasterRequest;
using Gs2.Gs2Mission.Result.UpdateMissionTaskModelMasterResult;
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.UpdateMissionTaskModelMasterResult> asyncResult = null;
yield return client.UpdateMissionTaskModelMaster(
new Gs2.Gs2Mission.Request.UpdateMissionTaskModelMasterRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-0001")
.WithMissionTaskName("mission-task-0001")
.WithMetadata("MISSION_TASK1")
.WithDescription("description1")
.WithVerifyCompleteType("counter")
.WithTargetCounter(new Gs2.Gs2Mission.Model.TargetCounterModel()
.WithCounterName("counter-0001")
.WithValue(100L))
.WithVerifyCompleteConsumeActions(null)
.WithCompleteAcquireActions(new Gs2.Core.Model.AcquireAction[] {
new Gs2.Core.Model.AcquireAction()
.WithAction("Gs2Stamina:RecoverStaminaByUserId")
.WithRequest("Gs2Stamina:RecoverStaminaByUserId-request"),
})
.WithChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-0001")
.WithPremiseMissionTaskName(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.updateMissionTaskModelMaster(
new Gs2Mission.UpdateMissionTaskModelMasterRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMissionTaskName("mission-task-0001")
.withMetadata("MISSION_TASK1")
.withDescription("description1")
.withVerifyCompleteType("counter")
.withTargetCounter(new Gs2Mission.model.TargetCounterModel()
.withCounterName("counter-0001")
.withValue(100))
.withVerifyCompleteConsumeActions(null)
.withCompleteAcquireActions([
new Gs2Mission.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("Gs2Stamina:RecoverStaminaByUserId-request"),
])
.withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-0001")
.withPremiseMissionTaskName(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.update_mission_task_model_master(
mission.UpdateMissionTaskModelMasterRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-0001')
.with_mission_task_name('mission-task-0001')
.with_metadata('MISSION_TASK1')
.with_description('description1')
.with_verify_complete_type('counter')
.with_target_counter(
mission.TargetCounterModel()
.with_counter_name('counter-0001')
.with_value(100))
.with_verify_complete_consume_actions(None)
.with_complete_acquire_actions([
mission.AcquireAction()
.with_action('Gs2Stamina:RecoverStaminaByUserId')
.with_request('Gs2Stamina:RecoverStaminaByUserId-request'),
])
.with_challenge_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-0001')
.with_premise_mission_task_name(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.update_mission_task_model_master({
namespaceName="namespace1",
missionGroupName="mission-group-0001",
missionTaskName="mission-task-0001",
metadata="MISSION_TASK1",
description="description1",
verifyCompleteType="counter",
targetCounter={
counterName="counter-0001",
value=100,
},
verifyCompleteConsumeActions=nil,
completeAcquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="Gs2Stamina:RecoverStaminaByUserId-request",
}
},
challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-0001",
premiseMissionTaskName=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.update_mission_task_model_master_async({
namespaceName="namespace1",
missionGroupName="mission-group-0001",
missionTaskName="mission-task-0001",
metadata="MISSION_TASK1",
description="description1",
verifyCompleteType="counter",
targetCounter={
counterName="counter-0001",
value=100,
},
verifyCompleteConsumeActions=nil,
completeAcquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="Gs2Stamina:RecoverStaminaByUserId-request",
}
},
challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-0001",
premiseMissionTaskName=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;
deleteMissionTaskModelMaster
ミッションタスクマスターを削除
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
missionGroupName | string | ✓ | ~ 128文字 | ミッショングループ名 | ||
missionTaskName | string | ✓ | ~ 128文字 | タスク名 |
Result
型 | 説明 | |
---|---|---|
item | MissionTaskModelMaster | 削除したミッションタスク |
実装例
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.DeleteMissionTaskModelMaster(
&mission.DeleteMissionTaskModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-0001"),
MissionTaskName: pointy.String("mission-task-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\DeleteMissionTaskModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteMissionTaskModelMaster(
(new DeleteMissionTaskModelMasterRequest())
->withNamespaceName(self::namespace1)
->withMissionGroupName("mission-group-0001")
->withMissionTaskName("mission-task-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.DeleteMissionTaskModelMasterRequest;
import io.gs2.mission.result.DeleteMissionTaskModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DeleteMissionTaskModelMasterResult result = client.deleteMissionTaskModelMaster(
new DeleteMissionTaskModelMasterRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMissionTaskName("mission-task-0001")
);
MissionTaskModelMaster 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.DeleteMissionTaskModelMasterRequest;
using Gs2.Gs2Mission.Result.DeleteMissionTaskModelMasterResult;
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.DeleteMissionTaskModelMasterResult> asyncResult = null;
yield return client.DeleteMissionTaskModelMaster(
new Gs2.Gs2Mission.Request.DeleteMissionTaskModelMasterRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-0001")
.WithMissionTaskName("mission-task-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.deleteMissionTaskModelMaster(
new Gs2Mission.DeleteMissionTaskModelMasterRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMissionTaskName("mission-task-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.delete_mission_task_model_master(
mission.DeleteMissionTaskModelMasterRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-0001')
.with_mission_task_name('mission-task-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.delete_mission_task_model_master({
namespaceName="namespace1",
missionGroupName="mission-group-0001",
missionTaskName="mission-task-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.delete_mission_task_model_master_async({
namespaceName="namespace1",
missionGroupName="mission-group-0001",
missionTaskName="mission-task-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;