GS2-LoginReward SDK API リファレンス
モデル
Namespace
ネームスペース
ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。
GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。
そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024文字 | ネームスペースGRN | ||
name | string | ✓ | ~ 128文字 | ネームスペース名 | ||
description | string | ~ 1024文字 | 説明文 | |||
transactionSetting | TransactionSetting | ✓ | トランザクション設定 | |||
receiveScript | ScriptSetting | 報酬を受け取る時に実行するスクリプト | ||||
logSetting | LogSetting | ログの出力設定 | ||||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
BonusModelMaster
ボーナスモデル
ログインボーナスの配布スケジュールを設定します。
配布スケジュールには《スケジュールモード》と《ストリーミングモード》があります。
スケジュールモードでは、GS2-Schedule のイベントの指定が必須で、そのイベントの開始日からの経過日数でボーナスの配布を行います。
途中で撮り逃しが発生した場合、その分のボーナスは配布されません。
ストリーミングモードでは、毎日ボーナスに設定された報酬を先頭から順番に配布します。
ストリーミングモードでは繰り返しの設定が可能です。その場合、ストリームの終端に達した場合、先頭から再度配布を行います。
スケジュールモード・ストリーミングモード 共に、取り逃がしの救済機能があります。
一定のコストを支払うことで、取り逃がしたボーナスを受け取ることができます。
ただし、GS2-Schedule のイベントが関連づけられている場合、イベントの開始日からの経過日数より先のボーナスは受け取ることができません。
取り逃がし機能はストリーミングモードかつ繰り返しが有効な場合は使用することができません。
スケジュールモード・ストリーミングモード 共に、設定可能なボーナスの最大日数は100日です。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
bonusModelId | string | ✓ | ~ 1024文字 | ログインボーナスモデルマスターGRN | ||
name | string | ✓ | ~ 128文字 | ログインボーナスモデル名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 2048文字 | メタデータ | |||
mode | enum { “schedule”, “streaming” } | ✓ | ~ 128文字 | モード | ||
periodEventId | string | ~ 1024文字 | ログインボーナスを有効化する期間を表す GS2-Schedule のイベントGRN | |||
resetHour | int | {periodEventId} == "" | ✓ | ~ 23 | 受け取りフラグのリセット時間(UTC) | |
repeat | enum { “enabled”, “disabled” } | {mode} == “streaming” | ✓ | ~ 128文字 | ストリームの終端に達した時に繰り返しを行うか | |
rewards | List<Reward> | ~ 100 items | 報酬リスト | |||
missedReceiveRelief | enum { “enabled”, “disabled” } | ✓ | “disabled” | ~ 128文字 | 取り逃がし救済機能 | |
missedReceiveReliefVerifyActions | List<VerifyAction> | {missedReceiveRelief} == “enabled” | ~ 10 items | 取り逃がし救済の検証アクションリスト | ||
missedReceiveReliefConsumeActions | List<ConsumeAction> | {missedReceiveRelief} == “enabled” | ~ 10 items | 取り逃がし救済の消費アクションリスト | ||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
mode に指定する列挙型の定義
定義 | 説明 |
---|---|
schedule | スケジュールモード |
streaming | ストリーミングモード |
repeat に指定する列挙型の定義
定義 | 説明 |
---|---|
enabled | 有効 |
disabled | 無効 |
missedReceiveRelief に指定する列挙型の定義
定義 | 説明 |
---|---|
enabled | 有効 |
disabled | 無効 |
CurrentBonusMaster
現在有効なマスターデータ
GS2ではマスターデータの管理にJSON形式のファイルを使用します。
ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。
JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが
よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。
Note
JSONファイルの形式については GS2-LoginReward マスターデータリファレンス をご参照ください。型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024文字 | 現在有効なログインボーナスマスターGRN | ||
settings | string | ✓ | ~ 5242880文字 | マスターデータ |
BonusModel
ボーナスモデル
ログインボーナスの配布スケジュールを設定します。
配布スケジュールには《スケジュールモード》と《ストリーミングモード》があります。
スケジュールモードでは、GS2-Schedule のイベントの指定が必須で、そのイベントの開始日からの経過日数でボーナスの配布を行います。
途中で撮り逃しが発生した場合、その分のボーナスは配布されません。
ストリーミングモードでは、毎日ボーナスに設定された報酬を先頭から順番に配布します。
ストリーミングモードでは繰り返しの設定が可能です。その場合、ストリームの終端に達した場合、先頭から再度配布を行います。
スケジュールモード・ストリーミングモード 共に、取り逃がしの救済機能があります。
一定のコストを支払うことで、取り逃がしたボーナスを受け取ることができます。
ただし、GS2-Schedule のイベントが関連づけられている場合、イベントの開始日からの経過日数より先のボーナスは受け取ることができません。
取り逃がし機能はストリーミングモードかつ繰り返しが有効な場合は使用することができません。
スケジュールモード・ストリーミングモード 共に、設定可能なボーナスの最大日数は100日です。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
bonusModelId | string | ✓ | ~ 1024文字 | ログインボーナスモデルGRN | ||
name | string | ✓ | ~ 128文字 | ボーナスモデル名 | ||
metadata | string | ~ 2048文字 | メタデータ | |||
mode | enum { “schedule”, “streaming” } | ✓ | ~ 128文字 | モード | ||
periodEventId | string | ~ 1024文字 | ログインボーナスを有効化する期間を表す GS2-Schedule のイベントGRN | |||
resetHour | int | {periodEventId} == "" | ✓ | ~ 23 | 受け取りフラグのリセット時間(UTC) | |
repeat | enum { “enabled”, “disabled” } | {mode} == “streaming” | ✓ | ~ 128文字 | 受け取りフラグのリセット時間(UTC) | |
rewards | List<Reward> | ~ 100 items | 報酬リスト | |||
missedReceiveRelief | enum { “enabled”, “disabled” } | ✓ | “disabled” | ~ 128文字 | 取り逃がし救済機能 | |
missedReceiveReliefVerifyActions | List<VerifyAction> | {missedReceiveRelief} == “enabled” | ~ 10 items | 取り逃がし救済の検証アクションリスト | ||
missedReceiveReliefConsumeActions | List<ConsumeAction> | {missedReceiveRelief} == “enabled” | ~ 10 items | 取り逃がし救済の消費アクションリスト |
mode に指定する列挙型の定義
定義 | 説明 |
---|---|
schedule | スケジュールモード |
streaming | ストリーミングモード |
repeat に指定する列挙型の定義
定義 | 説明 |
---|---|
enabled | 有効 |
disabled | 無効 |
missedReceiveRelief に指定する列挙型の定義
定義 | 説明 |
---|---|
enabled | 有効 |
disabled | 無効 |
Reward
報酬
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
acquireActions | List<AcquireAction> | ✓ | 1 ~ 10 items | 入手アクションリスト |
ReceiveStatus
受け取り状態
ログインボーナスの受け取り状態を保持するモデルです。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
receiveStatusId | string | ✓ | ~ 1024文字 | ログインボーナス受け取り状態GRN | ||
bonusModelName | string | ✓ | ~ 128文字 | ボーナスモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
receivedSteps | List<bool> | ~ 100 items | 受け取り済みフラグのリスト | |||
lastReceivedAt | long | ✓ | 0 | 最終受け取り時刻 (UNIX時間 単位:ミリ秒) | ||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
ConsumeAction
消費アクション
AcquireAction
入手アクション
VerifyAction
検証アクション
Config
コンフィグ設定
トランザクションの変数に適用する設定値
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
key | string | ✓ | ~ 64文字 | 名前 | ||
value | string | ~ 51200文字 | 値 |
VerifyActionResult
検証アクションの実行結果
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
action | enum { } | ✓ | ~ 128文字 | 検証アクションで実行するアクションの種類 | ||
verifyRequest | string | ✓ | ~ 1048576文字 | リクエストのJSON | ||
statusCode | int | ~ 999 | ステータスコード | |||
verifyResult | string | ~ 1048576文字 | 結果内容 |
action に指定する列挙型の定義
定義 | 説明 |
---|
ConsumeActionResult
消費アクションの実行結果
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
action | enum { } | ✓ | ~ 128文字 | 消費アクションで実行するアクションの種類 | ||
consumeRequest | string | ✓ | ~ 1048576文字 | リクエストのJSON | ||
statusCode | int | ~ 999 | ステータスコード | |||
consumeResult | string | ~ 1048576文字 | 結果内容 |
action に指定する列挙型の定義
定義 | 説明 |
---|
AcquireActionResult
入手アクションの実行結果
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
action | enum { } | ✓ | ~ 128文字 | 入手アクションで実行するアクションの種類 | ||
acquireRequest | string | ✓ | ~ 1048576文字 | リクエストのJSON | ||
statusCode | int | ~ 999 | ステータスコード | |||
acquireResult | string | ~ 1048576文字 | 結果内容 |
action に指定する列挙型の定義
定義 | 説明 |
---|
TransactionResult
トランザクション実行結果
サーバーサイドでのトランザクションの自動実行機能を利用して実行されたトランザクションの実行結果
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
transactionId | string | ✓ | 36 ~ 36文字 | トランザクションID | ||
verifyResults | List<VerifyActionResult> | ~ 10 items | 検証アクションの実行結果リスト | |||
consumeResults | List<ConsumeActionResult> | ~ 10 items | 消費アクションの実行結果リスト | |||
acquireResults | List<AcquireActionResult> | ~ 100 items | 入手アクションの実行結果リスト |
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 | タグ |
LogSetting
ログの書き出し設定
ログデータの書き出し設定を管理します。この型は、ログデータを書き出すために使用されるログ名前空間の識別子(Namespace ID)を保持します。
ログ名前空間IDは、ログデータを集約し、保存する対象の GS2-Log の名前空間を指定します。
この設定を通じて、この名前空間以下のAPIリクエスト・レスポンスログデータが対象の GS2-Log へ出力されるようになります。
GS2-Log にはリアルタイムでログが提供され、システムの監視や分析、デバッグなどに利用できます。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
loggingNamespaceId | string | ✓ | ~ 1024文字 | ネームスペースGRN |
TransactionSetting
トランザクション設定
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
enableAutoRun | bool | ✓ | false | 発行したトランザクションをサーバーサイドで自動的に実行するか | ||
enableAtomicCommit | bool | {enableAutoRun} == true | ✓ | false | トランザクションの実行をアトミックにコミットするか | |
transactionUseDistributor | bool | {enableAtomicCommit} == true | ✓ | false | トランザクションを非同期処理で実行する | |
acquireActionUseJobQueue | bool | {enableAtomicCommit} == true | ✓ | false | 入手アクションを実行する際に GS2-JobQueue を使用するか | |
distributorNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:distributor:default” | ~ 1024文字 | トランザクションの実行に使用する GS2-Distributor ネームスペース | |
queueNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:queue:default” | ~ 1024文字 | トランザクションの実行に使用する GS2-JobQueue のネームスペース |
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 |
メソッド
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.DescribeNamespaces(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.DescribeNamespacesRequest;
import io.gs2.loginReward.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.DescribeNamespacesRequest;
using Gs2.Gs2LoginReward.Result.DescribeNamespacesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.describeNamespaces(
new Gs2LoginReward.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 login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.describe_namespaces(
login_reward.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('loginReward')
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('loginReward')
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 | ✓ | トランザクション設定 | |||
receiveScript | ScriptSetting | 報酬を受け取る時に実行するスクリプト | ||||
logSetting | LogSetting | ログの出力設定 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | 作成したネームスペース |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.CreateNamespace(
&login_reward.CreateNamespaceRequest {
Name: pointy.String("namespace1"),
Description: nil,
TransactionSetting: &loginReward.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"),
},
ReceiveScript: nil,
LogSetting: &loginReward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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\LoginReward\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"))
->withReceiveScript(null)
->withLogSetting((new \Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.CreateNamespaceRequest;
import io.gs2.loginReward.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
CreateNamespaceResult result = client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withTransactionSetting(new io.gs2.loginReward.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"))
.withReceiveScript(null)
.withLogSetting(new io.gs2.loginReward.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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.CreateNamespaceRequest;
using Gs2.Gs2LoginReward.Result.CreateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2LoginReward.Request.CreateNamespaceRequest()
.WithName("namespace1")
.WithDescription(null)
.WithTransactionSetting(new Gs2.Gs2LoginReward.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"))
.WithReceiveScript(null)
.WithLogSetting(new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.createNamespace(
new Gs2LoginReward.CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withTransactionSetting(new Gs2LoginReward.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"))
.withReceiveScript(null)
.withLogSetting(new Gs2LoginReward.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 login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.create_namespace(
login_reward.CreateNamespaceRequest()
.with_name(self.hash1)
.with_description(None)
.with_transaction_setting(
login_reward.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_receive_script(None)
.with_log_setting(
login_reward.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('loginReward')
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",
},
receiveScript=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('loginReward')
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",
},
receiveScript=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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.GetNamespaceStatus(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.GetNamespaceStatusRequest;
import io.gs2.loginReward.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.GetNamespaceStatusRequest;
using Gs2.Gs2LoginReward.Result.GetNamespaceStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.getNamespaceStatus(
new Gs2LoginReward.GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
const status = result.getStatus();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.get_namespace_status(
login_reward.GetNamespaceStatusRequest()
.with_namespace_name(self.hash1)
)
status = result.status
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
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('loginReward')
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.GetNamespace(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.GetNamespaceRequest;
import io.gs2.loginReward.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.GetNamespaceRequest;
using Gs2.Gs2LoginReward.Result.GetNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.getNamespace(
new Gs2LoginReward.GetNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.get_namespace(
login_reward.GetNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
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('loginReward')
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 | ✓ | トランザクション設定 | |||
receiveScript | ScriptSetting | 報酬を受け取る時に実行するスクリプト | ||||
logSetting | LogSetting | ログの出力設定 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | 更新したネームスペース |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.UpdateNamespace(
&login_reward.UpdateNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
Description: pointy.String("description1"),
TransactionSetting: &loginReward.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"),
},
ReceiveScript: nil,
LogSetting: &loginReward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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\LoginReward\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"))
->withReceiveScript(null)
->withLogSetting((new \Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.UpdateNamespaceRequest;
import io.gs2.loginReward.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
UpdateNamespaceResult result = client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withTransactionSetting(new io.gs2.loginReward.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"))
.withReceiveScript(null)
.withLogSetting(new io.gs2.loginReward.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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.UpdateNamespaceRequest;
using Gs2.Gs2LoginReward.Result.UpdateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2LoginReward.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace1")
.WithDescription("description1")
.WithTransactionSetting(new Gs2.Gs2LoginReward.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"))
.WithReceiveScript(null)
.WithLogSetting(new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.updateNamespace(
new Gs2LoginReward.UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withTransactionSetting(new Gs2LoginReward.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"))
.withReceiveScript(null)
.withLogSetting(new Gs2LoginReward.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 login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.update_namespace(
login_reward.UpdateNamespaceRequest()
.with_namespace_name(self.hash1)
.with_description('description1')
.with_transaction_setting(
login_reward.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_receive_script(None)
.with_log_setting(
login_reward.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('loginReward')
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",
},
receiveScript=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('loginReward')
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",
},
receiveScript=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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.DeleteNamespace(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.DeleteNamespaceRequest;
import io.gs2.loginReward.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.DeleteNamespaceRequest;
using Gs2.Gs2LoginReward.Result.DeleteNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.deleteNamespace(
new Gs2LoginReward.DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.delete_namespace(
login_reward.DeleteNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
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('loginReward')
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.DumpUserDataByUserId(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.DumpUserDataByUserIdRequest;
import io.gs2.loginReward.result.DumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2LoginReward.Result.DumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.dumpUserDataByUserId(
new Gs2LoginReward.DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.dump_user_data_by_user_id(
login_reward.DumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
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('loginReward')
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.loginReward.result.CheckDumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2LoginReward.Result.CheckDumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.checkDumpUserDataByUserId(
new Gs2LoginReward.CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.check_dump_user_data_by_user_id(
login_reward.CheckDumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
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('loginReward')
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.CleanUserDataByUserId(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.CleanUserDataByUserIdRequest;
import io.gs2.loginReward.result.CleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2LoginReward.Result.CleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.cleanUserDataByUserId(
new Gs2LoginReward.CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.clean_user_data_by_user_id(
login_reward.CleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
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('loginReward')
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.loginReward.result.CheckCleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2LoginReward.Result.CheckCleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.checkCleanUserDataByUserId(
new Gs2LoginReward.CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.check_clean_user_data_by_user_id(
login_reward.CheckCleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
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('loginReward')
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.loginReward.result.PrepareImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2LoginReward.Result.PrepareImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.prepareImportUserDataByUserId(
new Gs2LoginReward.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 login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.prepare_import_user_data_by_user_id(
login_reward.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('loginReward')
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('loginReward')
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.ImportUserDataByUserId(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.ImportUserDataByUserIdRequest;
import io.gs2.loginReward.result.ImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2LoginReward.Result.ImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.importUserDataByUserId(
new Gs2LoginReward.ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.import_user_data_by_user_id(
login_reward.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('loginReward')
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('loginReward')
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.CheckImportUserDataByUserIdRequest;
import io.gs2.loginReward.result.CheckImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2LoginReward.Result.CheckImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.checkImportUserDataByUserId(
new Gs2LoginReward.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 login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.check_import_user_data_by_user_id(
login_reward.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('loginReward')
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('loginReward')
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;
describeBonusModelMasters
ログインボーナスモデルマスターの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<BonusModelMaster> | ログインボーナスモデルマスターのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.DescribeBonusModelMasters(
&login_reward.DescribeBonusModelMastersRequest {
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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\DescribeBonusModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeBonusModelMasters(
(new DescribeBonusModelMastersRequest())
->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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.DescribeBonusModelMastersRequest;
import io.gs2.loginReward.result.DescribeBonusModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
DescribeBonusModelMastersResult result = client.describeBonusModelMasters(
new DescribeBonusModelMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
List<BonusModelMaster> 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.DescribeBonusModelMastersRequest;
using Gs2.Gs2LoginReward.Result.DescribeBonusModelMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.DescribeBonusModelMastersResult> asyncResult = null;
yield return client.DescribeBonusModelMasters(
new Gs2.Gs2LoginReward.Request.DescribeBonusModelMastersRequest()
.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.describeBonusModelMasters(
new Gs2LoginReward.DescribeBonusModelMastersRequest()
.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 login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.describe_bonus_model_masters(
login_reward.DescribeBonusModelMastersRequest()
.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('loginReward')
api_result = client.describe_bonus_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('loginReward')
api_result_handler = client.describe_bonus_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;
createBonusModelMaster
ログインボーナスモデルマスターを新規作成
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
name | string | ✓ | ~ 128文字 | ログインボーナスモデル名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 2048文字 | メタデータ | |||
mode | enum { “schedule”, “streaming” } | ✓ | ~ 128文字 | モード | ||
periodEventId | string | ~ 1024文字 | ログインボーナスを有効化する期間を表す GS2-Schedule のイベントGRN | |||
resetHour | int | {periodEventId} == "" | ✓ | ~ 23 | 受け取りフラグのリセット時間(UTC) | |
repeat | enum { “enabled”, “disabled” } | {mode} == “streaming” | ✓ | ~ 128文字 | ストリームの終端に達した時に繰り返しを行うか | |
rewards | List<Reward> | ~ 100 items | 報酬リスト | |||
missedReceiveRelief | enum { “enabled”, “disabled” } | ✓ | “disabled” | ~ 128文字 | 取り逃がし救済機能 | |
missedReceiveReliefVerifyActions | List<VerifyAction> | {missedReceiveRelief} == “enabled” | ~ 10 items | 取り逃がし救済の検証アクションリスト | ||
missedReceiveReliefConsumeActions | List<ConsumeAction> | {missedReceiveRelief} == “enabled” | ~ 10 items | 取り逃がし救済の消費アクションリスト |
mode に指定する列挙型の定義
定義 | 説明 |
---|---|
schedule | スケジュールモード |
streaming | ストリーミングモード |
repeat に指定する列挙型の定義
定義 | 説明 |
---|---|
enabled | 有効 |
disabled | 無効 |
missedReceiveRelief に指定する列挙型の定義
定義 | 説明 |
---|---|
enabled | 有効 |
disabled | 無効 |
Result
型 | 説明 | |
---|---|---|
item | BonusModelMaster | 作成したログインボーナスモデルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.CreateBonusModelMaster(
&login_reward.CreateBonusModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
Name: pointy.String("bonusModel-0001"),
Description: nil,
Metadata: nil,
Mode: pointy.String("schedule"),
PeriodEventId: pointy.String("grn:gs2:schedule:grn-0001"),
ResetHour: nil,
Repeat: nil,
Rewards: []loginReward.Reward{
loginReward.Reward{
AcquireActions: []loginReward.AcquireAction{
loginReward.AcquireAction{
Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
Request: pointy.String("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
},
},
},
loginReward.Reward{
AcquireActions: []loginReward.AcquireAction{
loginReward.AcquireAction{
Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
Request: pointy.String("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
},
},
},
loginReward.Reward{
AcquireActions: []loginReward.AcquireAction{
loginReward.AcquireAction{
Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
Request: pointy.String("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
},
},
},
},
MissedReceiveRelief: pointy.String("disabled"),
MissedReceiveReliefVerifyActions: nil,
MissedReceiveReliefConsumeActions: 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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\CreateBonusModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createBonusModelMaster(
(new CreateBonusModelMasterRequest())
->withNamespaceName(self::namespace1)
->withName("bonusModel-0001")
->withDescription(null)
->withMetadata(null)
->withMode("schedule")
->withPeriodEventId("grn:gs2:schedule:grn-0001")
->withResetHour(null)
->withRepeat(null)
->withRewards([
(new \Gs2\LoginReward\Model\Reward())
->withAcquireActions([
(new \Gs2\LoginReward\Model\AcquireAction())
->withAction("Gs2Stamina:RecoverStaminaByUserId")
->withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
(new \Gs2\LoginReward\Model\Reward())
->withAcquireActions([
(new \Gs2\LoginReward\Model\AcquireAction())
->withAction("Gs2Stamina:RecoverStaminaByUserId")
->withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
(new \Gs2\LoginReward\Model\Reward())
->withAcquireActions([
(new \Gs2\LoginReward\Model\AcquireAction())
->withAction("Gs2Stamina:RecoverStaminaByUserId")
->withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
])
->withMissedReceiveRelief("disabled")
->withMissedReceiveReliefVerifyActions(null)
->withMissedReceiveReliefConsumeActions(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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.CreateBonusModelMasterRequest;
import io.gs2.loginReward.result.CreateBonusModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
CreateBonusModelMasterResult result = client.createBonusModelMaster(
new CreateBonusModelMasterRequest()
.withNamespaceName("namespace1")
.withName("bonusModel-0001")
.withDescription(null)
.withMetadata(null)
.withMode("schedule")
.withPeriodEventId("grn:gs2:schedule:grn-0001")
.withResetHour(null)
.withRepeat(null)
.withRewards(Arrays.asList(
new io.gs2.loginReward.model.Reward()
.withAcquireActions(Arrays.asList(
new io.gs2.loginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
)),
new io.gs2.loginReward.model.Reward()
.withAcquireActions(Arrays.asList(
new io.gs2.loginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
)),
new io.gs2.loginReward.model.Reward()
.withAcquireActions(Arrays.asList(
new io.gs2.loginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
))
))
.withMissedReceiveRelief("disabled")
.withMissedReceiveReliefVerifyActions(null)
.withMissedReceiveReliefConsumeActions(null)
);
BonusModelMaster 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.CreateBonusModelMasterRequest;
using Gs2.Gs2LoginReward.Result.CreateBonusModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.CreateBonusModelMasterResult> asyncResult = null;
yield return client.CreateBonusModelMaster(
new Gs2.Gs2LoginReward.Request.CreateBonusModelMasterRequest()
.WithNamespaceName("namespace1")
.WithName("bonusModel-0001")
.WithDescription(null)
.WithMetadata(null)
.WithMode("schedule")
.WithPeriodEventId("grn:gs2:schedule:grn-0001")
.WithResetHour(null)
.WithRepeat(null)
.WithRewards(new Gs2.Gs2LoginReward.Model.Reward[] {
new Gs2.Gs2LoginReward.Model.Reward()
.WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
new Gs2.Core.Model.AcquireAction()
.WithAction("Gs2Stamina:RecoverStaminaByUserId")
.WithRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
}),
new Gs2.Gs2LoginReward.Model.Reward()
.WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
new Gs2.Core.Model.AcquireAction()
.WithAction("Gs2Stamina:RecoverStaminaByUserId")
.WithRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
}),
new Gs2.Gs2LoginReward.Model.Reward()
.WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
new Gs2.Core.Model.AcquireAction()
.WithAction("Gs2Stamina:RecoverStaminaByUserId")
.WithRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
}),
})
.WithMissedReceiveRelief("disabled")
.WithMissedReceiveReliefVerifyActions(null)
.WithMissedReceiveReliefConsumeActions(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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.createBonusModelMaster(
new Gs2LoginReward.CreateBonusModelMasterRequest()
.withNamespaceName("namespace1")
.withName("bonusModel-0001")
.withDescription(null)
.withMetadata(null)
.withMode("schedule")
.withPeriodEventId("grn:gs2:schedule:grn-0001")
.withResetHour(null)
.withRepeat(null)
.withRewards([
new Gs2LoginReward.model.Reward()
.withAcquireActions([
new Gs2LoginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
new Gs2LoginReward.model.Reward()
.withAcquireActions([
new Gs2LoginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
new Gs2LoginReward.model.Reward()
.withAcquireActions([
new Gs2LoginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
])
.withMissedReceiveRelief("disabled")
.withMissedReceiveReliefVerifyActions(null)
.withMissedReceiveReliefConsumeActions(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.create_bonus_model_master(
login_reward.CreateBonusModelMasterRequest()
.with_namespace_name(self.hash1)
.with_name('bonusModel-0001')
.with_description(None)
.with_metadata(None)
.with_mode('schedule')
.with_period_event_id('grn:gs2:schedule:grn-0001')
.with_reset_hour(None)
.with_repeat(None)
.with_rewards([
login_reward.Reward()
.with_acquire_actions([
login_reward.AcquireAction()
.with_action('Gs2Stamina:RecoverStaminaByUserId')
.with_request('{"namespaceName": "stamina-0001", "userId": "user-0001", "slot": 0, "count": 100, "paidOnly": false}'),
]),
login_reward.Reward()
.with_acquire_actions([
login_reward.AcquireAction()
.with_action('Gs2Stamina:RecoverStaminaByUserId')
.with_request('{"namespaceName": "stamina-0001", "userId": "user-0001", "slot": 0, "count": 100, "paidOnly": false}'),
]),
login_reward.Reward()
.with_acquire_actions([
login_reward.AcquireAction()
.with_action('Gs2Stamina:RecoverStaminaByUserId')
.with_request('{"namespaceName": "stamina-0001", "userId": "user-0001", "slot": 0, "count": 100, "paidOnly": false}'),
]),
])
.with_missed_receive_relief('disabled')
.with_missed_receive_relief_verify_actions(None)
.with_missed_receive_relief_consume_actions(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.create_bonus_model_master({
namespaceName="namespace1",
name="bonusModel-0001",
description=nil,
metadata=nil,
mode="schedule",
periodEventId="grn:gs2:schedule:grn-0001",
resetHour=nil,
repeat=nil,
rewards={
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
},
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
},
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
}
},
missedReceiveRelief="disabled",
missedReceiveReliefVerifyActions=nil,
missedReceiveReliefConsumeActions=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('loginReward')
api_result_handler = client.create_bonus_model_master_async({
namespaceName="namespace1",
name="bonusModel-0001",
description=nil,
metadata=nil,
mode="schedule",
periodEventId="grn:gs2:schedule:grn-0001",
resetHour=nil,
repeat=nil,
rewards={
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
},
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
},
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
}
},
missedReceiveRelief="disabled",
missedReceiveReliefVerifyActions=nil,
missedReceiveReliefConsumeActions=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;
getBonusModelMaster
ログインボーナスモデルマスターを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
bonusModelName | string | ✓ | ~ 128文字 | ログインボーナスモデル名 |
Result
型 | 説明 | |
---|---|---|
item | BonusModelMaster | ログインボーナスモデルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.GetBonusModelMaster(
&login_reward.GetBonusModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonusModel-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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\GetBonusModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getBonusModelMaster(
(new GetBonusModelMasterRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonusModel-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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.GetBonusModelMasterRequest;
import io.gs2.loginReward.result.GetBonusModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
GetBonusModelMasterResult result = client.getBonusModelMaster(
new GetBonusModelMasterRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonusModel-0001")
);
BonusModelMaster 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.GetBonusModelMasterRequest;
using Gs2.Gs2LoginReward.Result.GetBonusModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.GetBonusModelMasterResult> asyncResult = null;
yield return client.GetBonusModelMaster(
new Gs2.Gs2LoginReward.Request.GetBonusModelMasterRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonusModel-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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.getBonusModelMaster(
new Gs2LoginReward.GetBonusModelMasterRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonusModel-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.get_bonus_model_master(
login_reward.GetBonusModelMasterRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonusModel-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.get_bonus_model_master({
namespaceName="namespace1",
bonusModelName="bonusModel-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('loginReward')
api_result_handler = client.get_bonus_model_master_async({
namespaceName="namespace1",
bonusModelName="bonusModel-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;
updateBonusModelMaster
ログインボーナスモデルマスターを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
bonusModelName | string | ✓ | ~ 128文字 | ログインボーナスモデル名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 2048文字 | メタデータ | |||
mode | enum { “schedule”, “streaming” } | ✓ | ~ 128文字 | モード | ||
periodEventId | string | ~ 1024文字 | ログインボーナスを有効化する期間を表す GS2-Schedule のイベントGRN | |||
resetHour | int | {periodEventId} == "" | ✓ | ~ 23 | 受け取りフラグのリセット時間(UTC) | |
repeat | enum { “enabled”, “disabled” } | {mode} == “streaming” | ✓ | ~ 128文字 | ストリームの終端に達した時に繰り返しを行うか | |
rewards | List<Reward> | ~ 100 items | 報酬リスト | |||
missedReceiveRelief | enum { “enabled”, “disabled” } | ✓ | “disabled” | ~ 128文字 | 取り逃がし救済機能 | |
missedReceiveReliefVerifyActions | List<VerifyAction> | {missedReceiveRelief} == “enabled” | ~ 10 items | 取り逃がし救済の検証アクションリスト | ||
missedReceiveReliefConsumeActions | List<ConsumeAction> | {missedReceiveRelief} == “enabled” | ~ 10 items | 取り逃がし救済の消費アクションリスト |
mode に指定する列挙型の定義
定義 | 説明 |
---|---|
schedule | スケジュールモード |
streaming | ストリーミングモード |
repeat に指定する列挙型の定義
定義 | 説明 |
---|---|
enabled | 有効 |
disabled | 無効 |
missedReceiveRelief に指定する列挙型の定義
定義 | 説明 |
---|---|
enabled | 有効 |
disabled | 無効 |
Result
型 | 説明 | |
---|---|---|
item | BonusModelMaster | 更新したログインボーナスモデルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.UpdateBonusModelMaster(
&login_reward.UpdateBonusModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonusModel-0001"),
Description: pointy.String("description1"),
Metadata: nil,
Mode: pointy.String("streaming"),
PeriodEventId: pointy.String("grn:gs2:schedule:grn-0001"),
ResetHour: nil,
Repeat: pointy.String("disabled"),
Rewards: []loginReward.Reward{
loginReward.Reward{
AcquireActions: []loginReward.AcquireAction{
loginReward.AcquireAction{
Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
Request: pointy.String("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
},
},
},
loginReward.Reward{
AcquireActions: []loginReward.AcquireAction{
loginReward.AcquireAction{
Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
Request: pointy.String("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
},
},
},
loginReward.Reward{
AcquireActions: []loginReward.AcquireAction{
loginReward.AcquireAction{
Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
Request: pointy.String("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
},
},
},
},
MissedReceiveRelief: pointy.String("enabled"),
MissedReceiveReliefVerifyActions: nil,
MissedReceiveReliefConsumeActions: []loginReward.ConsumeAction{
loginReward.ConsumeAction{
Action: pointy.String("Gs2Money:WithdrawByUserId"),
Request: pointy.String("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}"),
},
},
}
)
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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\UpdateBonusModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateBonusModelMaster(
(new UpdateBonusModelMasterRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonusModel-0001")
->withDescription("description1")
->withMetadata(null)
->withMode("streaming")
->withPeriodEventId("grn:gs2:schedule:grn-0001")
->withResetHour(null)
->withRepeat("disabled")
->withRewards([
(new \Gs2\LoginReward\Model\Reward())
->withAcquireActions([
(new \Gs2\LoginReward\Model\AcquireAction())
->withAction("Gs2Stamina:RecoverStaminaByUserId")
->withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
(new \Gs2\LoginReward\Model\Reward())
->withAcquireActions([
(new \Gs2\LoginReward\Model\AcquireAction())
->withAction("Gs2Stamina:RecoverStaminaByUserId")
->withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
(new \Gs2\LoginReward\Model\Reward())
->withAcquireActions([
(new \Gs2\LoginReward\Model\AcquireAction())
->withAction("Gs2Stamina:RecoverStaminaByUserId")
->withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
])
->withMissedReceiveRelief("enabled")
->withMissedReceiveReliefVerifyActions(null)
->withMissedReceiveReliefConsumeActions([
(new \Gs2\LoginReward\Model\ConsumeAction())
->withAction("Gs2Money:WithdrawByUserId")
->withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}"),
])
);
$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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.UpdateBonusModelMasterRequest;
import io.gs2.loginReward.result.UpdateBonusModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
UpdateBonusModelMasterResult result = client.updateBonusModelMaster(
new UpdateBonusModelMasterRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonusModel-0001")
.withDescription("description1")
.withMetadata(null)
.withMode("streaming")
.withPeriodEventId("grn:gs2:schedule:grn-0001")
.withResetHour(null)
.withRepeat("disabled")
.withRewards(Arrays.asList(
new io.gs2.loginReward.model.Reward()
.withAcquireActions(Arrays.asList(
new io.gs2.loginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
)),
new io.gs2.loginReward.model.Reward()
.withAcquireActions(Arrays.asList(
new io.gs2.loginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
)),
new io.gs2.loginReward.model.Reward()
.withAcquireActions(Arrays.asList(
new io.gs2.loginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
))
))
.withMissedReceiveRelief("enabled")
.withMissedReceiveReliefVerifyActions(null)
.withMissedReceiveReliefConsumeActions(Arrays.asList(
new io.gs2.loginReward.model.ConsumeAction()
.withAction("Gs2Money:WithdrawByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}")
))
);
BonusModelMaster 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.UpdateBonusModelMasterRequest;
using Gs2.Gs2LoginReward.Result.UpdateBonusModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.UpdateBonusModelMasterResult> asyncResult = null;
yield return client.UpdateBonusModelMaster(
new Gs2.Gs2LoginReward.Request.UpdateBonusModelMasterRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonusModel-0001")
.WithDescription("description1")
.WithMetadata(null)
.WithMode("streaming")
.WithPeriodEventId("grn:gs2:schedule:grn-0001")
.WithResetHour(null)
.WithRepeat("disabled")
.WithRewards(new Gs2.Gs2LoginReward.Model.Reward[] {
new Gs2.Gs2LoginReward.Model.Reward()
.WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
new Gs2.Core.Model.AcquireAction()
.WithAction("Gs2Stamina:RecoverStaminaByUserId")
.WithRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
}),
new Gs2.Gs2LoginReward.Model.Reward()
.WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
new Gs2.Core.Model.AcquireAction()
.WithAction("Gs2Stamina:RecoverStaminaByUserId")
.WithRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
}),
new Gs2.Gs2LoginReward.Model.Reward()
.WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
new Gs2.Core.Model.AcquireAction()
.WithAction("Gs2Stamina:RecoverStaminaByUserId")
.WithRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
}),
})
.WithMissedReceiveRelief("enabled")
.WithMissedReceiveReliefVerifyActions(null)
.WithMissedReceiveReliefConsumeActions(new Gs2.Core.Model.ConsumeAction[] {
new Gs2.Core.Model.ConsumeAction()
.WithAction("Gs2Money:WithdrawByUserId")
.WithRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}"),
}),
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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.updateBonusModelMaster(
new Gs2LoginReward.UpdateBonusModelMasterRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonusModel-0001")
.withDescription("description1")
.withMetadata(null)
.withMode("streaming")
.withPeriodEventId("grn:gs2:schedule:grn-0001")
.withResetHour(null)
.withRepeat("disabled")
.withRewards([
new Gs2LoginReward.model.Reward()
.withAcquireActions([
new Gs2LoginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
new Gs2LoginReward.model.Reward()
.withAcquireActions([
new Gs2LoginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
new Gs2LoginReward.model.Reward()
.withAcquireActions([
new Gs2LoginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
])
.withMissedReceiveRelief("enabled")
.withMissedReceiveReliefVerifyActions(null)
.withMissedReceiveReliefConsumeActions([
new Gs2LoginReward.model.ConsumeAction()
.withAction("Gs2Money:WithdrawByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}"),
])
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.update_bonus_model_master(
login_reward.UpdateBonusModelMasterRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonusModel-0001')
.with_description('description1')
.with_metadata(None)
.with_mode('streaming')
.with_period_event_id('grn:gs2:schedule:grn-0001')
.with_reset_hour(None)
.with_repeat('disabled')
.with_rewards([
login_reward.Reward()
.with_acquire_actions([
login_reward.AcquireAction()
.with_action('Gs2Stamina:RecoverStaminaByUserId')
.with_request('{"namespaceName": "stamina-0001", "userId": "user-0001", "slot": 0, "count": 100, "paidOnly": false}'),
]),
login_reward.Reward()
.with_acquire_actions([
login_reward.AcquireAction()
.with_action('Gs2Stamina:RecoverStaminaByUserId')
.with_request('{"namespaceName": "stamina-0001", "userId": "user-0001", "slot": 0, "count": 100, "paidOnly": false}'),
]),
login_reward.Reward()
.with_acquire_actions([
login_reward.AcquireAction()
.with_action('Gs2Stamina:RecoverStaminaByUserId')
.with_request('{"namespaceName": "stamina-0001", "userId": "user-0001", "slot": 0, "count": 100, "paidOnly": false}'),
]),
])
.with_missed_receive_relief('enabled')
.with_missed_receive_relief_verify_actions(None)
.with_missed_receive_relief_consume_actions([
login_reward.ConsumeAction()
.with_action('Gs2Money:WithdrawByUserId')
.with_request('{"namespaceName": "stamina-0001", "userId": "user-0001", "slot": 0, "count": 200, "paidOnly": false}'),
])
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.update_bonus_model_master({
namespaceName="namespace1",
bonusModelName="bonusModel-0001",
description="description1",
metadata=nil,
mode="streaming",
periodEventId="grn:gs2:schedule:grn-0001",
resetHour=nil,
repeat="disabled",
rewards={
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
},
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
},
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
}
},
missedReceiveRelief="enabled",
missedReceiveReliefVerifyActions=nil,
missedReceiveReliefConsumeActions={
{
action="Gs2Money:WithdrawByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}",
}
},
})
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('loginReward')
api_result_handler = client.update_bonus_model_master_async({
namespaceName="namespace1",
bonusModelName="bonusModel-0001",
description="description1",
metadata=nil,
mode="streaming",
periodEventId="grn:gs2:schedule:grn-0001",
resetHour=nil,
repeat="disabled",
rewards={
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
},
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
},
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
}
},
missedReceiveRelief="enabled",
missedReceiveReliefVerifyActions=nil,
missedReceiveReliefConsumeActions={
{
action="Gs2Money:WithdrawByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}",
}
},
})
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;
deleteBonusModelMaster
ログインボーナスモデルマスターを削除
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
bonusModelName | string | ✓ | ~ 128文字 | ログインボーナスモデル名 |
Result
型 | 説明 | |
---|---|---|
item | BonusModelMaster | 削除したログインボーナスモデルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.DeleteBonusModelMaster(
&login_reward.DeleteBonusModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonusModel-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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\DeleteBonusModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteBonusModelMaster(
(new DeleteBonusModelMasterRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonusModel-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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.DeleteBonusModelMasterRequest;
import io.gs2.loginReward.result.DeleteBonusModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
DeleteBonusModelMasterResult result = client.deleteBonusModelMaster(
new DeleteBonusModelMasterRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonusModel-0001")
);
BonusModelMaster 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.DeleteBonusModelMasterRequest;
using Gs2.Gs2LoginReward.Result.DeleteBonusModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.DeleteBonusModelMasterResult> asyncResult = null;
yield return client.DeleteBonusModelMaster(
new Gs2.Gs2LoginReward.Request.DeleteBonusModelMasterRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonusModel-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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.deleteBonusModelMaster(
new Gs2LoginReward.DeleteBonusModelMasterRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonusModel-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.delete_bonus_model_master(
login_reward.DeleteBonusModelMasterRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonusModel-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.delete_bonus_model_master({
namespaceName="namespace1",
bonusModelName="bonusModel-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('loginReward')
api_result_handler = client.delete_bonus_model_master_async({
namespaceName="namespace1",
bonusModelName="bonusModel-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;
exportMaster
現在有効な陳列棚マスターのマスターデータをエクスポート
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | CurrentBonusMaster | 現在有効な陳列棚マスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.ExportMaster(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.ExportMasterRequest;
import io.gs2.loginReward.result.ExportMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
ExportMasterResult result = client.exportMaster(
new ExportMasterRequest()
.withNamespaceName("namespace1")
);
CurrentBonusMaster 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.ExportMasterRequest;
using Gs2.Gs2LoginReward.Result.ExportMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.exportMaster(
new Gs2LoginReward.ExportMasterRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.export_master(
login_reward.ExportMasterRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
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('loginReward')
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;
getCurrentBonusMaster
現在有効な陳列棚マスターを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | CurrentBonusMaster | 現在有効な陳列棚マスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.GetCurrentBonusMaster(
&login_reward.GetCurrentBonusMasterRequest {
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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\GetCurrentBonusMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getCurrentBonusMaster(
(new GetCurrentBonusMasterRequest())
->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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.GetCurrentBonusMasterRequest;
import io.gs2.loginReward.result.GetCurrentBonusMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
GetCurrentBonusMasterResult result = client.getCurrentBonusMaster(
new GetCurrentBonusMasterRequest()
.withNamespaceName("namespace1")
);
CurrentBonusMaster 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.GetCurrentBonusMasterRequest;
using Gs2.Gs2LoginReward.Result.GetCurrentBonusMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.GetCurrentBonusMasterResult> asyncResult = null;
yield return client.GetCurrentBonusMaster(
new Gs2.Gs2LoginReward.Request.GetCurrentBonusMasterRequest()
.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.getCurrentBonusMaster(
new Gs2LoginReward.GetCurrentBonusMasterRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.get_current_bonus_master(
login_reward.GetCurrentBonusMasterRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.get_current_bonus_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('loginReward')
api_result_handler = client.get_current_bonus_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;
updateCurrentBonusMaster
現在有効な陳列棚マスターを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
settings | string | ✓ | ~ 5242880文字 | マスターデータ |
Result
型 | 説明 | |
---|---|---|
item | CurrentBonusMaster | 更新した現在有効な陳列棚マスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.UpdateCurrentBonusMaster(
&login_reward.UpdateCurrentBonusMasterRequest {
NamespaceName: pointy.String("namespace1"),
Settings: pointy.String("{\"version\": \"2023-07-11\", \"bonusModels\": [{\"name\": \"schedule\", \"mode\": \"schedule\", \"periodEventId\": \"grn:gs2:schedule:grn-0001\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"disabled\"}, {\"name\": \"streaming\", \"mode\": \"streaming\", \"resetHour\": 15, \"repeat\": \"enabled\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"enabled\", \"missedReceiveReliefConsumeActions\": [{\"action\": \"Gs2Money:WithdrawByUserId\", \"request\": {\"namespaceName\": \"money-0001\", \"userId\": \"#{userId}\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}}]}]}"),
}
)
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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\UpdateCurrentBonusMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCurrentBonusMaster(
(new UpdateCurrentBonusMasterRequest())
->withNamespaceName(self::namespace1)
->withSettings("{\"version\": \"2023-07-11\", \"bonusModels\": [{\"name\": \"schedule\", \"mode\": \"schedule\", \"periodEventId\": \"grn:gs2:schedule:grn-0001\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"disabled\"}, {\"name\": \"streaming\", \"mode\": \"streaming\", \"resetHour\": 15, \"repeat\": \"enabled\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"enabled\", \"missedReceiveReliefConsumeActions\": [{\"action\": \"Gs2Money:WithdrawByUserId\", \"request\": {\"namespaceName\": \"money-0001\", \"userId\": \"#{userId}\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}}]}]}")
);
$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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.UpdateCurrentBonusMasterRequest;
import io.gs2.loginReward.result.UpdateCurrentBonusMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
UpdateCurrentBonusMasterResult result = client.updateCurrentBonusMaster(
new UpdateCurrentBonusMasterRequest()
.withNamespaceName("namespace1")
.withSettings("{\"version\": \"2023-07-11\", \"bonusModels\": [{\"name\": \"schedule\", \"mode\": \"schedule\", \"periodEventId\": \"grn:gs2:schedule:grn-0001\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"disabled\"}, {\"name\": \"streaming\", \"mode\": \"streaming\", \"resetHour\": 15, \"repeat\": \"enabled\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"enabled\", \"missedReceiveReliefConsumeActions\": [{\"action\": \"Gs2Money:WithdrawByUserId\", \"request\": {\"namespaceName\": \"money-0001\", \"userId\": \"#{userId}\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}}]}]}")
);
CurrentBonusMaster 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.UpdateCurrentBonusMasterRequest;
using Gs2.Gs2LoginReward.Result.UpdateCurrentBonusMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.UpdateCurrentBonusMasterResult> asyncResult = null;
yield return client.UpdateCurrentBonusMaster(
new Gs2.Gs2LoginReward.Request.UpdateCurrentBonusMasterRequest()
.WithNamespaceName("namespace1")
.WithSettings("{\"version\": \"2023-07-11\", \"bonusModels\": [{\"name\": \"schedule\", \"mode\": \"schedule\", \"periodEventId\": \"grn:gs2:schedule:grn-0001\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"disabled\"}, {\"name\": \"streaming\", \"mode\": \"streaming\", \"resetHour\": 15, \"repeat\": \"enabled\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"enabled\", \"missedReceiveReliefConsumeActions\": [{\"action\": \"Gs2Money:WithdrawByUserId\", \"request\": {\"namespaceName\": \"money-0001\", \"userId\": \"#{userId}\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}}]}]}"),
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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.updateCurrentBonusMaster(
new Gs2LoginReward.UpdateCurrentBonusMasterRequest()
.withNamespaceName("namespace1")
.withSettings("{\"version\": \"2023-07-11\", \"bonusModels\": [{\"name\": \"schedule\", \"mode\": \"schedule\", \"periodEventId\": \"grn:gs2:schedule:grn-0001\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"disabled\"}, {\"name\": \"streaming\", \"mode\": \"streaming\", \"resetHour\": 15, \"repeat\": \"enabled\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"enabled\", \"missedReceiveReliefConsumeActions\": [{\"action\": \"Gs2Money:WithdrawByUserId\", \"request\": {\"namespaceName\": \"money-0001\", \"userId\": \"#{userId}\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}}]}]}")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.update_current_bonus_master(
login_reward.UpdateCurrentBonusMasterRequest()
.with_namespace_name(self.hash1)
.with_settings('{"version": "2023-07-11", "bonusModels": [{"name": "schedule", "mode": "schedule", "periodEventId": "grn:gs2:schedule:grn-0001", "rewards": [{"acquireActions": [{"action": "Gs2Stamina:RecoverStaminaByUserId", "request": {"namespaceName": "stamina-0001", "staminaName": "quest", "userId": "#{userId}", "recoverValue": 100}}]}, {"acquireActions": [{"action": "Gs2Stamina:RecoverStaminaByUserId", "request": {"namespaceName": "stamina-0001", "staminaName": "quest", "userId": "#{userId}", "recoverValue": 100}}]}, {"acquireActions": [{"action": "Gs2Stamina:RecoverStaminaByUserId", "request": {"namespaceName": "stamina-0001", "staminaName": "quest", "userId": "#{userId}", "recoverValue": 100}}]}], "missedReceiveRelief": "disabled"}, {"name": "streaming", "mode": "streaming", "resetHour": 15, "repeat": "enabled", "rewards": [{"acquireActions": [{"action": "Gs2Stamina:RecoverStaminaByUserId", "request": {"namespaceName": "stamina-0001", "staminaName": "quest", "userId": "#{userId}", "recoverValue": 100}}]}, {"acquireActions": [{"action": "Gs2Stamina:RecoverStaminaByUserId", "request": {"namespaceName": "stamina-0001", "staminaName": "quest", "userId": "#{userId}", "recoverValue": 100}}]}, {"acquireActions": [{"action": "Gs2Stamina:RecoverStaminaByUserId", "request": {"namespaceName": "stamina-0001", "staminaName": "quest", "userId": "#{userId}", "recoverValue": 100}}]}], "missedReceiveRelief": "enabled", "missedReceiveReliefConsumeActions": [{"action": "Gs2Money:WithdrawByUserId", "request": {"namespaceName": "money-0001", "userId": "#{userId}", "slot": 0, "count": 200, "paidOnly": false}}]}]}')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.update_current_bonus_master({
namespaceName="namespace1",
settings="{\"version\": \"2023-07-11\", \"bonusModels\": [{\"name\": \"schedule\", \"mode\": \"schedule\", \"periodEventId\": \"grn:gs2:schedule:grn-0001\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"disabled\"}, {\"name\": \"streaming\", \"mode\": \"streaming\", \"resetHour\": 15, \"repeat\": \"enabled\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"enabled\", \"missedReceiveReliefConsumeActions\": [{\"action\": \"Gs2Money:WithdrawByUserId\", \"request\": {\"namespaceName\": \"money-0001\", \"userId\": \"#{userId}\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}}]}]}",
})
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('loginReward')
api_result_handler = client.update_current_bonus_master_async({
namespaceName="namespace1",
settings="{\"version\": \"2023-07-11\", \"bonusModels\": [{\"name\": \"schedule\", \"mode\": \"schedule\", \"periodEventId\": \"grn:gs2:schedule:grn-0001\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"disabled\"}, {\"name\": \"streaming\", \"mode\": \"streaming\", \"resetHour\": 15, \"repeat\": \"enabled\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"enabled\", \"missedReceiveReliefConsumeActions\": [{\"action\": \"Gs2Money:WithdrawByUserId\", \"request\": {\"namespaceName\": \"money-0001\", \"userId\": \"#{userId}\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}}]}]}",
})
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;
updateCurrentBonusMasterFromGitHub
現在有効な陳列棚マスターを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
checkoutSetting | GitHubCheckoutSetting | ✓ | GitHubからマスターデータをチェックアウトしてくる設定 |
Result
型 | 説明 | |
---|---|---|
item | CurrentBonusMaster | 更新した現在有効な陳列棚マスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.UpdateCurrentBonusMasterFromGitHub(
&login_reward.UpdateCurrentBonusMasterFromGitHubRequest {
NamespaceName: pointy.String("namespace1"),
CheckoutSetting: &loginReward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\UpdateCurrentBonusMasterFromGitHubRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCurrentBonusMasterFromGitHub(
(new UpdateCurrentBonusMasterFromGitHubRequest())
->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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.UpdateCurrentBonusMasterFromGitHubRequest;
import io.gs2.loginReward.result.UpdateCurrentBonusMasterFromGitHubResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
UpdateCurrentBonusMasterFromGitHubResult result = client.updateCurrentBonusMasterFromGitHub(
new UpdateCurrentBonusMasterFromGitHubRequest()
.withNamespaceName("namespace1")
.withCheckoutSetting(new GitHubCheckoutSetting()
.withApiKeyId("$gitHubApiKey1.apiKeyId")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
CurrentBonusMaster 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.UpdateCurrentBonusMasterFromGitHubRequest;
using Gs2.Gs2LoginReward.Result.UpdateCurrentBonusMasterFromGitHubResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.UpdateCurrentBonusMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentBonusMasterFromGitHub(
new Gs2.Gs2LoginReward.Request.UpdateCurrentBonusMasterFromGitHubRequest()
.WithNamespaceName("namespace1")
.WithCheckoutSetting(new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.updateCurrentBonusMasterFromGitHub(
new Gs2LoginReward.UpdateCurrentBonusMasterFromGitHubRequest()
.withNamespaceName("namespace1")
.withCheckoutSetting(new Gs2LoginReward.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 login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.update_current_bonus_master_from_git_hub(
login_reward.UpdateCurrentBonusMasterFromGitHubRequest()
.with_namespace_name(self.hash1)
.with_checkout_setting(login_reward.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('loginReward')
api_result = client.update_current_bonus_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('loginReward')
api_result_handler = client.update_current_bonus_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;
describeBonusModels
陳列棚の一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
items | List<BonusModel> | 陳列棚のリスト |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.DescribeBonusModels(
&login_reward.DescribeBonusModelsRequest {
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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\DescribeBonusModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeBonusModels(
(new DescribeBonusModelsRequest())
->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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.DescribeBonusModelsRequest;
import io.gs2.loginReward.result.DescribeBonusModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
DescribeBonusModelsResult result = client.describeBonusModels(
new DescribeBonusModelsRequest()
.withNamespaceName("namespace1")
);
List<BonusModel> 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.DescribeBonusModelsRequest;
using Gs2.Gs2LoginReward.Result.DescribeBonusModelsResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.DescribeBonusModelsResult> asyncResult = null;
yield return client.DescribeBonusModels(
new Gs2.Gs2LoginReward.Request.DescribeBonusModelsRequest()
.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.describeBonusModels(
new Gs2LoginReward.DescribeBonusModelsRequest()
.withNamespaceName("namespace1")
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.describe_bonus_models(
login_reward.DescribeBonusModelsRequest()
.with_namespace_name(self.hash1)
)
items = result.items
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.describe_bonus_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('loginReward')
api_result_handler = client.describe_bonus_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;
getBonusModel
陳列棚を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
bonusModelName | string | ✓ | ~ 128文字 | ボーナスモデル名 |
Result
型 | 説明 | |
---|---|---|
item | BonusModel | 陳列棚 |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.GetBonusModel(
&login_reward.GetBonusModelRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\GetBonusModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getBonusModel(
(new GetBonusModelRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.GetBonusModelRequest;
import io.gs2.loginReward.result.GetBonusModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
GetBonusModelResult result = client.getBonusModel(
new GetBonusModelRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
);
BonusModel 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.GetBonusModelRequest;
using Gs2.Gs2LoginReward.Result.GetBonusModelResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.GetBonusModelResult> asyncResult = null;
yield return client.GetBonusModel(
new Gs2.Gs2LoginReward.Request.GetBonusModelRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.getBonusModel(
new Gs2LoginReward.GetBonusModelRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.get_bonus_model(
login_reward.GetBonusModelRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.get_bonus_model({
namespaceName="namespace1",
bonusModelName="bonus-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('loginReward')
api_result_handler = client.get_bonus_model_async({
namespaceName="namespace1",
bonusModelName="bonus-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;
receive
ログインボーナスを受け取る
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
bonusModelName | string | ✓ | ~ 128文字 | ボーナスモデル名 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID | ||
config | List<Config> | [] | ~ 32 items | トランザクションの変数に適用する設定値 |
Result
型 | 説明 | |
---|---|---|
item | ReceiveStatus | 受け取り状態 |
bonusModel | BonusModel | ログインボーナスモデル |
transactionId | string | 発行されたトランザクションID |
stampSheet | string | 購入処理の実行に使用するスタンプシート |
stampSheetEncryptionKeyId | string | スタンプシートの署名計算に使用した暗号鍵GRN |
autoRunStampSheet | bool? | トランザクションの自動実行が有効か |
atomicCommit | bool? | トランザクションをアトミックにコミットするか |
transaction | string | 発行されたトランザクション |
transactionResult | TransactionResult | トランザクション実行結果 |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.Receive(
&login_reward.ReceiveRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
AccessToken: pointy.String("accessToken-0001"),
Config: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\ReceiveRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->receive(
(new ReceiveRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withAccessToken(self::$accessToken0001)
->withConfig(null)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
$transactionId = $result->getTransactionId();
$stampSheet = $result->getStampSheet();
$stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
$autoRunStampSheet = $result->getAutoRunStampSheet();
$atomicCommit = $result->getAtomicCommit();
$transaction = $result->getTransaction();
$transactionResult = $result->getTransactionResult();
} 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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.ReceiveRequest;
import io.gs2.loginReward.result.ReceiveResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
ReceiveResult result = client.receive(
new ReceiveRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withAccessToken("accessToken-0001")
.withConfig(null)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
String transactionId = result.getTransactionId();
String stampSheet = result.getStampSheet();
String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
boolean autoRunStampSheet = result.getAutoRunStampSheet();
boolean atomicCommit = result.getAtomicCommit();
String transaction = result.getTransaction();
TransactionResult transactionResult = result.getTransactionResult();
} 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.ReceiveRequest;
using Gs2.Gs2LoginReward.Result.ReceiveResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.ReceiveResult> asyncResult = null;
yield return client.Receive(
new Gs2.Gs2LoginReward.Request.ReceiveRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithAccessToken("accessToken-0001")
.WithConfig(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.receive(
new Gs2LoginReward.ReceiveRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withAccessToken("accessToken-0001")
.withConfig(null)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
const transactionId = result.getTransactionId();
const stampSheet = result.getStampSheet();
const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
const autoRunStampSheet = result.getAutoRunStampSheet();
const atomicCommit = result.getAtomicCommit();
const transaction = result.getTransaction();
const transactionResult = result.getTransactionResult();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.receive(
login_reward.ReceiveRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_access_token(self.access_token_0001)
.with_config(None)
)
item = result.item
bonus_model = result.bonus_model
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
atomic_commit = result.atomic_commit
transaction = result.transaction
transaction_result = result.transaction_result
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.receive({
namespaceName="namespace1",
bonusModelName="bonus-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
item = result.item;
bonusModel = result.bonusModel;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
client = gs2('loginReward')
api_result_handler = client.receive_async({
namespaceName="namespace1",
bonusModelName="bonus-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
item = result.item;
bonusModel = result.bonusModel;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
receiveByUserId
ユーザIDを指定してログインボーナスを受け取る
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
bonusModelName | string | ✓ | ~ 128文字 | ボーナスモデル名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
config | List<Config> | [] | ~ 32 items | トランザクションの変数に適用する設定値 | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | ReceiveStatus | 受け取り状態 |
bonusModel | BonusModel | ログインボーナスモデル |
transactionId | string | 発行されたトランザクションID |
stampSheet | string | 購入処理の実行に使用するスタンプシート |
stampSheetEncryptionKeyId | string | スタンプシートの署名計算に使用した暗号鍵GRN |
autoRunStampSheet | bool? | トランザクションの自動実行が有効か |
atomicCommit | bool? | トランザクションをアトミックにコミットするか |
transaction | string | 発行されたトランザクション |
transactionResult | TransactionResult | トランザクション実行結果 |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.ReceiveByUserId(
&login_reward.ReceiveByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
UserId: pointy.String("user-0001"),
Config: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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)
->withBonusModelName("bonus-0001")
->withUserId("user-0001")
->withConfig(null)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
$transactionId = $result->getTransactionId();
$stampSheet = $result->getStampSheet();
$stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
$autoRunStampSheet = $result->getAutoRunStampSheet();
$atomicCommit = $result->getAtomicCommit();
$transaction = $result->getTransaction();
$transactionResult = $result->getTransactionResult();
} 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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.ReceiveByUserIdRequest;
import io.gs2.loginReward.result.ReceiveByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
ReceiveByUserIdResult result = client.receiveByUserId(
new ReceiveByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withConfig(null)
.withTimeOffsetToken(null)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
String transactionId = result.getTransactionId();
String stampSheet = result.getStampSheet();
String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
boolean autoRunStampSheet = result.getAutoRunStampSheet();
boolean atomicCommit = result.getAtomicCommit();
String transaction = result.getTransaction();
TransactionResult transactionResult = result.getTransactionResult();
} 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.ReceiveByUserIdRequest;
using Gs2.Gs2LoginReward.Result.ReceiveByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.ReceiveByUserIdResult> asyncResult = null;
yield return client.ReceiveByUserId(
new Gs2.Gs2LoginReward.Request.ReceiveByUserIdRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithUserId("user-0001")
.WithConfig(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.receiveByUserId(
new Gs2LoginReward.ReceiveByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withConfig(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
const transactionId = result.getTransactionId();
const stampSheet = result.getStampSheet();
const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
const autoRunStampSheet = result.getAutoRunStampSheet();
const atomicCommit = result.getAtomicCommit();
const transaction = result.getTransaction();
const transactionResult = result.getTransactionResult();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.receive_by_user_id(
login_reward.ReceiveByUserIdRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_user_id('user-0001')
.with_config(None)
.with_time_offset_token(None)
)
item = result.item
bonus_model = result.bonus_model
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
atomic_commit = result.atomic_commit
transaction = result.transaction
transaction_result = result.transaction_result
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.receive_by_user_id({
namespaceName="namespace1",
bonusModelName="bonus-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
item = result.item;
bonusModel = result.bonusModel;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
client = gs2('loginReward')
api_result_handler = client.receive_by_user_id_async({
namespaceName="namespace1",
bonusModelName="bonus-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
item = result.item;
bonusModel = result.bonusModel;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
missedReceive
ログインボーナスを受け取る
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
bonusModelName | string | ✓ | ~ 128文字 | ボーナスモデル名 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID | ||
stepNumber | int | ✓ | ~ 100 | 受け取るステップ番号 | ||
config | List<Config> | [] | ~ 32 items | トランザクションの変数に適用する設定値 |
Result
型 | 説明 | |
---|---|---|
item | ReceiveStatus | 受け取り状態 |
bonusModel | BonusModel | ログインボーナスモデル |
transactionId | string | 発行されたトランザクションID |
stampSheet | string | 購入処理の実行に使用するスタンプシート |
stampSheetEncryptionKeyId | string | スタンプシートの署名計算に使用した暗号鍵GRN |
autoRunStampSheet | bool? | トランザクションの自動実行が有効か |
atomicCommit | bool? | トランザクションをアトミックにコミットするか |
transaction | string | 発行されたトランザクション |
transactionResult | TransactionResult | トランザクション実行結果 |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.MissedReceive(
&login_reward.MissedReceiveRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
AccessToken: pointy.String("accessToken-0001"),
StepNumber: pointy.Int32(1),
Config: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\MissedReceiveRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->missedReceive(
(new MissedReceiveRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withAccessToken(self::$accessToken0001)
->withStepNumber(1)
->withConfig(null)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
$transactionId = $result->getTransactionId();
$stampSheet = $result->getStampSheet();
$stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
$autoRunStampSheet = $result->getAutoRunStampSheet();
$atomicCommit = $result->getAtomicCommit();
$transaction = $result->getTransaction();
$transactionResult = $result->getTransactionResult();
} 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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.MissedReceiveRequest;
import io.gs2.loginReward.result.MissedReceiveResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
MissedReceiveResult result = client.missedReceive(
new MissedReceiveRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withAccessToken("accessToken-0001")
.withStepNumber(1)
.withConfig(null)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
String transactionId = result.getTransactionId();
String stampSheet = result.getStampSheet();
String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
boolean autoRunStampSheet = result.getAutoRunStampSheet();
boolean atomicCommit = result.getAtomicCommit();
String transaction = result.getTransaction();
TransactionResult transactionResult = result.getTransactionResult();
} 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.MissedReceiveRequest;
using Gs2.Gs2LoginReward.Result.MissedReceiveResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.MissedReceiveResult> asyncResult = null;
yield return client.MissedReceive(
new Gs2.Gs2LoginReward.Request.MissedReceiveRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithAccessToken("accessToken-0001")
.WithStepNumber(1)
.WithConfig(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.missedReceive(
new Gs2LoginReward.MissedReceiveRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withAccessToken("accessToken-0001")
.withStepNumber(1)
.withConfig(null)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
const transactionId = result.getTransactionId();
const stampSheet = result.getStampSheet();
const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
const autoRunStampSheet = result.getAutoRunStampSheet();
const atomicCommit = result.getAtomicCommit();
const transaction = result.getTransaction();
const transactionResult = result.getTransactionResult();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.missed_receive(
login_reward.MissedReceiveRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_access_token(self.access_token_0001)
.with_step_number(1)
.with_config(None)
)
item = result.item
bonus_model = result.bonus_model
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
atomic_commit = result.atomic_commit
transaction = result.transaction
transaction_result = result.transaction_result
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.missed_receive({
namespaceName="namespace1",
bonusModelName="bonus-0001",
accessToken="accessToken-0001",
stepNumber=1,
config=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
client = gs2('loginReward')
api_result_handler = client.missed_receive_async({
namespaceName="namespace1",
bonusModelName="bonus-0001",
accessToken="accessToken-0001",
stepNumber=1,
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
item = result.item;
bonusModel = result.bonusModel;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
missedReceiveByUserId
ユーザIDを指定してログインボーナスを受け取る
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
bonusModelName | string | ✓ | ~ 128文字 | ボーナスモデル名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
stepNumber | int | ✓ | ~ 100 | 受け取るステップ番号 | ||
config | List<Config> | [] | ~ 32 items | トランザクションの変数に適用する設定値 | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | ReceiveStatus | 受け取り状態 |
bonusModel | BonusModel | ログインボーナスモデル |
transactionId | string | 発行されたトランザクションID |
stampSheet | string | 購入処理の実行に使用するスタンプシート |
stampSheetEncryptionKeyId | string | スタンプシートの署名計算に使用した暗号鍵GRN |
autoRunStampSheet | bool? | トランザクションの自動実行が有効か |
atomicCommit | bool? | トランザクションをアトミックにコミットするか |
transaction | string | 発行されたトランザクション |
transactionResult | TransactionResult | トランザクション実行結果 |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.MissedReceiveByUserId(
&login_reward.MissedReceiveByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
UserId: pointy.String("user-0001"),
StepNumber: pointy.Int32(1),
Config: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\MissedReceiveByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->missedReceiveByUserId(
(new MissedReceiveByUserIdRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withUserId("user-0001")
->withStepNumber(1)
->withConfig(null)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
$transactionId = $result->getTransactionId();
$stampSheet = $result->getStampSheet();
$stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
$autoRunStampSheet = $result->getAutoRunStampSheet();
$atomicCommit = $result->getAtomicCommit();
$transaction = $result->getTransaction();
$transactionResult = $result->getTransactionResult();
} 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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.MissedReceiveByUserIdRequest;
import io.gs2.loginReward.result.MissedReceiveByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
MissedReceiveByUserIdResult result = client.missedReceiveByUserId(
new MissedReceiveByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withStepNumber(1)
.withConfig(null)
.withTimeOffsetToken(null)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
String transactionId = result.getTransactionId();
String stampSheet = result.getStampSheet();
String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
boolean autoRunStampSheet = result.getAutoRunStampSheet();
boolean atomicCommit = result.getAtomicCommit();
String transaction = result.getTransaction();
TransactionResult transactionResult = result.getTransactionResult();
} 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.MissedReceiveByUserIdRequest;
using Gs2.Gs2LoginReward.Result.MissedReceiveByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.MissedReceiveByUserIdResult> asyncResult = null;
yield return client.MissedReceiveByUserId(
new Gs2.Gs2LoginReward.Request.MissedReceiveByUserIdRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithUserId("user-0001")
.WithStepNumber(1)
.WithConfig(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.missedReceiveByUserId(
new Gs2LoginReward.MissedReceiveByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withStepNumber(1)
.withConfig(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
const transactionId = result.getTransactionId();
const stampSheet = result.getStampSheet();
const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
const autoRunStampSheet = result.getAutoRunStampSheet();
const atomicCommit = result.getAtomicCommit();
const transaction = result.getTransaction();
const transactionResult = result.getTransactionResult();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.missed_receive_by_user_id(
login_reward.MissedReceiveByUserIdRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_user_id('user-0001')
.with_step_number(1)
.with_config(None)
.with_time_offset_token(None)
)
item = result.item
bonus_model = result.bonus_model
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
atomic_commit = result.atomic_commit
transaction = result.transaction
transaction_result = result.transaction_result
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.missed_receive_by_user_id({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
stepNumber=1,
config=nil,
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;
bonusModel = result.bonusModel;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
client = gs2('loginReward')
api_result_handler = client.missed_receive_by_user_id_async({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
stepNumber=1,
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
item = result.item;
bonusModel = result.bonusModel;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
describeReceiveStatuses
受け取り状態一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<ReceiveStatus> | 受け取り状態のリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.DescribeReceiveStatuses(
&login_reward.DescribeReceiveStatusesRequest {
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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\DescribeReceiveStatusesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeReceiveStatuses(
(new DescribeReceiveStatusesRequest())
->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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.DescribeReceiveStatusesRequest;
import io.gs2.loginReward.result.DescribeReceiveStatusesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
DescribeReceiveStatusesResult result = client.describeReceiveStatuses(
new DescribeReceiveStatusesRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
List<ReceiveStatus> 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.DescribeReceiveStatusesRequest;
using Gs2.Gs2LoginReward.Result.DescribeReceiveStatusesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.DescribeReceiveStatusesResult> asyncResult = null;
yield return client.DescribeReceiveStatuses(
new Gs2.Gs2LoginReward.Request.DescribeReceiveStatusesRequest()
.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.describeReceiveStatuses(
new Gs2LoginReward.DescribeReceiveStatusesRequest()
.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 login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.describe_receive_statuses(
login_reward.DescribeReceiveStatusesRequest()
.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('loginReward')
api_result = client.describe_receive_statuses({
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('loginReward')
api_result_handler = client.describe_receive_statuses_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;
describeReceiveStatusesByUserId
ユーザIDを指定して受け取り状態一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | |
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
items | List<ReceiveStatus> | 受け取り状態のリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.DescribeReceiveStatusesByUserId(
&login_reward.DescribeReceiveStatusesByUserIdRequest {
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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\DescribeReceiveStatusesByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeReceiveStatusesByUserId(
(new DescribeReceiveStatusesByUserIdRequest())
->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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.DescribeReceiveStatusesByUserIdRequest;
import io.gs2.loginReward.result.DescribeReceiveStatusesByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
DescribeReceiveStatusesByUserIdResult result = client.describeReceiveStatusesByUserId(
new DescribeReceiveStatusesByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<ReceiveStatus> 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.DescribeReceiveStatusesByUserIdRequest;
using Gs2.Gs2LoginReward.Result.DescribeReceiveStatusesByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.DescribeReceiveStatusesByUserIdResult> asyncResult = null;
yield return client.DescribeReceiveStatusesByUserId(
new Gs2.Gs2LoginReward.Request.DescribeReceiveStatusesByUserIdRequest()
.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.describeReceiveStatusesByUserId(
new Gs2LoginReward.DescribeReceiveStatusesByUserIdRequest()
.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 login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.describe_receive_statuses_by_user_id(
login_reward.DescribeReceiveStatusesByUserIdRequest()
.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('loginReward')
api_result = client.describe_receive_statuses_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('loginReward')
api_result_handler = client.describe_receive_statuses_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;
getReceiveStatus
受け取り状態を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
bonusModelName | string | ✓ | ~ 128文字 | ボーナスモデルの名前 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID |
Result
型 | 説明 | |
---|---|---|
item | ReceiveStatus | 受け取り状態 |
bonusModel | BonusModel | ログインボーナスモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.GetReceiveStatus(
&login_reward.GetReceiveStatusRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
AccessToken: pointy.String("accessToken-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\GetReceiveStatusRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getReceiveStatus(
(new GetReceiveStatusRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withAccessToken(self::$accessToken0001)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
} 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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.GetReceiveStatusRequest;
import io.gs2.loginReward.result.GetReceiveStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
GetReceiveStatusResult result = client.getReceiveStatus(
new GetReceiveStatusRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withAccessToken("accessToken-0001")
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
} 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.GetReceiveStatusRequest;
using Gs2.Gs2LoginReward.Result.GetReceiveStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.GetReceiveStatusResult> asyncResult = null;
yield return client.GetReceiveStatus(
new Gs2.Gs2LoginReward.Request.GetReceiveStatusRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithAccessToken("accessToken-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.getReceiveStatus(
new Gs2LoginReward.GetReceiveStatusRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withAccessToken("accessToken-0001")
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.get_receive_status(
login_reward.GetReceiveStatusRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_access_token(self.access_token_0001)
)
item = result.item
bonus_model = result.bonus_model
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.get_receive_status({
namespaceName="namespace1",
bonusModelName="bonus-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;
bonusModel = result.bonusModel;
client = gs2('loginReward')
api_result_handler = client.get_receive_status_async({
namespaceName="namespace1",
bonusModelName="bonus-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;
bonusModel = result.bonusModel;
getReceiveStatusByUserId
ユーザIDを指定して受け取り状態を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
bonusModelName | string | ✓ | ~ 128文字 | ボーナスモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | ReceiveStatus | 受け取り状態 |
bonusModel | BonusModel | ログインボーナスモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.GetReceiveStatusByUserId(
&login_reward.GetReceiveStatusByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\GetReceiveStatusByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getReceiveStatusByUserId(
(new GetReceiveStatusByUserIdRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
} 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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.GetReceiveStatusByUserIdRequest;
import io.gs2.loginReward.result.GetReceiveStatusByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
GetReceiveStatusByUserIdResult result = client.getReceiveStatusByUserId(
new GetReceiveStatusByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
} 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.GetReceiveStatusByUserIdRequest;
using Gs2.Gs2LoginReward.Result.GetReceiveStatusByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.GetReceiveStatusByUserIdResult> asyncResult = null;
yield return client.GetReceiveStatusByUserId(
new Gs2.Gs2LoginReward.Request.GetReceiveStatusByUserIdRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.getReceiveStatusByUserId(
new Gs2LoginReward.GetReceiveStatusByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.get_receive_status_by_user_id(
login_reward.GetReceiveStatusByUserIdRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_user_id('user-0001')
.with_time_offset_token(None)
)
item = result.item
bonus_model = result.bonus_model
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.get_receive_status_by_user_id({
namespaceName="namespace1",
bonusModelName="bonus-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;
bonusModel = result.bonusModel;
client = gs2('loginReward')
api_result_handler = client.get_receive_status_by_user_id_async({
namespaceName="namespace1",
bonusModelName="bonus-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;
bonusModel = result.bonusModel;
deleteReceiveStatusByUserId
ユーザIDを指定して受け取り状態のリセット
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
bonusModelName | string | ✓ | ~ 128文字 | ボーナスモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | ReceiveStatus | 受け取り状態 |
bonusModel | BonusModel | ログインボーナスモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.DeleteReceiveStatusByUserId(
&login_reward.DeleteReceiveStatusByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\DeleteReceiveStatusByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteReceiveStatusByUserId(
(new DeleteReceiveStatusByUserIdRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
} 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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.DeleteReceiveStatusByUserIdRequest;
import io.gs2.loginReward.result.DeleteReceiveStatusByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
DeleteReceiveStatusByUserIdResult result = client.deleteReceiveStatusByUserId(
new DeleteReceiveStatusByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
} 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.DeleteReceiveStatusByUserIdRequest;
using Gs2.Gs2LoginReward.Result.DeleteReceiveStatusByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.DeleteReceiveStatusByUserIdResult> asyncResult = null;
yield return client.DeleteReceiveStatusByUserId(
new Gs2.Gs2LoginReward.Request.DeleteReceiveStatusByUserIdRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.deleteReceiveStatusByUserId(
new Gs2LoginReward.DeleteReceiveStatusByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.delete_receive_status_by_user_id(
login_reward.DeleteReceiveStatusByUserIdRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_user_id('user-0001')
.with_time_offset_token(None)
)
item = result.item
bonus_model = result.bonus_model
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.delete_receive_status_by_user_id({
namespaceName="namespace1",
bonusModelName="bonus-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;
bonusModel = result.bonusModel;
client = gs2('loginReward')
api_result_handler = client.delete_receive_status_by_user_id_async({
namespaceName="namespace1",
bonusModelName="bonus-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;
bonusModel = result.bonusModel;
deleteReceiveStatusByStampSheet
入手アクションとして受け取り状態のリセットを実行
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
stampSheet | string | ✓ | ~ 5242880文字 | トランザクション | ||
keyId | string | ✓ | ~ 1024文字 | 暗号鍵GRN |
Result
型 | 説明 | |
---|---|---|
item | ReceiveStatus | 受け取り状態 |
bonusModel | BonusModel | ログインボーナスモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.DeleteReceiveStatusByStampSheet(
&login_reward.DeleteReceiveStatusByStampSheetRequest {
StampSheet: pointy.String("stampSheet"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\DeleteReceiveStatusByStampSheetRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteReceiveStatusByStampSheet(
(new DeleteReceiveStatusByStampSheetRequest())
->withStampSheet(self::stampSheet)
->withKeyId(self::key-0001)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
} 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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.DeleteReceiveStatusByStampSheetRequest;
import io.gs2.loginReward.result.DeleteReceiveStatusByStampSheetResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
DeleteReceiveStatusByStampSheetResult result = client.deleteReceiveStatusByStampSheet(
new DeleteReceiveStatusByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
} 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.DeleteReceiveStatusByStampSheetRequest;
using Gs2.Gs2LoginReward.Result.DeleteReceiveStatusByStampSheetResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.DeleteReceiveStatusByStampSheetResult> asyncResult = null;
yield return client.DeleteReceiveStatusByStampSheet(
new Gs2.Gs2LoginReward.Request.DeleteReceiveStatusByStampSheetRequest()
.WithStampSheet("stampSheet")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.deleteReceiveStatusByStampSheet(
new Gs2LoginReward.DeleteReceiveStatusByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.delete_receive_status_by_stamp_sheet(
login_reward.DeleteReceiveStatusByStampSheetRequest()
.with_stamp_sheet(self.stamp_sheet)
.with_key_id(self.key1.key_id)
)
item = result.item
bonus_model = result.bonus_model
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.delete_receive_status_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;
bonusModel = result.bonusModel;
client = gs2('loginReward')
api_result_handler = client.delete_receive_status_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;
bonusModel = result.bonusModel;
markReceived
受け取り済み化
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
bonusModelName | string | ✓ | ~ 128文字 | ボーナスモデルの名前 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID | ||
stepNumber | int | ✓ | ~ 100 | ステップ番号 |
Result
型 | 説明 | |
---|---|---|
item | ReceiveStatus | 受け取り状態 |
bonusModel | BonusModel | ログインボーナスモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.MarkReceived(
&login_reward.MarkReceivedRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
AccessToken: pointy.String("accessToken-0001"),
StepNumber: pointy.Int32(1),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\MarkReceivedRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->markReceived(
(new MarkReceivedRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withAccessToken(self::$accessToken0001)
->withStepNumber(1)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
} 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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.MarkReceivedRequest;
import io.gs2.loginReward.result.MarkReceivedResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
MarkReceivedResult result = client.markReceived(
new MarkReceivedRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withAccessToken("accessToken-0001")
.withStepNumber(1)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
} 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.MarkReceivedRequest;
using Gs2.Gs2LoginReward.Result.MarkReceivedResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.MarkReceivedResult> asyncResult = null;
yield return client.MarkReceived(
new Gs2.Gs2LoginReward.Request.MarkReceivedRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithAccessToken("accessToken-0001")
.WithStepNumber(1),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.markReceived(
new Gs2LoginReward.MarkReceivedRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withAccessToken("accessToken-0001")
.withStepNumber(1)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.mark_received(
login_reward.MarkReceivedRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_access_token(self.access_token_0001)
.with_step_number(1)
)
item = result.item
bonus_model = result.bonus_model
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.mark_received({
namespaceName="namespace1",
bonusModelName="bonus-0001",
accessToken="accessToken-0001",
stepNumber=1,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
client = gs2('loginReward')
api_result_handler = client.mark_received_async({
namespaceName="namespace1",
bonusModelName="bonus-0001",
accessToken="accessToken-0001",
stepNumber=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;
bonusModel = result.bonusModel;
markReceivedByUserId
ユーザIDを指定して受け取り済み化
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
bonusModelName | string | ✓ | ~ 128文字 | ボーナスモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
stepNumber | int | ✓ | ~ 100 | ステップ番号 | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | ReceiveStatus | 受け取り状態 |
bonusModel | BonusModel | ログインボーナスモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.MarkReceivedByUserId(
&login_reward.MarkReceivedByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
UserId: pointy.String("user-0001"),
StepNumber: pointy.Int32(1),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\MarkReceivedByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->markReceivedByUserId(
(new MarkReceivedByUserIdRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withUserId("user-0001")
->withStepNumber(1)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
} 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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.MarkReceivedByUserIdRequest;
import io.gs2.loginReward.result.MarkReceivedByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
MarkReceivedByUserIdResult result = client.markReceivedByUserId(
new MarkReceivedByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withStepNumber(1)
.withTimeOffsetToken(null)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
} 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.MarkReceivedByUserIdRequest;
using Gs2.Gs2LoginReward.Result.MarkReceivedByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.MarkReceivedByUserIdResult> asyncResult = null;
yield return client.MarkReceivedByUserId(
new Gs2.Gs2LoginReward.Request.MarkReceivedByUserIdRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithUserId("user-0001")
.WithStepNumber(1)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.markReceivedByUserId(
new Gs2LoginReward.MarkReceivedByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withStepNumber(1)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.mark_received_by_user_id(
login_reward.MarkReceivedByUserIdRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_user_id('user-0001')
.with_step_number(1)
.with_time_offset_token(None)
)
item = result.item
bonus_model = result.bonus_model
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.mark_received_by_user_id({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
stepNumber=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;
bonusModel = result.bonusModel;
client = gs2('loginReward')
api_result_handler = client.mark_received_by_user_id_async({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
stepNumber=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;
bonusModel = result.bonusModel;
unmarkReceivedByUserId
ユーザIDを指定して未受け取り化
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
bonusModelName | string | ✓ | ~ 128文字 | ボーナスモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
stepNumber | int | ✓ | ~ 100 | ステップ番号 | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | ReceiveStatus | 受け取り状態 |
bonusModel | BonusModel | ログインボーナスモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.UnmarkReceivedByUserId(
&login_reward.UnmarkReceivedByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
UserId: pointy.String("user-0001"),
StepNumber: pointy.Int32(1),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\UnmarkReceivedByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->unmarkReceivedByUserId(
(new UnmarkReceivedByUserIdRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withUserId("user-0001")
->withStepNumber(1)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
} 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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.UnmarkReceivedByUserIdRequest;
import io.gs2.loginReward.result.UnmarkReceivedByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
UnmarkReceivedByUserIdResult result = client.unmarkReceivedByUserId(
new UnmarkReceivedByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withStepNumber(1)
.withTimeOffsetToken(null)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
} 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.UnmarkReceivedByUserIdRequest;
using Gs2.Gs2LoginReward.Result.UnmarkReceivedByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.UnmarkReceivedByUserIdResult> asyncResult = null;
yield return client.UnmarkReceivedByUserId(
new Gs2.Gs2LoginReward.Request.UnmarkReceivedByUserIdRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithUserId("user-0001")
.WithStepNumber(1)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.unmarkReceivedByUserId(
new Gs2LoginReward.UnmarkReceivedByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withStepNumber(1)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.unmark_received_by_user_id(
login_reward.UnmarkReceivedByUserIdRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_user_id('user-0001')
.with_step_number(1)
.with_time_offset_token(None)
)
item = result.item
bonus_model = result.bonus_model
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.unmark_received_by_user_id({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
stepNumber=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;
bonusModel = result.bonusModel;
client = gs2('loginReward')
api_result_handler = client.unmark_received_by_user_id_async({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
stepNumber=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;
bonusModel = result.bonusModel;
markReceivedByStampTask
消費アクションとして受け取り済み化を実行
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
stampTask | string | ✓ | ~ 5242880文字 | 消費アクション | ||
keyId | string | ✓ | ~ 1024文字 | 暗号鍵GRN |
Result
型 | 説明 | |
---|---|---|
item | ReceiveStatus | 受け取り状態 |
bonusModel | BonusModel | ログインボーナスモデル |
newContextStack | string | 消費アクションの実行結果を記録したコンテキスト |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.MarkReceivedByStampTask(
&login_reward.MarkReceivedByStampTaskRequest {
StampTask: pointy.String("stampTask"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\MarkReceivedByStampTaskRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->markReceivedByStampTask(
(new MarkReceivedByStampTaskRequest())
->withStampTask(self::stampTask)
->withKeyId(self::key-0001)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
$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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.MarkReceivedByStampTaskRequest;
import io.gs2.loginReward.result.MarkReceivedByStampTaskResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
MarkReceivedByStampTaskResult result = client.markReceivedByStampTask(
new MarkReceivedByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.MarkReceivedByStampTaskRequest;
using Gs2.Gs2LoginReward.Result.MarkReceivedByStampTaskResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.MarkReceivedByStampTaskResult> asyncResult = null;
yield return client.MarkReceivedByStampTask(
new Gs2.Gs2LoginReward.Request.MarkReceivedByStampTaskRequest()
.WithStampTask("stampTask")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.markReceivedByStampTask(
new Gs2LoginReward.MarkReceivedByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
const newContextStack = result.getNewContextStack();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.mark_received_by_stamp_task(
login_reward.MarkReceivedByStampTaskRequest()
.with_stamp_task(self.stamp_task)
.with_key_id(self.key1.key_id)
)
item = result.item
bonus_model = result.bonus_model
new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.mark_received_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;
bonusModel = result.bonusModel;
newContextStack = result.newContextStack;
client = gs2('loginReward')
api_result_handler = client.mark_received_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;
bonusModel = result.bonusModel;
newContextStack = result.newContextStack;
unmarkReceivedByStampSheet
入手アクションとして未受け取り化を実行
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
stampSheet | string | ✓ | ~ 5242880文字 | トランザクション | ||
keyId | string | ✓ | ~ 1024文字 | 暗号鍵GRN |
Result
型 | 説明 | |
---|---|---|
item | ReceiveStatus | 受け取り状態 |
bonusModel | BonusModel | ログインボーナスモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.UnmarkReceivedByStampSheet(
&login_reward.UnmarkReceivedByStampSheetRequest {
StampSheet: pointy.String("stampSheet"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\UnmarkReceivedByStampSheetRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->unmarkReceivedByStampSheet(
(new UnmarkReceivedByStampSheetRequest())
->withStampSheet(self::stampSheet)
->withKeyId(self::key-0001)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
} 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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.UnmarkReceivedByStampSheetRequest;
import io.gs2.loginReward.result.UnmarkReceivedByStampSheetResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
UnmarkReceivedByStampSheetResult result = client.unmarkReceivedByStampSheet(
new UnmarkReceivedByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
} 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.UnmarkReceivedByStampSheetRequest;
using Gs2.Gs2LoginReward.Result.UnmarkReceivedByStampSheetResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.UnmarkReceivedByStampSheetResult> asyncResult = null;
yield return client.UnmarkReceivedByStampSheet(
new Gs2.Gs2LoginReward.Request.UnmarkReceivedByStampSheetRequest()
.WithStampSheet("stampSheet")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.unmarkReceivedByStampSheet(
new Gs2LoginReward.UnmarkReceivedByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.unmark_received_by_stamp_sheet(
login_reward.UnmarkReceivedByStampSheetRequest()
.with_stamp_sheet(self.stamp_sheet)
.with_key_id(self.key1.key_id)
)
item = result.item
bonus_model = result.bonus_model
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.unmark_received_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;
bonusModel = result.bonusModel;
client = gs2('loginReward')
api_result_handler = client.unmark_received_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;
bonusModel = result.bonusModel;