GS2-Buff SDK API リファレンス
モデル
Namespace
ネームスペース
ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。 GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。
そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024文字 | ネームスペースGRN | ||
name | string | ✓ | ~ 128文字 | ネームスペース名 | ||
description | string | ~ 1024文字 | 説明文 | |||
applyBuffScript | ScriptSetting | バフを適用する際に実行するスクリプト | ||||
logSetting | LogSetting | ログの出力設定 | ||||
createdAt | long | ✓ | 作成日時 | |||
updatedAt | long | ✓ | 最終更新日時 | |||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
BuffTargetModel
モデルに適用するバフ
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
targetModelName | enum [ "Gs2Exchange:RateModel", "Gs2Exchange:IncrementalRateModel", "Gs2Experience:Status", "Gs2Formation:Mold", "Gs2Idle:CategoryModel", "Gs2Idle:Status", "Gs2Inventory:Inventory", "Gs2LoginReward:BonusModel", "Gs2Mission:MissionTaskModel", "Gs2Quest:QuestModel", "Gs2Showcase:DisplayItem", "Gs2Showcase:RandomDisplayItemModel", "Gs2SkillTree:NodeModel", "Gs2Stamina:Stamina", ] | ✓ | ~ 128文字 | バフを適用するモデルの種類 | ||
targetFieldName | string | ✓ | ~ 64文字 | バフの適用対象フィールド名 | ||
conditionGrns | List<BuffTargetGrn> | ✓ | 1 ~ 10 items | バフの適用条件GRNのリスト | ||
rate | float | ✓ | ~ 1000000 | レート |
BuffTargetAction
アクションに適用するバフ
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
targetActionName | enum [ "Gs2Experience:AddExperienceByUserId", "Gs2Experience:SubExperience", "Gs2Experience:SubExperienceByUserId", "Gs2Inventory:AcquireItemSetByUserId", "Gs2Inventory:ConsumeItemSet", "Gs2Inventory:ConsumeItemSetByUserId", "Gs2Inventory:AcquireSimpleItemsByUserId", "Gs2Inventory:ConsumeSimpleItems", "Gs2Inventory:ConsumeSimpleItemsByUserId", "Gs2Inventory:AcquireBigItemByUserId", "Gs2Inventory:ConsumeBigItem", "Gs2Inventory:ConsumeBigItemByUserId", "Gs2Limit:CountUp", "Gs2Limit:CountUpByUserId", "Gs2Money:DepositByUserId", "Gs2Money:Withdraw", "Gs2Money:WithdrawByUserId", "Gs2Money2:DepositByUserId", "Gs2Money2:Withdraw", "Gs2Money2:WithdrawByUserId", "Gs2Stamina:ConsumeStamina", "Gs2Stamina:ConsumeStaminaByUserId", "Gs2Stamina:RecoverStaminaByUserId", ] | ✓ | ~ 128文字 | バフを適用するアクションの種類 | ||
targetFieldName | string | ✓ | ~ 64文字 | バフの適用対象フィールド名 | ||
conditionGrns | List<BuffTargetGrn> | ✓ | 1 ~ 10 items | バフの適用条件GRNのリスト | ||
rate | float | ✓ | ~ 1000000 | レート |
BuffTargetGrn
バフを適用するリソースのGRNパターン
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
targetModelName | string | ✓ | ~ 64文字 | バフの適用条件のモデル名 | ||
targetGrn | string | ✓ | ~ 1024文字 | バフの適用条件GRN |
BuffEntryModel
バフモデル
バフの適用量は BuffEntryModel で管理し、特定のエントリーに対して複数の BuffEntryModel を関連づけることが可能です。 BuffEntryModel の適用順番は BuffEntryModel の priority で管理し、priority の値が小さいほど優先度が高くなります。
バフの適用方式は2種類存在し「Add」と「Mul」があります。 Add はバフの適用レートに加算する命令で、Mul はバフの適用レートに乗算する命令です。 デフォルトのレートは 1.0 で、Add 0.2 と設定するとバフの適用レートが 1.2 になります。 Mul 0.5 と設定するとバフの適用レートが 0.5 倍になります。
BuffEntryModel には GS2-Schedule のイベントを関連づけることができ、イベントの開催期間中のみバフを適用するような設定も可能です。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
buffEntryModelId | string | ✓ | ~ 1024文字 | バフモデルGRN | ||
name | string | ✓ | ~ 128文字 | バフエンティティ名 | ||
metadata | string | ~ 2048文字 | メタデータ | |||
expression | enum [ “rate_add”, “mul”, “value_add” ] | ✓ | ~ 128文字 | バフの適用タイプ | ||
targetType | enum [ “model”, “action” ] | ✓ | ~ 128文字 | バフをかける対象の種類 | ||
targetModel | BuffTargetModel | {targetType} == “model” | ✓ | バフをかける対象のモデル | ||
targetAction | BuffTargetAction | {targetType} == “action” | ✓ | バフをかける対象のアクション | ||
priority | int | ✓ | ~ 2147483646 | バフの適用優先度 | ||
applyPeriodScheduleEventId | string | ~ 1024文字 | バフを適用するイベントの開催期間 |
BuffEntryModelMaster
バフモデルマスター
バフの適用量は BuffEntryModel で管理し、特定のエントリーに対して複数の BuffEntryModel を関連づけることが可能です。 BuffEntryModel の適用順番は BuffEntryModel の priority で管理し、priority の値が小さいほど優先度が高くなります。
バフの適用方式は2種類存在し「Add」と「Mul」があります。 Add はバフの適用レートに加算する命令で、Mul はバフの適用レートに乗算する命令です。 デフォルトのレートは 1.0 で、Add 0.2 と設定するとバフの適用レートが 1.2 になります。 Mul 0.5 と設定するとバフの適用レートが 0.5 倍になります。
BuffEntryModel には GS2-Schedule のイベントを関連づけることができ、イベントの開催期間中のみバフを適用するような設定も可能です。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
buffEntryModelId | string | ✓ | ~ 1024文字 | バフマスターGRN | ||
name | string | ✓ | ~ 128文字 | バフエンティティ名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 2048文字 | メタデータ | |||
expression | enum [ “rate_add”, “mul”, “value_add” ] | ✓ | ~ 128文字 | バフの適用タイプ | ||
targetType | enum [ “model”, “action” ] | ✓ | ~ 128文字 | バフをかける対象の種類 | ||
targetModel | BuffTargetModel | {targetType} == “model” | ✓ | バフをかける対象のモデル | ||
targetAction | BuffTargetAction | {targetType} == “action” | ✓ | バフをかける対象のアクション | ||
priority | int | ✓ | ~ 2147483646 | バフの適用優先度 | ||
applyPeriodScheduleEventId | string | ~ 1024文字 | バフを適用するイベントの開催期間 | |||
createdAt | long | ✓ | 作成日時 | |||
updatedAt | long | ✓ | 最終更新日時 | |||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
CurrentBuffMaster
現在有効なマスターデータ
GS2ではマスターデータの管理にJSON形式のファイルを使用します。 ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。
JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。
JSONファイルの形式についてはドキュメントを参照ください。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024文字 | 現在有効なバフ設定GRN | ||
settings | string | ✓ | ~ 5242880文字 | マスターデータ |
OverrideBuffRate
バフの適用レート上書きモデル
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | バフエンティティ名 | ||
rate | float | ✓ | ~ 100 | レート |
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 |
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文字 | タグ名 |
LogSetting
ログの書き出し設定
ログデータの書き出し設定を管理します。この型は、ログデータを書き出すために使用されるログ名前空間の識別子(Namespace ID)を保持します。 ログ名前空間IDは、ログデータを集約し、保存する対象の GS2-Log の名前空間を指定します。 この設定を通じて、この名前空間以下のAPIリクエスト・レスポンスログデータが対象の GS2-Log へ出力されるようになります。 GS2-Log にはリアルタイムでログが提供され、システムの監視や分析、デバッグなどに利用できます。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
loggingNamespaceId | string | ✓ | ~ 1024文字 | ネームスペースGRN |
メソッド
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/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.DescribeNamespaces(
&buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.DescribeNamespacesRequest;
import io.gs2.buff.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.DescribeNamespacesRequest;
using Gs2.Gs2Buff.Result.DescribeNamespacesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.describeNamespaces(
new Gs2Buff.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 buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.describe_namespaces(
buff.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('buff')
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;
createNamespace
ネームスペースを新規作成
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | ネームスペース名 | ||
description | string | ~ 1024文字 | 説明文 | |||
applyBuffScript | ScriptSetting | バフを適用する際に実行するスクリプト | ||||
logSetting | LogSetting | ログの出力設定 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | 作成したネームスペース |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.CreateNamespace(
&buff.CreateNamespaceRequest {
Name: pointy.String("namespace1"),
Description: nil,
ApplyBuffScript: nil,
LogSetting: &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\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)
->withApplyBuffScript(null)
->withLogSetting((new \Gs2\Buff\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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.CreateNamespaceRequest;
import io.gs2.buff.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(session);
try {
CreateNamespaceResult result = client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withApplyBuffScript(null)
.withLogSetting(new io.gs2.buff.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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.CreateNamespaceRequest;
using Gs2.Gs2Buff.Result.CreateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2Buff.Request.CreateNamespaceRequest()
.WithName("namespace1")
.WithDescription(null)
.WithApplyBuffScript(null)
.WithLogSetting(new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.createNamespace(
new Gs2Buff.CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withApplyBuffScript(null)
.withLogSetting(new Gs2Buff.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 buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.create_namespace(
buff.CreateNamespaceRequest()
.with_name(self.hash1)
.with_description(None)
.with_apply_buff_script(None)
.with_log_setting(
buff.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('buff')
api_result = client.create_namespace({
name="namespace1",
description=nil,
applyBuffScript=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;
getNamespaceStatus
ネームスペースの状態を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
status | string |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.GetNamespaceStatus(
&buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.GetNamespaceStatusRequest;
import io.gs2.buff.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Buff.Result.GetNamespaceStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.getNamespaceStatus(
new Gs2Buff.GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
const status = result.getStatus();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.get_namespace_status(
buff.GetNamespaceStatusRequest()
.with_namespace_name(self.hash1)
)
status = result.status
except core.Gs2Exception as e:
exit(1)
client = gs2('buff')
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;
getNamespace
ネームスペースを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | ネームスペース |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.GetNamespace(
&buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.GetNamespaceRequest;
import io.gs2.buff.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.GetNamespaceRequest;
using Gs2.Gs2Buff.Result.GetNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.getNamespace(
new Gs2Buff.GetNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.get_namespace(
buff.GetNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('buff')
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;
updateNamespace
ネームスペースを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
description | string | ~ 1024文字 | 説明文 | |||
applyBuffScript | ScriptSetting | バフを適用する際に実行するスクリプト | ||||
logSetting | LogSetting | ログの出力設定 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | 更新したネームスペース |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.UpdateNamespace(
&buff.UpdateNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
Description: pointy.String("description1"),
ApplyBuffScript: nil,
LogSetting: &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\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")
->withApplyBuffScript(null)
->withLogSetting((new \Gs2\Buff\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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.UpdateNamespaceRequest;
import io.gs2.buff.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(session);
try {
UpdateNamespaceResult result = client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withApplyBuffScript(null)
.withLogSetting(new io.gs2.buff.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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.UpdateNamespaceRequest;
using Gs2.Gs2Buff.Result.UpdateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2Buff.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace1")
.WithDescription("description1")
.WithApplyBuffScript(null)
.WithLogSetting(new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.updateNamespace(
new Gs2Buff.UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withApplyBuffScript(null)
.withLogSetting(new Gs2Buff.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 buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.update_namespace(
buff.UpdateNamespaceRequest()
.with_namespace_name(self.hash1)
.with_description('description1')
.with_apply_buff_script(None)
.with_log_setting(
buff.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('buff')
api_result = client.update_namespace({
namespaceName="namespace1",
description="description1",
applyBuffScript=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;
deleteNamespace
ネームスペースを削除
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | 削除したネームスペース |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.DeleteNamespace(
&buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.DeleteNamespaceRequest;
import io.gs2.buff.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.DeleteNamespaceRequest;
using Gs2.Gs2Buff.Result.DeleteNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.deleteNamespace(
new Gs2Buff.DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.delete_namespace(
buff.DeleteNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('buff')
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;
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/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.DumpUserDataByUserId(
&buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.DumpUserDataByUserIdRequest;
import io.gs2.buff.result.DumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Buff.Result.DumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.dumpUserDataByUserId(
new Gs2Buff.DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.dump_user_data_by_user_id(
buff.DumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('buff')
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
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/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
&buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.buff.result.CheckDumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Buff.Result.CheckDumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.checkDumpUserDataByUserId(
new Gs2Buff.CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.check_dump_user_data_by_user_id(
buff.CheckDumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)
client = gs2('buff')
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;
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/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.CleanUserDataByUserId(
&buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.CleanUserDataByUserIdRequest;
import io.gs2.buff.result.CleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Buff.Result.CleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.cleanUserDataByUserId(
new Gs2Buff.CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.clean_user_data_by_user_id(
buff.CleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('buff')
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
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/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
&buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.buff.result.CheckCleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Buff.Result.CheckCleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.checkCleanUserDataByUserId(
new Gs2Buff.CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.check_clean_user_data_by_user_id(
buff.CheckCleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('buff')
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
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/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
&buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.buff.result.PrepareImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Buff.Result.PrepareImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.prepareImportUserDataByUserId(
new Gs2Buff.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 buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.prepare_import_user_data_by_user_id(
buff.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('buff')
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;
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/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.ImportUserDataByUserId(
&buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.ImportUserDataByUserIdRequest;
import io.gs2.buff.result.ImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Buff.Result.ImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.importUserDataByUserId(
new Gs2Buff.ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.import_user_data_by_user_id(
buff.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('buff')
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
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/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
&buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.CheckImportUserDataByUserIdRequest;
import io.gs2.buff.result.CheckImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Buff.Result.CheckImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.checkImportUserDataByUserId(
new Gs2Buff.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 buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.check_import_user_data_by_user_id(
buff.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('buff')
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;
describeBuffEntryModels
バフモデルの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
items | List<BuffEntryModel> | バフモデルのリスト |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.DescribeBuffEntryModels(
&buff.DescribeBuffEntryModelsRequest {
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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\DescribeBuffEntryModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeBuffEntryModels(
(new DescribeBuffEntryModelsRequest())
->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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.DescribeBuffEntryModelsRequest;
import io.gs2.buff.result.DescribeBuffEntryModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(session);
try {
DescribeBuffEntryModelsResult result = client.describeBuffEntryModels(
new DescribeBuffEntryModelsRequest()
.withNamespaceName("namespace1")
);
List<BuffEntryModel> 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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.DescribeBuffEntryModelsRequest;
using Gs2.Gs2Buff.Result.DescribeBuffEntryModelsResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.DescribeBuffEntryModelsResult> asyncResult = null;
yield return client.DescribeBuffEntryModels(
new Gs2.Gs2Buff.Request.DescribeBuffEntryModelsRequest()
.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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.describeBuffEntryModels(
new Gs2Buff.DescribeBuffEntryModelsRequest()
.withNamespaceName("namespace1")
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.describe_buff_entry_models(
buff.DescribeBuffEntryModelsRequest()
.with_namespace_name(self.hash1)
)
items = result.items
except core.Gs2Exception as e:
exit(1)
client = gs2('buff')
api_result = client.describe_buff_entry_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;
getBuffEntryModel
バフモデルを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
buffEntryName | string | ✓ | ~ 128文字 | バフエンティティ名 |
Result
型 | 説明 | |
---|---|---|
item | BuffEntryModel | バフモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.GetBuffEntryModel(
&buff.GetBuffEntryModelRequest {
NamespaceName: pointy.String("namespace1"),
BuffEntryName: pointy.String("character-level"),
}
)
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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\GetBuffEntryModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getBuffEntryModel(
(new GetBuffEntryModelRequest())
->withNamespaceName(self::namespace1)
->withBuffEntryName("character-level")
);
$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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.GetBuffEntryModelRequest;
import io.gs2.buff.result.GetBuffEntryModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(session);
try {
GetBuffEntryModelResult result = client.getBuffEntryModel(
new GetBuffEntryModelRequest()
.withNamespaceName("namespace1")
.withBuffEntryName("character-level")
);
BuffEntryModel 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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.GetBuffEntryModelRequest;
using Gs2.Gs2Buff.Result.GetBuffEntryModelResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.GetBuffEntryModelResult> asyncResult = null;
yield return client.GetBuffEntryModel(
new Gs2.Gs2Buff.Request.GetBuffEntryModelRequest()
.WithNamespaceName("namespace1")
.WithBuffEntryName("character-level"),
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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.getBuffEntryModel(
new Gs2Buff.GetBuffEntryModelRequest()
.withNamespaceName("namespace1")
.withBuffEntryName("character-level")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.get_buff_entry_model(
buff.GetBuffEntryModelRequest()
.with_namespace_name(self.hash1)
.with_buff_entry_name('character-level')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('buff')
api_result = client.get_buff_entry_model({
namespaceName="namespace1",
buffEntryName="character-level",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
describeBuffEntryModelMasters
バフマスターの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<BuffEntryModelMaster> | バフマスターのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.DescribeBuffEntryModelMasters(
&buff.DescribeBuffEntryModelMastersRequest {
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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\DescribeBuffEntryModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeBuffEntryModelMasters(
(new DescribeBuffEntryModelMastersRequest())
->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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.DescribeBuffEntryModelMastersRequest;
import io.gs2.buff.result.DescribeBuffEntryModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(session);
try {
DescribeBuffEntryModelMastersResult result = client.describeBuffEntryModelMasters(
new DescribeBuffEntryModelMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
List<BuffEntryModelMaster> 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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.DescribeBuffEntryModelMastersRequest;
using Gs2.Gs2Buff.Result.DescribeBuffEntryModelMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.DescribeBuffEntryModelMastersResult> asyncResult = null;
yield return client.DescribeBuffEntryModelMasters(
new Gs2.Gs2Buff.Request.DescribeBuffEntryModelMastersRequest()
.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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.describeBuffEntryModelMasters(
new Gs2Buff.DescribeBuffEntryModelMastersRequest()
.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 buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.describe_buff_entry_model_masters(
buff.DescribeBuffEntryModelMastersRequest()
.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('buff')
api_result = client.describe_buff_entry_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;
createBuffEntryModelMaster
バフマスターを新規作成
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
name | string | ✓ | ~ 128文字 | バフエンティティ名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 2048文字 | メタデータ | |||
expression | enum [ “rate_add”, “mul”, “value_add” ] | ✓ | ~ 128文字 | バフの適用タイプ | ||
targetType | enum [ “model”, “action” ] | ✓ | ~ 128文字 | バフをかける対象の種類 | ||
targetModel | BuffTargetModel | {targetType} == “model” | ✓ | バフをかける対象のモデル | ||
targetAction | BuffTargetAction | {targetType} == “action” | ✓ | バフをかける対象のアクション | ||
priority | int | ✓ | ~ 2147483646 | バフの適用優先度 | ||
applyPeriodScheduleEventId | string | ~ 1024文字 | バフを適用するイベントの開催期間 |
Result
型 | 説明 | |
---|---|---|
item | BuffEntryModelMaster | 作成したバフマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.CreateBuffEntryModelMaster(
&buff.CreateBuffEntryModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
Name: pointy.String("buff-0001"),
Description: nil,
Metadata: nil,
Expression: pointy.String("add"),
TargetType: pointy.String("model"),
TargetModel: &buff.BuffTargetModel{
TargetModelName: pointy.String("Gs2Experience:Status"),
TargetFieldName: pointy.String("rankCapValue"),
ConditionGrns: []buff.BuffTargetGrn{
buff.BuffTargetGrn{
TargetModelName: pointy.String("Gs2Experience:RateModel"),
TargetGrn: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001"),
},
},
Rate: pointy.Float32(1.0),
},
TargetAction: nil,
Priority: pointy.Int32(1),
ApplyPeriodScheduleEventId: 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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\CreateBuffEntryModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createBuffEntryModelMaster(
(new CreateBuffEntryModelMasterRequest())
->withNamespaceName(self::namespace1)
->withName("buff-0001")
->withDescription(null)
->withMetadata(null)
->withExpression("add")
->withTargetType("model")
->withTargetModel((new \Gs2\Buff\Model\BuffTargetModel())
->withTargetModelName("Gs2Experience:Status")
->withTargetFieldName("rankCapValue")
->withConditionGrns([
(new \Gs2\Buff\Model\BuffTargetGrn())
->withTargetModelName("Gs2Experience:RateModel")
->withTargetGrn("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001"),
])
->withRate(1.0))
->withTargetAction(null)
->withPriority(1)
->withApplyPeriodScheduleEventId(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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.CreateBuffEntryModelMasterRequest;
import io.gs2.buff.result.CreateBuffEntryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(session);
try {
CreateBuffEntryModelMasterResult result = client.createBuffEntryModelMaster(
new CreateBuffEntryModelMasterRequest()
.withNamespaceName("namespace1")
.withName("buff-0001")
.withDescription(null)
.withMetadata(null)
.withExpression("add")
.withTargetType("model")
.withTargetModel(new io.gs2.buff.model.BuffTargetModel()
.withTargetModelName("Gs2Experience:Status")
.withTargetFieldName("rankCapValue")
.withConditionGrns(Arrays.asList(
new io.gs2.buff.model.BuffTargetGrn()
.withTargetModelName("Gs2Experience:RateModel")
.withTargetGrn("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001")
))
.withRate(1.0f))
.withTargetAction(null)
.withPriority(1)
.withApplyPeriodScheduleEventId(null)
);
BuffEntryModelMaster 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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.CreateBuffEntryModelMasterRequest;
using Gs2.Gs2Buff.Result.CreateBuffEntryModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.CreateBuffEntryModelMasterResult> asyncResult = null;
yield return client.CreateBuffEntryModelMaster(
new Gs2.Gs2Buff.Request.CreateBuffEntryModelMasterRequest()
.WithNamespaceName("namespace1")
.WithName("buff-0001")
.WithDescription(null)
.WithMetadata(null)
.WithExpression("add")
.WithTargetType("model")
.WithTargetModel(new Gs2.Gs2Buff.Model.BuffTargetModel()
.WithTargetModelName("Gs2Experience:Status")
.WithTargetFieldName("rankCapValue")
.WithConditionGrns(new Gs2.Gs2Buff.Model.BuffTargetGrn[] {
new Gs2.Gs2Buff.Model.BuffTargetGrn()
.WithTargetModelName("Gs2Experience:RateModel")
.WithTargetGrn("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001"),
})
.WithRate(1.0f))
.WithTargetAction(null)
.WithPriority(1)
.WithApplyPeriodScheduleEventId(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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.createBuffEntryModelMaster(
new Gs2Buff.CreateBuffEntryModelMasterRequest()
.withNamespaceName("namespace1")
.withName("buff-0001")
.withDescription(null)
.withMetadata(null)
.withExpression("add")
.withTargetType("model")
.withTargetModel(new Gs2Buff.model.BuffTargetModel()
.withTargetModelName("Gs2Experience:Status")
.withTargetFieldName("rankCapValue")
.withConditionGrns([
new Gs2Buff.model.BuffTargetGrn()
.withTargetModelName("Gs2Experience:RateModel")
.withTargetGrn("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001"),
])
.withRate(1.0))
.withTargetAction(null)
.withPriority(1)
.withApplyPeriodScheduleEventId(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.create_buff_entry_model_master(
buff.CreateBuffEntryModelMasterRequest()
.with_namespace_name(self.hash1)
.with_name('buff-0001')
.with_description(None)
.with_metadata(None)
.with_expression('add')
.with_target_type('model')
.with_target_model(
buff.BuffTargetModel()
.with_target_model_name('Gs2Experience:Status')
.with_target_field_name('rankCapValue')
.with_condition_grns([
buff.BuffTargetGrn()
.with_target_model_name('Gs2Experience:RateModel')
.with_target_grn('grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001'),
])
.with_rate(1.0))
.with_target_action(None)
.with_priority(1)
.with_apply_period_schedule_event_id(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('buff')
api_result = client.create_buff_entry_model_master({
namespaceName="namespace1",
name="buff-0001",
description=nil,
metadata=nil,
expression="add",
targetType="model",
targetModel={
targetModelName="Gs2Experience:Status",
targetFieldName="rankCapValue",
conditionGrns={
{
targetModelName="Gs2Experience:RateModel",
targetGrn="grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001",
}
},
rate=1.0,
},
targetAction=nil,
priority=1,
applyPeriodScheduleEventId=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getBuffEntryModelMaster
バフマスターを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
buffEntryName | string | ✓ | ~ 128文字 | バフエンティティ名 |
Result
型 | 説明 | |
---|---|---|
item | BuffEntryModelMaster | バフマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.GetBuffEntryModelMaster(
&buff.GetBuffEntryModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
BuffEntryName: pointy.String("buff-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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\GetBuffEntryModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getBuffEntryModelMaster(
(new GetBuffEntryModelMasterRequest())
->withNamespaceName(self::namespace1)
->withBuffEntryName("buff-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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.GetBuffEntryModelMasterRequest;
import io.gs2.buff.result.GetBuffEntryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(session);
try {
GetBuffEntryModelMasterResult result = client.getBuffEntryModelMaster(
new GetBuffEntryModelMasterRequest()
.withNamespaceName("namespace1")
.withBuffEntryName("buff-0001")
);
BuffEntryModelMaster 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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.GetBuffEntryModelMasterRequest;
using Gs2.Gs2Buff.Result.GetBuffEntryModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.GetBuffEntryModelMasterResult> asyncResult = null;
yield return client.GetBuffEntryModelMaster(
new Gs2.Gs2Buff.Request.GetBuffEntryModelMasterRequest()
.WithNamespaceName("namespace1")
.WithBuffEntryName("buff-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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.getBuffEntryModelMaster(
new Gs2Buff.GetBuffEntryModelMasterRequest()
.withNamespaceName("namespace1")
.withBuffEntryName("buff-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.get_buff_entry_model_master(
buff.GetBuffEntryModelMasterRequest()
.with_namespace_name(self.hash1)
.with_buff_entry_name('buff-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('buff')
api_result = client.get_buff_entry_model_master({
namespaceName="namespace1",
buffEntryName="buff-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateBuffEntryModelMaster
バフマスターを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
buffEntryName | string | ✓ | ~ 128文字 | バフエンティティ名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 2048文字 | メタデータ | |||
expression | enum [ “rate_add”, “mul”, “value_add” ] | ✓ | ~ 128文字 | バフの適用タイプ | ||
targetType | enum [ “model”, “action” ] | ✓ | ~ 128文字 | バフをかける対象の種類 | ||
targetModel | BuffTargetModel | {targetType} == “model” | ✓ | バフをかける対象のモデル | ||
targetAction | BuffTargetAction | {targetType} == “action” | ✓ | バフをかける対象のアクション | ||
priority | int | ✓ | ~ 2147483646 | バフの適用優先度 | ||
applyPeriodScheduleEventId | string | ~ 1024文字 | バフを適用するイベントの開催期間 |
Result
型 | 説明 | |
---|---|---|
item | BuffEntryModelMaster | 更新したバフマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.UpdateBuffEntryModelMaster(
&buff.UpdateBuffEntryModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
BuffEntryName: pointy.String("buff-0001"),
Description: pointy.String("description1"),
Metadata: pointy.String("BUFF_0001"),
Expression: pointy.String("mul"),
TargetType: pointy.String("action"),
TargetModel: nil,
TargetAction: &buff.BuffTargetAction{
TargetActionName: pointy.String("Gs2Experience:AddExperienceByUserId"),
TargetFieldName: pointy.String("experienceValue"),
ConditionGrns: []buff.BuffTargetGrn{
buff.BuffTargetGrn{
TargetModelName: pointy.String("Gs2Experience:RateModel"),
TargetGrn: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001"),
},
},
Rate: pointy.Float32(1.5),
},
Priority: pointy.Int32(2),
ApplyPeriodScheduleEventId: 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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\UpdateBuffEntryModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateBuffEntryModelMaster(
(new UpdateBuffEntryModelMasterRequest())
->withNamespaceName(self::namespace1)
->withBuffEntryName("buff-0001")
->withDescription("description1")
->withMetadata("BUFF_0001")
->withExpression("mul")
->withTargetType("action")
->withTargetModel(null)
->withTargetAction((new \Gs2\Buff\Model\BuffTargetAction())
->withTargetActionName("Gs2Experience:AddExperienceByUserId")
->withTargetFieldName("experienceValue")
->withConditionGrns([
(new \Gs2\Buff\Model\BuffTargetGrn())
->withTargetModelName("Gs2Experience:RateModel")
->withTargetGrn("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001"),
])
->withRate(1.5))
->withPriority(2)
->withApplyPeriodScheduleEventId(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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.UpdateBuffEntryModelMasterRequest;
import io.gs2.buff.result.UpdateBuffEntryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(session);
try {
UpdateBuffEntryModelMasterResult result = client.updateBuffEntryModelMaster(
new UpdateBuffEntryModelMasterRequest()
.withNamespaceName("namespace1")
.withBuffEntryName("buff-0001")
.withDescription("description1")
.withMetadata("BUFF_0001")
.withExpression("mul")
.withTargetType("action")
.withTargetModel(null)
.withTargetAction(new io.gs2.buff.model.BuffTargetAction()
.withTargetActionName("Gs2Experience:AddExperienceByUserId")
.withTargetFieldName("experienceValue")
.withConditionGrns(Arrays.asList(
new io.gs2.buff.model.BuffTargetGrn()
.withTargetModelName("Gs2Experience:RateModel")
.withTargetGrn("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001")
))
.withRate(1.5f))
.withPriority(2)
.withApplyPeriodScheduleEventId(null)
);
BuffEntryModelMaster 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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.UpdateBuffEntryModelMasterRequest;
using Gs2.Gs2Buff.Result.UpdateBuffEntryModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.UpdateBuffEntryModelMasterResult> asyncResult = null;
yield return client.UpdateBuffEntryModelMaster(
new Gs2.Gs2Buff.Request.UpdateBuffEntryModelMasterRequest()
.WithNamespaceName("namespace1")
.WithBuffEntryName("buff-0001")
.WithDescription("description1")
.WithMetadata("BUFF_0001")
.WithExpression("mul")
.WithTargetType("action")
.WithTargetModel(null)
.WithTargetAction(new Gs2.Gs2Buff.Model.BuffTargetAction()
.WithTargetActionName("Gs2Experience:AddExperienceByUserId")
.WithTargetFieldName("experienceValue")
.WithConditionGrns(new Gs2.Gs2Buff.Model.BuffTargetGrn[] {
new Gs2.Gs2Buff.Model.BuffTargetGrn()
.WithTargetModelName("Gs2Experience:RateModel")
.WithTargetGrn("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001"),
})
.WithRate(1.5f))
.WithPriority(2)
.WithApplyPeriodScheduleEventId(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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.updateBuffEntryModelMaster(
new Gs2Buff.UpdateBuffEntryModelMasterRequest()
.withNamespaceName("namespace1")
.withBuffEntryName("buff-0001")
.withDescription("description1")
.withMetadata("BUFF_0001")
.withExpression("mul")
.withTargetType("action")
.withTargetModel(null)
.withTargetAction(new Gs2Buff.model.BuffTargetAction()
.withTargetActionName("Gs2Experience:AddExperienceByUserId")
.withTargetFieldName("experienceValue")
.withConditionGrns([
new Gs2Buff.model.BuffTargetGrn()
.withTargetModelName("Gs2Experience:RateModel")
.withTargetGrn("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001"),
])
.withRate(1.5))
.withPriority(2)
.withApplyPeriodScheduleEventId(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.update_buff_entry_model_master(
buff.UpdateBuffEntryModelMasterRequest()
.with_namespace_name(self.hash1)
.with_buff_entry_name('buff-0001')
.with_description('description1')
.with_metadata('BUFF_0001')
.with_expression('mul')
.with_target_type('action')
.with_target_model(None)
.with_target_action(
buff.BuffTargetAction()
.with_target_action_name('Gs2Experience:AddExperienceByUserId')
.with_target_field_name('experienceValue')
.with_condition_grns([
buff.BuffTargetGrn()
.with_target_model_name('Gs2Experience:RateModel')
.with_target_grn('grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001'),
])
.with_rate(1.5))
.with_priority(2)
.with_apply_period_schedule_event_id(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('buff')
api_result = client.update_buff_entry_model_master({
namespaceName="namespace1",
buffEntryName="buff-0001",
description="description1",
metadata="BUFF_0001",
expression="mul",
targetType="action",
targetModel=nil,
targetAction={
targetActionName="Gs2Experience:AddExperienceByUserId",
targetFieldName="experienceValue",
conditionGrns={
{
targetModelName="Gs2Experience:RateModel",
targetGrn="grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001",
}
},
rate=1.5,
},
priority=2,
applyPeriodScheduleEventId=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteBuffEntryModelMaster
バフマスターを削除
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
buffEntryName | string | ✓ | ~ 128文字 | バフエンティティ名 |
Result
型 | 説明 | |
---|---|---|
item | BuffEntryModelMaster | 削除したバフマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.DeleteBuffEntryModelMaster(
&buff.DeleteBuffEntryModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
BuffEntryName: pointy.String("buff-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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\DeleteBuffEntryModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteBuffEntryModelMaster(
(new DeleteBuffEntryModelMasterRequest())
->withNamespaceName(self::namespace1)
->withBuffEntryName("buff-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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.DeleteBuffEntryModelMasterRequest;
import io.gs2.buff.result.DeleteBuffEntryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(session);
try {
DeleteBuffEntryModelMasterResult result = client.deleteBuffEntryModelMaster(
new DeleteBuffEntryModelMasterRequest()
.withNamespaceName("namespace1")
.withBuffEntryName("buff-0001")
);
BuffEntryModelMaster 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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.DeleteBuffEntryModelMasterRequest;
using Gs2.Gs2Buff.Result.DeleteBuffEntryModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.DeleteBuffEntryModelMasterResult> asyncResult = null;
yield return client.DeleteBuffEntryModelMaster(
new Gs2.Gs2Buff.Request.DeleteBuffEntryModelMasterRequest()
.WithNamespaceName("namespace1")
.WithBuffEntryName("buff-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 Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.deleteBuffEntryModelMaster(
new Gs2Buff.DeleteBuffEntryModelMasterRequest()
.withNamespaceName("namespace1")
.withBuffEntryName("buff-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.delete_buff_entry_model_master(
buff.DeleteBuffEntryModelMasterRequest()
.with_namespace_name(self.hash1)
.with_buff_entry_name('buff-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('buff')
api_result = client.delete_buff_entry_model_master({
namespaceName="namespace1",
buffEntryName="buff-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
applyBuff
バフを適用
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID |
Result
型 | 説明 | |
---|---|---|
items | List<BuffEntryModel> | 適用したバフモデルのリスト |
newContextStack | string | 消費アクションの実行結果を記録したコンテキスト |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.ApplyBuff(
&buff.ApplyBuffRequest {
NamespaceName: pointy.String("namespace1"),
AccessToken: pointy.String("accessToken-0001"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\ApplyBuffRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->applyBuff(
(new ApplyBuffRequest())
->withNamespaceName(self::namespace1)
->withAccessToken(self::$accessToken0001)
);
$items = $result->getItems();
$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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.ApplyBuffRequest;
import io.gs2.buff.result.ApplyBuffResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(session);
try {
ApplyBuffResult result = client.applyBuff(
new ApplyBuffRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
);
List<BuffEntryModel> items = result.getItems();
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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.ApplyBuffRequest;
using Gs2.Gs2Buff.Result.ApplyBuffResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.ApplyBuffResult> asyncResult = null;
yield return client.ApplyBuff(
new Gs2.Gs2Buff.Request.ApplyBuffRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("accessToken-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.applyBuff(
new Gs2Buff.ApplyBuffRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
);
const items = result.getItems();
const newContextStack = result.getNewContextStack();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.apply_buff(
buff.ApplyBuffRequest()
.with_namespace_name(self.hash1)
.with_access_token(self.access_token_0001)
)
items = result.items
new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
exit(1)
client = gs2('buff')
api_result = client.apply_buff({
namespaceName="namespace1",
accessToken="accessToken-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
newContextStack = result.newContextStack;
applyBuffByUserId
ユーザIDを指定してバフを適用
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
items | List<BuffEntryModel> | 適用したバフモデルのリスト |
newContextStack | string | 消費アクションの実行結果を記録したコンテキスト |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.ApplyBuffByUserId(
&buff.ApplyBuffByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\ApplyBuffByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->applyBuffByUserId(
(new ApplyBuffByUserIdRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.ApplyBuffByUserIdRequest;
import io.gs2.buff.result.ApplyBuffByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(session);
try {
ApplyBuffByUserIdResult result = client.applyBuffByUserId(
new ApplyBuffByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
List<BuffEntryModel> items = result.getItems();
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.Gs2Buff.Gs2BuffRestClient;
using Gs2.Gs2Buff.Request.ApplyBuffByUserIdRequest;
using Gs2.Gs2Buff.Result.ApplyBuffByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2BuffRestClient(session);
AsyncResult<Gs2.Gs2Buff.Result.ApplyBuffByUserIdResult> asyncResult = null;
yield return client.ApplyBuffByUserId(
new Gs2.Gs2Buff.Request.ApplyBuffByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as Gs2Buff from '@/gs2/buff';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Buff.Gs2BuffRestClient(session);
try {
const result = await client.applyBuffByUserId(
new Gs2Buff.ApplyBuffByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const items = result.getItems();
const newContextStack = result.getNewContextStack();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import buff
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = buff.Gs2BuffRestClient(session)
try:
result = client.apply_buff_by_user_id(
buff.ApplyBuffByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_time_offset_token(None)
)
items = result.items
new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
exit(1)
client = gs2('buff')
api_result = client.apply_buff_by_user_id({
namespaceName="namespace1",
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
items = result.items;
newContextStack = result.newContextStack;
exportMaster
現在有効なバフ設定のマスターデータをエクスポート
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | CurrentBuffMaster | 現在有効なバフ設定 |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
Session: &session,
}
result, err := client.ExportMaster(
&buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.ExportMasterRequest;
import io.gs2.buff.result.ExportMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(session);
try {
ExportMasterResult result = client.exportMaster(
new ExportMasterRequest()
.withNamespaceName("namespace1")
);
CurrentBuffMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;