GS2-Money2 SDK API リファレンス

モデル

Namespace

ネームスペース

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

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

有効化条件必須デフォルト値の制限説明
namespaceIdstring~ 1024文字ネームスペースGRN
namestring~ 128文字ネームスペースの名前
descriptionstring~ 1024文字説明文
currencyUsagePriorityenum [
“PrioritizeFree”,
“PrioritizePaid”
]
~ 128文字消費優先度
sharedFreeCurrencybool無償課金通貨を異なるスロットで共有するか
platformSettingPlatformSettingストアプラットフォーム設定
changeBalanceScriptScriptSettingウォレット残高が変動したときに実行するスクリプト
logSettingLogSettingログの出力設定
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

Wallet

ウォレット

ウォレット内の通貨は大きく有償で購入した通貨と、無償で入手した通貨が分けて管理されます。 有償で購入した通貨は更に購入時の単価毎に管理され、サービス終了になってしまった際の返金や資金決済法に該当するだけの残高が存在するかが集計できます。

ウォレットにはスロットがあり、スロットごとに異なる残高を管理できます。 プラットフォームをまたいで残高を共有できない場合にはプラットフォーム毎に異なるスロットを利用することで分けて管理することができます。 その際に無償で入手した通貨は全てのプラットフォームで共通した値を利用することもできます。

有効化条件必須デフォルト値の制限説明
walletIdstring~ 1024文字ウォレットGRN
userIdstring~ 128文字ユーザーID
slotint~ 100000000スロット番号
summaryWalletSummaryウォレットの状態
depositTransactionsList<DepositTransaction>[]~ 1000 items入金トランザクションリスト
sharedFreeCurrencybool無償課金通貨を共有するか
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

Event

レシート

レシートは決済履歴を記録するエンティティです。 決済履歴とは、課金通貨の増減に関するリクエストだけではなく、各種配信プラットフォームにおける決済トランザクションの履歴も含まれます。

有効化条件必須デフォルト値の制限説明
eventIdstring~ 1024文字イベントGRN
transactionIdstring~ 1024文字トランザクションID
userIdstring~ 128文字ユーザーID
eventTypeenum [
“VerifyReceipt”,
“Deposit”,
“Withdraw”
]
~ 128文字イベントの種類
verifyReceiptEventVerifyReceiptEventレシート検証イベント
depositEventDepositEvent入金イベント
withdrawEventWithdrawEvent出金イベント
createdAtlong作成日時
revisionlong0~ 9223372036854775805リビジョン

StoreContentModel

ストアプラットフォームのコンテンツ

有効化条件必須デフォルト値の制限説明
storeContentModelIdstring~ 1024文字コンテンツモデルGRN
namestring~ 128文字ストアコンテンツモデル名
metadatastring~ 1024文字メタデータ
appleAppStoreAppleAppStoreContentApple AppStore のコンテンツ
googlePlayGooglePlayContentGoogle Play のコンテンツ

StoreContentModelMaster

ストアプラットフォームのコンテンツ

有効化条件必須デフォルト値の制限説明
storeContentModelIdstring~ 1024文字コンテンツモデルマスターGRN
namestring~ 128文字ストアコンテンツモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 1024文字メタデータ
appleAppStoreAppleAppStoreContentApple AppStore のコンテンツ
googlePlayGooglePlayContentGoogle Play のコンテンツ
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

CurrentModelMaster

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

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

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

JSONファイルの形式についてはドキュメントを参照ください。

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

Receipt

ストアプラットフォームのレシート

有効化条件必須デフォルト値の制限説明
Storeenum [
“AppleAppStore”,
“GooglePlay”,
“fake”
]
~ 128文字ストア
TransactionIDstring~ 128文字トランザクションID
Payloadstring~ 1048576文字ペイロード

PlatformSetting

ストアプラットフォームの設定

有効化条件必須デフォルト値の制限説明
appleAppStoreAppleAppStoreSettingApple AppStore の設定
googlePlayGooglePlaySettingGoogle Play の設定
fakeFakeSettingFake(Unity Editor) の設定

AppleAppStoreSetting

Apple AppStore の設定

有効化条件必須デフォルト値の制限説明
bundleIdstring~ 1024文字Apple AppStore のバンドルID

GooglePlaySetting

Google Play の設定

有効化条件必須デフォルト値の制限説明
packageNamestring~ 5120文字Google Play で配信するパッケージ名
publicKeystring~ 5120文字署名検証に使用する暗号鍵

FakeSetting

デバッグ用の偽のプラットフォームの設定

有効化条件必須デフォルト値の制限説明
acceptFakeReceiptenum [
“Accept”,
“Reject”
]
“Reject”~ 128文字UnityEditorが出力する偽のレシートで決済できるようにするか

WalletSummary

ウォレットの状態

有効化条件必須デフォルト値の制限説明
paidint0~ 2147483646有償課金通貨
freeint0~ 2147483646無償課金通貨
totalint0~ 2147483646総数

DepositTransaction

入金トランザクション

有効化条件必須デフォルト値の制限説明
pricefloat~ 100000.0購入価格
currencystring{price} > 0~ 8文字通過コード
countint~ 2147483646所持量
depositedAtlong入金日時

VerifyReceiptEvent

入金イベント

有効化条件必須デフォルト値の制限説明
contentNamestring~ 128文字ストアコンテンツモデル名
platformenum [
“AppleAppStore”,
“GooglePlay”,
“fake”
]
~ 128文字ストアプラットフォーム
appleAppStoreVerifyReceiptEventAppleAppStoreVerifyReceiptEventApple AppStore のレシート検証イベント
googlePlayVerifyReceiptEventGooglePlayVerifyReceiptEventGoogle Play のレシート検証イベント

DepositEvent

入金イベント

有効化条件必須デフォルト値の制限説明
slotint~ 100000000スロット番号
depositTransactionsList<DepositTransaction>[]~ 1000 items入金トランザクションリスト
statusWalletSummaryウォレットの状態

WithdrawEvent

出金イベント

有効化条件必須デフォルト値の制限説明
slotint~ 100000000スロット番号
withdrawDetailsList<DepositTransaction>[]~ 1000 items出金したウォレットの詳細リスト
statusWalletSummaryウォレットの状態

AppleAppStoreVerifyReceiptEvent

Apple AppStore のレシート

有効化条件必須デフォルト値の制限説明
environmentenum [
“sandbox”,
“production”
]
~ 128文字環境

GooglePlayVerifyReceiptEvent

Google Play のレシート検証イベント

有効化条件必須デフォルト値の制限説明
purchaseTokenstring~ 4096文字Purchase Token

AppleAppStoreContent

Apple AppStore のコンテンツ

有効化条件必須デフォルト値の制限説明
productIdstring~ 1024文字プロダクトID

GooglePlayContent

Google Play のコンテンツ

有効化条件必須デフォルト値の制限説明
productIdstring~ 1024文字プロダクトID

GitHubCheckoutSetting

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

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

ScriptSetting

スクリプト設定

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

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

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

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

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

LogSetting

ログの書き出し設定

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

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

DailyTransactionHistory

日々の取引履歴

有効化条件必須デフォルト値の制限説明
dailyTransactionHistoryIdstring~ 1024文字日々の取引履歴GRN
yearint2000 ~ 3000
monthint1 ~ 12
dayint1 ~ 31
currencystring~ 8文字通貨コード
depositAmountfloat0~ 16777214売り上げ総額
withdrawAmountfloat0~ 16777214消費総額
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

UnusedBalance

未使用残高

各通貨ごとの課金通貨の未使用残高を保持するエンティティ。

有効化条件必須デフォルト値の制限説明
unusedBalanceIdstring~ 1024文字未使用残高GRN
currencystring~ 8文字通貨コード
balancefloat~ 16777214未使用残高
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

メソッド

describeNamespaces

ネームスペースの一覧を取得

Request

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

Result

説明
itemsList<Namespace>ネームスペースのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &money2.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\Money2\Gs2Money2RestClient;
use Gs2\Money2\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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeNamespacesRequest;
import io.gs2.money2.result.DescribeNamespacesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.DescribeNamespacesRequest;
using Gs2.Gs2Money2.Result.DescribeNamespacesResult;

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

AsyncResult<Gs2.Gs2Money2.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Money2.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 Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.describeNamespaces(
        new Gs2Money2.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 money2

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

try:
    result = client.describe_namespaces(
        money2.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('money2')

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

有効化条件必須デフォルト値の制限説明
namestring~ 128文字ネームスペースの名前
currencyUsagePriorityenum [
“PrioritizeFree”,
“PrioritizePaid”
]
~ 128文字消費優先度
descriptionstring~ 1024文字説明文
sharedFreeCurrencybool無償課金通貨を異なるスロットで共有するか
platformSettingPlatformSettingストアプラットフォーム設定
changeBalanceScriptScriptSettingウォレット残高が変動したときに実行するスクリプト
logSettingLogSettingログの出力設定

Result

説明
itemNamespace作成したネームスペース

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &money2.CreateNamespaceRequest {
        Name: pointy.String("namespace1"),
        CurrencyUsagePriority: pointy.String("PrioritizeFree"),
        Description: nil,
        SharedFreeCurrency: pointy.Bool(false),
        PlatformSetting: nil,
        ChangeBalanceScript: nil,
        LogSetting: &money2.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\Money2\Gs2Money2RestClient;
use Gs2\Money2\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)
            ->withCurrencyUsagePriority("PrioritizeFree")
            ->withDescription(null)
            ->withSharedFreeCurrency(False)
            ->withPlatformSetting(null)
            ->withChangeBalanceScript(null)
            ->withLogSetting((new \Gs2\Money2\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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.CreateNamespaceRequest;
import io.gs2.money2.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace1")
            .withCurrencyUsagePriority("PrioritizeFree")
            .withDescription(null)
            .withSharedFreeCurrency(false)
            .withPlatformSetting(null)
            .withChangeBalanceScript(null)
            .withLogSetting(new io.gs2.money2.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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.CreateNamespaceRequest;
using Gs2.Gs2Money2.Result.CreateNamespaceResult;

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

AsyncResult<Gs2.Gs2Money2.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Money2.Request.CreateNamespaceRequest()
        .WithName("namespace1")
        .WithCurrencyUsagePriority("PrioritizeFree")
        .WithDescription(null)
        .WithSharedFreeCurrency(false)
        .WithPlatformSetting(null)
        .WithChangeBalanceScript(null)
        .WithLogSetting(new Gs2.Gs2Money2.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 Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.createNamespace(
        new Gs2Money2.CreateNamespaceRequest()
            .withName("namespace1")
            .withCurrencyUsagePriority("PrioritizeFree")
            .withDescription(null)
            .withSharedFreeCurrency(false)
            .withPlatformSetting(null)
            .withChangeBalanceScript(null)
            .withLogSetting(new Gs2Money2.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 money2

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

try:
    result = client.create_namespace(
        money2.CreateNamespaceRequest()
            .with_name(self.hash1)
            .with_currency_usage_priority('PrioritizeFree')
            .with_description(None)
            .with_shared_free_currency(False)
            .with_platform_setting(None)
            .with_change_balance_script(None)
            .with_log_setting(
                money2.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('money2')

api_result = client.create_namespace({
    name="namespace1",
    currencyUsagePriority="PrioritizeFree",
    description=nil,
    sharedFreeCurrency=false,
    platformSetting=nil,
    changeBalanceScript=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

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペースの名前

Result

説明
statusstring

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &money2.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\Money2\Gs2Money2RestClient;
use Gs2\Money2\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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetNamespaceStatusRequest;
import io.gs2.money2.result.GetNamespaceStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Money2.Result.GetNamespaceStatusResult;

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

AsyncResult<Gs2.Gs2Money2.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Money2.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 Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.getNamespaceStatus(
        new Gs2Money2.GetNamespaceStatusRequest()
            .withNamespaceName("namespace1")
    );
    const status = result.getStatus();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

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

try:
    result = client.get_namespace_status(
        money2.GetNamespaceStatusRequest()
            .with_namespace_name(self.hash1)
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

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

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペースの名前

Result

説明
itemNamespaceネームスペース

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &money2.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\Money2\Gs2Money2RestClient;
use Gs2\Money2\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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetNamespaceRequest;
import io.gs2.money2.result.GetNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.GetNamespaceRequest;
using Gs2.Gs2Money2.Result.GetNamespaceResult;

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

AsyncResult<Gs2.Gs2Money2.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Money2.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 Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.getNamespace(
        new Gs2Money2.GetNamespaceRequest()
            .withNamespaceName("namespace1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

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

try:
    result = client.get_namespace(
        money2.GetNamespaceRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

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

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペースの名前
currencyUsagePriorityenum [
“PrioritizeFree”,
“PrioritizePaid”
]
~ 128文字消費優先度
descriptionstring~ 1024文字説明文
platformSettingPlatformSettingストアプラットフォーム設定
changeBalanceScriptScriptSettingウォレット残高が変動したときに実行するスクリプト
logSettingLogSettingログの出力設定

Result

説明
itemNamespace更新したネームスペース

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &money2.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        CurrencyUsagePriority: pointy.String("PrioritizePaid"),
        Description: pointy.String("description1"),
        PlatformSetting: &money2.PlatformSetting{
            AppleAppStore: money2.AppleAppStoreSetting{
                BundleId: pointy.String("io.gs2.sample"),
            },
            GooglePlay: money2.GooglePlaySetting{
                PackageName: pointy.String("io.gs2.sample"),
                PublicKey: pointy.String("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAicE6mZuA6w39F+xhKQfn+KJw9AVxLuwsJGS8oTRj8K9IPTfs4BVuVLYkgxz7qA0ltO20X2Xvkf/lRfZJBLlwMa1PihXv96/sipj6FPu7xsqlvvaPmDi5JT5+8XirE33M8ezR5M7QlUoNHOuELT+DGxbnFn1s/A3bGI58SYqLzQvoqrEDGHKfKsCtP5ncX1ZwF8AFvk5WQlK5W3wkkrZXrbJbBsfur+5hWpVg5qS+dXAKSrKPfPmq9Fn11rhMDutGmm8BQ+/fDMz5jiuAVWcSjhEn7HI473es7dquQ7OO4NZJ0R9vkpTiQUzrEdnforr51du0riegjJOLTQtXAKLOIQIDAQAB"),
            },
            Fake: money2.FakeSetting{
                AcceptFakeReceipt: pointy.String("Accept"),
            },
        },
        ChangeBalanceScript: &money2.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004"),
        },
        LogSetting: &money2.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\Money2\Gs2Money2RestClient;
use Gs2\Money2\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)
            ->withCurrencyUsagePriority("PrioritizePaid")
            ->withDescription("description1")
            ->withPlatformSetting((new \Gs2\Money2\Model\PlatformSetting())
                ->withAppleAppStore((new \Gs2\Money2\Model\AppleAppStoreSetting())
                    ->withBundleId("io.gs2.sample"))
                ->withGooglePlay((new \Gs2\Money2\Model\GooglePlaySetting())
                    ->withPackageName("io.gs2.sample")
                    ->withPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAicE6mZuA6w39F+xhKQfn+KJw9AVxLuwsJGS8oTRj8K9IPTfs4BVuVLYkgxz7qA0ltO20X2Xvkf/lRfZJBLlwMa1PihXv96/sipj6FPu7xsqlvvaPmDi5JT5+8XirE33M8ezR5M7QlUoNHOuELT+DGxbnFn1s/A3bGI58SYqLzQvoqrEDGHKfKsCtP5ncX1ZwF8AFvk5WQlK5W3wkkrZXrbJbBsfur+5hWpVg5qS+dXAKSrKPfPmq9Fn11rhMDutGmm8BQ+/fDMz5jiuAVWcSjhEn7HI473es7dquQ7OO4NZJ0R9vkpTiQUzrEdnforr51du0riegjJOLTQtXAKLOIQIDAQAB"))
                ->withFake((new \Gs2\Money2\Model\FakeSetting())
                    ->withAcceptFakeReceipt("Accept")))
            ->withChangeBalanceScript((new \Gs2\Money2\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-1003")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-1004"))
            ->withLogSetting((new \Gs2\Money2\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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.UpdateNamespaceRequest;
import io.gs2.money2.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withCurrencyUsagePriority("PrioritizePaid")
            .withDescription("description1")
            .withPlatformSetting(new io.gs2.money2.model.PlatformSetting()
                .withAppleAppStore(new io.gs2.money2.model.AppleAppStoreSetting()
                    .withBundleId("io.gs2.sample"))
                .withGooglePlay(new io.gs2.money2.model.GooglePlaySetting()
                    .withPackageName("io.gs2.sample")
                    .withPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAicE6mZuA6w39F+xhKQfn+KJw9AVxLuwsJGS8oTRj8K9IPTfs4BVuVLYkgxz7qA0ltO20X2Xvkf/lRfZJBLlwMa1PihXv96/sipj6FPu7xsqlvvaPmDi5JT5+8XirE33M8ezR5M7QlUoNHOuELT+DGxbnFn1s/A3bGI58SYqLzQvoqrEDGHKfKsCtP5ncX1ZwF8AFvk5WQlK5W3wkkrZXrbJbBsfur+5hWpVg5qS+dXAKSrKPfPmq9Fn11rhMDutGmm8BQ+/fDMz5jiuAVWcSjhEn7HI473es7dquQ7OO4NZJ0R9vkpTiQUzrEdnforr51du0riegjJOLTQtXAKLOIQIDAQAB"))
                .withFake(new io.gs2.money2.model.FakeSetting()
                    .withAcceptFakeReceipt("Accept")))
            .withChangeBalanceScript(new io.gs2.money2.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004"))
            .withLogSetting(new io.gs2.money2.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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.UpdateNamespaceRequest;
using Gs2.Gs2Money2.Result.UpdateNamespaceResult;

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

AsyncResult<Gs2.Gs2Money2.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Money2.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace1")
        .WithCurrencyUsagePriority("PrioritizePaid")
        .WithDescription("description1")
        .WithPlatformSetting(new Gs2.Gs2Money2.Model.PlatformSetting()
            .WithAppleAppStore(new Gs2.Gs2Money2.Model.AppleAppStoreSetting()
                .WithBundleId("io.gs2.sample"))
            .WithGooglePlay(new Gs2.Gs2Money2.Model.GooglePlaySetting()
                .WithPackageName("io.gs2.sample")
                .WithPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAicE6mZuA6w39F+xhKQfn+KJw9AVxLuwsJGS8oTRj8K9IPTfs4BVuVLYkgxz7qA0ltO20X2Xvkf/lRfZJBLlwMa1PihXv96/sipj6FPu7xsqlvvaPmDi5JT5+8XirE33M8ezR5M7QlUoNHOuELT+DGxbnFn1s/A3bGI58SYqLzQvoqrEDGHKfKsCtP5ncX1ZwF8AFvk5WQlK5W3wkkrZXrbJbBsfur+5hWpVg5qS+dXAKSrKPfPmq9Fn11rhMDutGmm8BQ+/fDMz5jiuAVWcSjhEn7HI473es7dquQ7OO4NZJ0R9vkpTiQUzrEdnforr51du0riegjJOLTQtXAKLOIQIDAQAB"))
            .WithFake(new Gs2.Gs2Money2.Model.FakeSetting()
                .WithAcceptFakeReceipt("Accept")))
        .WithChangeBalanceScript(new Gs2.Gs2Money2.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004"))
        .WithLogSetting(new Gs2.Gs2Money2.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 Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.updateNamespace(
        new Gs2Money2.UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withCurrencyUsagePriority("PrioritizePaid")
            .withDescription("description1")
            .withPlatformSetting(new Gs2Money2.model.PlatformSetting()
                .withAppleAppStore(new Gs2Money2.model.AppleAppStoreSetting()
                    .withBundleId("io.gs2.sample"))
                .withGooglePlay(new Gs2Money2.model.GooglePlaySetting()
                    .withPackageName("io.gs2.sample")
                    .withPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAicE6mZuA6w39F+xhKQfn+KJw9AVxLuwsJGS8oTRj8K9IPTfs4BVuVLYkgxz7qA0ltO20X2Xvkf/lRfZJBLlwMa1PihXv96/sipj6FPu7xsqlvvaPmDi5JT5+8XirE33M8ezR5M7QlUoNHOuELT+DGxbnFn1s/A3bGI58SYqLzQvoqrEDGHKfKsCtP5ncX1ZwF8AFvk5WQlK5W3wkkrZXrbJbBsfur+5hWpVg5qS+dXAKSrKPfPmq9Fn11rhMDutGmm8BQ+/fDMz5jiuAVWcSjhEn7HI473es7dquQ7OO4NZJ0R9vkpTiQUzrEdnforr51du0riegjJOLTQtXAKLOIQIDAQAB"))
                .withFake(new Gs2Money2.model.FakeSetting()
                    .withAcceptFakeReceipt("Accept")))
            .withChangeBalanceScript(new Gs2Money2.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004"))
            .withLogSetting(new Gs2Money2.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 money2

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

try:
    result = client.update_namespace(
        money2.UpdateNamespaceRequest()
            .with_namespace_name(self.hash1)
            .with_currency_usage_priority('PrioritizePaid')
            .with_description('description1')
            .with_platform_setting(
                money2.PlatformSetting()
                    .with_apple_app_store(money2.AppleAppStoreSetting()
                        .with_bundle_id('io.gs2.sample'))
                    .with_google_play(money2.GooglePlaySetting()
                        .with_package_name('io.gs2.sample')
                        .with_public_key('MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAicE6mZuA6w39F+xhKQfn+KJw9AVxLuwsJGS8oTRj8K9IPTfs4BVuVLYkgxz7qA0ltO20X2Xvkf/lRfZJBLlwMa1PihXv96/sipj6FPu7xsqlvvaPmDi5JT5+8XirE33M8ezR5M7QlUoNHOuELT+DGxbnFn1s/A3bGI58SYqLzQvoqrEDGHKfKsCtP5ncX1ZwF8AFvk5WQlK5W3wkkrZXrbJbBsfur+5hWpVg5qS+dXAKSrKPfPmq9Fn11rhMDutGmm8BQ+/fDMz5jiuAVWcSjhEn7HI473es7dquQ7OO4NZJ0R9vkpTiQUzrEdnforr51du0riegjJOLTQtXAKLOIQIDAQAB'))
                    .with_fake(money2.FakeSetting()
                        .with_accept_fake_receipt('Accept')))
            .with_change_balance_script(
                money2.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004'))
            .with_log_setting(
                money2.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('money2')

api_result = client.update_namespace({
    namespaceName="namespace1",
    currencyUsagePriority="PrioritizePaid",
    description="description1",
    platformSetting={
        appleAppStore={
            bundleId="io.gs2.sample",
        },
        googlePlay={
            packageName="io.gs2.sample",
            publicKey="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAicE6mZuA6w39F+xhKQfn+KJw9AVxLuwsJGS8oTRj8K9IPTfs4BVuVLYkgxz7qA0ltO20X2Xvkf/lRfZJBLlwMa1PihXv96/sipj6FPu7xsqlvvaPmDi5JT5+8XirE33M8ezR5M7QlUoNHOuELT+DGxbnFn1s/A3bGI58SYqLzQvoqrEDGHKfKsCtP5ncX1ZwF8AFvk5WQlK5W3wkkrZXrbJbBsfur+5hWpVg5qS+dXAKSrKPfPmq9Fn11rhMDutGmm8BQ+/fDMz5jiuAVWcSjhEn7HI473es7dquQ7OO4NZJ0R9vkpTiQUzrEdnforr51du0riegjJOLTQtXAKLOIQIDAQAB",
        },
        fake={
            acceptFakeReceipt="Accept",
        },
    },
    changeBalanceScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004",
    },
    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

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペースの名前

Result

説明
itemNamespace削除したネームスペース

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &money2.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\Money2\Gs2Money2RestClient;
use Gs2\Money2\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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DeleteNamespaceRequest;
import io.gs2.money2.result.DeleteNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.DeleteNamespaceRequest;
using Gs2.Gs2Money2.Result.DeleteNamespaceResult;

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

AsyncResult<Gs2.Gs2Money2.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Money2.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 Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.deleteNamespace(
        new Gs2Money2.DeleteNamespaceRequest()
            .withNamespaceName("namespace1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

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

try:
    result = client.delete_namespace(
        money2.DeleteNamespaceRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

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

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &money2.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\Money2\Gs2Money2RestClient;
use Gs2\Money2\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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DumpUserDataByUserIdRequest;
import io.gs2.money2.result.DumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Money2.Result.DumpUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Money2.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2Money2.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 Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.dumpUserDataByUserId(
        new Gs2Money2.DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

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

try:
    result = client.dump_user_data_by_user_id(
        money2.DumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

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

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
urlstring出力データのURL

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &money2.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\Money2\Gs2Money2RestClient;
use Gs2\Money2\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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.money2.result.CheckDumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Money2.Result.CheckDumpUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Money2.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2Money2.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 Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.checkDumpUserDataByUserId(
        new Gs2Money2.CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

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

try:
    result = client.check_dump_user_data_by_user_id(
        money2.CheckDumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

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

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &money2.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\Money2\Gs2Money2RestClient;
use Gs2\Money2\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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.CleanUserDataByUserIdRequest;
import io.gs2.money2.result.CleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Money2.Result.CleanUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Money2.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2Money2.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 Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.cleanUserDataByUserId(
        new Gs2Money2.CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

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

try:
    result = client.clean_user_data_by_user_id(
        money2.CleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

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

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &money2.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\Money2\Gs2Money2RestClient;
use Gs2\Money2\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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.money2.result.CheckCleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Money2.Result.CheckCleanUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Money2.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2Money2.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 Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.checkCleanUserDataByUserId(
        new Gs2Money2.CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

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

try:
    result = client.check_clean_user_data_by_user_id(
        money2.CheckCleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

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

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
uploadTokenstringアップロード後に結果を反映する際に使用するトークン
uploadUrlstringユーザーデータアップロード処理の実行に使用するURL

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &money2.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\Money2\Gs2Money2RestClient;
use Gs2\Money2\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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.money2.result.PrepareImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Money2.Result.PrepareImportUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Money2.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2Money2.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 Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.prepareImportUserDataByUserId(
        new Gs2Money2.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 money2

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

try:
    result = client.prepare_import_user_data_by_user_id(
        money2.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('money2')

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

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
uploadTokenstring~ 1024文字アップロード準備で受け取ったトークン
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &money2.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\Money2\Gs2Money2RestClient;
use Gs2\Money2\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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.ImportUserDataByUserIdRequest;
import io.gs2.money2.result.ImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Money2.Result.ImportUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Money2.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
    new Gs2.Gs2Money2.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 Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.importUserDataByUserId(
        new Gs2Money2.ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

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

try:
    result = client.import_user_data_by_user_id(
        money2.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('money2')

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

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
uploadTokenstring~ 1024文字アップロード準備で受け取ったトークン
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
urlstring出力ログのURL

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &money2.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\Money2\Gs2Money2RestClient;
use Gs2\Money2\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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.CheckImportUserDataByUserIdRequest;
import io.gs2.money2.result.CheckImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Money2.Result.CheckImportUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Money2.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
    new Gs2.Gs2Money2.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 Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.checkImportUserDataByUserId(
        new Gs2Money2.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 money2

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

try:
    result = client.check_import_user_data_by_user_id(
        money2.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('money2')

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;

describeWallets

ウォレット一覧を取得

Request

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

Result

説明
itemsList<Wallet>ウォレットのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeWallets(
    &money2.DescribeWalletsRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("accessToken-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeWalletsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DescribeWalletsResult result = client.describeWallets(
        new DescribeWalletsRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Wallet> 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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.DescribeWalletsRequest;
using Gs2.Gs2Money2.Result.DescribeWalletsResult;

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

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

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

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

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

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

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

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

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

describeWalletsByUserId

ユーザーIDを指定してウォレット一覧を取得

Request

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

Result

説明
itemsList<Wallet>ウォレットのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeWalletsByUserId(
    &money2.DescribeWalletsByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeWalletsByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DescribeWalletsByUserIdResult result = client.describeWalletsByUserId(
        new DescribeWalletsByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Wallet> 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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.DescribeWalletsByUserIdRequest;
using Gs2.Gs2Money2.Result.DescribeWalletsByUserIdResult;

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

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

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

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

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

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

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

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

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

getWallet

ウォレットを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペースの名前
accessTokenstring~ 128文字ユーザーID
slotint~ 100000000スロット番号

Result

説明
itemWalletウォレット

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetWallet(
    &money2.GetWalletRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("accessToken-0001"),
        Slot: pointy.Int32(0),
    }
)
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\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetWalletRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getWallet(
        (new GetWalletRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withSlot(0)
    );
    $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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetWalletRequest;
import io.gs2.money2.result.GetWalletResult;

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

try {
    GetWalletResult result = client.getWallet(
        new GetWalletRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
            .withSlot(0)
    );
    Wallet 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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.GetWalletRequest;
using Gs2.Gs2Money2.Result.GetWalletResult;

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

AsyncResult<Gs2.Gs2Money2.Result.GetWalletResult> asyncResult = null;
yield return client.GetWallet(
    new Gs2.Gs2Money2.Request.GetWalletRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("accessToken-0001")
        .WithSlot(0),
    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 Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.getWallet(
        new Gs2Money2.GetWalletRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
            .withSlot(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

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

try:
    result = client.get_wallet(
        money2.GetWalletRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_slot(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_wallet({
    namespaceName="namespace1",
    accessToken="accessToken-0001",
    slot=0,
})

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

result = api_result.result
item = result.item;

getWalletByUserId

ユーザーIDを指定してウォレットを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペースの名前
userIdstring~ 128文字ユーザーID
slotint~ 100000000スロット番号
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemWalletウォレット

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetWalletByUserId(
    &money2.GetWalletByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        Slot: pointy.Int32(0),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetWalletByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getWalletByUserId(
        (new GetWalletByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withSlot(0)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetWalletByUserIdRequest;
import io.gs2.money2.result.GetWalletByUserIdResult;

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

try {
    GetWalletByUserIdResult result = client.getWalletByUserId(
        new GetWalletByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withSlot(0)
            .withTimeOffsetToken(null)
    );
    Wallet 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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.GetWalletByUserIdRequest;
using Gs2.Gs2Money2.Result.GetWalletByUserIdResult;

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

AsyncResult<Gs2.Gs2Money2.Result.GetWalletByUserIdResult> asyncResult = null;
yield return client.GetWalletByUserId(
    new Gs2.Gs2Money2.Request.GetWalletByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithSlot(0)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.getWalletByUserId(
        new Gs2Money2.GetWalletByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withSlot(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

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

try:
    result = client.get_wallet_by_user_id(
        money2.GetWalletByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_slot(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_wallet_by_user_id({
    namespaceName="namespace1",
    userId="user-0001",
    slot=0,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;

depositByUserId

ユーザーIDを指定してウォレットに残高を加算

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペースの名前
userIdstring~ 128文字ユーザーID
slotint~ 100000000スロット番号
depositTransactionsList<DepositTransaction>1 ~ 1000 items入金トランザクションリスト
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemWallet加算後のウォレット

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DepositByUserId(
    &money2.DepositByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        Slot: pointy.Int32(0),
        DepositTransactions: []money2.DepositTransaction{
            money2.DepositTransaction{
                Price: pointy.Float32(120),
                Currency: pointy.String("JPY"),
                Count: pointy.Int32(50),
            },
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DepositByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->depositByUserId(
        (new DepositByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withSlot(0)
            ->withDepositTransactions([
                (new DepositTransaction())
                    ->withPrice(120)
                    ->withCurrency("JPY")
                    ->withCount(50),
            ])
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DepositByUserIdRequest;
import io.gs2.money2.result.DepositByUserIdResult;

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

try {
    DepositByUserIdResult result = client.depositByUserId(
        new DepositByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withSlot(0)
            .withDepositTransactions(Arrays.asList(
                new DepositTransaction()
                    .withPrice(120f)
                    .withCurrency("JPY")
                    .withCount(50)
            ))
            .withTimeOffsetToken(null)
    );
    Wallet 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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.DepositByUserIdRequest;
using Gs2.Gs2Money2.Result.DepositByUserIdResult;

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

AsyncResult<Gs2.Gs2Money2.Result.DepositByUserIdResult> asyncResult = null;
yield return client.DepositByUserId(
    new Gs2.Gs2Money2.Request.DepositByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithSlot(0)
        .WithDepositTransactions(new Gs2.Gs2Money2.Model.DepositTransaction[] {
            new Gs2.Gs2Money2.Model.DepositTransaction()
                .WithPrice(120f)
                .WithCurrency("JPY")
                .WithCount(50),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.depositByUserId(
        new Gs2Money2.DepositByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withSlot(0)
            .withDepositTransactions([
                new Gs2Money2.model.DepositTransaction()
                    .withPrice(120)
                    .withCurrency("JPY")
                    .withCount(50),
            ])
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

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

try:
    result = client.deposit_by_user_id(
        money2.DepositByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_slot(0)
            .with_deposit_transactions([
                money2.DepositTransaction()
                    .with_price(120)
                    .with_currency('JPY')
                    .with_count(50),
            ])
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.deposit_by_user_id({
    namespaceName="namespace1",
    userId="user-0001",
    slot=0,
    depositTransactions={
        {
            price=120,
            currency="JPY",
            count=50,
        }
    },
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;

withdraw

ウォレットから残高を消費

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペースの名前
accessTokenstring~ 128文字ユーザーID
slotint~ 100000000スロット番号
withdrawCountint1 ~ 2147483646消費する課金通貨の数量
paidOnlyboolfalse有償課金通貨のみを対象とするか

Result

説明
itemWallet消費後のウォレット
withdrawTransactionsList<DepositTransaction>消費した入金トランザクションリスト

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.Withdraw(
    &money2.WithdrawRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("accessToken-0001"),
        Slot: pointy.Int32(0),
        WithdrawCount: pointy.Int32(50),
        PaidOnly: pointy.Bool(false),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
withdrawTransactions := result.WithdrawTransactions
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\WithdrawRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->withdraw(
        (new WithdrawRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withSlot(0)
            ->withWithdrawCount(50)
            ->withPaidOnly(False)
    );
    $item = $result->getItem();
    $withdrawTransactions = $result->getWithdrawTransactions();
} 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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.WithdrawRequest;
import io.gs2.money2.result.WithdrawResult;

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

try {
    WithdrawResult result = client.withdraw(
        new WithdrawRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
            .withSlot(0)
            .withWithdrawCount(50)
            .withPaidOnly(false)
    );
    Wallet item = result.getItem();
    List<DepositTransaction> withdrawTransactions = result.getWithdrawTransactions();
} 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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.WithdrawRequest;
using Gs2.Gs2Money2.Result.WithdrawResult;

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

AsyncResult<Gs2.Gs2Money2.Result.WithdrawResult> asyncResult = null;
yield return client.Withdraw(
    new Gs2.Gs2Money2.Request.WithdrawRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("accessToken-0001")
        .WithSlot(0)
        .WithWithdrawCount(50)
        .WithPaidOnly(false),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var withdrawTransactions = result.WithdrawTransactions;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.withdraw(
        new Gs2Money2.WithdrawRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
            .withSlot(0)
            .withWithdrawCount(50)
            .withPaidOnly(false)
    );
    const item = result.getItem();
    const withdrawTransactions = result.getWithdrawTransactions();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

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

try:
    result = client.withdraw(
        money2.WithdrawRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_slot(0)
            .with_withdraw_count(50)
            .with_paid_only(False)
    )
    item = result.item
    withdraw_transactions = result.withdraw_transactions
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.withdraw({
    namespaceName="namespace1",
    accessToken="accessToken-0001",
    slot=0,
    withdrawCount=50,
    paidOnly=false,
})

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

result = api_result.result
item = result.item;
withdrawTransactions = result.withdrawTransactions;

withdrawByUserId

ユーザーIDを指定してウォレットから残高を消費

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペースの名前
userIdstring~ 128文字ユーザーID
slotint~ 100000000スロット番号
withdrawCountint1 ~ 2147483646消費する課金通貨の数量
paidOnlyboolfalse有償課金通貨のみを対象とするか
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemWallet消費後のウォレット
withdrawTransactionsList<DepositTransaction>消費した入金トランザクションリスト

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.WithdrawByUserId(
    &money2.WithdrawByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        Slot: pointy.Int32(0),
        WithdrawCount: pointy.Int32(50),
        PaidOnly: pointy.Bool(false),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
withdrawTransactions := result.WithdrawTransactions
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\WithdrawByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->withdrawByUserId(
        (new WithdrawByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withSlot(0)
            ->withWithdrawCount(50)
            ->withPaidOnly(False)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $withdrawTransactions = $result->getWithdrawTransactions();
} 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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.WithdrawByUserIdRequest;
import io.gs2.money2.result.WithdrawByUserIdResult;

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

try {
    WithdrawByUserIdResult result = client.withdrawByUserId(
        new WithdrawByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withSlot(0)
            .withWithdrawCount(50)
            .withPaidOnly(false)
            .withTimeOffsetToken(null)
    );
    Wallet item = result.getItem();
    List<DepositTransaction> withdrawTransactions = result.getWithdrawTransactions();
} 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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.WithdrawByUserIdRequest;
using Gs2.Gs2Money2.Result.WithdrawByUserIdResult;

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

AsyncResult<Gs2.Gs2Money2.Result.WithdrawByUserIdResult> asyncResult = null;
yield return client.WithdrawByUserId(
    new Gs2.Gs2Money2.Request.WithdrawByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithSlot(0)
        .WithWithdrawCount(50)
        .WithPaidOnly(false)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var withdrawTransactions = result.WithdrawTransactions;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

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

try {
    const result = await client.withdrawByUserId(
        new Gs2Money2.WithdrawByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withSlot(0)
            .withWithdrawCount(50)
            .withPaidOnly(false)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const withdrawTransactions = result.getWithdrawTransactions();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

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

try:
    result = client.withdraw_by_user_id(
        money2.WithdrawByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_slot(0)
            .with_withdraw_count(50)
            .with_paid_only(False)
            .with_time_offset_token(None)
    )
    item = result.item
    withdraw_transactions = result.withdraw_transactions
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.withdraw_by_user_id({
    namespaceName="namespace1",
    userId="user-0001",
    slot=0,
    withdrawCount=50,
    paidOnly=false,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
withdrawTransactions = result.withdrawTransactions;

depositByStampSheet

スタンプシートを使用してウォレットに残高を加算

Request

有効化条件必須デフォルト値の制限説明
stampSheetstring~ 5242880文字スタンプシート
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
itemWallet加算後のウォレット

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DepositByStampSheet(
    &money2.DepositByStampSheetRequest {
        StampSheet: pointy.String("stampSheet"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DepositByStampSheetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DepositByStampSheetResult result = client.depositByStampSheet(
        new DepositByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-0001")
    );
    Wallet 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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.DepositByStampSheetRequest;
using Gs2.Gs2Money2.Result.DepositByStampSheetResult;

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

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

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

try {
    const result = await client.depositByStampSheet(
        new Gs2Money2.DepositByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

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

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

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

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

result = api_result.result
item = result.item;

withdrawByStampTask

スタンプシートを使用してウォレットから残高を消費

Request

有効化条件必須デフォルト値の制限説明
stampTaskstring~ 5242880文字スタンプタスク
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
itemWallet消費後のウォレット
withdrawTransactionsList<DepositTransaction>消費した入金トランザクションリスト
newContextStackstringスタンプタスクの実行結果を記録したコンテキスト

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
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 := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.WithdrawByStampTask(
    &money2.WithdrawByStampTaskRequest {
        StampTask: pointy.String("stampTask"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
withdrawTransactions := result.WithdrawTransactions
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\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\WithdrawByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->withdrawByStampTask(
        (new WithdrawByStampTaskRequest())
            ->withStampTask(self::stampTask)
            ->withKeyId(self::key-0001)
    );
    $item = $result->getItem();
    $withdrawTransactions = $result->getWithdrawTransactions();
    $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.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.WithdrawByStampTaskRequest;
import io.gs2.money2.result.WithdrawByStampTaskResult;

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

try {
    WithdrawByStampTaskResult result = client.withdrawByStampTask(
        new WithdrawByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    Wallet item = result.getItem();
    List<DepositTransaction> withdrawTransactions = result.getWithdrawTransactions();
    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.Gs2Money2.Gs2Money2RestClient;
using Gs2.Gs2Money2.Request.WithdrawByStampTaskRequest;
using Gs2.Gs2Money2.Result.WithdrawByStampTaskResult;

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

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

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

try {
    const result = await client.withdrawByStampTask(
        new Gs2Money2.WithdrawByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    const item = result.getItem();
    const withdrawTransactions = result.getWithdrawTransactions();
    const newContextStack = result.getNewContextStack();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

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